public class StandardTitanTx extends TitanBlueprintsTransaction implements TypeInspector, VertexFactory
| Constructor and Description |
|---|
StandardTitanTx(StandardTitanGraph graph,
TransactionConfiguration config) |
| Modifier and Type | Method and Description |
|---|---|
TitanEdge |
addEdge(TitanVertex outVertex,
TitanVertex inVertex,
EdgeLabel label)
Creates a new edge connecting the specified vertices.
|
TitanProperty |
addProperty(TitanVertex vertex,
PropertyKey key,
Object value)
Creates a new property for the given vertex and key with the specified value.
|
TitanProperty |
addPropertyInternal(TitanVertex vertex,
PropertyKey key,
Object value) |
TitanVertex |
addVertex()
Creates a new vertex in the graph.
|
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 given vertex label name.
|
TitanVertex |
addVertex(VertexLabel vertexLabel)
Creates a new vertex in the graph with the given vertex label.
|
void |
commit()
Commits and closes the transaction.
|
boolean |
containsRelationType(String name)
Checks whether a type with the specified name exists.
|
boolean |
containsVertex(long vertexid)
Checks whether a vertex with the specified id exists in the graph database.
|
boolean |
containsVertexLabel(String name)
Whether a vertex label with the given name exists in the graph.
|
void |
executeMultiQuery(Collection<InternalVertex> vertices,
SliceQuery sq) |
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<com.tinkerpop.blueprints.Edge> |
getEdges() |
Iterable<TitanEdge> |
getEdges(PropertyKey key,
Object attribute)
Retrieves all vertices which have a property of the given key with the specified value.
|
EdgeSerializer |
getEdgeSerializer() |
RelationType |
getExistingRelationType(long typeid) |
StandardTitanGraph |
getGraph() |
IDInspector |
getIdInspector() |
InternalVertex |
getInternalVertex(long vertexid) |
StandardTitanTx |
getNextTx() |
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<com.tinkerpop.blueprints.Vertex> |
getVertices() |
Iterable<TitanVertex> |
getVertices(PropertyKey key,
Object attribute)
Retrieves all vertices which have a property of the given key with the specified value.
|
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) |
TitanMultiVertexQuery |
multiQuery(TitanVertex... vertices) |
GraphCentricQueryBuilder |
query() |
VertexCentricQueryBuilder |
query(TitanVertex vertex) |
void |
removeRelation(InternalRelation relation) |
void |
rollback()
Aborts and closes the transaction.
|
void |
setBackendTransaction(BackendTransaction txHandle) |
TitanProperty |
setProperty(TitanVertex vertex,
PropertyKey key,
Object value) |
void |
verifyAccess(TitanVertex... vertices) |
Object |
verifyAttribute(PropertyKey key,
Object attribute) |
addEdge, addEdge, addProperty, addVertex, createKeyIndex, dropKeyIndex, getEdge, getEdges, getFeatures, getIndexedKeys, getVertex, getVertices, removeEdge, removeVertex, shutdown, stopTransaction, toStringpublic 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()
public BackendTransaction getTxHandle()
public EdgeSerializer getEdgeSerializer()
public IDInspector 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)
TitanTransactioncontainsVertex in interface TitanTransactionvertexid - vertex idpublic TitanVertex getVertex(long vertexid)
TitanTransactiongetVertex in interface TitanTransactionvertexid - id of the vertex to retrieveTitanTransaction.containsVertex(long)public 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()
TitanTransactionaddVertex in interface TitanTransactionpublic TitanVertex addVertex(String vertexLabel)
TitanTransactionaddVertex in interface TitanTransactionpublic TitanVertex addVertex(VertexLabel vertexLabel)
TitanTransactionaddVertex in interface TitanTransactionpublic Iterable<com.tinkerpop.blueprints.Vertex> getVertices()
getVertices in interface com.tinkerpop.blueprints.Graphpublic 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)
TitanTransactionTitanEdge with given label connecting the vertices in the order
specified.addEdge in interface TitanTransactionoutVertex - outgoing vertex of the edgeinVertex - incoming vertex of the edgelabel - label of the edge to be createdpublic TitanProperty addProperty(TitanVertex vertex, PropertyKey key, Object value)
TitanTransactionTitanProperty with specified property key and the given object being the value.addProperty in interface TitanTransactionvertex - vertex for which to create the propertykey - key of the property to be createdvalue - value of the property to be createdpublic TitanProperty addPropertyInternal(TitanVertex vertex, PropertyKey key, Object value)
public TitanProperty setProperty(TitanVertex vertex, PropertyKey key, Object value)
public Iterable<com.tinkerpop.blueprints.Edge> getEdges()
getEdges in interface com.tinkerpop.blueprints.Graphpublic final TitanSchemaVertex makeSchemaVertex(TitanSchemaCategory schemaCategory, String name, TypeDefinitionMap definition)
public PropertyKey makePropertyKey(String name, TypeDefinitionMap definition)
public EdgeLabel makeEdgeLabel(String name, TypeDefinitionMap definition)
public boolean containsRelationType(String name)
TitanTransactioncontainsRelationType in interface TitanTransactioncontainsRelationType in interface TypeInspectorname - name of the typepublic TitanSchemaVertex getSchemaVertex(String schemaName)
public RelationType getRelationType(String name)
TitanTransactiongetRelationType in interface TitanTransactiongetRelationType in interface TypeInspectorname - name of the type to returnRelationTypepublic RelationType getExistingRelationType(long typeid)
getExistingRelationType in interface TypeInspectorpublic PropertyKey getPropertyKey(String name)
TitanTransactiongetPropertyKey in interface TitanTransactionname - name of the property key to returnPropertyKeypublic EdgeLabel getEdgeLabel(String name)
TitanTransactiongetEdgeLabel in interface TitanTransactionname - name of the edge label to returnEdgeLabelpublic PropertyKeyMaker makePropertyKey(String name)
TitanTransactionPropertyKeyMaker 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 TitanTransactionPropertyKeyMaker linked to this transaction.PropertyKeyMaker,
PropertyKeypublic EdgeLabelMaker makeEdgeLabel(String name)
TitanTransactionEdgeLabelMaker 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 TitanTransactionEdgeLabelMaker linked to this transaction.EdgeLabelMaker,
EdgeLabelpublic boolean containsVertexLabel(String name)
TitanTransactioncontainsVertexLabel in interface TitanTransactionpublic VertexLabel getVertexLabel(String name)
TitanTransactionDefaultSchemaMaker.
Attempting to automatically create a vertex label might cause an exception depending on the configuration.getVertexLabel in interface TitanTransactionpublic VertexLabelMaker makeVertexLabel(String name)
TitanTransactionVertexLabelMaker to define a new vertex label with the given name. Note, that the name must
be unique.makeVertexLabel in interface TitanTransactionpublic VertexCentricQueryBuilder query(TitanVertex vertex)
public TitanMultiVertexQuery multiQuery(TitanVertex... vertices)
multiQuery in interface TitanTransactionTitanGraph.multiQuery(TitanVertex...)public TitanMultiVertexQuery multiQuery(Collection<TitanVertex> vertices)
multiQuery in interface TitanTransactionTitanGraph.multiQuery(Collection)public void executeMultiQuery(Collection<InternalVertex> vertices, SliceQuery sq)
public com.google.common.base.Function<Object,? extends TitanElement> getConversionFunction(ElementCategory elementCategory)
public GraphCentricQueryBuilder query()
query in interface TitanTransactionquery in interface com.tinkerpop.blueprints.GraphTitanGraph.query()public TitanIndexQuery indexQuery(String indexName, String query)
TitanTransactionTitanIndexQuery 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 TitanTransactionindexName - Name of the indexing backend to query as configuredquery - Query stringpublic Iterable<TitanVertex> getVertices(PropertyKey key, Object attribute)
TitanTransactiongetVertices in interface TitanTransactionkey - keyattribute - value valueTitanManagement.buildIndex(String, Class)public Iterable<TitanEdge> getEdges(PropertyKey key, Object attribute)
TitanTransactiongetEdges in interface TitanTransactionkey - keyattribute - value valueTitanManagement.buildIndex(String, Class)public void commit()
TitanTransactioncommit in interface TitanTransactioncommit in interface com.tinkerpop.blueprints.TransactionalGraphpublic void rollback()
TitanTransactionrollback in interface TitanTransactionrollback in interface com.tinkerpop.blueprints.TransactionalGraphpublic boolean isOpen()
TitanTransactionisOpen in interface TitanTransactionpublic boolean isClosed()
TitanTransactionisClosed in interface TitanTransactionpublic boolean hasModifications()
TitanTransactionhasModifications in interface TitanTransactionCopyright © 2012–2014. All rights reserved.