public class PgxSession extends PgxManagedObject
ServerInstance
. Every session gets a workspace assigned on the server, which can be used to read graph data, create transient data or custom algorithms for the sake of graph analysis. Once a session gets destroyed, all data in the session workspace gets freed.Modifier and Type | Method and Description |
---|---|
PgxFuture<oracle.pgx.api.CompiledProgram> |
compileProgramCodeAsync(java.lang.String code)
Compiles a Green-Marl program for parallel execution with all optimizations enabled.
|
PgxFuture<oracle.pgx.api.CompiledProgram> |
compileProgramCodeAsync(java.lang.String code, boolean overwrite)
Compiles a Green-Marl program for parallel execution with all optimizations enabled.
|
PgxFuture<oracle.pgx.api.CompiledProgram> |
compileProgramCodeAsync(java.lang.String code, boolean overwrite, boolean parallel, java.util.List<oracle.pgx.api.GmCompilerOptimization> disabledOptimizations, boolean verbose)
Compiles a Green-Marl program.
|
Analyst |
createAnalyst()
Creates a new analyst.
|
PgxFuture<GraphConfig> |
describeGraphAsync(oracle.pgx.loaders.location.GraphLocation location)
Describes the graph contained in a given graph location
|
GraphConfig |
describeGraphFile(java.lang.String path)
Blocking version of
describeGraphFileAsync(String) . |
GraphConfig |
describeGraphFile(java.lang.String path, Format format)
Blocking version of
describeGraphFileAsync(String, Format) . |
PgxFuture<GraphConfig> |
describeGraphFileAsync(java.lang.String path)
Describes the graph contained in the file at the given path.
|
PgxFuture<GraphConfig> |
describeGraphFileAsync(java.lang.String path, Format format)
Describes the graph contained in the file at the given path.
|
GraphConfig |
describeGraphFiles(java.util.List<java.lang.String> filePaths)
Blocking version of
describeGraphFilesAsync(List) . |
GraphConfig |
describeGraphFiles(java.util.List<java.lang.String> filePaths, Format format)
Blocking version of
describeGraphFilesAsync(List, Format) . |
java.util.Set<java.lang.String> |
getAvailableCompiledProgramIds()
Blocking version of
getAvailableCompiledProgramIdsAsync() . |
PgxFuture<java.util.Set<java.lang.String>> |
getAvailableCompiledProgramIdsAsync()
Gets the set of available compiled program IDs.
|
java.util.Deque<GraphMetaData> |
getAvailableSnapshots(GraphConfig config)
Blocking version of
getAvailableSnapshotsAsync(GraphConfig) . |
java.util.Deque<GraphMetaData> |
getAvailableSnapshots(PgxGraph snapshot)
Blocking version of
getAvailableSnapshotsAsync(PgxGraph) . |
PgxFuture<java.util.Deque<GraphMetaData>> |
getAvailableSnapshotsAsync(GraphConfig config)
Gets a list of available in-memory snapshots of a graph described by a graph configuration.
|
PgxFuture<java.util.Deque<GraphMetaData>> |
getAvailableSnapshotsAsync(PgxGraph snapshot)
Gets a list of available in-memory snapshots of a given snapshot.
|
oracle.pgx.api.CompiledProgram |
getCompiledProgram(java.lang.String id)
Blocking version of
getCompiledProgramAsync(String) . |
PgxFuture<oracle.pgx.api.CompiledProgram> |
getCompiledProgramAsync(java.lang.String id)
Gets a compiled program by ID.
|
ExecutionEnvironment |
getExecutionEnvironment()
Gets the execution environment for this session.
|
java.lang.String |
getId()
Gets the session ID.
|
java.lang.Long |
getIdleTimeout()
Gets the idle timeout of this session.
|
java.lang.String |
getName()
Alias for
getId() |
PatternMatchingSemantic |
getPatternMatchingSemantic() |
PgqlResultSet |
getPgqlResultSet(java.lang.String id)
Blocking version of
getPgqlResultSetAsync(String) . |
PgxFuture<PgqlResultSet> |
getPgqlResultSetAsync(java.lang.String id)
Gets a PGQL result set by ID.
|
ServerInstance |
getServerInstance()
Gets the server instance.
|
java.lang.String |
getSource()
Gets the source.
|
java.lang.Long |
getTaskTimeout()
Gets the task timeout of this session.
|
GraphBuilder<java.lang.Integer> |
newGraphBuilder()
Creates a graph builder with integer vertex IDs
|
<ID extends java.lang.Comparable<ID>> |
newGraphBuilder(IdType idType)
Creates a graph builder with the given vertex ID type
|
PgxGraph |
readGraphAsOf(GraphConfig config, GraphMetaData metaData)
Blocking version of
readGraphAsOfAsync(GraphConfig, GraphMetaData) . |
PgxGraph |
readGraphAsOf(GraphConfig config, GraphMetaData metaData, java.lang.String newGraphName)
Blocking version of
readGraphAsOfAsync(GraphConfig, GraphMetaData, String) . |
PgxGraph |
readGraphAsOf(GraphConfig config, long creationTimestamp)
Blocking version of
readGraphAsOfAsync(GraphConfig, long) . |
PgxGraph |
readGraphAsOf(GraphConfig config, long creationTimestamp, java.lang.String newGraphName)
Blocking version of
readGraphAsOfAsync(GraphConfig, long, String) . |
PgxFuture<PgxGraph> |
readGraphAsOfAsync(GraphConfig config, GraphMetaData metaData)
Reads a graph and its properties of a specific version (metaData) into memory.
|
PgxFuture<PgxGraph> |
readGraphAsOfAsync(GraphConfig config, GraphMetaData metaData, java.lang.String newGraphName)
Reads a graph and its properties of a specific version (metaData) into memory.
|
PgxFuture<PgxGraph> |
readGraphAsOfAsync(GraphConfig config, long creationTimestamp)
Reads a graph and its properties of a specific version (creationTimestamp) into memory.
|
PgxFuture<PgxGraph> |
readGraphAsOfAsync(GraphConfig config, long creationTimestamp, java.lang.String newGraphName)
Reads a graph and its properties of a specific version (creationTimestamp) into memory.
|
PgxGraph |
readGraphFile(java.lang.String path)
Blocking version of
readGraphFileAsync(String) . |
PgxGraph |
readGraphFile(java.lang.String path, Format format)
Blocking version of
readGraphFileAsync(String, Format) . |
PgxGraph |
readGraphFile(java.lang.String path, Format format, java.lang.String newGraphName)
Blocking version of
readGraphFileAsync(String, Format, String) . |
PgxGraph |
readGraphFile(java.lang.String path, java.lang.String newGraphName)
Blocking version of
readGraphFileAsync(String, String) . |
PgxFuture<PgxGraph> |
readGraphFileAsync(java.lang.String path)
Loads the graph contained in the file at the given path.
|
PgxFuture<PgxGraph> |
readGraphFileAsync(java.lang.String path, Format format)
Loads the graph contained in the file at the given path.
|
PgxFuture<PgxGraph> |
readGraphFileAsync(java.lang.String path, Format format, java.lang.String newGraphName)
Loads the graph contained in the files at the given path.
|
PgxFuture<PgxGraph> |
readGraphFileAsync(java.lang.String path, java.lang.String newGraphName)
Loads the graph contained in the file at the given path.
|
PgxFuture<PgxGraph> |
readGraphFilesAsync(java.util.List<java.lang.String> filePaths, Format format, java.lang.String newGraphName)
Loads the graph contained in the files at the given paths.
|
PgxGraph |
readGraphWithProperties(GraphConfig config)
Blocking version of
readGraphWithPropertiesAsync(GraphConfig) . |
PgxGraph |
readGraphWithProperties(GraphConfig config, boolean updateIfNotFresh)
Blocking version of
readGraphWithPropertiesAsync(GraphConfig, boolean) . |
PgxGraph |
readGraphWithProperties(GraphConfig config, boolean updateIfNotFresh, java.lang.String newGraphName)
Blocking version of
readGraphWithPropertiesAsync(GraphConfig, boolean, String) . |
PgxGraph |
readGraphWithProperties(GraphConfig config, long maxAge, java.util.concurrent.TimeUnit maxAgeTimeUnit)
Blocking version of
readGraphWithPropertiesAsync(GraphConfig, long, TimeUnit) . |
PgxGraph |
readGraphWithProperties(GraphConfig config, long maxAge, java.util.concurrent.TimeUnit maxAgeTimeUnit, boolean blockIfFull, java.lang.String newGraphName)
Blocking version of
readGraphWithPropertiesAsync(GraphConfig, long, TimeUnit, boolean, String) . |
PgxGraph |
readGraphWithProperties(GraphConfig config, java.lang.String newGraphName)
Blocking version of
readGraphWithPropertiesAsync(GraphConfig, String) . |
PgxGraph |
readGraphWithProperties(java.lang.String path)
Blocking version of
readGraphWithPropertiesAsync(String) . |
PgxGraph |
readGraphWithProperties(java.lang.String path, java.lang.String newGraphName)
Blocking version of
readGraphWithPropertiesAsync(String, String) . |
PgxFuture<PgxGraph> |
readGraphWithPropertiesAsync(GraphConfig config)
Reads a graph and its properties, specified a graph config, into memory.
|
PgxFuture<PgxGraph> |
readGraphWithPropertiesAsync(GraphConfig config, boolean updateIfNotFresh)
Reads a graph and its properties, specified a graph config, into memory.
|
PgxFuture<PgxGraph> |
readGraphWithPropertiesAsync(GraphConfig config, boolean updateIfNotFresh, java.lang.String newGraphName)
Reads a graph and its properties, specified a graph config, into memory.
|
PgxFuture<PgxGraph> |
readGraphWithPropertiesAsync(GraphConfig config, long maxAge, java.util.concurrent.TimeUnit maxAgeTimeUnit)
Reads a graph and its properties, specified a graph config, into memory.
|
PgxFuture<PgxGraph> |
readGraphWithPropertiesAsync(GraphConfig config, long maxAge, java.util.concurrent.TimeUnit maxAgeTimeUnit, boolean blockIfFull, java.lang.String newGraphName)
Reads a graph and its properties, specified a graph config, into memory.
|
PgxFuture<PgxGraph> |
readGraphWithPropertiesAsync(GraphConfig config, java.lang.String newGraphName)
Reads a graph and its properties, specified a graph config, into memory.
|
PgxFuture<PgxGraph> |
readGraphWithPropertiesAsync(java.lang.String path)
Reads a graph and its properties, specified by a path to a graph config, into memory.
|
PgxFuture<PgxGraph> |
readGraphWithPropertiesAsync(java.lang.String path, java.lang.String newGraphName)
Reads a graph and its properties, specified by a path to a graph config, into memory.
|
void |
setPatternMatchingSemantic(PatternMatchingSemantic patternMatchingSemantic)
Set the pattern matching semantic of the session.
|
void |
setSnapshot(PgxGraph graph, GraphMetaData metaData)
Blocking version of
setSnapshotAsync(PgxGraph, GraphMetaData) . |
void |
setSnapshot(PgxGraph graph, GraphMetaData metaData, boolean forceDeleteProperties)
Blocking version of
setSnapshotAsync(PgxGraph, GraphMetaData, boolean) . |
void |
setSnapshot(PgxGraph graph, long creationTimestamp)
Blocking version of
setSnapshotAsync(PgxGraph, long) . |
void |
setSnapshot(PgxGraph graph, long creationTimestamp, boolean forceDeleteProperties)
Blocking version of
setSnapshotAsync(PgxGraph, long, boolean) . |
PgxFuture<java.lang.Void> |
setSnapshotAsync(PgxGraph graph, GraphMetaData metaData)
Sets a graph to a specific snapshot.
|
PgxFuture<java.lang.Void> |
setSnapshotAsync(PgxGraph graph, GraphMetaData metaData, boolean forceDeleteTransientProperties)
Sets a graph to a specific snapshot.
|
PgxFuture<java.lang.Void> |
setSnapshotAsync(PgxGraph graph, long creationTimestamp)
Sets a graph to a specific snapshot.
|
PgxFuture<java.lang.Void> |
setSnapshotAsync(PgxGraph graph, long creationTimestamp, boolean forceDeleteTransientProperties)
Sets a graph to a specific snapshot.
|
java.lang.String |
toString() |
equals, hashCode
close, destroy, destroyAsync
public PgxFuture<oracle.pgx.api.CompiledProgram> compileProgramCodeAsync(java.lang.String code)
code
- the Green-Marl code to compilepublic PgxFuture<oracle.pgx.api.CompiledProgram> compileProgramCodeAsync(java.lang.String code, boolean overwrite)
code
- the Green-Marl code to compileoverwrite
- if the procedure in the given code already exists, overwrite if true
, throw an exception otherwisepublic PgxFuture<oracle.pgx.api.CompiledProgram> compileProgramCodeAsync(java.lang.String code, boolean overwrite, boolean parallel, java.util.List<oracle.pgx.api.GmCompilerOptimization> disabledOptimizations, boolean verbose)
code
- the Green-Marl code to compileparallel
- if false
, the compiled program will be optimized for sequential executiondisabledOptimizations
- list of compiler optimizations to disableverbose
- if true
, the compiler will output compilation stagespublic Analyst createAnalyst()
Analyst
gives access to all built-in algorithms.public PgxFuture<GraphConfig> describeGraphAsync(oracle.pgx.loaders.location.GraphLocation location)
PGX will try to detect the graph configuration. If the configuration cannot be determined or if the graph format does not match the given format, the future is completed exceptionally.
location
- the graph locationpublic GraphConfig describeGraphFile(java.lang.String path) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
describeGraphFileAsync(String)
. Calls describeGraphFileAsync(String)
and waits for the returned PgxFuture
to complete.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.public GraphConfig describeGraphFile(java.lang.String path, Format format) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
describeGraphFileAsync(String, Format)
. Calls describeGraphFileAsync(String, Format)
and waits for the returned PgxFuture
to complete.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.public PgxFuture<GraphConfig> describeGraphFileAsync(java.lang.String path)
PGX will try to detect the file format and the graph configuration. If the format or the configuration cannot be determined, the future is completed exceptionally.
path
- graph file pathpublic PgxFuture<GraphConfig> describeGraphFileAsync(java.lang.String path, Format format)
PGX will try to detect the graph configuration. If the configuration cannot be determined or if the file format does not match the given format, the future is completed exceptionally.
path
- graph file pathformat
- file formatpublic GraphConfig describeGraphFiles(java.util.List<java.lang.String> filePaths) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
describeGraphFilesAsync(List)
. Calls describeGraphFilesAsync(List)
and waits for the returned PgxFuture
to complete.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.public GraphConfig describeGraphFiles(java.util.List<java.lang.String> filePaths, Format format) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
describeGraphFilesAsync(List, Format)
. Calls describeGraphFilesAsync(List, Format)
and waits for the returned PgxFuture
to complete.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.public java.util.Set<java.lang.String> getAvailableCompiledProgramIds() throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
getAvailableCompiledProgramIdsAsync()
. Calls getAvailableCompiledProgramIdsAsync()
and waits for returned PgxFuture
to complete.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.public PgxFuture<java.util.Set<java.lang.String>> getAvailableCompiledProgramIdsAsync()
public java.util.Deque<GraphMetaData> getAvailableSnapshots(GraphConfig config) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
getAvailableSnapshotsAsync(GraphConfig)
. Calls getAvailableSnapshotsAsync(GraphConfig)
and waits for returned PgxFuture
to complete.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.public java.util.Deque<GraphMetaData> getAvailableSnapshots(PgxGraph snapshot) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
getAvailableSnapshotsAsync(PgxGraph)
. Calls getAvailableSnapshotsAsync(PgxGraph)
and waits for returned PgxFuture
to complete.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.public PgxFuture<java.util.Deque<GraphMetaData>> getAvailableSnapshotsAsync(GraphConfig config)
PgxGraph.isTransient()
.GraphMetaData.getCreationTimestamp()
value (milliseconds since Jan 1st 1970) - the timestamp when the snapshot was created.public PgxFuture<java.util.Deque<GraphMetaData>> getAvailableSnapshotsAsync(PgxGraph snapshot)
PgxGraph.isTransient()
.GraphMetaData.getCreationTimestamp()
value (milliseconds since Jan 1st 1970) - the timestamp when the snapshot was created.public oracle.pgx.api.CompiledProgram getCompiledProgram(java.lang.String id) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
getCompiledProgramAsync(String)
. Calls getCompiledProgramAsync(String)
and waits for returned PgxFuture
to complete.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.public PgxFuture<oracle.pgx.api.CompiledProgram> getCompiledProgramAsync(java.lang.String id)
id
- the ID of the compiled programpublic ExecutionEnvironment getExecutionEnvironment()
ExecutionException
gives access to detailed scheduling configurationpublic java.lang.String getId()
public java.lang.Long getIdleTimeout()
null
indicates this session uses the default session idle timeout as specified by the PGX instance.null
.public java.lang.String getName()
getId()
getName
in class PgxManagedObject
public PatternMatchingSemantic getPatternMatchingSemantic()
public PgqlResultSet getPgqlResultSet(java.lang.String id) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
getPgqlResultSetAsync(String)
. Calls getPgqlResultSetAsync(String)
and waits for returned PgxFuture
to complete.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.public PgxFuture<PgqlResultSet> getPgqlResultSetAsync(java.lang.String id)
id
- the PGQL result set IDpublic ServerInstance getServerInstance()
public java.lang.String getSource()
public java.lang.Long getTaskTimeout()
null
indicates this session uses the default session task timeout as specified by the PGX instance.null
.public GraphBuilder<java.lang.Integer> newGraphBuilder()
newGraphBuilder(IdType)
public <ID extends java.lang.Comparable<ID>> GraphBuilder<ID> newGraphBuilder(IdType idType)
ID
- the type of the vertex IDidType
- the vertex ID typepublic PgxGraph readGraphAsOf(GraphConfig config, GraphMetaData metaData) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
readGraphAsOfAsync(GraphConfig, GraphMetaData)
. Calls readGraphAsOfAsync(GraphConfig, GraphMetaData)
and waits for the returned PgxFuture
to complete.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.public PgxGraph readGraphAsOf(GraphConfig config, GraphMetaData metaData, java.lang.String newGraphName) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
readGraphAsOfAsync(GraphConfig, GraphMetaData, String)
. Calls readGraphAsOfAsync(GraphConfig, GraphMetaData, String)
and waits for the returned PgxFuture
to complete.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.public PgxGraph readGraphAsOf(GraphConfig config, long creationTimestamp) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
readGraphAsOfAsync(GraphConfig, long)
. Calls readGraphAsOfAsync(GraphConfig, long)
and waits for the returned PgxFuture
to complete.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.public PgxGraph readGraphAsOf(GraphConfig config, long creationTimestamp, java.lang.String newGraphName) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
readGraphAsOfAsync(GraphConfig, long, String)
. Calls readGraphAsOfAsync(GraphConfig, long, String)
and waits for the returned PgxFuture
to complete.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.public PgxFuture<PgxGraph> readGraphAsOfAsync(GraphConfig config, GraphMetaData metaData)
config
- the graph configmetaData
- the metaData object returned by (GraphConfig)
identifying the version to be checked outgetAvailableSnapshotsAsync(GraphConfig)
, setSnapshotAsync(PgxGraph, GraphMetaData)
public PgxFuture<PgxGraph> readGraphAsOfAsync(GraphConfig config, GraphMetaData metaData, java.lang.String newGraphName)
config
- the graph configmetaData
- the metaData object returned by (GraphConfig)
identifying the version to be checked outnewGraphName
- how the graph should be named. If null
, a name will be generated. If a graph with that name already exists, the returned future will complete exceptionally.getAvailableSnapshotsAsync(GraphConfig)
, setSnapshotAsync(PgxGraph, GraphMetaData)
public PgxFuture<PgxGraph> readGraphAsOfAsync(GraphConfig config, long creationTimestamp)
getAvailableSnapshotsAsync(GraphConfig)
config
- the graph configcreationTimestamp
- the creation timestamp (milliseconds since jan 1st 1970) identifying the version to be checked outgetAvailableSnapshotsAsync(GraphConfig)
, setSnapshotAsync(PgxGraph, long)
public PgxFuture<PgxGraph> readGraphAsOfAsync(GraphConfig config, long creationTimestamp, java.lang.String newGraphName)
getAvailableSnapshotsAsync(GraphConfig)
config
- the graph configcreationTimestamp
- the creation timestamp (milliseconds since jan 1st 1970) identifying the version to be checked outnewGraphName
- how the graph should be named. If null
, a name will be generated. If a graph with that name already exists, the returned future will complete exceptionally.getAvailableSnapshotsAsync(GraphConfig)
, setSnapshotAsync(PgxGraph, long)
public PgxGraph readGraphFile(java.lang.String path) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
readGraphFileAsync(String)
. Calls readGraphFileAsync(String)
and waits for the returned PgxFuture
to complete.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.public PgxGraph readGraphFile(java.lang.String path, Format format) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
readGraphFileAsync(String, Format)
. Calls readGraphFileAsync(String, Format)
and waits for the returned PgxFuture
to complete.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.public PgxGraph readGraphFile(java.lang.String path, Format format, java.lang.String newGraphName) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
readGraphFileAsync(String, Format, String)
. Calls readGraphFileAsync(String, Format, String)
and waits for the returned PgxFuture
to complete.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.public PgxGraph readGraphFile(java.lang.String path, java.lang.String newGraphName) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
readGraphFileAsync(String, String)
. Calls readGraphFileAsync(String, String)
and waits for the returned PgxFuture
to complete.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.public PgxFuture<PgxGraph> readGraphFileAsync(java.lang.String path)
PGX will try to detect the file format and the graph configuration. If the format or the configuration cannot be determined, the future is completed exceptionally.
path
- graph file pathdescribeGraphFileAsync(String)
public PgxFuture<PgxGraph> readGraphFileAsync(java.lang.String path, Format format)
PGX will try to detect the graph configuration. If the configuration cannot be determined or if the file format does not match the given format, the future is completed exceptionally.
path
- graph file pathformat
- file formatdescribeGraphFileAsync(String, Format)
public PgxFuture<PgxGraph> readGraphFileAsync(java.lang.String path, Format format, java.lang.String newGraphName)
PGX will try to detect the graph configuration. If the configuration cannot be determined or if the file format does not match the given format, the future is completed exceptionally.
path
- graph file pathformat
- file formatnewGraphName
- how the graph should be named. If null
, a name will be generated. If a graph with that name already exists, the returned future will complete exceptionally.describeGraphFilesAsync(String, String, Format)
public PgxFuture<PgxGraph> readGraphFileAsync(java.lang.String path, java.lang.String newGraphName)
PGX will try to detect the file format and the graph configuration. If the format or the configuration cannot be determined, the future is completed exceptionally.
path
- graph file pathnewGraphName
- how the graph should be named. If null
, a name will be generated. If a graph with that name already exists, the returned future will complete exceptionally.describeGraphFileAsync(String)
public PgxFuture<PgxGraph> readGraphFilesAsync(java.util.List<java.lang.String> filePaths, Format format, java.lang.String newGraphName)
PGX will try to detect the graph configuration. If the configuration cannot be determined or if the file format does not match the given format, the future is completed exceptionally.
filePaths
- paths to the graph filesformat
- file formatnewGraphName
- how the graph should be named. If null
, a name will be generated. If a graph with that name already exists, the returned future will complete exceptionally.describeGraphFilesAsync(List, Format)
public PgxGraph readGraphWithProperties(GraphConfig config) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
readGraphWithPropertiesAsync(GraphConfig)
. Calls readGraphWithPropertiesAsync(GraphConfig)
and waits for returned PgxFuture
to complete.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.public PgxGraph readGraphWithProperties(GraphConfig config, boolean updateIfNotFresh) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
readGraphWithPropertiesAsync(GraphConfig, boolean)
. Calls readGraphWithPropertiesAsync(GraphConfig, boolean)
and waits for returned PgxFuture
to complete.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.public PgxGraph readGraphWithProperties(GraphConfig config, boolean updateIfNotFresh, java.lang.String newGraphName) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
readGraphWithPropertiesAsync(GraphConfig, boolean, String)
. Calls readGraphWithPropertiesAsync(GraphConfig, boolean, String)
and waits for returned PgxFuture
to complete.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.public PgxGraph readGraphWithProperties(GraphConfig config, long maxAge, java.util.concurrent.TimeUnit maxAgeTimeUnit) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
readGraphWithPropertiesAsync(GraphConfig, long, TimeUnit)
. Calls readGraphWithPropertiesAsync(GraphConfig, long, TimeUnit)
and waits for returned PgxFuture
to complete.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.public PgxGraph readGraphWithProperties(GraphConfig config, long maxAge, java.util.concurrent.TimeUnit maxAgeTimeUnit, boolean blockIfFull, java.lang.String newGraphName) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
readGraphWithPropertiesAsync(GraphConfig, long, TimeUnit, boolean, String)
. Calls readGraphWithPropertiesAsync(GraphConfig, long, TimeUnit, boolean, String)
and waits for returned PgxFuture
to complete.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.public PgxGraph readGraphWithProperties(GraphConfig config, java.lang.String newGraphName) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
readGraphWithPropertiesAsync(GraphConfig, String)
. Calls readGraphWithPropertiesAsync(GraphConfig, String)
and waits for returned PgxFuture
to complete.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.public PgxGraph readGraphWithProperties(java.lang.String path) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
readGraphWithPropertiesAsync(String)
. Calls readGraphWithPropertiesAsync(String)
and waits for returned PgxFuture
to complete.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.public PgxGraph readGraphWithProperties(java.lang.String path, java.lang.String newGraphName) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
readGraphWithPropertiesAsync(String, String)
. Calls readGraphWithPropertiesAsync(String, String)
and waits for returned PgxFuture
to complete.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.public PgxFuture<PgxGraph> readGraphWithPropertiesAsync(GraphConfig config)
config
- the graph configpublic PgxFuture<PgxGraph> readGraphWithPropertiesAsync(GraphConfig config, boolean updateIfNotFresh)
config
- the graph configupdateIfNotFresh
- if another snapshot of the given graph already exists and this flag is true
, a new snapshot will be loaded into memory in case that existing snapshot is not fresh (according to PgxGraph.isFresh()
). If no other snapshot of that graph exists, this flag has no effect.public PgxFuture<PgxGraph> readGraphWithPropertiesAsync(GraphConfig config, boolean updateIfNotFresh, java.lang.String newGraphName)
config
- the graph configupdateIfNotFresh
- if another snapshot of the given graph already exists and this flag is true
, a new snapshot will be loaded into memory in case that existing snapshot is not fresh (according to PgxGraph.isFresh()
). If no other snapshot of that graph exists, this flag has no effect.newGraphName
- how the graph should be named. If null
, a name will be generated. If a graph with that name already exists, the returned future will complete exceptionally.public PgxFuture<PgxGraph> readGraphWithPropertiesAsync(GraphConfig config, long maxAge, java.util.concurrent.TimeUnit maxAgeTimeUnit)
config
- the graph configmaxAge
- if another snapshot of the given graph already exists, the age of the latest existing snapshot will be compared to the given maxAge. If the latest snapshot is in the given range, it will be returned, otherwise a new snapshot will be created.maxAgeTimeUnit
- the time unit of the maxAge parameterpublic PgxFuture<PgxGraph> readGraphWithPropertiesAsync(GraphConfig config, long maxAge, java.util.concurrent.TimeUnit maxAgeTimeUnit, boolean blockIfFull, java.lang.String newGraphName)
config
- the graph configmaxAge
- if another snapshot of the given graph already exists, the age of the latest existing snapshot will be compared to the given maxAge. If the latest snapshot is in the given range, it will be returned, otherwise a new snapshot will be created.maxAgeTimeUnit
- the time unit of the maxAge parameterblockIfFull
- if true
and a new snapshot needs to be created but no more snapshots are allowed by the server configuration, the returned future will not complete until space becomes available. If full and this flage is false
, the returned future will complete exceptionally instead.newGraphName
- how the graph should be named. If null
, a name will be generated. If a graph with that name already exists, the returned future will complete exceptionally.public PgxFuture<PgxGraph> readGraphWithPropertiesAsync(GraphConfig config, java.lang.String newGraphName)
config
- the graph confignewGraphName
- how the graph should be named. If null
, a name will be generated. If a graph with that name already exists, the returned future will complete exceptionally.public PgxFuture<PgxGraph> readGraphWithPropertiesAsync(java.lang.String path)
path
- a path to a graph config, e.g. 'hdfs:/path/to/config.json' or 'http://myserver.com/my-config.json'public PgxFuture<PgxGraph> readGraphWithPropertiesAsync(java.lang.String path, java.lang.String newGraphName)
path
- a path to a graph config, e.g. 'hdfs:/path/to/config.json' or 'http://myserver.com/my-config.json'newGraphName
- how the graph should be named. If null
, a name will be generated. If a graph with that name already exists, the returned future will complete exceptionally.public void setPatternMatchingSemantic(PatternMatchingSemantic patternMatchingSemantic)
patternMatchingSemantic
- pattern matching semantic. If null is passed, the session respects the pattern matching semantic of the engine.public void setSnapshot(PgxGraph graph, GraphMetaData metaData) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
setSnapshotAsync(PgxGraph, GraphMetaData)
. Calls setSnapshotAsync(PgxGraph, GraphMetaData)
and waits for returned PgxFuture
to complete.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.public void setSnapshot(PgxGraph graph, GraphMetaData metaData, boolean forceDeleteProperties) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
setSnapshotAsync(PgxGraph, GraphMetaData, boolean)
. Calls setSnapshotAsync(PgxGraph, GraphMetaData, boolean)
and waits for returned PgxFuture
to complete.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.public void setSnapshot(PgxGraph graph, long creationTimestamp) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
setSnapshotAsync(PgxGraph, long)
. Calls setSnapshotAsync(PgxGraph, long)
and waits for returned PgxFuture
to complete.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.public void setSnapshot(PgxGraph graph, long creationTimestamp, boolean forceDeleteProperties) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
setSnapshotAsync(PgxGraph, long, boolean)
. Calls setSnapshotAsync(PgxGraph, long, boolean)
and waits for returned PgxFuture
to complete.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.public PgxFuture<java.lang.Void> setSnapshotAsync(PgxGraph graph, GraphMetaData metaData)
graph
- the graph to be checked out to a different version. Note that transient properties cannot be checked out to a different graph version. If the given graph contains any transient properties, the returned future will complete exceptionally with an UnsupportedOperationException
set as cause. You can use setSnapshotAsync(PgxGraph, long, boolean)
to force a checkout on a graph with transient properties.metaData
- the metaData object returned by getAvailableSnapshotsAsync(GraphConfig)
identifying the version to be checked outpublic PgxFuture<java.lang.Void> setSnapshotAsync(PgxGraph graph, GraphMetaData metaData, boolean forceDeleteTransientProperties)
graph
- the graph to be checked out to a different snapshot versionmetaData
- the metaData object returned by (GraphConfig)
identifying the version to be checked outforceDeleteTransientProperties
- Graphs with transient properties cannot be checked out to a different version. If this flag is set to true
, the checked out graph will no longer contain any transient properties. If false
, the returned future will complete exceptionally with an UnsupportedOperationException
as its cause.public PgxFuture<java.lang.Void> setSnapshotAsync(PgxGraph graph, long creationTimestamp)
graph
- the graph to be checked out to a different version. Note that transient properties cannot be checked out to a different graph version. If the given graph contains any transient properties, the returned future will complete exceptionally with an UnsupportedOperationException
set as cause. You can use setSnapshotAsync(PgxGraph, long, boolean)
to force a checkout on a graph with transient properties.creationTimestamp
- the creation timestamp (milliseconds since Jan 1st 1970) identifying the version to be checked outpublic PgxFuture<java.lang.Void> setSnapshotAsync(PgxGraph graph, long creationTimestamp, boolean forceDeleteTransientProperties)
graph
- the graph to be checked out to a different snapshot versioncreationTimestamp
- the creation timestamp (milliseconds since Jan 1st 1970) identifying the version to be checked outforceDeleteTransientProperties
- Graphs with transient properties cannot be checked out to a different version. If this flag is set to true
, the checked out graph will no longer contain any transient properties. If false
, the returned future will complete exceptionally with an UnsupportedOperationException
as its cause.public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2017 Oracle Corp. All Rights Reserved.