module Voltdb::VoltTableUtils

Public Class Methods

map_first_row_from_volt_table(volt_table, &block) click to toggle source

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

@param volt_table [VoltTable] @yield [VoltTableRow] @return [Object, nil]

# 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, &block) click to toggle source

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

@param volt_table [VoltTable] @yield [VoltTableRow] @return [Array<Object, Object>]

# 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

Public Instance Methods

map() click to toggle source

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

@yield [VoltTableRow] @return [Array<Object, Object>]

# File lib/voltdb/volt_table_utils.rb, line 54
def map
  VoltTableUtils.map_volt_table(self, &block)
end
map_first_row() click to toggle source

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

@yield [VoltTableRow] @return [Object, nil]

# File lib/voltdb/volt_table_utils.rb, line 64
def map_first_row
  VoltTableUtils.map_first_row_from_volt_table(self, &block)
end