Package oracle.pgx.api
Class GraphBuilderImpl<VID>
java.lang.Object
oracle.pgx.api.internal.ApiObject
oracle.pgx.api.GraphBuilderImpl<VID>
- Type Parameters:
VID- the vertex ID type
- All Implemented Interfaces:
GraphBuilder<VID>
- Direct Known Subclasses:
EdgeBuilderImpl,GraphChangeSetImpl,VertexBuilderImpl
public class GraphBuilderImpl<VID>
extends oracle.pgx.api.internal.ApiObject
implements GraphBuilder<VID>
A graph builder for constructing a
PgxGraph.-
Method Summary
Modifier and TypeMethodDescriptionaddEdge(long edgeId, VertexBuilder<VID> srcVertex, VertexBuilder<VID> dstVertex) Adds an edge with the given edge ID and the given source and destination vertices.Adds an edge with the given edge ID and the given source and destination vertices.addEdge(String edgeId, VertexBuilder<VID> srcVertex, VertexBuilder<VID> dstVertex) Adds an edge with the given edge ID and the given source and destination vertices.Adds an edge with the given edge ID and the given source and destination vertices.addEdge(VertexBuilder<VID> srcVertex, VertexBuilder<VID> dstVertex) Adds an edge with an implicit ID and the given source and destination vertices.Adds an edge with an implicit ID and the given source and destination vertices.Adds a vertex with an implicit id to the graph builder.Adds the vertex with the given id to the graph builder.final PgxGraphbuild()Blocking version ofGraphBuilder.buildAsync().final PgxGraphBlocking version ofGraphBuilder.buildAsync(String).Shortcut forGraphBuilder.buildAsync(String)without a namebuildAsync(String newGraphName) Builds a new graph out of the changes in this graph buildergetConfigParameter(GraphBuilderConfig.Field parameter) Retrieve the value for the given config parameterfinal PgxSessionGets the session.booleanpartitionedEdgeIds(boolean partitionedIds) Specifies if the final graph should useIdStrategy.PARTITIONED_IDSfor edges.partitionedVertexIds(boolean partitionedIds) Specifies if the final graph should useIdStrategy.PARTITIONED_IDSfor vertices.resetEdge(long edgeId) Resets any change for the edge with the given ID.Resets any change for the edge with the given ID.resetVertex(VertexBuilder<VID> vertex) Resets any change for the given vertex.resetVertex(VID vertexId) Resets any change for the vertex with the given ID.voidsetConfigParameter(GraphBuilderConfig.Field parameter, Object value) Set the given configuration parameter to the given valuevoidsetDataSourceVersion(String version) Sets the version information for the built graph or snapshotsetEdgeIdGenerationStrategy(IdGenerationStrategy edgeIdGenerationStrategy) Defines the ID generation strategy the GraphBuilder should use for edges.setRetainEdgeIds(boolean retainEdgeIds) Controls whether the edge ids provided in this graph builder are to be retained in the final graph.setRetainVertexIds(boolean retainVertexIds) Controls whether to retain the vertex ids provided in this graph builder are to be retained in the final graph.setVertexIdGenerationStrategy(IdGenerationStrategy vertexIdGenerationStrategy) Defines the ID generation strategy the GraphBuilder should use for vertices.toString()Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface oracle.pgx.api.GraphBuilder
setRetainIds
-
Method Details
-
setDataSourceVersion
Description copied from interface:GraphBuilderSets the version information for the built graph or snapshot- Specified by:
setDataSourceVersionin interfaceGraphBuilder<VID>- Parameters:
version- the version information
-
addVertex
Description copied from interface:GraphBuilderAdds the vertex with the given id to the graph builder. If the vertex doesn't exist it is added, if it exists a builder for that vertex is returned Throws anUnsupportedOperationExceptionif vertex Id generation strategy is set toIdGenerationStrategy.AUTO_GENERATED- Specified by:
addVertexin interfaceGraphBuilder<VID>- Parameters:
vertexId- the ID of the new vertex- Returns:
- a vertex builder instance
-
addVertex
Description copied from interface:GraphBuilderAdds a vertex with an implicit id to the graph builder. A builder for that vertex is returned Throws anUnsupportedOperationExceptionif vertex Id generation strategy is set toIdGenerationStrategy.USER_IDS- Specified by:
addVertexin interfaceGraphBuilder<VID>- Returns:
- a vertex builder instance
-
resetVertex
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
Description copied from interface:GraphBuilderResets any change for the given vertex.- Specified by:
resetVertexin interfaceGraphBuilder<VID>- Parameters:
vertex- aVertexBuilder- Returns:
- this graph builder
-
resetEdge
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
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
-
addEdge
Description copied from interface:GraphBuilderAdds an edge with the given edge ID and the given source and destination vertices. If the edge doesn't exist it is added, if it exists a builder for that edge is returned Vertices that don't yet exist in the graph are added on the fly. Throws anUnsupportedOperationExceptionif edge Id generation strategy is set toIdGenerationStrategy.AUTO_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
Description copied from interface:GraphBuilderAdds an edge with the given edge ID and the given source and destination vertices. If the edge doesn't exist it is added, if it exists a builder for that edge is returned Vertices that don't yet exist in the graph are added on the fly. Throws anUnsupportedOperationExceptionif edge Id generation strategy is set toIdGenerationStrategy.AUTO_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
Description copied from interface:GraphBuilderAdds an edge with an implicit ID and the given source and destination vertices. Vertices that don't yet exist in the graph are added on the fly. Throws anUnsupportedOperationExceptionif edge Id generation strategy is set toIdGenerationStrategy.USER_IDS- Specified by:
addEdgein interfaceGraphBuilder<VID>- Parameters:
srcVertex- the source ID of the new edgedstVertex- the destination ID of the new edge- Returns:
- an edge builder instance
-
addEdge
public EdgeBuilder<VID> addEdge(long edgeId, VertexBuilder<VID> srcVertex, VertexBuilder<VID> dstVertex) Description copied from interface:GraphBuilderAdds an edge with the given edge ID and the given source and destination vertices. If the edge doesn't exist it is added, if it exists a builder for that edge is returned Throws anUnsupportedOperationExceptionif edge Id generation strategy is set toIdGenerationStrategy.AUTO_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:
-
addEdge
public EdgeBuilder<VID> addEdge(String edgeId, VertexBuilder<VID> srcVertex, VertexBuilder<VID> dstVertex) Description copied from interface:GraphBuilderAdds an edge with the given edge ID and the given source and destination vertices. If the edge doesn't exist it is added, if it exists a builder for that edge is returned Throws anUnsupportedOperationExceptionif edge Id generation strategy is set toIdGenerationStrategy.AUTO_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:
-
addEdge
Description copied from interface:GraphBuilderAdds an edge with an implicit ID and the given source and destination vertices. Throws anUnsupportedOperationExceptionif edge Id generation strategy is set toIdGenerationStrategy.USER_IDS- Specified by:
addEdgein interfaceGraphBuilder<VID>- Parameters:
srcVertex- aVertexBuilderImplinstance representing the source vertexdstVertex- aVertexBuilderImplinstance representing the destination vertex- Returns:
- an edge builder instance
- See Also:
-
buildAsync
Description copied from interface:GraphBuilderBuilds a new graph out of the changes in this graph builder- Specified by:
buildAsyncin interfaceGraphBuilder<VID>- Parameters:
newGraphName- the new name of the graph. Ifnulla name is generated- Returns:
- a new graph
-
buildAsync
Description copied from interface:GraphBuilderShortcut forGraphBuilder.buildAsync(String)without a name- Specified by:
buildAsyncin interfaceGraphBuilder<VID>- Returns:
- a new graph
-
setConfigParameter
Description copied from interface:GraphBuilderSet the given configuration parameter to the given value- Specified by:
setConfigParameterin interfaceGraphBuilder<VID>- Parameters:
parameter- the config parameter to setvalue- the new value for the config parameter
-
getConfigParameter
Description copied from interface:GraphBuilderRetrieve the value for the given config parameter- Specified by:
getConfigParameterin interfaceGraphBuilder<VID>- Parameters:
parameter- the config parameter to get the value for- Returns:
- the value for the given config parameter
-
setRetainEdgeIds
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
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
-
setVertexIdGenerationStrategy
public GraphBuilder<VID> setVertexIdGenerationStrategy(IdGenerationStrategy vertexIdGenerationStrategy) Description copied from interface:GraphBuilderDefines the ID generation strategy the GraphBuilder should use for vertices. IfIdGenerationStrategy.AUTO_GENERATEDvertices IDs are internally generated, ifIdGenerationStrategy.USER_IDSvertices IDs are explicitly defined by the user- Specified by:
setVertexIdGenerationStrategyin interfaceGraphBuilder<VID>- Parameters:
vertexIdGenerationStrategy- Id generation strategy- Returns:
- this graph builder
-
setEdgeIdGenerationStrategy
Description copied from interface:GraphBuilderDefines the ID generation strategy the GraphBuilder should use for edges. IfIdGenerationStrategy.AUTO_GENERATEDedges IDs are internally generated, ifIdGenerationStrategy.USER_IDSedges IDs are explicitly defined by the user- Specified by:
setEdgeIdGenerationStrategyin interfaceGraphBuilder<VID>- Parameters:
edgeIdGenerationStrategy- Id generation strategy- Returns:
- this graph builder
-
build
Description copied from interface:GraphBuilderBlocking version ofGraphBuilder.buildAsync(String). CallsGraphBuilder.buildAsync(String)and waits for the returnedPgxFutureto complete.- Specified by:
buildin interfaceGraphBuilder<VID>- Throws:
ExecutionException- if any exception occurred during asynchronous execution. The actual exception will be nested.InterruptedException- if the caller thread gets interrupted while waiting for completion.
-
build
Description copied from interface:GraphBuilderBlocking version ofGraphBuilder.buildAsync(). CallsGraphBuilder.buildAsync()and waits for the returnedPgxFutureto complete.- Specified by:
buildin interfaceGraphBuilder<VID>- Throws:
ExecutionException- if any exception occurred during asynchronous execution. The actual exception will be nested.InterruptedException- if the caller thread gets interrupted while waiting for completion.
-
partitionedVertexIds
Description copied from interface:GraphBuilderSpecifies if the final graph should useIdStrategy.PARTITIONED_IDSfor vertices. Partitioned Ids can be used only in the context of building a partitioned graph, and only if the original Ids are retained, that is, only if the client is configured to build partitioned graphs andGraphBuilder.setRetainVertexIds(boolean)both are set to true- Specified by:
partitionedVertexIdsin interfaceGraphBuilder<VID>- Parameters:
partitionedIds- whether or not to useIdStrategy.PARTITIONED_IDSfor vertices in the final graph- Returns:
- this graph builder
-
partitionedEdgeIds
Description copied from interface:GraphBuilderSpecifies if the final graph should useIdStrategy.PARTITIONED_IDSfor edges. Partitioned Ids can be used only in the context of building a partitioned graph, and only if the original Ids are retained, that is, only if the client is configured to build partitioned graphs andGraphBuilder.setRetainEdgeIds(boolean)both are set to true- Specified by:
partitionedEdgeIdsin interfaceGraphBuilder<VID>- Parameters:
partitionedIds- whether or not to useIdStrategy.PARTITIONED_IDSfor edges in the final graph- Returns:
- this graph builder
-
isGraphBuilderConfigFinalized
public boolean isGraphBuilderConfigFinalized() -
getSession
Gets the session.- Returns:
- the session this graph builder belongs to
-
toString
-