Class WidePrimaryKeyMap
- java.lang.Object
-
- org.apache.cassandra.index.sai.disk.v1.SkinnyPrimaryKeyMap
-
- org.apache.cassandra.index.sai.disk.v1.WidePrimaryKeyMap
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,PrimaryKeyMap
@NotThreadSafe public class WidePrimaryKeyMap extends SkinnyPrimaryKeyMap
An extension of theSkinnyPrimaryKeyMap
for wide tables (those with clustering columns).This used the following additional on-disk structures to the
SkinnyPrimaryKeyMap
- A block-packed structure for partitionId to partition size (number of rows in the partition) lookups using
BlockPackedReader
. Uses theIndexComponent.PARTITION_TO_SIZE
component - A key store for rowId to
Clustering
andClustering
to rowId lookups usingKeyLookup
. Uses theIndexComponent.CLUSTERING_KEY_BLOCKS
andIndexComponent.CLUSTERING_KEY_BLOCK_OFFSETS
components
WidePrimaryKeyMap.Factory
is threadsafe, individual instances of theWidePrimaryKeyMap
are not.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WidePrimaryKeyMap.Factory
-
Field Summary
-
Fields inherited from class org.apache.cassandra.index.sai.disk.v1.SkinnyPrimaryKeyMap
partitionKeyCursor, primaryKeyFactory, rowIdToPartitionIdArray, rowIdToTokenArray
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
long
floor(Token token)
PrimaryKey
primaryKeyFromRowId(long sstableRowId)
Returns aPrimaryKey
for a row IDlong
rowIdFromPrimaryKey(PrimaryKey primaryKey)
Returns a row ID for aPrimaryKey
-
Methods inherited from class org.apache.cassandra.index.sai.disk.v1.SkinnyPrimaryKeyMap
ceiling, readPartitionKey, tokenCollisionDetection
-
-
-
-
Method Detail
-
primaryKeyFromRowId
public PrimaryKey primaryKeyFromRowId(long sstableRowId)
Description copied from interface:PrimaryKeyMap
Returns aPrimaryKey
for a row ID- Specified by:
primaryKeyFromRowId
in interfacePrimaryKeyMap
- Overrides:
primaryKeyFromRowId
in classSkinnyPrimaryKeyMap
- Parameters:
sstableRowId
- the row ID to lookup- Returns:
- the
PrimaryKey
associated with the row ID
-
rowIdFromPrimaryKey
public long rowIdFromPrimaryKey(PrimaryKey primaryKey)
Description copied from interface:PrimaryKeyMap
Returns a row ID for aPrimaryKey
- Specified by:
rowIdFromPrimaryKey
in interfacePrimaryKeyMap
- Overrides:
rowIdFromPrimaryKey
in classSkinnyPrimaryKeyMap
- Parameters:
primaryKey
- thePrimaryKey
to lookup- Returns:
- the row ID associated with the
PrimaryKey
-
floor
public long floor(Token token)
Description copied from interface:PrimaryKeyMap
Returns the last row ID of the nearestToken
less than or equal to the givenToken
, or a negative value if theToken
is at its minimum value- Specified by:
floor
in interfacePrimaryKeyMap
- Overrides:
floor
in classSkinnyPrimaryKeyMap
- Parameters:
token
- theToken
to lookup- Returns:
- the floor row ID associated with the
Token
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Specified by:
close
in interfacePrimaryKeyMap
- Overrides:
close
in classSkinnyPrimaryKeyMap
-
-