com.thinkaurelius.titan.diskstorage.keycolumnvalue.keyvalue

## Class OrderedKeyValueStoreManagerAdapter

- java.lang.Object
- - com.thinkaurelius.titan.diskstorage.keycolumnvalue.keyvalue.OrderedKeyValueStoreManagerAdapter

- All Implemented Interfaces:
    KeyColumnValueStoreManager, StoreManager

      public class OrderedKeyValueStoreManagerAdapter
      extends Object
      implements KeyColumnValueStoreManager

  Wraps a `OrderedKeyValueStoreManager` and exposes it as a `KeyColumnValueStoreManager`.

  An optional mapping of key-length can be defined if it is known that the `KeyColumnValueStore` of a given name has a static key length. See `OrderedKeyValueStoreAdapter` for more information.
  Author:
    Matthias Bröcheler (me@matthiasb.com);

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `OrderedKeyValueStoreManagerAdapter(OrderedKeyValueStoreManager manager)`
    `OrderedKeyValueStoreManagerAdapter(OrderedKeyValueStoreManager manager, Map<String,Integer> keyLengths)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `StoreTransaction` | `beginTransaction(BaseTransactionConfig config)` Returns a transaction handle for a new transaction according to the given configuration.
    `void` | `clearStorage()` Deletes and clears all database in this storage manager.
    `void` | `close()` Closes the Storage Manager and all databases that have been opened.
    `StoreFeatures` | `getFeatures()` Returns the features supported by this storage manager
    `List<KeyRange>` | `getLocalKeyPartition()` Returns `KeyRange`s locally hosted on this machine.
    `String` | `getName()` Return an identifier for the StoreManager.
    `void` | `mutateMany(Map<String,Map<StaticBuffer,KCVMutation>> mutations, StoreTransaction txh)` Executes multiple mutations at once.
    `OrderedKeyValueStoreAdapter` | `openDatabase(String name)` Opens an ordered database by the given name.

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

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

- - ### Constructor Detail

    - #### OrderedKeyValueStoreManagerAdapter

          public OrderedKeyValueStoreManagerAdapter(OrderedKeyValueStoreManager manager)

    - #### OrderedKeyValueStoreManagerAdapter

          public OrderedKeyValueStoreManagerAdapter(OrderedKeyValueStoreManager manager,
                                            Map<String,Integer> keyLengths)

  - ### Method Detail

    - #### getFeatures

          public StoreFeatures getFeatures()

      Description copied from interface: `StoreManager`
      Returns the features supported by this storage manager
      Specified by:
        `getFeatures` in interface `StoreManager`
      Returns:
        The supported features of this storage manager
      See Also:
        `StoreFeatures`

    - #### beginTransaction

          public StoreTransaction beginTransaction(BaseTransactionConfig config)
                                            throws BackendException

      Description copied from interface: `StoreManager`
      Returns a transaction handle for a new transaction according to the given configuration.
      Specified by:
        `beginTransaction` in interface `StoreManager`
      Returns:
        New Transaction Handle
      Throws:
        `BackendException`

    - #### close

          public void close()
                     throws BackendException

      Description copied from interface: `StoreManager`
      Closes the Storage Manager and all databases that have been opened.
      Specified by:
        `close` in interface `StoreManager`
      Throws:
        `BackendException`

    - #### clearStorage

          public void clearStorage()
                            throws BackendException

      Description copied from interface: `StoreManager`
      Deletes and clears all database in this storage manager.

      ATTENTION: Invoking this method will delete ALL your data!!
      Specified by:
        `clearStorage` in interface `StoreManager`
      Throws:
        `BackendException`

    - #### openDatabase

          public OrderedKeyValueStoreAdapter openDatabase(String name)
                                                   throws BackendException

      Description copied from interface: `KeyColumnValueStoreManager`
      Opens an ordered database by the given name. If the database does not exist, it is created. If it has already been opened, the existing handle is returned.
      Specified by:
        `openDatabase` in interface `KeyColumnValueStoreManager`
      Parameters:
        `name` - Name of database
      Returns:
        Database Handle
      Throws:
        `BackendException`

    - #### mutateMany

          public void mutateMany(Map<String,Map<StaticBuffer,KCVMutation>> mutations,
                        StoreTransaction txh)
                          throws BackendException

      Description copied from interface: `KeyColumnValueStoreManager`
      Executes multiple mutations at once. For each store (identified by a string name) there is a map of (key,mutation) pairs that specifies all the mutations to execute against the particular store for that key. This is an optional operation. Check `StoreManager.getFeatures()` if it is supported by a particular implementation.
      Specified by:
        `mutateMany` in interface `KeyColumnValueStoreManager`
      Throws:
        `BackendException`

    - #### getLocalKeyPartition

          public List<KeyRange> getLocalKeyPartition()
                                              throws BackendException

      Description copied from interface: `StoreManager`
      Returns `KeyRange`s locally hosted on this machine. The start of each `KeyRange` is inclusive. The end is exclusive. The start and end must each be at least 4 bytes in length.
      Specified by:
        `getLocalKeyPartition` in interface `StoreManager`
      Returns:
        A list of local key ranges
      Throws:
        `BackendException`

    - #### getName

          public String getName()

      Description copied from interface: `StoreManager`
      Return an identifier for the StoreManager. Two managers with the same name would open databases that read and write the same underlying data; two store managers with different names should be, for data read/write purposes, completely isolated from each other.

      Examples:
      - Cassandra keyspace
      - HBase tablename
      - InMemoryStore heap address (i.e. default toString()).
      Specified by:
        `getName` in interface `StoreManager`
      Returns:
        Name for this StoreManager

Copyright © 2012–2014. All rights reserved.