public class ManagementSystem extends Object implements TitanManagement
| Modifier and Type | Class and Description |
|---|---|
static class |
ManagementSystem.IndexJobStatus |
TitanManagement.IndexJobFuture| Constructor and Description |
|---|
ManagementSystem(StandardTitanGraph graph,
KCVSConfiguration config,
Log sysLog,
ManagementLogger mgmtLogger,
SchemaCache schemaCache) |
| Modifier and Type | Method and Description |
|---|---|
void |
addIndexKey(TitanGraphIndex index,
PropertyKey key,
Parameter... parameters) |
static GraphIndexStatusWatcher |
awaitGraphIndexStatus(TitanGraph g,
String graphIndexName)
|
static RelationIndexStatusWatcher |
awaitRelationIndexStatus(TitanGraph g,
String relationIndexName,
String relationTypeName)
Returns a
RelationIndexStatusWatcher configured to watch the index specified by
relationIndexName and relationIndexType through graph g. |
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 |
containsEdgeLabel(String name)
Checks whether an edge label of the given name has been defined in the Titan schema.
|
boolean |
containsGraphIndex(String name)
Whether the graph has a graph index defined with the given name.
|
boolean |
containsPropertyKey(String name)
Checks whether a property key of the given name has been defined in the Titan schema.
|
boolean |
containsRelationIndex(RelationType type,
String name)
Whether a
RelationTypeIndex with the given name has been defined for the provided RelationType |
boolean |
containsRelationType(String name)
Checks whether a type with the specified name exists.
|
boolean |
containsVertexLabel(String name)
Whether a vertex label with the given name exists in the graph.
|
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)
Returns the edge label with the given name.
|
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 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
TitanManagement.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.
|
Set<String> |
getOpenInstancesInternal() |
EdgeLabel |
getOrCreateEdgeLabel(String name)
Returns the edge label with the given name.
|
PropertyKey |
getOrCreatePropertyKey(String name)
Returns the property key with the given name.
|
VertexLabel |
getOrCreateVertexLabel(String name)
Returns the vertex label with the given name.
|
PropertyKey |
getPropertyKey(String name)
Returns the property key with the given name.
|
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)
|
RelationType |
getRelationType(String name)
Returns the type with the given name.
|
<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). |
TitanSchemaElement |
getSchemaElement(long id) |
TitanSchemaVertex |
getSchemaVertex(TitanSchemaElement element) |
java.time.Duration |
getTTL(TitanSchemaType type)
Retrieves the time-to-live for the given
TitanSchemaType as a Duration. |
VertexLabel |
getVertexLabel(String name)
Returns the vertex label with the given name.
|
Iterable<VertexLabel> |
getVertexLabels()
Returns an
Iterable over all defined VertexLabels. |
StandardTitanTx |
getWrappedTx() |
boolean |
isOpen()
Whether this management transaction is open or has been closed (i.e.
|
EdgeLabelMaker |
makeEdgeLabel(String name)
Returns a
EdgeLabelMaker instance to define a new EdgeLabel with the given name. |
PropertyKeyMaker |
makePropertyKey(String name)
Returns a
PropertyKeyMaker instance to define a new PropertyKey with the given name. |
VertexLabelMaker |
makeVertexLabel(String name)
Returns a
VertexLabelMaker to define a new vertex label with the given name. |
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,
java.time.Duration duration)
Sets time-to-live for those schema types that support it
|
TitanManagement.IndexJobFuture |
updateIndex(TitanIndex index,
SchemaAction updateAction)
Updates the provided index according to the given
SchemaAction |
public ManagementSystem(StandardTitanGraph graph, KCVSConfiguration config, Log sysLog, ManagementLogger mgmtLogger, SchemaCache schemaCache)
public Set<String> getOpenInstances()
TitanManagementgetOpenInstances in interface TitanManagementpublic void forceCloseInstance(String instanceId)
TitanManagementforceCloseInstance in interface TitanManagementpublic void commit()
TitanManagementcommit in interface TitanManagementTitanTransaction.commit()public void rollback()
TitanManagementrollback in interface TitanManagementTitanTransaction.rollback()public boolean isOpen()
TitanManagementisOpen in interface TitanManagementpublic StandardTitanTx getWrappedTx()
public TitanSchemaElement getSchemaElement(long id)
public RelationTypeIndex buildEdgeIndex(EdgeLabel label, String name, org.apache.tinkerpop.gremlin.structure.Direction direction, PropertyKey... sortKeys)
TitanManagement#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.buildEdgeIndex in interface TitanManagementRelationTypeIndexpublic RelationTypeIndex buildEdgeIndex(EdgeLabel label, String name, org.apache.tinkerpop.gremlin.structure.Direction direction, org.apache.tinkerpop.gremlin.process.traversal.Order sortOrder, PropertyKey... sortKeys)
TitanManagementRelationTypeIndex 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.buildEdgeIndex in interface TitanManagementRelationTypeIndexpublic RelationTypeIndex buildPropertyIndex(PropertyKey key, String name, PropertyKey... sortKeys)
TitanManagement#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.buildPropertyIndex in interface TitanManagementRelationTypeIndexpublic RelationTypeIndex buildPropertyIndex(PropertyKey key, String name, org.apache.tinkerpop.gremlin.process.traversal.Order sortOrder, PropertyKey... sortKeys)
TitanManagementRelationTypeIndex 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.buildPropertyIndex in interface TitanManagementRelationTypeIndexpublic boolean containsRelationIndex(RelationType type, String name)
TitanManagementRelationTypeIndex with the given name has been defined for the provided RelationTypecontainsRelationIndex in interface TitanManagementpublic RelationTypeIndex getRelationIndex(RelationType type, String name)
TitanManagementRelationTypeIndex with the given name for the provided RelationType or null
if it does not existgetRelationIndex in interface TitanManagementpublic Iterable<RelationTypeIndex> getRelationIndexes(RelationType type)
TitanManagementgetRelationIndexes in interface TitanManagementpublic static IndexType getGraphIndexDirect(String name, StandardTitanTx transaction)
public boolean containsGraphIndex(String name)
TitanManagementcontainsGraphIndex in interface TitanManagementpublic TitanGraphIndex getGraphIndex(String name)
TitanManagementgetGraphIndex in interface TitanManagementpublic Iterable<TitanGraphIndex> getGraphIndexes(Class<? extends org.apache.tinkerpop.gremlin.structure.Element> elementType)
TitanManagementgetGraphIndexes in interface TitanManagementpublic static GraphIndexStatusWatcher awaitGraphIndexStatus(TitanGraph g, String graphIndexName)
GraphIndexStatusWatcher configured to watch
graphIndexName through graph g.
This method just instantiates an object.
Invoke GraphIndexStatusWatcher.call() to wait.g - the graph through which to read index informationgraphIndexName - the name of a graph index to watchpublic static RelationIndexStatusWatcher awaitRelationIndexStatus(TitanGraph g, String relationIndexName, String relationTypeName)
RelationIndexStatusWatcher configured to watch the index specified by
relationIndexName and relationIndexType through graph g.
This method just instantiates an object.
Invoke RelationIndexStatusWatcher.call() to wait.g - the graph through which to read index informationrelationIndexName - the name of the relation index to watchrelationTypeName - the type on the relation index to watchpublic void addIndexKey(TitanGraphIndex index, PropertyKey key, Parameter... parameters)
addIndexKey in interface TitanManagementpublic TitanManagement.IndexBuilder buildIndex(String indexName, Class<? extends org.apache.tinkerpop.gremlin.structure.Element> elementType)
TitanManagementTitanManagement.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.buildIndex in interface TitanManagementpublic TitanManagement.IndexJobFuture updateIndex(TitanIndex index, SchemaAction updateAction)
TitanManagementSchemaActionupdateIndex in interface TitanManagementpublic TitanManagement.IndexJobFuture getIndexJobStatus(TitanIndex index)
TitanManagementTitanManagement.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.getIndexJobStatus in interface TitanManagementpublic void changeName(TitanSchemaElement element, String newName)
TitanManagementTitanSchemaElement to the provided new name.
The new name must be valid and not already in use, otherwise an IllegalArgumentException is thrown.changeName in interface TitanManagementpublic TitanSchemaVertex getSchemaVertex(TitanSchemaElement element)
public ConsistencyModifier getConsistency(TitanSchemaElement element)
getConsistency in interface TitanManagementelement - public void setConsistency(TitanSchemaElement element, ConsistencyModifier consistency)
setConsistency in interface TitanManagementelement - consistency - public java.time.Duration getTTL(TitanSchemaType type)
TitanManagementTitanSchemaType as a Duration.
If no TTL has been defined, the returned Duration will be zero-length ("lives forever").getTTL in interface TitanManagementpublic void setTTL(TitanSchemaType type, java.time.Duration duration)
setTTL in interface TitanManagementtype - duration - Note that only 'seconds' granularity is supportedpublic boolean containsRelationType(String name)
SchemaInspectorcontainsRelationType in interface SchemaInspectorname - name of the typepublic RelationType getRelationType(String name)
SchemaInspectorgetRelationType in interface SchemaInspectorname - name of the type to returnRelationTypepublic boolean containsPropertyKey(String name)
SchemaInspectorcontainsPropertyKey in interface SchemaInspectorname - name of the property keypublic PropertyKey getPropertyKey(String name)
SchemaInspectorgetPropertyKey in interface SchemaInspectorpublic boolean containsEdgeLabel(String name)
SchemaInspectorcontainsEdgeLabel in interface SchemaInspectorname - name of the edge labelpublic EdgeLabel getOrCreateEdgeLabel(String name)
SchemaInspectorgetOrCreateEdgeLabel in interface SchemaInspectorname - name of the edge label to returnEdgeLabelpublic PropertyKey getOrCreatePropertyKey(String name)
SchemaInspectorgetOrCreatePropertyKey in interface SchemaInspectorname - name of the property key to returnPropertyKeypublic EdgeLabel getEdgeLabel(String name)
SchemaInspectorgetEdgeLabel in interface SchemaInspectorpublic PropertyKeyMaker makePropertyKey(String name)
SchemaManagerPropertyKeyMaker instance to define a new PropertyKey with the given name.
By defining types explicitly (rather than implicitly through usage) one can control various
aspects of the key and associated consistency constraints.
The key constructed with this maker will be created in the context of this transaction.makePropertyKey in interface SchemaManagerPropertyKeyMaker linked to this transaction.PropertyKeyMaker,
PropertyKeypublic EdgeLabelMaker makeEdgeLabel(String name)
SchemaManagerEdgeLabelMaker instance to define a new EdgeLabel with the given name.
By defining types explicitly (rather than implicitly through usage) one can control various
aspects of the label and associated consistency constraints.
The label constructed with this maker will be created in the context of this transaction.makeEdgeLabel in interface SchemaManagerEdgeLabelMaker linked to this transaction.EdgeLabelMaker,
EdgeLabelpublic <T extends RelationType> Iterable<T> getRelationTypes(Class<T> clazz)
TitanManagementEdgeLabel which returns all labels,
PropertyKey which returns all keys, or RelationType which returns all types).getRelationTypes in interface TitanManagementclazz - RelationType or sub-interfacepublic boolean containsVertexLabel(String name)
SchemaInspectorcontainsVertexLabel in interface SchemaInspectorpublic VertexLabel getVertexLabel(String name)
SchemaInspectorgetVertexLabel in interface SchemaInspectorpublic VertexLabel getOrCreateVertexLabel(String name)
SchemaInspectorDefaultSchemaMaker.
Attempting to automatically create a vertex label might cause an exception depending on the configuration.getOrCreateVertexLabel in interface SchemaInspectorpublic VertexLabelMaker makeVertexLabel(String name)
SchemaManagerVertexLabelMaker to define a new vertex label with the given name. Note, that the name must
be unique.makeVertexLabel in interface SchemaManagerpublic Iterable<VertexLabel> getVertexLabels()
TitanManagementIterable over all defined VertexLabels.getVertexLabels in interface TitanManagementpublic String get(String path)
TitanConfigurationget in interface TitanConfigurationpublic TitanConfiguration set(String path, Object value)
TitanConfigurationset in interface TitanConfigurationCopyright © 2012–2015. All rights reserved.