com.thinkaurelius.titan.diskstorage.keycolumnvalue

## Class KCVSUtil

- java.lang.Object
- - com.thinkaurelius.titan.diskstorage.keycolumnvalue.KCVSUtil

-     public class KCVSUtil
      extends Object

  Contains static utility methods for operating on `KeyColumnValueStore`.
  Author:
    Matthias Broecheler (me@matthiasb.com)

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `KCVSUtil()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static boolean` | `containsKey(KeyColumnValueStore store, StaticBuffer key, int maxColumnLength, StoreTransaction txh)`
    `static boolean` | `containsKey(KeyColumnValueStore store, StaticBuffer key, StoreTransaction txh)`
    `static boolean` | `containsKeyColumn(KeyColumnValueStore store, StaticBuffer key, StaticBuffer column, StoreTransaction txh)` Returns true if the specified key-column pair exists in the store.
    `static Map<StaticBuffer,EntryList>` | `emptyResults(List<StaticBuffer> keys)`
    `static StaticBuffer` | `get(KeyColumnValueStore store, StaticBuffer key, StaticBuffer column, StoreTransaction txh)` Retrieves the value for the specified column and key under the given transaction from the store if such exists, otherwise returns NULL
    `static KeyIterator` | `getKeys(KeyColumnValueStore store, StoreFeatures features, int keyLength, int sliceLength, StoreTransaction txh)` If the store supports unordered scans, then call {#link `KeyColumnValueStore.getKeys(SliceQuery, StoreTransaction)`.
    `static boolean` | `matches(KeyRangeQuery query, StaticBuffer key, StaticBuffer column)`
    `static boolean` | `matches(SliceQuery query, StaticBuffer column)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### KCVSUtil

          public KCVSUtil()

  - ### Method Detail

    - #### get

          public static StaticBuffer get(KeyColumnValueStore store,
                         StaticBuffer key,
                         StaticBuffer column,
                         StoreTransaction txh)
                                  throws BackendException

      Retrieves the value for the specified column and key under the given transaction from the store if such exists, otherwise returns NULL
      Parameters:
        `store` - Store
        `key` - Key
        `column` - Column
        `txh` - Transaction
      Returns:
        Value for key and column or NULL if such does not exist
      Throws:
        `BackendException`

    - #### getKeys

          public static KeyIterator getKeys(KeyColumnValueStore store,
                            StoreFeatures features,
                            int keyLength,
                            int sliceLength,
                            StoreTransaction txh)
                                     throws BackendException

      If the store supports unordered scans, then call {#link `KeyColumnValueStore.getKeys(SliceQuery, StoreTransaction)`. The `SliceQuery` bounds are a binary all-zeros with an all-ones buffer. The limit is 1.

      If the store supports ordered scans, then call {#link `KeyColumnValueStore.getKeys(KeyRangeQuery, StoreTransaction)`. The key and columns slice bounds are the same as those described above. The column limit is 1.

      Parameters:
        `store` - the store to query
        `features` - the store's features
        `keyLength` - length of the zero/one buffers that form the key limits
        `sliceLength` - length of the zero/one buffers that form the col limits
        `txh` - transaction to use with getKeys
      Returns:
        keys returned by the store.getKeys call
      Throws:
        `BackendException` - unexpected failure

    - #### containsKeyColumn

          public static boolean containsKeyColumn(KeyColumnValueStore store,
                                  StaticBuffer key,
                                  StaticBuffer column,
                                  StoreTransaction txh)
                                           throws BackendException

      Returns true if the specified key-column pair exists in the store.
      Parameters:
        `store` - Store
        `key` - Key
        `column` - Column
        `txh` - Transaction
      Returns:
        TRUE, if key has at least one column-value pair, else FALSE
      Throws:
        `BackendException`

    - #### containsKey

          public static boolean containsKey(KeyColumnValueStore store,
                            StaticBuffer key,
                            StoreTransaction txh)
                                     throws BackendException

      Throws:
        `BackendException`

    - #### containsKey

          public static boolean containsKey(KeyColumnValueStore store,
                            StaticBuffer key,
                            int maxColumnLength,
                            StoreTransaction txh)
                                     throws BackendException

      Throws:
        `BackendException`

    - #### matches

          public static boolean matches(SliceQuery query,
                        StaticBuffer column)

    - #### matches

          public static boolean matches(KeyRangeQuery query,
                        StaticBuffer key,
                        StaticBuffer column)

    - #### emptyResults

          public static Map<StaticBuffer,EntryList> emptyResults(List<StaticBuffer> keys)

Copyright © 2012–2014. All rights reserved.