Module: Voltdb::VoltTableUtils

Defined in:
lib/voltdb/volt_table_utils.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.map_first_row_from_volt_table(volt_table) {|VoltTableRow| ... } ⇒ Object?

This method is used when we extend the VoltDB VoltTable interface and it’s used to iterate over the first row of a VoltTableRow while also adding VoltTableRow Ruby Utils

Parameters:

  • volt_table (VoltTable)

Yields:

  • (VoltTableRow)

Returns:

  • (Object, nil)


37
38
39
40
41
42
43
44
45
46
# File 'lib/voltdb/volt_table_utils.rb', line 37

def self.map_first_row_from_volt_table(volt_table, &block)
  volt_table.reset_row_position
  volt_table.extend(VoltTableRowUtils)

  if(volt_table.advance_row)
    block.call(volt_table)
  else
    nil
  end
end

.map_volt_table(volt_table) {|VoltTableRow| ... } ⇒ Array<Object, Object>

This method is used when we extend the VoltDB VoltTable interface and it’s used to iterate over a VoltTableRow while also adding VoltTableRow Ruby Utils

Parameters:

  • volt_table (VoltTable)

Yields:

  • (VoltTableRow)

Returns:

  • (Array<Object, Object>)


17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/voltdb/volt_table_utils.rb', line 17

def self.map_volt_table(volt_table, &block)
  results = []

  volt_table.reset_row_position
  volt_table.extend(VoltTableRowUtils)

  while(volt_table.advance_row) do
    results << block.call(volt_table)
  end

  results
end

Instance Method Details

#map {|VoltTableRow| ... } ⇒ Array<Object, Object>

This method is used when we extend the VoltDB VoltTable interface and it’s used to iterate over a VoltTableRow while also adding VoltTableRow Ruby Utils

Yields:

  • (VoltTableRow)

Returns:

  • (Array<Object, Object>)


54
55
56
# File 'lib/voltdb/volt_table_utils.rb', line 54

def map
  VoltTableUtils.map_volt_table(self, &block)
end

#map_first_row {|VoltTableRow| ... } ⇒ Object?

This method is used when we extend the VoltDB VoltTable interface and it’s used to iterate over the first row of a VoltTableRow while also adding VoltTableRow Ruby Utils

Yields:

  • (VoltTableRow)

Returns:

  • (Object, nil)


64
65
66
# File 'lib/voltdb/volt_table_utils.rb', line 64

def map_first_row
  VoltTableUtils.map_first_row_from_volt_table(self, &block)
end