Record Class ColumnChunk
java.lang.Object
java.lang.Record
dev.hardwood.metadata.ColumnChunk
- Record Components:
metaData- column metadataoffsetIndexOffset- file offset of the offset index for this column chunk, ornullif absentoffsetIndexLength- length of the offset index in bytes, ornullif absentcolumnIndexOffset- file offset of the column index for this column chunk, ornullif absentcolumnIndexLength- length of the column index in bytes, ornullif absentfilePath- file holding this chunk's data under the legacy split-file layout, or the empty string — nevernull— when the data sits in the file being read, as it does in every layout Hardwood can decode. Reading a chunk with a non-emptyfilePathfails; its metadata is still readable
-
Constructor Summary
ConstructorsConstructorDescriptionColumnChunk(ColumnMetaData metaData, Long offsetIndexOffset, Integer offsetIndexLength, Long columnIndexOffset, Integer columnIndexLength, String filePath) AnullfilePathis normalised to the empty string, so the two ways of saying "this file" — the field absent and the field set to the empty string the spec allows — have one representation, andrequireSameFile()has nothing to guard against. -
Method Summary
Modifier and TypeMethodDescriptionlongComputes the absolute file offset where a column chunk's data starts.Returns the value of thecolumnIndexLengthrecord component.Returns the value of thecolumnIndexOffsetrecord component.final booleanIndicates whether some other object is "equal to" this one.filePath()Returns the value of thefilePathrecord component.final inthashCode()Returns a hash code value for this object.metaData()Returns the value of themetaDatarecord component.Returns the value of theoffsetIndexLengthrecord component.Returns the value of theoffsetIndexOffsetrecord component.voidFails unless this chunk's data sits in the file being read.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ColumnChunk
public ColumnChunk(ColumnMetaData metaData, Long offsetIndexOffset, Integer offsetIndexLength, Long columnIndexOffset, Integer columnIndexLength, String filePath) AnullfilePathis normalised to the empty string, so the two ways of saying "this file" — the field absent and the field set to the empty string the spec allows — have one representation, andrequireSameFile()has nothing to guard against.
-
-
Method Details
-
requireSameFile
Fails unless this chunk's data sits in the file being read.
A non-empty
filePathputs the data in a different file — the legacy split-file layout, which Hardwood does not read. Every offset in the chunk's metadata then addresses that other file, so followingdata_page_offsethere would decode whatever happens to sit at that offset in this one and hand it back as data.This is checked where the data is about to be read rather than while parsing the footer, so that the metadata of such a file stays inspectable.
- Throws:
IOException- if this chunk's data lives in another file
-
chunkStartOffset
public long chunkStartOffset()Computes the absolute file offset where a column chunk's data starts. -
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object). -
metaData
-
offsetIndexOffset
Returns the value of theoffsetIndexOffsetrecord component.- Returns:
- the value of the
offsetIndexOffsetrecord component
-
offsetIndexLength
Returns the value of theoffsetIndexLengthrecord component.- Returns:
- the value of the
offsetIndexLengthrecord component
-
columnIndexOffset
Returns the value of thecolumnIndexOffsetrecord component.- Returns:
- the value of the
columnIndexOffsetrecord component
-
columnIndexLength
Returns the value of thecolumnIndexLengthrecord component.- Returns:
- the value of the
columnIndexLengthrecord component
-
filePath
-