Class SegmentMetadata
java.lang.Object
org.apache.cassandra.index.sai.disk.v1.segment.SegmentMetadata
Multiple
SegmentMetadata are stored in IndexComponent.META file, each corresponds to an on-disk
index segment.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionRoot, offset, length for each index structure in the segment.final PrimaryKeyfinal longfinal ByteBufferfinal PrimaryKeyOrdered by their token position in current segmentfinal longMin and max sstable rowId in current segment.final ByteBufferMinimum and maximum indexed column value ordered by itsAbstractType.final longnumber of indexed rows (aka.final longUsed to retrieve sstableRowId which equals to offset plus segmentRowId. -
Constructor Summary
ConstructorsConstructorDescriptionSegmentMetadata(long rowIdOffset, long numRows, long minSSTableRowId, long maxSSTableRowId, PrimaryKey minKey, PrimaryKey maxKey, ByteBuffer minTerm, ByteBuffer maxTerm, SegmentMetadata.ComponentMetadataMap componentMetadatas) -
Method Summary
Modifier and TypeMethodDescriptionstatic List<SegmentMetadata>load(MetadataSource source, PrimaryKey.Factory primaryKeyFactory) inttoSegmentRowId(long sstableRowId) toString()static voidwrite(MetadataWriter writer, List<SegmentMetadata> segments) Writes disk metadata for the given segment list.
-
Field Details
-
rowIdOffset
public final long rowIdOffsetUsed to retrieve sstableRowId which equals to offset plus segmentRowId. -
minSSTableRowId
public final long minSSTableRowIdMin and max sstable rowId in current segment.For index generated by compaction, minSSTableRowId is the same as segmentRowIdOffset. But for flush, segmentRowIdOffset is taken from previous segment's maxSSTableRowId.
-
maxSSTableRowId
public final long maxSSTableRowId -
numRows
public final long numRowsnumber of indexed rows (aka. a pair of term and segmentRowId) in the current segment -
minKey
Ordered by their token position in current segment -
maxKey
-
minTerm
Minimum and maximum indexed column value ordered by itsAbstractType. -
maxTerm
-
componentMetadatas
Root, offset, length for each index structure in the segment.Note: postings block offsets are stored in terms dictionary, no need to worry about its root.
-
-
Constructor Details
-
SegmentMetadata
public SegmentMetadata(long rowIdOffset, long numRows, long minSSTableRowId, long maxSSTableRowId, PrimaryKey minKey, PrimaryKey maxKey, ByteBuffer minTerm, ByteBuffer maxTerm, SegmentMetadata.ComponentMetadataMap componentMetadatas)
-
-
Method Details
-
toSegmentRowId
public int toSegmentRowId(long sstableRowId) -
load
public static List<SegmentMetadata> load(MetadataSource source, PrimaryKey.Factory primaryKeyFactory) throws IOException - Throws:
IOException
-
write
Writes disk metadata for the given segment list.- Throws:
IOException
-
toString
-