public class StandardTitanTx extends TitanBlueprintsTransaction implements TypeInspector, SchemaInspector, VertexFactory
org.apache.tinkerpop.gremlin.structure.Graph.Exceptions, org.apache.tinkerpop.gremlin.structure.Graph.Features, org.apache.tinkerpop.gremlin.structure.Graph.Hidden, org.apache.tinkerpop.gremlin.structure.Graph.OptIn, org.apache.tinkerpop.gremlin.structure.Graph.OptIns, org.apache.tinkerpop.gremlin.structure.Graph.OptOut, org.apache.tinkerpop.gremlin.structure.Graph.OptOuts, org.apache.tinkerpop.gremlin.structure.Graph.Variables| Constructor and Description |
|---|
StandardTitanTx(StandardTitanGraph graph,
TransactionConfiguration config) |
| Modifier and Type | Method and Description |
|---|---|
TitanEdge |
addEdge(TitanVertex outVertex,
TitanVertex inVertex,
EdgeLabel label) |
TitanVertexProperty |
addProperty(TitanVertex vertex,
PropertyKey key,
Object value) |
TitanVertexProperty |
addProperty(org.apache.tinkerpop.gremlin.structure.VertexProperty.Cardinality cardi,
TitanVertex vertex,
PropertyKey key,
Object value) |
TitanVertex |
addVertex(Long vertexId,
VertexLabel label)
Creates a new vertex in the graph with the given vertex id and the given vertex label.
|
TitanVertex |
addVertex(String vertexLabel)
Creates a new vertex in the graph with the vertex label named by the argument.
|
TitanVertex |
addVertex(VertexLabel vertexLabel) |
void |
commit()
Commits and closes the transaction.
|
boolean |
containsEdgeLabel(String name)
Checks whether an edge label of the given name has been defined in the Titan schema.
|
boolean |
containsPropertyKey(String name)
Checks whether a property key of the given name has been defined in the Titan schema.
|
boolean |
containsRelationType(String name)
Checks whether a type with the specified name exists.
|
boolean |
containsVertex(long vertexid) |
boolean |
containsVertexLabel(String name)
Whether a vertex label with the given name exists in the graph.
|
void |
executeMultiQuery(Collection<InternalVertex> vertices,
SliceQuery sq,
QueryProfiler profiler) |
InternalVertex[] |
getAllRepresentatives(TitanVertex partitionedVertex,
boolean restrict2Partitions) |
InternalVertex |
getCanonicalVertex(InternalVertex partitionedVertex) |
TransactionConfiguration |
getConfiguration() |
com.google.common.base.Function<Object,? extends TitanElement> |
getConversionFunction(ElementCategory elementCategory) |
EdgeLabel |
getEdgeLabel(String name)
Returns the edge label with the given name.
|
Iterable<TitanEdge> |
getEdges(RelationIdentifier... ids) |
EdgeSerializer |
getEdgeSerializer() |
RelationType |
getExistingRelationType(long typeid) |
VertexLabel |
getExistingVertexLabel(long id) |
StandardTitanGraph |
getGraph()
Returns the graph that this transaction is based on
|
IDManager |
getIdInspector() |
InternalVertex |
getInternalVertex(long vertexid) |
StandardTitanTx |
getNextTx() |
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.
|
InternalVertex |
getOtherPartitionVertex(TitanVertex partitionedVertex,
long otherPartition) |
PropertyKey |
getPropertyKey(String name)
Returns the property key with the given name.
|
RelationType |
getRelationType(String name)
Returns the type with the given name.
|
TitanSchemaVertex |
getSchemaVertex(String schemaName) |
BackendTransaction |
getTxHandle() |
TitanVertex |
getVertex(long vertexid)
Retrieves the vertex for the specified id.
|
VertexLabel |
getVertexLabel(String name)
Returns the vertex label with the given name.
|
Iterable<TitanVertex> |
getVertices(long... ids) |
boolean |
hasModifications()
Checks whether any changes to the graph database have been made in this transaction.
|
TitanIndexQuery |
indexQuery(String indexName,
String query)
Returns a
TitanIndexQuery to query for vertices or edges against the specified indexing backend using
the given query string. |
boolean |
isClosed()
Checks whether the transaction has been closed.
|
boolean |
isOpen()
Checks whether the transaction is still open.
|
boolean |
isPartitionedVertex(TitanVertex vertex) |
boolean |
isRemovedRelation(Long relationId) |
EdgeLabelMaker |
makeEdgeLabel(String name)
Returns a
EdgeLabelMaker instance to define a new EdgeLabel with the given name. |
EdgeLabel |
makeEdgeLabel(String name,
TypeDefinitionMap definition) |
PropertyKeyMaker |
makePropertyKey(String name)
Returns a
PropertyKeyMaker instance to define a new PropertyKey with the given name. |
PropertyKey |
makePropertyKey(String name,
TypeDefinitionMap definition) |
TitanSchemaVertex |
makeSchemaVertex(TitanSchemaCategory schemaCategory,
String name,
TypeDefinitionMap definition) |
VertexLabelMaker |
makeVertexLabel(String name)
Returns a
VertexLabelMaker to define a new vertex label with the given name. |
TitanMultiVertexQuery |
multiQuery(Collection<TitanVertex> vertices)
Deprecated.
|
TitanMultiVertexQuery |
multiQuery(TitanVertex... vertices)
Deprecated.
|
GraphCentricQueryBuilder |
query() |
VertexCentricQueryBuilder |
query(TitanVertex vertex) |
void |
removeRelation(InternalRelation relation) |
void |
rollback()
Aborts and closes the transaction.
|
void |
setBackendTransaction(BackendTransaction txHandle) |
void |
updateSchemaVertex(TitanSchemaVertex schemaVertex) |
boolean |
validDataType(Class datatype) |
void |
verifyAccess(TitanVertex... vertices) |
Object |
verifyAttribute(PropertyKey key,
Object attribute) |
addVertex, close, compute, compute, configuration, edges, features, io, toString, tx, variables, verticesclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetExistingEdgeLabel, getExistingPropertyKeypublic final QueryExecutor<VertexCentricQuery,TitanRelation,SliceQuery> edgeProcessor
public final QueryExecutor<VertexCentricQuery,TitanRelation,SliceQuery> edgeProcessorImpl
public final QueryExecutor<GraphCentricQuery,TitanElement,JointIndexQuery> elementProcessor
public final QueryExecutor<GraphCentricQuery,TitanElement,JointIndexQuery> elementProcessorImpl
public StandardTitanTx(StandardTitanGraph graph, TransactionConfiguration config)
public void setBackendTransaction(BackendTransaction txHandle)
public final void verifyAccess(TitanVertex... vertices)
public StandardTitanTx getNextTx()
public TransactionConfiguration getConfiguration()
public StandardTitanGraph getGraph()
TitanBlueprintsTransactiongetGraph in class TitanBlueprintsTransactionpublic BackendTransaction getTxHandle()
public EdgeSerializer getEdgeSerializer()
public IDManager getIdInspector()
public boolean isPartitionedVertex(TitanVertex vertex)
public InternalVertex getCanonicalVertex(InternalVertex partitionedVertex)
public InternalVertex getOtherPartitionVertex(TitanVertex partitionedVertex, long otherPartition)
public InternalVertex[] getAllRepresentatives(TitanVertex partitionedVertex, boolean restrict2Partitions)
public boolean containsVertex(long vertexid)
public TitanVertex getVertex(long vertexid)
TitanTransactionGraph.vertices(Object...) instead.getVertex in interface TitanTransactionvertexid - id of the vertex to retrievepublic Iterable<TitanVertex> getVertices(long... ids)
getVertices in interface TitanTransactionpublic InternalVertex getInternalVertex(long vertexid)
getInternalVertex in interface VertexFactorypublic TitanVertex addVertex(Long vertexId, VertexLabel label)
TitanTransactionGraphDatabaseConfiguration.ALLOW_SETTING_VERTEX_ID.
Use TitanId.toVertexId(long) to construct a valid Titan vertex id from a user id.addVertex in interface TitanTransactionvertexId - vertex id of the vertex to be createdlabel - vertex label for this vertex - can be null if no vertex label should be set.public TitanVertex addVertex(String vertexLabel)
TitanGraphTransactionaddVertex in interface TitanGraphTransactionaddVertex in interface org.apache.tinkerpop.gremlin.structure.GraphvertexLabel - the name of the vertex label to usepublic TitanVertex addVertex(VertexLabel vertexLabel)
public final boolean validDataType(Class datatype)
public final Object verifyAttribute(PropertyKey key, Object attribute)
public void removeRelation(InternalRelation relation)
public boolean isRemovedRelation(Long relationId)
public TitanEdge addEdge(TitanVertex outVertex, TitanVertex inVertex, EdgeLabel label)
public TitanVertexProperty addProperty(TitanVertex vertex, PropertyKey key, Object value)
public TitanVertexProperty addProperty(org.apache.tinkerpop.gremlin.structure.VertexProperty.Cardinality cardi, TitanVertex vertex, PropertyKey key, Object value)
public Iterable<TitanEdge> getEdges(RelationIdentifier... ids)
getEdges in interface TitanTransactionpublic final TitanSchemaVertex makeSchemaVertex(TitanSchemaCategory schemaCategory, String name, TypeDefinitionMap definition)
public void updateSchemaVertex(TitanSchemaVertex schemaVertex)
public PropertyKey makePropertyKey(String name, TypeDefinitionMap definition)
public EdgeLabel makeEdgeLabel(String name, TypeDefinitionMap definition)
public TitanSchemaVertex getSchemaVertex(String schemaName)
public boolean containsRelationType(String name)
SchemaInspectorcontainsRelationType in interface SchemaInspectorcontainsRelationType in interface TypeInspectorname - name of the typepublic RelationType getRelationType(String name)
SchemaInspectorgetRelationType in interface SchemaInspectorgetRelationType in interface TypeInspectorname - name of the type to returnRelationTypepublic boolean containsPropertyKey(String name)
SchemaInspectorcontainsPropertyKey in interface SchemaInspectorname - name of the property keypublic boolean containsEdgeLabel(String name)
SchemaInspectorcontainsEdgeLabel in interface SchemaInspectorname - name of the edge labelpublic RelationType getExistingRelationType(long typeid)
getExistingRelationType in interface TypeInspectorpublic PropertyKey getPropertyKey(String name)
SchemaInspectorgetPropertyKey in interface SchemaInspectorpublic PropertyKey getOrCreatePropertyKey(String name)
SchemaInspectorgetOrCreatePropertyKey in interface SchemaInspectorname - name of the property key to returnPropertyKeypublic EdgeLabel getEdgeLabel(String name)
SchemaInspectorgetEdgeLabel in interface SchemaInspectorpublic EdgeLabel getOrCreateEdgeLabel(String name)
SchemaInspectorgetOrCreateEdgeLabel in interface SchemaInspectorname - name of the edge label to returnEdgeLabelpublic 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 VertexLabel getExistingVertexLabel(long id)
getExistingVertexLabel in interface TypeInspectorpublic 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 VertexCentricQueryBuilder query(TitanVertex vertex)
@Deprecated public TitanMultiVertexQuery multiQuery(TitanVertex... vertices)
multiQuery in interface TitanGraphTransactionTitanGraphTransaction.multiQuery(com.thinkaurelius.titan.core.TitanVertex...)@Deprecated public TitanMultiVertexQuery multiQuery(Collection<TitanVertex> vertices)
multiQuery in interface TitanGraphTransactionTitanGraphTransaction.multiQuery(java.util.Collection)public void executeMultiQuery(Collection<InternalVertex> vertices, SliceQuery sq, QueryProfiler profiler)
public com.google.common.base.Function<Object,? extends TitanElement> getConversionFunction(ElementCategory elementCategory)
public GraphCentricQueryBuilder query()
query in interface TitanGraphTransactionTitanGraphTransaction.query()public TitanIndexQuery indexQuery(String indexName, String query)
TitanGraphTransactionTitanIndexQuery to query for vertices or edges against the specified indexing backend using
the given query string. The query string is analyzed and answered by the underlying storage backend.
Note, that using indexQuery will may ignore modifications in the current transaction.indexQuery in interface TitanGraphTransactionindexName - Name of the indexing backend to query as configuredquery - Query stringpublic void commit()
TitanTransactioncommit in interface TitanTransactionpublic void rollback()
TitanTransactionrollback in interface TitanTransactionpublic final boolean isOpen()
TitanTransactionisOpen in interface TitanTransactionpublic final boolean isClosed()
TitanTransactionisClosed in interface TitanTransactionpublic boolean hasModifications()
TitanTransactionhasModifications in interface TitanTransactionCopyright © 2012–2015. All rights reserved.