Package oracle.pgx.api
Interface GraphChangeSet<VID>
-
- All Superinterfaces:
GraphBuilder<VID>
- All Known Subinterfaces:
EdgeModifier<VID>,VertexModifier<VID>
- All Known Implementing Classes:
EdgeModifierImpl,GraphChangeSetImpl,VertexModifierImpl
public interface GraphChangeSet<VID> extends GraphBuilder<VID>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description EdgeBuilder<VID>addEdge(long edgeId, VertexBuilder<VID> srcVertex, VertexBuilder<VID> dstVertex)Adds an edge with the given edge ID and the given source and destination vertices.EdgeBuilder<VID>addEdge(long edgeId, VID srcVertex, VID dstVertex)Adds an edge with the given edge ID and the given source and destination vertices.EdgeBuilder<VID>addEdge(java.lang.String edgeId, VertexBuilder<VID> srcVertex, VertexBuilder<VID> dstVertex)Adds an edge with the given edge ID and the given source and destination vertices.EdgeBuilder<VID>addEdge(java.lang.String edgeId, VID srcVertex, VID dstVertex)Adds an edge with the given edge ID and the given source and destination vertices.VertexBuilder<VID>addVertex()Adds the vertex to the graph builder.VertexBuilder<VID>addVertex(VID vertexId)Adds the vertex with the given id to the graph builder.default PgxGraphbuildNewSnapshot()Blocking version ofbuildNewSnapshotAsync().PgxFuture<PgxGraph>buildNewSnapshotAsync()Builds a new snapshot of the graph out ofthisGraphChangeSet: the resultingPgxGraphis a new snapshot of thePgxGraphobjectthiswas created from.ChangeTypegetEdgeChangeType(java.lang.Object id)Returns theChangeTypeof the update for the edge with the given IDChangeTypegetVertexChangeType(VID id)Returns theChangeTypeof the update for the vertex with the given IDGraphChangeSet<VID>removeEdge(long edgeId)Removes an edge from the graph.GraphChangeSet<VID>removeEdge(java.lang.String edgeId)Removes an edge from the graph.GraphChangeSet<VID>removeVertex(VID vertexId)Removes a vertex from the graph.GraphChangeSet<VID>resetEdge(long edgeId)Resets any change for the edge with the given ID.GraphChangeSet<VID>resetEdge(java.lang.String edgeId)Resets any change for the edge with the given ID.GraphChangeSet<VID>resetVertex(VertexBuilder<VID> vertex)Resets any change for the given vertex.GraphChangeSet<VID>resetVertex(VID vertexId)Resets any change for the vertex with the given ID.GraphChangeSet<VID>setAddExistingEdgePolicy(OnAddExistingElement addExistingEdgePolicy)Sets the policy on what to do when an edge is added that already existsGraphChangeSet<VID>setAddExistingVertexPolicy(OnAddExistingElement addExistingVertexPolicy)Sets the policy on what to do when a vertex is added that already existsGraphChangeSet<VID>setInvalidChangePolicy(OnInvalidChange invalidChangePolicy)Sets the policy on what to do when an invalid action is addedGraphChangeSet<VID>setRequiredConversionPolicy(OnRequiredConversion requiredConversionPolicy)Sets the policy on what to do when an invalid type is encountereddefault GraphChangeSet<VID>setRetainEdgeIds(boolean retainEdgeIds)Controls whether the edge ids provided in this graph builder are to be retained in the final graph.default GraphChangeSet<VID>setRetainIds(boolean retainIds)Controls for both vertex and edge ids whether to retain them in the final graph.default GraphChangeSet<VID>setRetainVertexIds(boolean retainVertexIds)Controls whether to retain the vertex ids provided in this graph builder are to be retained in the final graph.EdgeModifier<VID>updateEdge(long edgeId)Returns aEdgeModifierwith which you can update edge properties and the edge label.EdgeModifier<VID>updateEdge(java.lang.String edgeId)Returns aEdgeModifierwith which you can update edge properties and the edge label.VertexModifier<VID>updateVertex(VID vertexId)Returns aVertexModifierwith which you can update vertex properties.-
Methods inherited from interface oracle.pgx.api.GraphBuilder
addEdge, addEdge, build, build, buildAsync, buildAsync, getConfigParameter, setConfigParameter, setDataSourceVersion
-
-
-
-
Method Detail
-
addVertex
VertexBuilder<VID> addVertex(VID vertexId)
Adds the vertex with the given id to the graph builder. If the addExistingVertexPolicy is set to ERROR throws an exception if a vertex with the given id already exists Otherwise a builder for that vertex is returned Throws anUnsupportedOperationExceptionif vertex Id generation strategy is set toAUTO_GENERATED- Specified by:
addVertexin interfaceGraphBuilder<VID>- Parameters:
vertexId- the ID of the new vertex- Returns:
- a vertex builder instance
-
addVertex
VertexBuilder<VID> addVertex()
Adds the vertex to the graph builder. If the addExistingVertexPolicy is set to ERROR throws an exception if a vertex already exists Otherwise a builder for that vertex is returned Throws anUnsupportedOperationExceptionif vertex Id generation strategy for partitioned graphs . is set toAUTO_GENERATED- Specified by:
addVertexin interfaceGraphBuilder<VID>- Returns:
- a vertex builder instance
-
addEdge
EdgeBuilder<VID> addEdge(long edgeId, VID srcVertex, VID dstVertex)
Adds an edge with the given edge ID and the given source and destination vertices. If the addExistingEdgePolicy is set to ERROR throws an exception if an edge with the given id already exists Otherwise a builder for that edge is returnedThrows an
UnsupportedOperationExceptionif edge Id generation strategy is set toAUTO_GENERATED- Specified by:
addEdgein interfaceGraphBuilder<VID>- Parameters:
edgeId- the ID of the new edgesrcVertex- the source ID of the new edgedstVertex- the destination ID of the new edge- Returns:
- an edge builder instance
-
addEdge
EdgeBuilder<VID> addEdge(java.lang.String edgeId, VID srcVertex, VID dstVertex)
Adds an edge with the given edge ID and the given source and destination vertices. If the addExistingEdgePolicy is set to ERROR throws an exception if an edge with the given id already exists Otherwise a builder for that edge is returnedThrows an
UnsupportedOperationExceptionif edge Id generation strategy is set toAUTO_GENERATED- Specified by:
addEdgein interfaceGraphBuilder<VID>- Parameters:
edgeId- the ID of the new edgesrcVertex- the source ID of the new edgedstVertex- the destination ID of the new edge- Returns:
- an edge builder instance
-
addEdge
EdgeBuilder<VID> addEdge(long edgeId, VertexBuilder<VID> srcVertex, VertexBuilder<VID> dstVertex)
Adds an edge with the given edge ID and the given source and destination vertices. If the addExistingEdgePolicy is set to ERROR throws an exception if an edge with the given id already exists Otherwise a builder for that edge is returned Throws anUnsupportedOperationExceptionif edge Id generation strategy is set toAUTO_GENERATED- Specified by:
addEdgein interfaceGraphBuilder<VID>- Parameters:
edgeId- the ID of the new edgesrcVertex- aVertexBuilderImplinstance representing the source vertexdstVertex- aVertexBuilderImplinstance representing the destination vertex- Returns:
- an edge builder instance
- See Also:
VertexBuilderImpl
-
addEdge
EdgeBuilder<VID> addEdge(java.lang.String edgeId, VertexBuilder<VID> srcVertex, VertexBuilder<VID> dstVertex)
Adds an edge with the given edge ID and the given source and destination vertices. If the addExistingEdgePolicy is set to ERROR throws an exception if an edge with the given id already exists Otherwise a builder for that edge is returned Throws anUnsupportedOperationExceptionif edge Id generation strategy is set toAUTO_GENERATED- Specified by:
addEdgein interfaceGraphBuilder<VID>- Parameters:
edgeId- the ID of the new edgesrcVertex- aVertexBuilderImplinstance representing the source vertexdstVertex- aVertexBuilderImplinstance representing the destination vertex- Returns:
- an edge builder instance
- See Also:
VertexBuilderImpl
-
removeVertex
GraphChangeSet<VID> removeVertex(VID vertexId)
Removes a vertex from the graph. If the graph doesn't have a vertex with the given ID, an exception will be thrown once the graph is built.- Parameters:
vertexId- the ID of the vertex to be removed- Returns:
- this graph change set
-
removeEdge
GraphChangeSet<VID> removeEdge(long edgeId)
Removes an edge from the graph. If the graph doesn't have an edge with the given ID, an exception will be thrown once the graph is built.- Parameters:
edgeId- the ID of the edge to be removed- Returns:
- this graph change set
-
removeEdge
GraphChangeSet<VID> removeEdge(java.lang.String edgeId)
Removes an edge from the graph. If the graph doesn't have an edge with the given ID, an exception will be thrown once the graph is built.- Parameters:
edgeId- the ID of the edge to be removed- Returns:
- this graph change set
-
updateVertex
VertexModifier<VID> updateVertex(VID vertexId)
Returns aVertexModifierwith which you can update vertex properties. Throws an exception if the vertex has been removed with this graph change set before.- Parameters:
vertexId- the ID of the vertex that should be updated- Returns:
- a
VertexModifierinstance
-
updateEdge
EdgeModifier<VID> updateEdge(long edgeId)
Returns aEdgeModifierwith which you can update edge properties and the edge label.- Parameters:
edgeId- the ID of the edge that should be updated- Returns:
- an
VertexModifierinstance
-
updateEdge
EdgeModifier<VID> updateEdge(java.lang.String edgeId)
Returns aEdgeModifierwith which you can update edge properties and the edge label.- Parameters:
edgeId- the ID of the edge that should be updated- Returns:
- an
VertexModifierinstance
-
setAddExistingVertexPolicy
GraphChangeSet<VID> setAddExistingVertexPolicy(OnAddExistingElement addExistingVertexPolicy)
Sets the policy on what to do when a vertex is added that already exists- Parameters:
addExistingVertexPolicy- the new policy- Returns:
- this graph builder
-
setInvalidChangePolicy
GraphChangeSet<VID> setInvalidChangePolicy(OnInvalidChange invalidChangePolicy)
Sets the policy on what to do when an invalid action is added- Parameters:
invalidChangePolicy-- Returns:
- this graph builder
- Since:
- 20.2.0
-
setRequiredConversionPolicy
GraphChangeSet<VID> setRequiredConversionPolicy(OnRequiredConversion requiredConversionPolicy)
Sets the policy on what to do when an invalid type is encountered- Parameters:
requiredConversionPolicy-- Returns:
- this graph builder
- Since:
- 20.2.0
-
setAddExistingEdgePolicy
GraphChangeSet<VID> setAddExistingEdgePolicy(OnAddExistingElement addExistingEdgePolicy)
Sets the policy on what to do when an edge is added that already exists- Parameters:
addExistingEdgePolicy- the new policy- Returns:
- this graph builder
-
resetVertex
GraphChangeSet<VID> resetVertex(VID vertexId)
Description copied from interface:GraphBuilderResets any change for the vertex with the given ID. Does nothing if no change for the given vertex ID exists.- Specified by:
resetVertexin interfaceGraphBuilder<VID>- Parameters:
vertexId- the ID of the vertex which should be reset- Returns:
- this graph builder
-
resetVertex
GraphChangeSet<VID> resetVertex(VertexBuilder<VID> vertex)
Description copied from interface:GraphBuilderResets any change for the given vertex.- Specified by:
resetVertexin interfaceGraphBuilder<VID>- Parameters:
vertex- aVertexBuilder- Returns:
- this graph builder
-
resetEdge
GraphChangeSet<VID> resetEdge(long edgeId)
Description copied from interface:GraphBuilderResets any change for the edge with the given ID. Does nothing if no change for the given edge ID exists.- Specified by:
resetEdgein interfaceGraphBuilder<VID>- Parameters:
edgeId- the ID of the edge which should be reset- Returns:
- this graph builder
-
resetEdge
GraphChangeSet<VID> resetEdge(java.lang.String edgeId)
Description copied from interface:GraphBuilderResets any change for the edge with the given ID. Does nothing if no change for the given edge ID exists.- Specified by:
resetEdgein interfaceGraphBuilder<VID>- Parameters:
edgeId- the ID of the edge which should be reset- Returns:
- this graph builder
-
setRetainEdgeIds
default GraphChangeSet<VID> setRetainEdgeIds(boolean retainEdgeIds)
Description copied from interface:GraphBuilderControls whether the edge ids provided in this graph builder are to be retained in the final graph. Iftrueretain the edge ids, iffalseuse internally generated edge ids.- Specified by:
setRetainEdgeIdsin interfaceGraphBuilder<VID>- Parameters:
retainEdgeIds- whether or not to retain edge ids- Returns:
- this graph builder
-
setRetainVertexIds
default GraphChangeSet<VID> setRetainVertexIds(boolean retainVertexIds)
Description copied from interface:GraphBuilderControls whether to retain the vertex ids provided in this graph builder are to be retained in the final graph. Iftrueretain the vertex ids, iffalseuse internally generated vertex ids of typeInteger- Specified by:
setRetainVertexIdsin interfaceGraphBuilder<VID>- Parameters:
retainVertexIds- whether or not to retain vertex ids- Returns:
- this graph builder
-
setRetainIds
default GraphChangeSet<VID> setRetainIds(boolean retainIds)
Description copied from interface:GraphBuilderControls for both vertex and edge ids whether to retain them in the final graph.- Specified by:
setRetainIdsin interfaceGraphBuilder<VID>- Parameters:
retainIds- whether or not to retain vertex and edge ids- Returns:
- this graph builder
- See Also:
GraphBuilder.setRetainEdgeIds(boolean),GraphBuilder.setRetainVertexIds(boolean)
-
buildNewSnapshotAsync
PgxFuture<PgxGraph> buildNewSnapshotAsync()
Builds a new snapshot of the graph out ofthisGraphChangeSet: the resultingPgxGraphis a new snapshot of thePgxGraphobjectthiswas created from.
-
buildNewSnapshot
default PgxGraph buildNewSnapshot() throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Blocking version ofbuildNewSnapshotAsync(). CallsbuildNewSnapshotAsync()and waits for the returnedPgxFutureto complete.- Throws:
java.lang.InterruptedException- if the caller thread gets interrupted while waiting for completion.java.util.concurrent.ExecutionException- if any exception occurred during asynchronous execution. The actual exception will be nested.- Since:
- 20.0.0
-
getVertexChangeType
ChangeType getVertexChangeType(VID id)
Returns theChangeTypeof the update for the vertex with the given ID- Parameters:
id- the ID of the vertex that should be referenced- Returns:
- the
ChangeTypeor null if the graph doesn't have an vertex with the given ID - Since:
- 22.3.0
-
getEdgeChangeType
ChangeType getEdgeChangeType(java.lang.Object id)
Returns theChangeTypeof the update for the edge with the given ID- Parameters:
id- the ID of the edge that should be referenced- Returns:
- the
ChangeTypeor null if the graph doesn't have an edge with the given ID - Since:
- 22.3.0
-
-