Record Class Blockfile<T>

java.lang.Object
java.lang.Record
io.datarouter.bytes.blockfile.Blockfile<T>

public record Blockfile<T>(BlockfileStorage storage, BlockfileCompressors registeredCompressors, BlockfileChecksummers registeredChecksummers) extends Record
  • Constructor Details

    • Blockfile

      public Blockfile(BlockfileStorage storage, BlockfileCompressors registeredCompressors, BlockfileChecksummers registeredChecksummers)
      Creates an instance of a Blockfile record class.
      Parameters:
      storage - the value for the storage record component
      registeredCompressors - the value for the registeredCompressors record component
      registeredChecksummers - the value for the registeredChecksummers record component
  • Method Details

    • newWriterBuilder

      public BlockfileWriterBuilder<T> newWriterBuilder(String name, Function<T,byte[]> encoder)
    • newMetadataReaderBuilder

      public BlockfileMetadataReaderBuilder<T> newMetadataReaderBuilder(String pathAndFile)
    • newReaderBuilder

      public BlockfileReaderBuilder<T> newReaderBuilder(BlockfileMetadataReader<T> metadataReader, Function<BlockfileReader<T>,Function<byte[],T>> decoderExtractor)
    • newReaderBuilderKnownFileLength

      public BlockfileReaderBuilder<T> newReaderBuilderKnownFileLength(String pathAndFile, Function<BlockfileReader<T>,Function<byte[],T>> decoderExtractor, long knownFileLength)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • storage

      public BlockfileStorage storage()
      Returns the value of the storage record component.
      Returns:
      the value of the storage record component
    • registeredCompressors

      public BlockfileCompressors registeredCompressors()
      Returns the value of the registeredCompressors record component.
      Returns:
      the value of the registeredCompressors record component
    • registeredChecksummers

      public BlockfileChecksummers registeredChecksummers()
      Returns the value of the registeredChecksummers record component.
      Returns:
      the value of the registeredChecksummers record component