Package org.apache.cassandra.db
Class NativeClustering
java.lang.Object
org.apache.cassandra.db.NativeClustering
- All Implemented Interfaces:
IMeasurableMemory,Clusterable<ByteBuffer>,Clustering<ByteBuffer>,ClusteringPrefix<ByteBuffer>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.cassandra.db.Clustering
Clustering.SerializerNested classes/interfaces inherited from interface org.apache.cassandra.db.ClusteringPrefix
ClusteringPrefix.Deserializer, ClusteringPrefix.Kind -
Field Summary
Fields inherited from interface org.apache.cassandra.db.Clustering
EMPTY, serializer, STATIC_CLUSTERING -
Constructor Summary
ConstructorsConstructorDescriptionNativeClustering(NativeAllocator allocator, OpOrder.Group writeOp, Clustering<?> clustering) -
Method Summary
Modifier and TypeMethodDescriptionaccessor()intdataSize()The size of the data hold by this prefix.final booleanget(int i) Retrieves the ith value of this prefix.The values of this prefix as an array.final inthashCode()kind()Return the key in a form that can be retained for longer-term use.intsize()The number of values in this prefix.longlongMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.cassandra.db.Clustering
asEndBound, asStartBound, clone, toCQLString, toStringMethods inherited from interface org.apache.cassandra.db.ClusteringPrefix
bufferAt, clusteringString, digest, isBottom, isEmpty, isTop, serializeAsPartitionKey, stringAt, validate, validate
-
Constructor Details
-
NativeClustering
-
-
Method Details
-
kind
- Specified by:
kindin interfaceClusteringPrefix<ByteBuffer>
-
clustering
- Specified by:
clusteringin interfaceClusterable<ByteBuffer>
-
size
public int size()Description copied from interface:ClusteringPrefixThe number of values in this prefix. There can't be more values that the this is a prefix of has of clustering columns.- Specified by:
sizein interfaceClusteringPrefix<ByteBuffer>- Returns:
- the number of values in this prefix.
-
dataSize
public int dataSize()Description copied from interface:ClusteringPrefixThe size of the data hold by this prefix.- Specified by:
dataSizein interfaceClusteringPrefix<ByteBuffer>- Returns:
- the size of the data hold by this prefix (this is not the size of the object in memory, just the size of the data it stores).
-
get
Description copied from interface:ClusteringPrefixRetrieves the ith value of this prefix.- Specified by:
getin interfaceClusteringPrefix<ByteBuffer>- Parameters:
i- the index of the value to retrieve. Must be such that0 <= i < size().- Returns:
- the ith value of this prefix. Note that a value can be
null.
-
getRawValues
Description copied from interface:ClusteringPrefixThe values of this prefix as an array.Please note that this may or may not require an array creation. So 1) you should *not* modify the returned array and 2) it's more efficient to use
ClusteringPrefix.size()andClusteringPrefix.get(int)unless you actually need an array.- Specified by:
getRawValuesin interfaceClusteringPrefix<ByteBuffer>- Returns:
- the values for this prefix as an array.
-
getBufferArray
- Specified by:
getBufferArrayin interfaceClusteringPrefix<ByteBuffer>
-
accessor
- Specified by:
accessorin interfaceClusteringPrefix<ByteBuffer>
-
hashCode
public final int hashCode() -
equals
-
retainable
Description copied from interface:ClusteringPrefixReturn the key in a form that can be retained for longer-term use. This means extracting keys stored in shared memory (i.e. in memtables) to minimized on-heap versions. If the object is already in minimal form, no action will be taken.- Specified by:
retainablein interfaceClusteringPrefix<ByteBuffer>
-