NativeClustering (apache-cassandra API)
Date: 2018-02-14

org.apache.cassandra.db

## Class NativeClustering

- java.lang.Object
- - org.apache.cassandra.db.AbstractClusteringPrefix
  - - org.apache.cassandra.db.NativeClustering

- All Implemented Interfaces:
    IMeasurableMemory, Clusterable, Clustering, ClusteringPrefix

      public class NativeClustering
      extends AbstractClusteringPrefix
      implements Clustering

- - ### 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 and Description
    `NativeClustering(NativeAllocator allocator, OpOrder.Group writeOp, Clustering clustering)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.nio.ByteBuffer` | `get(int i)` Retrieves the ith value of this prefix.
    `java.nio.ByteBuffer[]` | `getRawValues()` The values of this prefix as an array.
    `ClusteringPrefix.Kind` | `kind()`
    `int` | `size()` The number of values in this prefix.
    `long` | `unsharedHeapSize()`
    `long` | `unsharedHeapSizeExcludingData()`

    - ### Methods inherited from class org.apache.cassandra.db.AbstractClusteringPrefix

      `clustering, dataSize, digest, equals, hashCode`

    - ### 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

      `copy, make, toCQLString, toString`

    - ### Methods inherited from interface org.apache.cassandra.db.ClusteringPrefix

      `dataSize, digest`

    - ### Methods inherited from interface org.apache.cassandra.db.Clusterable

      `clustering`

- - ### Constructor Detail

    - #### NativeClustering

          public NativeClustering(NativeAllocator allocator,
                                  OpOrder.Group writeOp,
                                  Clustering clustering)

  - ### Method Detail

    - #### kind

          public ClusteringPrefix.Kind kind()

      Specified by:
        `kind` in interface `ClusteringPrefix`

    - #### size

          public int size()

      Description copied from interface: `ClusteringPrefix`
      The 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:
        `size` in interface `ClusteringPrefix`
      Returns:
        the number of values in this prefix.

    - #### get

          public java.nio.ByteBuffer get(int i)

      Description copied from interface: `ClusteringPrefix`
      Retrieves the ith value of this prefix.
      Specified by:
        `get` in interface `ClusteringPrefix`
      Parameters:
        `i` - the index of the value to retrieve. Must be such that `0 <= 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: `ClusteringPrefix`
      The 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()` and `ClusteringPrefix.get(int)` unless you actually need an array.

      Specified by:
        `getRawValues` in interface `ClusteringPrefix`
      Returns:
        the values for this prefix as an array.

    - #### unsharedHeapSize

          public long unsharedHeapSize()

      Specified by:
        `unsharedHeapSize` in interface `IMeasurableMemory`
      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:
        `unsharedHeapSizeExcludingData` in interface `Clustering`

Copyright © 2018 The Apache Software Foundation