com.thinkaurelius.titan.diskstorage

## Class Backend

- java.lang.Object
- - com.thinkaurelius.titan.diskstorage.Backend

- All Implemented Interfaces:
    LockerProvider

      public class Backend
      extends Object
      implements LockerProvider

  Orchestrates and configures all backend systems: The primary backend storage (`KeyColumnValueStore`) and all external indexing providers (`IndexProvider`).
  Author:
    Matthias Broecheler (me@matthiasb.com)

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static double` | `EDGESTORE_CACHE_PERCENT`
    `static String` | `EDGESTORE_NAME` These are the names for the edge store and property index databases, respectively.
    `static String` | `ID_STORE_NAME`
    `static double` | `INDEXSTORE_CACHE_PERCENT`
    `static String` | `INDEXSTORE_NAME`
    `static String` | `LOCK_STORE_SUFFIX`
    `static String` | `METRICS_CACHE_SUFFIX`
    `static String` | `METRICS_MERGED_CACHE`
    `static String` | `METRICS_MERGED_STORE`
    `static Map<String,String>` | `REGISTERED_INDEX_PROVIDERS`
    `static Map<String,String>` | `REGISTERED_LOG_MANAGERS`
    `static Map<String,ConfigOption>` | `REGISTERED_STORAGE_MANAGERS_SHORTHAND`
    `static Map<String,Integer>` | `STATIC_KEY_LENGTHS`
    `static String` | `SYSTEM_MGMT_LOG_NAME`
    `static String` | `SYSTEM_TX_LOG_NAME`
    `static int` | `THREAD_POOL_SIZE_SCALE_FACTOR`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Backend(Configuration configuration)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `BackendTransaction` | `beginTransaction(TransactionConfiguration configuration, KeyInformation.Retriever indexKeyRetriever)` Opens a new transaction against all registered backend system wrapped in one `BackendTransaction`.
    `void` | `clearStorage()` Clears the storage of all registered backend data providers.
    `void` | `close()`
    `KCVSConfiguration` | `getGlobalSystemConfig()`
    `IDAuthority` | `getIDAuthority()` Returns the configured `IDAuthority`.
    `static <T> T` | `getImplementationClass(Configuration config, String clazzname, Map<String,String> registeredImpls)`
    `Map<String,IndexFeatures>` | `getIndexFeatures()` Returns the `IndexFeatures` of all configured index backends
    `Map<String,IndexInformation>` | `getIndexInformation()` Get information about all registered `IndexProvider`s.
    `KCVSLogManager` | `getKCVSLogManager(String logName)`
    `Locker` | `getLocker(String lockerName)`
    `LogManager` | `getLogManager(String logName)`
    `static KCVSConfiguration` | `getStandaloneGlobalConfiguration(KeyColumnValueStoreManager manager, Configuration config)`
    `static KeyColumnValueStoreManager` | `getStorageManager(Configuration storageConfig)`
    `StoreFeatures` | `getStoreFeatures()` Returns the `StoreFeatures` of the configured backend storage engine.
    `Log` | `getSystemMgmtLog()`
    `KCVSLog` | `getSystemTxLog()`
    `Log` | `getUserLog(String identifier)`
    `static String` | `getUserLogName(String identifier)`
    `void` | `initialize(Configuration config)` Initializes this backend with the given configuration.
    `static void` | `registerShorthands(Properties props, String prefix, Map<String,String> shorthands)`

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

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

- - ### Field Detail

    - #### EDGESTORE_NAME

          public static final String EDGESTORE_NAME

      These are the names for the edge store and property index databases, respectively. The edge store contains all edges and properties. The property index contains an inverted index from attribute value to vertex.

      These names are fixed and should NEVER be changed. Changing these strings can disrupt storage adapters that rely on these names for specific configurations.
      See Also:
        Constant Field Values

    - #### INDEXSTORE_NAME

          public static final String INDEXSTORE_NAME

      See Also:
        Constant Field Values

    - #### ID_STORE_NAME

          public static final String ID_STORE_NAME

      See Also:
        Constant Field Values

    - #### METRICS_MERGED_STORE

          public static final String METRICS_MERGED_STORE

      See Also:
        Constant Field Values

    - #### METRICS_MERGED_CACHE

          public static final String METRICS_MERGED_CACHE

      See Also:
        Constant Field Values

    - #### METRICS_CACHE_SUFFIX

          public static final String METRICS_CACHE_SUFFIX

      See Also:
        Constant Field Values

    - #### LOCK_STORE_SUFFIX

          public static final String LOCK_STORE_SUFFIX

      See Also:
        Constant Field Values

    - #### SYSTEM_TX_LOG_NAME

          public static final String SYSTEM_TX_LOG_NAME

      See Also:
        Constant Field Values

    - #### SYSTEM_MGMT_LOG_NAME

          public static final String SYSTEM_MGMT_LOG_NAME

      See Also:
        Constant Field Values

    - #### EDGESTORE_CACHE_PERCENT

          public static final double EDGESTORE_CACHE_PERCENT

      See Also:
        Constant Field Values

    - #### INDEXSTORE_CACHE_PERCENT

          public static final double INDEXSTORE_CACHE_PERCENT

      See Also:
        Constant Field Values

    - #### THREAD_POOL_SIZE_SCALE_FACTOR

          public static final int THREAD_POOL_SIZE_SCALE_FACTOR

      See Also:
        Constant Field Values

    - #### STATIC_KEY_LENGTHS

          public static final Map<String,Integer> STATIC_KEY_LENGTHS

    - #### REGISTERED_STORAGE_MANAGERS_SHORTHAND

          public static final Map<String,ConfigOption> REGISTERED_STORAGE_MANAGERS_SHORTHAND

    - #### REGISTERED_INDEX_PROVIDERS

          public static final Map<String,String> REGISTERED_INDEX_PROVIDERS

    - #### REGISTERED_LOG_MANAGERS

          public static final Map<String,String> REGISTERED_LOG_MANAGERS

  - ### Constructor Detail

    - #### Backend

          public Backend(Configuration configuration)

  - ### Method Detail

    - #### getLocker

          public Locker getLocker(String lockerName)

      Specified by:
        `getLocker` in interface `LockerProvider`

    - #### initialize

          public void initialize(Configuration config)

      Initializes this backend with the given configuration. Must be called before this Backend can be used
      Parameters:
        `config` -

    - #### getIndexInformation

          public Map<String,IndexInformation> getIndexInformation()

      Get information about all registered `IndexProvider`s.
      Returns:

    - #### getSystemTxLog

          public KCVSLog getSystemTxLog()

    - #### getSystemMgmtLog

          public Log getSystemMgmtLog()

    - #### getUserLog

          public Log getUserLog(String identifier)
                         throws BackendException

      Throws:
        `BackendException`

    - #### getUserLogName

          public static final String getUserLogName(String identifier)

    - #### getGlobalSystemConfig

          public KCVSConfiguration getGlobalSystemConfig()

    - #### getKCVSLogManager

          public KCVSLogManager getKCVSLogManager(String logName)

    - #### getLogManager

          public LogManager getLogManager(String logName)

    - #### getStorageManager

          public static KeyColumnValueStoreManager getStorageManager(Configuration storageConfig)

    - #### getStandaloneGlobalConfiguration

          public static KCVSConfiguration getStandaloneGlobalConfiguration(KeyColumnValueStoreManager manager,
                                                           Configuration config)

    - #### getImplementationClass

          public static final <T> T getImplementationClass(Configuration config,
                                     String clazzname,
                                     Map<String,String> registeredImpls)

    - #### getIDAuthority

          public IDAuthority getIDAuthority()

      Returns the configured `IDAuthority`.
      Returns:

    - #### getStoreFeatures

          public StoreFeatures getStoreFeatures()

      Returns the `StoreFeatures` of the configured backend storage engine.
      Returns:

    - #### getIndexFeatures

          public Map<String,IndexFeatures> getIndexFeatures()

      Returns the `IndexFeatures` of all configured index backends

    - #### beginTransaction

          public BackendTransaction beginTransaction(TransactionConfiguration configuration,
                                            KeyInformation.Retriever indexKeyRetriever)
                                              throws BackendException

      Opens a new transaction against all registered backend system wrapped in one `BackendTransaction`.
      Returns:
      Throws:
        `BackendException`

    - #### close

          public void close()
                     throws BackendException

      Throws:
        `BackendException`

    - #### clearStorage

          public void clearStorage()
                            throws BackendException

      Clears the storage of all registered backend data providers. This includes backend storage engines and index providers.

      IMPORTANT: Clearing storage means that ALL data will be lost and cannot be recovered.
      Throws:
        `BackendException`

    - #### registerShorthands

          public static final void registerShorthands(Properties props,
                                String prefix,
                                Map<String,String> shorthands)

Copyright © 2012–2014. All rights reserved.