Package org.apache.cassandra.db
Class NativeClustering
- java.lang.Object
-
- org.apache.cassandra.db.NativeClustering
-
- All Implemented Interfaces:
IMeasurableMemory,Clusterable<java.nio.ByteBuffer>,Clustering<java.nio.ByteBuffer>,ClusteringPrefix<java.nio.ByteBuffer>
public class NativeClustering extends java.lang.Object implements Clustering<java.nio.ByteBuffer>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.cassandra.db.Clustering
Clustering.Serializer
-
Nested 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
Constructors Constructor Description NativeClustering(NativeAllocator allocator, OpOrder.Group writeOp, Clustering<?> clustering)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ValueAccessor<java.nio.ByteBuffer>accessor()ClusteringPrefix<java.nio.ByteBuffer>clustering()booleanequals(java.lang.Object o)java.nio.ByteBufferget(int i)Retrieves the ith value of this prefix.java.nio.ByteBuffer[]getBufferArray()java.nio.ByteBuffer[]getRawValues()The values of this prefix as an array.inthashCode()ClusteringPrefix.Kindkind()ClusteringPrefix<java.nio.ByteBuffer>minimize()If the prefix contains byte buffers that can be minimized (seeByteBufferUtil.minimalBufferFor(ByteBuffer)), this will return a copy of the prefix with minimized values, otherwise it returns itself.intsize()The number of values in this prefix.longunsharedHeapSize()longunsharedHeapSizeExcludingData()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.cassandra.db.Clustering
clone, toCQLString, toString
-
Methods inherited from interface org.apache.cassandra.db.ClusteringPrefix
bufferAt, dataSize, digest, isBottom, isEmpty, isTop, serializeAsPartitionKey, stringAt, validate
-
-
-
-
Constructor Detail
-
NativeClustering
public NativeClustering(NativeAllocator allocator, OpOrder.Group writeOp, Clustering<?> clustering)
-
-
Method Detail
-
minimize
public ClusteringPrefix<java.nio.ByteBuffer> minimize()
Description copied from interface:ClusteringPrefixIf the prefix contains byte buffers that can be minimized (seeByteBufferUtil.minimalBufferFor(ByteBuffer)), this will return a copy of the prefix with minimized values, otherwise it returns itself.- Specified by:
minimizein interfaceClusteringPrefix<java.nio.ByteBuffer>
-
kind
public ClusteringPrefix.Kind kind()
- Specified by:
kindin interfaceClusteringPrefix<java.nio.ByteBuffer>
-
clustering
public ClusteringPrefix<java.nio.ByteBuffer> clustering()
- Specified by:
clusteringin interfaceClusterable<java.nio.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<java.nio.ByteBuffer>- Returns:
- the number of values in this prefix.
-
get
public java.nio.ByteBuffer get(int i)
Description copied from interface:ClusteringPrefixRetrieves the ith value of this prefix.- Specified by:
getin interfaceClusteringPrefix<java.nio.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
public java.nio.ByteBuffer[] 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<java.nio.ByteBuffer>- Returns:
- the values for this prefix as an array.
-
getBufferArray
public java.nio.ByteBuffer[] getBufferArray()
- Specified by:
getBufferArrayin interfaceClusteringPrefix<java.nio.ByteBuffer>
-
accessor
public ValueAccessor<java.nio.ByteBuffer> accessor()
- Specified by:
accessorin interfaceClusteringPrefix<java.nio.ByteBuffer>
-
unsharedHeapSize
public long unsharedHeapSize()
- Specified by:
unsharedHeapSizein interfaceIMeasurableMemory- Returns:
- the amount of on-heap memory retained by the object that might be reclaimed if the object were reclaimed, i.e. it should try to exclude globally cached data where possible, or counting portions of arrays that are referenced by the object but used by other objects only (e.g. slabbed byte-buffers), etc.
-
unsharedHeapSizeExcludingData
public long unsharedHeapSizeExcludingData()
- Specified by:
unsharedHeapSizeExcludingDatain interfaceClustering<java.nio.ByteBuffer>
-
hashCode
public final int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public final boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
-