Class SegmentedFile.Builder

  • Enclosing class:
    SegmentedFile

    public static final class SegmentedFile.Builder
    extends java.lang.Object
    • Field Detail

      • myBytesPerSegment

        private long myBytesPerSegment
      • myDelimiter

        private int myDelimiter
      • myFile

        private final java.io.File myFile
      • myParallelism

        private int myParallelism
    • Constructor Detail

      • Builder

        Builder​(java.io.File file)
    • Method Detail

      • delimiter

        public SegmentedFile.Builder delimiter​(byte delimiter)
        The delimiter is used to determine where to split the file into segments. The default value is '\n' (newline).
      • parallelism

        public SegmentedFile.Builder parallelism​(java.util.function.IntSupplier parallelism)
        The expected number of threads that will be used to process the file. The number of segments will a multiple of this number. The default value is the number of CPU cores.
      • segmentBytes

        public SegmentedFile.Builder segmentBytes​(long bytesPerSegment)
        The target (max) size (bytes) of each segment. The actual size will be less than or equal to this value. The last segment will be smaller than or equal to the other segments.