Class TokenMapFileSharedBuffers

java.lang.Object
io.nosqlbench.datamappers.functions.rainbow.TokenMapFileSharedBuffers

public class TokenMapFileSharedBuffers extends Object
  • Field Details

  • Method Details

    • getByteBuffer

      public static ByteBuffer getByteBuffer(String filename, boolean instanced, boolean ascending)
      Find and load the ByteBuffer which can be read at the specified location. This will only be loaded into memory once. All callers will get access to the same logical source data. Whether or not the caller gets its own buffer tracking state (see Buffer). If each caller will use the Buffer API for incremental reads, where callers could possibly read the same records, then separate instanced buffers are advised.

      However, if you are planning to use position-oriented access to the buffer only, then it is not necessary to ask for instanced buffers. In some usage patterns, it may be desirable to provide a single logical view of buffer reader position across multiple threads. In this case, setting instanced to false is necessary.

      Parameters:
      filename - The location of the source data for the buffer.
      instanced - If true, each caller gets a wrapped buffer object with its own tracking state
      ascending -
      Returns:
      An instance of a ByteBuffer