Class HashedFileExtractToString

java.lang.Object
io.nosqlbench.virtdata.library.basics.shared.from_long.to_string.HashedFileExtractToString
All Implemented Interfaces:
LongFunction<String>

public class HashedFileExtractToString extends Object implements LongFunction<String>
Pseudo-randomly extract a section of a text file and return it according to some minimum and maximum extract size. The file is loaded into memory as a shared text image. It is then indexed into as a character buffer to find a pseudo-randomly sized fragment.
  • Constructor Details

    • HashedFileExtractToString

      public HashedFileExtractToString(String filename, int minsize, int maxsize)
    • HashedFileExtractToString

      public HashedFileExtractToString(String filename, Object sizefunc)
      Provide a size function for the fragment to be extracted. In this form, if the size function specifies a string size which is larger than the text image, it is truncated via modulo to fall within the text image size.
      Parameters:
      filename - The file name to be loaded
      sizefunc - A function which determines the size of the data to be loaded.
  • Method Details