com.thinkaurelius.titan.diskstorage.keycolumnvalue.cache

## Class KCVSCache

- java.lang.Object
- - com.thinkaurelius.titan.diskstorage.keycolumnvalue.KCVSProxy
  - - com.thinkaurelius.titan.diskstorage.keycolumnvalue.cache.KCVSCache

- All Implemented Interfaces:
    KeyColumnValueStore
  Direct Known Subclasses:
    ExpirationKCVSCache, NoKCVSCache

      public abstract class KCVSCache
      extends KCVSProxy

  Author:
    Matthias Broecheler (me@matthiasb.com)

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static List<Entry>` | `NO_DELETIONS`

    - ### Fields inherited from class com.thinkaurelius.titan.diskstorage.keycolumnvalue.KCVSProxy

      `store`

    - ### Fields inherited from interface com.thinkaurelius.titan.diskstorage.keycolumnvalue.KeyColumnValueStore

      `NO_ADDITIONS`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `KCVSCache(KeyColumnValueStore store, String metricsName)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract void` | `clearCache()`
    `EntryList` | `getSliceNoCache(KeySliceQuery query, StoreTransaction txh)`
    `Map<StaticBuffer,EntryList>` | `getSliceNoCache(List<StaticBuffer> keys, SliceQuery query, StoreTransaction txh)`
    `protected boolean` | `hasValidateKeysOnly()`
    `protected void` | `incActionBy(int by, CacheMetricsAction action, StoreTransaction txh)`
    `protected abstract void` | `invalidate(StaticBuffer key, List<CachableStaticBuffer> entries)`
    `void` | `mutate(StaticBuffer key, List<Entry> additions, List<StaticBuffer> deletions, StoreTransaction txh)` Verifies acquisition of locks `txh` from previous calls to `KeyColumnValueStore.acquireLock(StaticBuffer, StaticBuffer, StaticBuffer, StoreTransaction)` , then writes supplied `additions` and/or `deletions` to `key` in the underlying data store.
    `void` | `mutateEntries(StaticBuffer key, List<Entry> additions, List<Entry> deletions, StoreTransaction txh)`
    `protected StoreTransaction` | `unwrapTx(StoreTransaction txh)`

    - ### Methods inherited from class com.thinkaurelius.titan.diskstorage.keycolumnvalue.KCVSProxy

      `acquireLock, close, getKeys, getKeys, getName, getSlice, getSlice`

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

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

- - ### Field Detail

    - #### NO_DELETIONS

          public static final List<Entry> NO_DELETIONS

  - ### Constructor Detail

    - #### KCVSCache

          protected KCVSCache(KeyColumnValueStore store,
                   String metricsName)

  - ### Method Detail

    - #### hasValidateKeysOnly

          protected boolean hasValidateKeysOnly()

    - #### incActionBy

          protected void incActionBy(int by,
                         CacheMetricsAction action,
                         StoreTransaction txh)

    - #### clearCache

          public abstract void clearCache()

    - #### invalidate

          protected abstract void invalidate(StaticBuffer key,
                        List<CachableStaticBuffer> entries)

    - #### mutate

          public void mutate(StaticBuffer key,
                    List<Entry> additions,
                    List<StaticBuffer> deletions,
                    StoreTransaction txh)
                      throws BackendException

      Description copied from interface: `KeyColumnValueStore`
      Verifies acquisition of locks `txh` from previous calls to `KeyColumnValueStore.acquireLock(StaticBuffer, StaticBuffer, StaticBuffer, StoreTransaction)` , then writes supplied `additions` and/or `deletions` to `key` in the underlying data store. Deletions are applied strictly before additions. In other words, if both an addition and deletion are supplied for the same column, then the column will first be deleted and then the supplied Entry for the column will be added.

      Implementations which don't support locking should skip the initial lock verification step but otherwise behave as described above.
      Specified by:
        `mutate` in interface `KeyColumnValueStore`
      Overrides:
        `mutate` in class `KCVSProxy`
      Parameters:
        `key` - the key under which the columns in `additions` and `deletions` will be written
        `additions` - the list of Entry instances representing column-value pairs to create under `key`, or null to add no column-value pairs
        `deletions` - the list of columns to delete from `key`, or null to delete no columns
        `txh` - the transaction to use
      Throws:
        `PermanentLockingException` - if locking is supported by the implementation and at least one lock acquisition attempted by `KeyColumnValueStore.acquireLock(StaticBuffer, StaticBuffer, StaticBuffer, StoreTransaction)` has failed
        `BackendException`

    - #### mutateEntries

          public void mutateEntries(StaticBuffer key,
                           List<Entry> additions,
                           List<Entry> deletions,
                           StoreTransaction txh)
                             throws BackendException

      Throws:
        `BackendException`

    - #### unwrapTx

          protected final StoreTransaction unwrapTx(StoreTransaction txh)

      Overrides:
        `unwrapTx` in class `KCVSProxy`

    - #### getSliceNoCache

          public EntryList getSliceNoCache(KeySliceQuery query,
                                  StoreTransaction txh)
                                    throws BackendException

      Throws:
        `BackendException`

    - #### getSliceNoCache

          public Map<StaticBuffer,EntryList> getSliceNoCache(List<StaticBuffer> keys,
                                                    SliceQuery query,
                                                    StoreTransaction txh)
                                                      throws BackendException

      Throws:
        `BackendException`

Copyright © 2012–2014. All rights reserved.