com.thinkaurelius.titan.graphdb.database.management

## Class ManagementSystem

- java.lang.Object
- - com.thinkaurelius.titan.graphdb.database.management.ManagementSystem

- All Implemented Interfaces:
    TitanConfiguration, TitanManagement

      public class ManagementSystem
      extends Object
      implements TitanManagement

  Author:
    Matthias Broecheler (me@matthiasb.com), Joshua Shinavier (http://fortytwo.net)

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ManagementSystem(StandardTitanGraph graph, KCVSConfiguration config, Log sysLog, ManagementLogger mgmtLogger, SchemaCache schemaCache)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addIndexKey(TitanGraphIndex index, PropertyKey key, Parameter... parameters)`
    `RelationTypeIndex` | `buildEdgeIndex(EdgeLabel label, String name, com.tinkerpop.blueprints.Direction direction, Order sortOrder, RelationType... sortKeys)` Creates a `RelationTypeIndex` for the provided edge label.
    `RelationTypeIndex` | `buildEdgeIndex(EdgeLabel label, String name, com.tinkerpop.blueprints.Direction direction, RelationType... sortKeys)` Identical to `TitanManagement.buildEdgeIndex(com.thinkaurelius.titan.core.EdgeLabel, String, com.tinkerpop.blueprints.Direction, com.thinkaurelius.titan.core.Order, com.thinkaurelius.titan.core.RelationType...)` with default sort order `Order.ASC`.
    `TitanManagement.IndexBuilder` | `buildIndex(String indexName, Class<? extends com.tinkerpop.blueprints.Element> elementType)` Returns an `TitanManagement.IndexBuilder` to add a graph index to this Titan graph.
    `RelationTypeIndex` | `buildPropertyIndex(PropertyKey key, String name, Order sortOrder, RelationType... sortKeys)` Creates a `RelationTypeIndex` for the provided property key.
    `RelationTypeIndex` | `buildPropertyIndex(PropertyKey key, String name, RelationType... sortKeys)` Identical to `TitanManagement.buildPropertyIndex(com.thinkaurelius.titan.core.PropertyKey, String, com.thinkaurelius.titan.core.Order, com.thinkaurelius.titan.core.RelationType...)` with default sort order `Order.ASC`.
    `void` | `changeName(TitanSchemaElement element, String newName)` Changes the name of a `TitanSchemaElement` to the provided new name.
    `void` | `commit()` Commits this management transaction and persists all schema changes.
    `boolean` | `containsGraphIndex(String name)` Whether the graph has a graph index defined with the given name.
    `boolean` | `containsRelationIndex(RelationType type, String name)` Whether a `RelationTypeIndex` with the given name has been defined for the provided `RelationType`
    `boolean` | `containsRelationType(String name)` Identical to `TitanTransaction.containsRelationType(String)`
    `boolean` | `containsVertexLabel(String name)` Identical to `TitanTransaction.containsVertexLabel(String)`
    `void` | `forceCloseInstance(String instanceId)` Forcefully removes a Titan instance from this graph cluster as identified by its name.
    `String` | `get(String path)` Returns a string representation of the provided configuration option or namespace for inspection.
    `ConsistencyModifier` | `getConsistency(TitanSchemaElement element)` Retrieves the consistency level for a schema element (types and internal indexes)
    `EdgeLabel` | `getEdgeLabel(String name)` Identical to `TitanTransaction.getEdgeLabel(String)`
    `TitanGraphIndex` | `getGraphIndex(String name)` Returns the graph index with the given name or null if it does not exist
    `static IndexType` | `getGraphIndexDirect(String name, StandardTitanTx transaction)`
    `Iterable<TitanGraphIndex>` | `getGraphIndexes(Class<? extends com.tinkerpop.blueprints.Element> elementType)` Returns all graph indexes that index the given element type.
    `Set<String>` | `getOpenInstances()` Returns a set of unique instance ids for all Titan instances that are currently part of this graph cluster.
    `PropertyKey` | `getPropertyKey(String name)` Identical to `TitanTransaction.getPropertyKey(String)`
    `RelationTypeIndex` | `getRelationIndex(RelationType type, String name)` Returns the `RelationTypeIndex` with the given name for the provided `RelationType` or null if it does not exist
    `Iterable<RelationTypeIndex>` | `getRelationIndexes(RelationType type)` Returns an `Iterable` over all `RelationTypeIndex`es defined for the provided `RelationType`
    `RelationType` | `getRelationType(String name)` Identical to `TitanTransaction.getRelationType(String)`
    `<T extends RelationType> Iterable<T>` | `getRelationTypes(Class<T> clazz)` Returns an iterable over all defined types that have the given clazz (either `EdgeLabel` which returns all labels, `PropertyKey` which returns all keys, or `RelationType` which returns all types).
    `TitanSchemaElement` | `getSchemaElement(long id)`
    `TitanSchemaVertex` | `getSchemaVertex(TitanSchemaElement element)`
    `Duration` | `getTTL(TitanSchemaType type)` Retrieves the time-to-live for the given `TitanSchemaType` as a `Duration`.
    `VertexLabel` | `getVertexLabel(String name)` Identical to `TitanTransaction.getVertexLabel(String)`
    `Iterable<VertexLabel>` | `getVertexLabels()` Returns an `Iterable` over all defined `VertexLabel`s.
    `StandardTitanTx` | `getWrappedTx()`
    `boolean` | `isOpen()` Whether this management transaction is open or has been closed (i.e.
    `EdgeLabelMaker` | `makeEdgeLabel(String name)` Identical to `TitanTransaction.makeEdgeLabel(String)`
    `PropertyKeyMaker` | `makePropertyKey(String name)` Identical to `TitanTransaction.makePropertyKey(String)`
    `VertexLabelMaker` | `makeVertexLabel(String name)` Identical to `TitanTransaction.makeVertexLabel(String)`
    `void` | `rollback()` Closes this management transaction and discards all changes.
    `TitanConfiguration` | `set(String path, Object value)` Sets the configuration option identified by the provided path to the given value.
    `void` | `setConsistency(TitanSchemaElement element, ConsistencyModifier consistency)` Sets the consistency level for those schema elements that support it (types and internal indexes)
    `void` | `setTTL(TitanSchemaType type, int ttl, TimeUnit unit)` Sets time-to-live for those schema types that support it
    `void` | `updateIndex(TitanIndex index, SchemaAction updateAction)` Updates the provided index according to the given `SchemaAction`

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

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

- - ### Constructor Detail

    - #### ManagementSystem

          public ManagementSystem(StandardTitanGraph graph,
                          KCVSConfiguration config,
                          Log sysLog,
                          ManagementLogger mgmtLogger,
                          SchemaCache schemaCache)

  - ### Method Detail

    - #### getOpenInstances

          public Set<String> getOpenInstances()

      Description copied from interface: `TitanManagement`
      Returns a set of unique instance ids for all Titan instances that are currently part of this graph cluster.
      Specified by:
        `getOpenInstances` in interface `TitanManagement`
      Returns:

    - #### forceCloseInstance

          public void forceCloseInstance(String instanceId)

      Description copied from interface: `TitanManagement`
      Forcefully removes a Titan instance from this graph cluster as identified by its name.

      This method should be used with great care and only in cases where a Titan instance has been abnormally terminated (i.e. killed instead of properly shut-down). If this happens, the instance will continue to be listed as an open instance which means that 1) a new instance with the same id cannot be started and 2) schema updates will fail because the killed instance cannot acknowledge the schema update.

      Throws an exception if the instance is not part of this cluster or if the instance has been started after the start of this management transaction which is indicative of the instance having been restarted successfully.
      Specified by:
        `forceCloseInstance` in interface `TitanManagement`

    - #### commit

          public void commit()

      Description copied from interface: `TitanManagement`
      Commits this management transaction and persists all schema changes. Closes this transaction.
      Specified by:
        `commit` in interface `TitanManagement`
      See Also:
        `TitanTransaction.commit()`

    - #### rollback

          public void rollback()

      Description copied from interface: `TitanManagement`
      Closes this management transaction and discards all changes.
      Specified by:
        `rollback` in interface `TitanManagement`
      See Also:
        `TitanTransaction.rollback()`

    - #### isOpen

          public boolean isOpen()

      Description copied from interface: `TitanManagement`
      Whether this management transaction is open or has been closed (i.e. committed or rolled-back)
      Specified by:
        `isOpen` in interface `TitanManagement`
      Returns:

    - #### getWrappedTx

          public StandardTitanTx getWrappedTx()

    - #### getSchemaElement

          public TitanSchemaElement getSchemaElement(long id)

    - #### buildEdgeIndex

          public RelationTypeIndex buildEdgeIndex(EdgeLabel label,
                                         String name,
                                         com.tinkerpop.blueprints.Direction direction,
                                         RelationType... sortKeys)

      Description copied from interface: `TitanManagement`
      Identical to `TitanManagement.buildEdgeIndex(com.thinkaurelius.titan.core.EdgeLabel, String, com.tinkerpop.blueprints.Direction, com.thinkaurelius.titan.core.Order, com.thinkaurelius.titan.core.RelationType...)` with default sort order `Order.ASC`.
      Specified by:
        `buildEdgeIndex` in interface `TitanManagement`
      Returns:
        the created `RelationTypeIndex`

    - #### buildEdgeIndex

          public RelationTypeIndex buildEdgeIndex(EdgeLabel label,
                                         String name,
                                         com.tinkerpop.blueprints.Direction direction,
                                         Order sortOrder,
                                         RelationType... sortKeys)

      Description copied from interface: `TitanManagement`
      Creates a `RelationTypeIndex` for the provided edge label. That means, that all edges of that label will be indexed according to this index definition which will speed up certain vertex-centric queries.

      An indexed is defined by its name, the direction in which the index should be created (can be restricted to one direction or both), the sort order and - most importantly - the sort keys which define the index key.
      Specified by:
        `buildEdgeIndex` in interface `TitanManagement`
      Returns:
        the created `RelationTypeIndex`

    - #### buildPropertyIndex

          public RelationTypeIndex buildPropertyIndex(PropertyKey key,
                                             String name,
                                             RelationType... sortKeys)

      Description copied from interface: `TitanManagement`
      Identical to `TitanManagement.buildPropertyIndex(com.thinkaurelius.titan.core.PropertyKey, String, com.thinkaurelius.titan.core.Order, com.thinkaurelius.titan.core.RelationType...)` with default sort order `Order.ASC`.
      Specified by:
        `buildPropertyIndex` in interface `TitanManagement`
      Returns:
        the created `RelationTypeIndex`

    - #### buildPropertyIndex

          public RelationTypeIndex buildPropertyIndex(PropertyKey key,
                                             String name,
                                             Order sortOrder,
                                             RelationType... sortKeys)

      Description copied from interface: `TitanManagement`
      Creates a `RelationTypeIndex` for the provided property key. That means, that all properties of that key will be indexed according to this index definition which will speed up certain vertex-centric queries.

      An indexed is defined by its name, the sort order and - most importantly - the sort keys which define the index key.
      Specified by:
        `buildPropertyIndex` in interface `TitanManagement`
      Returns:
        the created `RelationTypeIndex`

    - #### containsRelationIndex

          public boolean containsRelationIndex(RelationType type,
                                      String name)

      Description copied from interface: `TitanManagement`
      Whether a `RelationTypeIndex` with the given name has been defined for the provided `RelationType`
      Specified by:
        `containsRelationIndex` in interface `TitanManagement`
      Returns:

    - #### getRelationIndex

          public RelationTypeIndex getRelationIndex(RelationType type,
                                           String name)

      Description copied from interface: `TitanManagement`
      Returns the `RelationTypeIndex` with the given name for the provided `RelationType` or null if it does not exist
      Specified by:
        `getRelationIndex` in interface `TitanManagement`
      Returns:

    - #### getRelationIndexes

          public Iterable<RelationTypeIndex> getRelationIndexes(RelationType type)

      Description copied from interface: `TitanManagement`
      Returns an `Iterable` over all `RelationTypeIndex`es defined for the provided `RelationType`
      Specified by:
        `getRelationIndexes` in interface `TitanManagement`
      Returns:

    - #### getGraphIndexDirect

          public static IndexType getGraphIndexDirect(String name,
                                      StandardTitanTx transaction)

    - #### containsGraphIndex

          public boolean containsGraphIndex(String name)

      Description copied from interface: `TitanManagement`
      Whether the graph has a graph index defined with the given name.
      Specified by:
        `containsGraphIndex` in interface `TitanManagement`
      Returns:

    - #### getGraphIndex

          public TitanGraphIndex getGraphIndex(String name)

      Description copied from interface: `TitanManagement`
      Returns the graph index with the given name or null if it does not exist
      Specified by:
        `getGraphIndex` in interface `TitanManagement`
      Returns:

    - #### getGraphIndexes

          public Iterable<TitanGraphIndex> getGraphIndexes(Class<? extends com.tinkerpop.blueprints.Element> elementType)

      Description copied from interface: `TitanManagement`
      Returns all graph indexes that index the given element type.
      Specified by:
        `getGraphIndexes` in interface `TitanManagement`
      Returns:

    - #### addIndexKey

          public void addIndexKey(TitanGraphIndex index,
                         PropertyKey key,
                         Parameter... parameters)

      Specified by:
        `addIndexKey` in interface `TitanManagement`

    - #### buildIndex

          public TitanManagement.IndexBuilder buildIndex(String indexName,
                                                Class<? extends com.tinkerpop.blueprints.Element> elementType)

      Description copied from interface: `TitanManagement`
      Returns an `TitanManagement.IndexBuilder` to add a graph index to this Titan graph. The index to-be-created has the provided name and indexes elements of the given type.
      Specified by:
        `buildIndex` in interface `TitanManagement`
      Returns:

    - #### updateIndex

          public void updateIndex(TitanIndex index,
                         SchemaAction updateAction)

      Description copied from interface: `TitanManagement`
      Updates the provided index according to the given `SchemaAction`
      Specified by:
        `updateIndex` in interface `TitanManagement`

    - #### changeName

          public void changeName(TitanSchemaElement element,
                        String newName)

      Description copied from interface: `TitanManagement`
      Changes the name of a `TitanSchemaElement` to the provided new name. The new name must be valid and not already in use, otherwise an `IllegalArgumentException` is thrown.
      Specified by:
        `changeName` in interface `TitanManagement`

    - #### getSchemaVertex

          public TitanSchemaVertex getSchemaVertex(TitanSchemaElement element)

    - #### getConsistency

          public ConsistencyModifier getConsistency(TitanSchemaElement element)

      Retrieves the consistency level for a schema element (types and internal indexes)
      Specified by:
        `getConsistency` in interface `TitanManagement`
      Parameters:
        `element` -
      Returns:

    - #### setConsistency

          public void setConsistency(TitanSchemaElement element,
                            ConsistencyModifier consistency)

      Sets the consistency level for those schema elements that support it (types and internal indexes) Note, that it is possible to have a race condition here if two threads simultaneously try to change the consistency level. However, this is resolved when the consistency level is being read by taking the first one and deleting all existing attached consistency levels upon modification.
      Specified by:
        `setConsistency` in interface `TitanManagement`
      Parameters:
        `element` -
        `consistency` -

    - #### getTTL

          public Duration getTTL(TitanSchemaType type)

      Description copied from interface: `TitanManagement`
      Retrieves the time-to-live for the given `TitanSchemaType` as a `Duration`. If none has been explicitly defined, a zero-length `Duration` is returned.
      Specified by:
        `getTTL` in interface `TitanManagement`
      Returns:

    - #### setTTL

          public void setTTL(TitanSchemaType type,
                    int ttl,
                    TimeUnit unit)

      Sets time-to-live for those schema types that support it
      Specified by:
        `setTTL` in interface `TitanManagement`
      Parameters:
        `type` -
        `ttl` - time-to-live, in seconds
        `unit` - time unit of the specified ttl

    - #### containsRelationType

          public boolean containsRelationType(String name)

      Description copied from interface: `TitanManagement`
      Identical to `TitanTransaction.containsRelationType(String)`
      Specified by:
        `containsRelationType` in interface `TitanManagement`
      Returns:

    - #### getRelationType

          public RelationType getRelationType(String name)

      Description copied from interface: `TitanManagement`
      Identical to `TitanTransaction.getRelationType(String)`
      Specified by:
        `getRelationType` in interface `TitanManagement`
      Returns:

    - #### getPropertyKey

          public PropertyKey getPropertyKey(String name)

      Description copied from interface: `TitanManagement`
      Identical to `TitanTransaction.getPropertyKey(String)`
      Specified by:
        `getPropertyKey` in interface `TitanManagement`
      Returns:

    - #### getEdgeLabel

          public EdgeLabel getEdgeLabel(String name)

      Description copied from interface: `TitanManagement`
      Identical to `TitanTransaction.getEdgeLabel(String)`
      Specified by:
        `getEdgeLabel` in interface `TitanManagement`
      Returns:

    - #### makePropertyKey

          public PropertyKeyMaker makePropertyKey(String name)

      Description copied from interface: `TitanManagement`
      Identical to `TitanTransaction.makePropertyKey(String)`
      Specified by:
        `makePropertyKey` in interface `TitanManagement`
      Returns:

    - #### makeEdgeLabel

          public EdgeLabelMaker makeEdgeLabel(String name)

      Description copied from interface: `TitanManagement`
      Identical to `TitanTransaction.makeEdgeLabel(String)`
      Specified by:
        `makeEdgeLabel` in interface `TitanManagement`
      Returns:

    - #### getRelationTypes

          public <T extends RelationType> Iterable<T> getRelationTypes(Class<T> clazz)

      Description copied from interface: `TitanManagement`
      Returns an iterable over all defined types that have the given clazz (either `EdgeLabel` which returns all labels, `PropertyKey` which returns all keys, or `RelationType` which returns all types).
      Specified by:
        `getRelationTypes` in interface `TitanManagement`
      Parameters:
        `clazz` - `RelationType` or sub-interface
      Returns:
        Iterable over all types for the given category (label, key, or both)

    - #### containsVertexLabel

          public boolean containsVertexLabel(String name)

      Description copied from interface: `TitanManagement`
      Identical to `TitanTransaction.containsVertexLabel(String)`
      Specified by:
        `containsVertexLabel` in interface `TitanManagement`
      Returns:

    - #### getVertexLabel

          public VertexLabel getVertexLabel(String name)

      Description copied from interface: `TitanManagement`
      Identical to `TitanTransaction.getVertexLabel(String)`
      Specified by:
        `getVertexLabel` in interface `TitanManagement`
      Returns:

    - #### makeVertexLabel

          public VertexLabelMaker makeVertexLabel(String name)

      Description copied from interface: `TitanManagement`
      Identical to `TitanTransaction.makeVertexLabel(String)`
      Specified by:
        `makeVertexLabel` in interface `TitanManagement`
      Returns:

    - #### getVertexLabels

          public Iterable<VertexLabel> getVertexLabels()

      Description copied from interface: `TitanManagement`
      Returns an `Iterable` over all defined `VertexLabel`s.
      Specified by:
        `getVertexLabels` in interface `TitanManagement`
      Returns:

    - #### get

          public String get(String path)

      Description copied from interface: `TitanConfiguration`
      Returns a string representation of the provided configuration option or namespace for inspection.

      An exception is thrown if the path is invalid.
      Specified by:
        `get` in interface `TitanConfiguration`
      Returns:

    - #### set

          public TitanConfiguration set(String path,
                               Object value)

      Description copied from interface: `TitanConfiguration`
      Sets the configuration option identified by the provided path to the given value.
      Specified by:
        `set` in interface `TitanConfiguration`

Copyright © 2012–2014. All rights reserved.