public interface TitanManagement extends TitanConfiguration, SchemaManager
TitanTransaction and therefore copies many of its methods as they relate to schema inspection
and definition.
TitanManagement behaves like a transaction in that it opens a transactional scope for reading the schema and making
changes to it. As such, it needs to be explicitly closed via its commit() or rollback() methods.
A TitanManagement transaction is opened on a graph via TitanGraph.openManagement().
TitanManagement provides methods to:
| Modifier and Type | Interface and Description |
|---|---|
static interface |
TitanManagement.IndexBuilder
Builder for
TitanGraphIndex. |
static interface |
TitanManagement.IndexJobFuture |
| Modifier and Type | Method and Description |
|---|---|
void |
addIndexKey(TitanGraphIndex index,
PropertyKey key,
Parameter... parameters) |
RelationTypeIndex |
buildEdgeIndex(EdgeLabel label,
String name,
org.apache.tinkerpop.gremlin.structure.Direction direction,
org.apache.tinkerpop.gremlin.process.traversal.Order sortOrder,
PropertyKey... sortKeys)
Creates a
RelationTypeIndex for the provided edge label. |
RelationTypeIndex |
buildEdgeIndex(EdgeLabel label,
String name,
org.apache.tinkerpop.gremlin.structure.Direction direction,
PropertyKey... sortKeys)
Identical to
#buildEdgeIndex(com.thinkaurelius.titan.core.EdgeLabel, String, com.tinkerpop.gremlin.structure.Direction, com.tinkerpop.gremlin.structure.Order, com.thinkaurelius.titan.core.PropertyKey...)
with default sort order Order.incr. |
TitanManagement.IndexBuilder |
buildIndex(String indexName,
Class<? extends org.apache.tinkerpop.gremlin.structure.Element> elementType)
Returns an
TitanManagement.IndexBuilder to add a graph index to this Titan graph. |
RelationTypeIndex |
buildPropertyIndex(PropertyKey key,
String name,
org.apache.tinkerpop.gremlin.process.traversal.Order sortOrder,
PropertyKey... sortKeys)
Creates a
RelationTypeIndex for the provided property key. |
RelationTypeIndex |
buildPropertyIndex(PropertyKey key,
String name,
PropertyKey... sortKeys)
Identical to
#buildPropertyIndex(com.thinkaurelius.titan.core.PropertyKey, String, com.tinkerpop.gremlin.structure.Order, com.thinkaurelius.titan.core.PropertyKey...)
with default sort order com.tinkerpop.gremlin.structure.Order#incr. |
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 |
void |
forceCloseInstance(String instanceId)
Forcefully removes a Titan instance from this graph cluster as identified by its name.
|
ConsistencyModifier |
getConsistency(TitanSchemaElement element)
Retrieves the consistency modifier for the given
TitanSchemaElement. |
TitanGraphIndex |
getGraphIndex(String name)
Returns the graph index with the given name or null if it does not exist
|
Iterable<TitanGraphIndex> |
getGraphIndexes(Class<? extends org.apache.tinkerpop.gremlin.structure.Element> elementType)
Returns all graph indexes that index the given element type.
|
TitanManagement.IndexJobFuture |
getIndexJobStatus(TitanIndex index)
If an index update job was triggered through
updateIndex(TitanIndex, SchemaAction) with schema actions
SchemaAction.REINDEX or SchemaAction.REMOVE_INDEX
then this method can be used to track the status of this asynchronous process. |
Set<String> |
getOpenInstances()
Returns a set of unique instance ids for all Titan instances that are currently
part of this graph cluster.
|
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)
|
<T extends RelationType> |
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). |
java.time.Duration |
getTTL(TitanSchemaType type)
Retrieves the time-to-live for the given
TitanSchemaType as a Duration. |
Iterable<VertexLabel> |
getVertexLabels()
Returns an
Iterable over all defined VertexLabels. |
boolean |
isOpen()
Whether this management transaction is open or has been closed (i.e.
|
void |
rollback()
Closes this management transaction and discards all changes.
|
void |
setConsistency(TitanSchemaElement element,
ConsistencyModifier consistency)
Sets the consistency modifier for the given
TitanSchemaElement. |
void |
setTTL(TitanSchemaType type,
java.time.Duration duration)
Sets the time-to-live for the given
TitanSchemaType. |
TitanManagement.IndexJobFuture |
updateIndex(TitanIndex index,
SchemaAction updateAction)
Updates the provided index according to the given
SchemaAction |
get, setmakeEdgeLabel, makePropertyKey, makeVertexLabelcontainsEdgeLabel, containsPropertyKey, containsRelationType, containsVertexLabel, getEdgeLabel, getOrCreateEdgeLabel, getOrCreatePropertyKey, getOrCreateVertexLabel, getPropertyKey, getRelationType, getVertexLabelRelationTypeIndex buildEdgeIndex(EdgeLabel label, String name, org.apache.tinkerpop.gremlin.structure.Direction direction, PropertyKey... sortKeys)
#buildEdgeIndex(com.thinkaurelius.titan.core.EdgeLabel, String, com.tinkerpop.gremlin.structure.Direction, com.tinkerpop.gremlin.structure.Order, com.thinkaurelius.titan.core.PropertyKey...)
with default sort order Order.incr.label - name - direction - sortKeys - RelationTypeIndexRelationTypeIndex buildEdgeIndex(EdgeLabel label, String name, org.apache.tinkerpop.gremlin.structure.Direction direction, org.apache.tinkerpop.gremlin.process.traversal.Order sortOrder, PropertyKey... sortKeys)
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.label - name - direction - sortOrder - sortKeys - RelationTypeIndexRelationTypeIndex buildPropertyIndex(PropertyKey key, String name, PropertyKey... sortKeys)
#buildPropertyIndex(com.thinkaurelius.titan.core.PropertyKey, String, com.tinkerpop.gremlin.structure.Order, com.thinkaurelius.titan.core.PropertyKey...)
with default sort order com.tinkerpop.gremlin.structure.Order#incr.key - name - sortKeys - RelationTypeIndexRelationTypeIndex buildPropertyIndex(PropertyKey key, String name, org.apache.tinkerpop.gremlin.process.traversal.Order sortOrder, PropertyKey... sortKeys)
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.key - name - sortOrder - sortKeys - RelationTypeIndexboolean containsRelationIndex(RelationType type, String name)
RelationTypeIndex with the given name has been defined for the provided RelationTypetype - name - RelationTypeIndex getRelationIndex(RelationType type, String name)
RelationTypeIndex with the given name for the provided RelationType or null
if it does not existtype - name - Iterable<RelationTypeIndex> getRelationIndexes(RelationType type)
type - boolean containsGraphIndex(String name)
name - TitanGraphIndex getGraphIndex(String name)
name - Iterable<TitanGraphIndex> getGraphIndexes(Class<? extends org.apache.tinkerpop.gremlin.structure.Element> elementType)
elementType - TitanManagement.IndexBuilder buildIndex(String indexName, Class<? extends org.apache.tinkerpop.gremlin.structure.Element> elementType)
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.indexName - elementType - void addIndexKey(TitanGraphIndex index, PropertyKey key, Parameter... parameters)
ConsistencyModifier getConsistency(TitanSchemaElement element)
TitanSchemaElement. If none has been explicitly
defined, ConsistencyModifier.DEFAULT is returned.element - void setConsistency(TitanSchemaElement element, ConsistencyModifier consistency)
TitanSchemaElement. Note, that only RelationTypes
and composite graph indexes allow changing of the consistency level.element - consistency - java.time.Duration getTTL(TitanSchemaType type)
TitanSchemaType as a Duration.
If no TTL has been defined, the returned Duration will be zero-length ("lives forever").type - void setTTL(TitanSchemaType type, java.time.Duration duration)
TitanSchemaType. The most granular time unit used for TTL values
is seconds. Any argument will be rounded to seconds if it is more granular than that.
The ttl must be nonnegative. When ttl is zero, any existing TTL on type is removed
("lives forever"). Positive ttl values are interpreted literally.type - the affected typettl - time-to-liveunit - time unit of the specified ttlvoid changeName(TitanSchemaElement element, String newName)
TitanSchemaElement to the provided new name.
The new name must be valid and not already in use, otherwise an IllegalArgumentException is thrown.element - newName - TitanManagement.IndexJobFuture updateIndex(TitanIndex index, SchemaAction updateAction)
SchemaActionindex - updateAction - TitanManagement.IndexJobFuture getIndexJobStatus(TitanIndex index)
updateIndex(TitanIndex, SchemaAction) with schema actions
SchemaAction.REINDEX or SchemaAction.REMOVE_INDEX
then this method can be used to track the status of this asynchronous process.index - Set<String> getOpenInstances()
void forceCloseInstance(String instanceId)
instanceId - <T extends RelationType> Iterable<T> getRelationTypes(Class<T> clazz)
EdgeLabel which returns all labels,
PropertyKey which returns all keys, or RelationType which returns all types).T - clazz - RelationType or sub-interfaceIterable<VertexLabel> getVertexLabels()
Iterable over all defined VertexLabels.boolean isOpen()
void commit()
TitanTransaction.commit()void rollback()
TitanTransaction.rollback()Copyright © 2012–2015. All rights reserved.