Method: PEROBS::IDList#initialize

Defined in:
lib/perobs/IDList.rb

#initialize(dir, name, max_in_memory, page_size = 32) ⇒ IDList

Create a new IDList object. The data that can’t be kept in memory will be stored in the specified directory under the given name.

Parameters:

  • dir (String)

    Path of the directory

  • name (String)

    Name of the file

  • max_in_memory (Integer)

    Specifies the maximum number of values that will be kept in memory. If the list is larger, values will be cached in the specified file.

  • page_size (Integer) (defaults to: 32)

    The number of values per page. The default value is 32 which was found the best performing config in tests.



50
51
52
53
54
55
# File 'lib/perobs/IDList.rb', line 50

def initialize(dir, name, max_in_memory, page_size = 32)
  # The page_file manages the pages that store the values.
  @page_file = IDListPageFile.new(self, dir, name,
                                  max_in_memory, page_size)
  clear
end