Class PgxSession

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class PgxSession
    extends PgxManagedObject
    A PGX session represents an active user connected to a 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.
    • Method Detail

      • getId

        public java.lang.String getId()
        Gets the session ID.
        Returns:
        the Session ID
      • getSessionContext

        public SessionContext getSessionContext()
        Gets the context describing the session
        Returns:
        the session context
      • getSource

        public java.lang.String getSource()
        Gets the source.
        Returns:
        the source
      • getIdleTimeout

        public java.lang.Long getIdleTimeout()
        Gets the idle timeout of this session. A value of null indicates this session uses the default session idle timeout as specified by the PGX instance.
        Returns:
        the idle timeout in seconds. May be null.
      • getTaskTimeout

        public java.lang.Long getTaskTimeout()
        Gets the task timeout of this session. A value of null indicates this session uses the default session task timeout as specified by the PGX instance.
        Returns:
        the task timeout in seconds. May be null.
      • getServerInstance

        public ServerInstance getServerInstance()
        Gets the server instance.
        Returns:
        the server instance.
      • registerKeystore

        public void registerKeystore​(java.lang.String keystorePath,
                                     char[] keystorePassword)
        Register the keystore to read needed secrets.
        Parameters:
        keystorePath - the path to the keystore to register.
        keystorePassword - the path to the keystore to register.
      • createAnalyst

        public Analyst createAnalyst()
        Creates a new analyst. The Analyst gives access to all built-in algorithms.
        Returns:
        the analyst
      • getExecutionEnvironment

        public ExecutionEnvironment getExecutionEnvironment()
        Gets the execution environment for this session. The ExecutionEnvironment gives access to detailed scheduling configuration
        Returns:
        the execution environment
      • createFrameBuilder

        public PgxFrameBuilder createFrameBuilder​(java.util.List<ColumnDescriptor> schema)
                                           throws java.util.concurrent.ExecutionException,
                                                  java.lang.InterruptedException
        Creates a new frame builder with which it is possible to parameterize the building of the row frame
        Parameters:
        schema - the schema of the frame to be built
        Returns:
        a frame builder object with which it is possible to parameterize the building
        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:
        21.3
      • createFrame

        public PgxFrame createFrame​(java.util.List<ColumnDescriptor> schema,
                                    java.util.Map<java.lang.String,​java.lang.Iterable<?>> columnData,
                                    java.lang.String frameName)
                             throws java.util.concurrent.ExecutionException,
                                    java.lang.InterruptedException
        Blocking version of createFrameAsync(List, Map, String). Calls createFrameAsync(List, Map, String) and waits for the returned PgxFuture to complete.
        Parameters:
        schema - the schema of the frame to build
        columnData - the data of the frame to build
        frameName - the name of the frame to build
        Returns:
        the frame built
        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:
        21.3
      • createFrameAsync

        public PgxFuture<PgxFrame> createFrameAsync​(java.util.List<ColumnDescriptor> schema,
                                                    java.util.Map<java.lang.String,​java.lang.Iterable<?>> columnData,
                                                    java.lang.String frameName)
                                             throws java.util.concurrent.ExecutionException,
                                                    java.lang.InterruptedException
        Creates a new frame from client-side data
        Parameters:
        schema - the schema of the frame to build
        columnData - the data of the frame to build
        frameName - the name of the frame to build
        Returns:
        the frame built
        Throws:
        java.util.concurrent.ExecutionException
        java.lang.InterruptedException
        Since:
        21.3
      • readFrame

        public PgxGenericFrameReader readFrame()
        Creates a new frame reader with which it is possible to parameterize the loading of the row frame
        Returns:
        a frame reader object with which it is possible to parameterize the loading
        Since:
        3.2.0
      • createGraphFromFrames

        public PgxGraphFromFramesCreator createGraphFromFrames​(java.lang.String graphName)
        Creates a graph from frames creator with which it is possible to specify the different vertex and edge tables of a graph from frames.
        Parameters:
        graphName - the name of the graph to create
        Returns:
        a graph from frames creator object
        Since:
        3.2.0
      • createGraphFromFramesAsync

        public PgxFuture<PgxGraph> createGraphFromFramesAsync​(java.lang.String graphName,
                                                              PgxFrame vertexFrame,
                                                              PgxFrame edgeFrame)
        Creates an homogeneous graph from the specified frames that represent the vertices and edges of the graph.
        Parameters:
        graphName - the name of the graph to create
        vertexFrame - the frame that contains the vertices of the graph
        edgeFrame - the frame that contains the edges of the graph
        Returns:
        the newly created graph
      • createGraphFromFrames

        public PgxGraph createGraphFromFrames​(java.lang.String graphName,
                                              PgxFrame vertexFrame,
                                              PgxFrame edgeFrame)
                                       throws java.lang.InterruptedException,
                                              java.util.concurrent.ExecutionException
        Creates an homogeneous graph from the specified frames that represent the vertices and edges of the graph.
        Parameters:
        graphName - the name of the graph to create
        vertexFrame - the frame that contains the vertices of the graph
        edgeFrame - the frame that contains the edges of the graph
        Returns:
        the newly created graph
        Throws:
        java.lang.InterruptedException
        java.util.concurrent.ExecutionException
      • createGraphBuilder

        public GraphBuilder<java.lang.Integer> createGraphBuilder​(IdGenerationStrategy vertexIdGenerationStrategy,
                                                                  IdGenerationStrategy edgeIdGenerationStrategy)
        Creates a graph builder with integer vertex IDs and Ids Mode
        Parameters:
        vertexIdGenerationStrategy - the vertices Id generation strategy to be used
        edgeIdGenerationStrategy - the edges Id generation strategy to be used
        Returns:
        an empty graph builder instance
        Since:
        3.1.0
        See Also:
        createGraphBuilder(IdType)
      • createGraphBuilder

        public <ID extends java.lang.Comparable<ID>> GraphBuilder<ID> createGraphBuilder​(IdType idType,
                                                                                         IdGenerationStrategy vertexIdGenerationStrategy,
                                                                                         IdGenerationStrategy edgeIdGenerationStrategy)
        Creates a graph builder with the given vertex ID type and Ids Mode
        Type Parameters:
        ID - the type of the vertex ID
        Parameters:
        idType - the vertex ID type
        vertexIdGenerationStrategy - the vertices Id generation strategy to be used
        edgeIdGenerationStrategy - the edges Id generation strategy to be used
        Returns:
        an empty graph builder instance
        Since:
        3.1.0
      • createGraphBuilder

        public <ID extends java.lang.Comparable<ID>> GraphBuilder<ID> createGraphBuilder​(IdType idType)
        Creates a graph builder with the given vertex ID type using IdGenerationStrategy.AUTO_GENERATED for edge ID generation strategy
        Type Parameters:
        ID - the type of the vertex ID
        Parameters:
        idType - the vertex ID type
        Returns:
        an empty graph builder instance
      • destroyAsync

        public PgxFuture<java.lang.Void> destroyAsync()
        Destroys the active session.
        Specified by:
        destroyAsync in class Destroyable
        Returns:
        a future which will be completed once the destruction request finishes.
      • describeGraphFileAsync

        public PgxFuture<GraphConfig> describeGraphFileAsync​(java.lang.String path)
        Describes the graph contained in the file at the given 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.

        Parameters:
        path - graph file path
        Returns:
        configuration which can be used to load the graph
      • describeGraphFileAsync

        public PgxFuture<GraphConfig> describeGraphFileAsync​(java.lang.String path,
                                                             @Nullable
                                                             Format format)
        Describes the graph contained in the file at the given path.

        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.

        Parameters:
        path - graph file path
        format - file format
        Returns:
        configuration which can be used to load the graph
      • describeGraphFilesAsync

        public PgxFuture<GraphConfig> describeGraphFilesAsync​(java.util.List<java.lang.String> filePaths)
        Describes the graph contained in the files at the given paths.

        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.

        Parameters:
        filePaths - paths to the files
        Returns:
        configuration which can be used to load the graph
      • describeGraphFilesAsync

        public PgxFuture<GraphConfig> describeGraphFilesAsync​(java.util.List<java.lang.String> filePaths,
                                                              @Nullable
                                                              Format format)
        Describes the graph contained in the files at the given paths.

        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.

        Parameters:
        filePaths - paths to the files
        Returns:
        configuration which can be used to load the graph
      • describeGraphFilesAsync

        public PgxFuture<GraphConfig> describeGraphFilesAsync​(java.lang.String vertexFilePath,
                                                              java.lang.String edgeFilePath)
        Describes the graph contained in the files at the given paths.

        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.

        Parameters:
        vertexFilePath - path to the vertex file
        edgeFilePath - path to the edge file
        Returns:
        configuration which can be used to load the graph
      • describeGraphFilesAsync

        public PgxFuture<GraphConfig> describeGraphFilesAsync​(java.lang.String vertexFilePath,
                                                              java.lang.String edgeFilePath,
                                                              @Nullable
                                                              Format format)
        Describes the graph contained in the files at the given paths.

        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.

        Parameters:
        vertexFilePath - path to the vertex file
        edgeFilePath - path to the edge file
        format - file format
        Returns:
        configuration which can be used to load the graph
      • describeGraphFilesAsync

        public PgxFuture<GraphConfig> describeGraphFilesAsync​(java.util.List<java.lang.String> vertexFilePaths,
                                                              java.util.List<java.lang.String> edgeFilePaths)
        Describes the graph contained in the files at the given paths.

        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.

        Parameters:
        vertexFilePaths - paths to the vertex files
        edgeFilePaths - paths to the edge files
        Returns:
        configuration which can be used to load the graph
      • describeGraphFilesAsync

        public PgxFuture<GraphConfig> describeGraphFilesAsync​(java.util.List<java.lang.String> vertexFilePaths,
                                                              java.util.List<java.lang.String> edgeFilePaths,
                                                              @Nullable
                                                              Format format)
        Describes the graph contained in the files at the given paths.

        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.

        Parameters:
        vertexFilePaths - paths to the vertex files
        edgeFilePaths - paths to the edge files
        format - file format
        Returns:
        configuration which can be used to load the graph
      • describeGraphAsync

        public PgxFuture<GraphConfig> describeGraphAsync​(oracle.pgx.loaders.location.GraphLocation location)
        Describes the graph contained in a given graph 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.

        Parameters:
        location - the graph location
        Returns:
        configuration which can be used to load the graph
      • readGraphFileAsync

        public PgxFuture<PgxGraph> readGraphFileAsync​(java.lang.String path)
        Loads the graph contained in the file at the given 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.

        Parameters:
        path - graph file path
        Returns:
        graph at the given location
        See Also:
        describeGraphFileAsync(String)
      • readGraphFileAsync

        public PgxFuture<PgxGraph> readGraphFileAsync​(java.lang.String path,
                                                      @Nullable
                                                      Format format)
        Loads the graph contained in the file at the given path.

        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.

        Parameters:
        path - graph file path
        format - file format
        Returns:
        graph at the given location
        See Also:
        describeGraphFileAsync(String, Format)
      • readGraphFileAsync

        public PgxFuture<PgxGraph> readGraphFileAsync​(java.lang.String path,
                                                      @Nullable
                                                      java.lang.String newGraphName)
        Loads the graph contained in the file at the given 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.

        Parameters:
        path - graph file path
        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.
        Returns:
        graph at the given location
        See Also:
        describeGraphFileAsync(String)
      • readGraphFileAsync

        public PgxFuture<PgxGraph> readGraphFileAsync​(java.lang.String path,
                                                      @Nullable
                                                      Format format,
                                                      @Nullable
                                                      java.lang.String newGraphName)
        Loads the graph contained in the files at the given path.

        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.

        Parameters:
        path - graph file path
        format - file format
        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.
        Returns:
        graph at the given location
        See Also:
        describeGraphFilesAsync(String, String, Format)
      • readGraphFilesAsync

        public PgxFuture<PgxGraph> readGraphFilesAsync​(java.util.List<java.lang.String> filePaths)
        Loads the graph contained in the files at the given paths.

        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.

        Parameters:
        filePaths - paths to the files
        Returns:
        graph at the given location
        See Also:
        describeGraphFilesAsync(List)
      • readGraphFilesAsync

        public PgxFuture<PgxGraph> readGraphFilesAsync​(java.util.List<java.lang.String> filePaths,
                                                       @Nullable
                                                       Format format)
        Loads the graph contained in the files at the given paths.

        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.

        Parameters:
        filePaths - paths to the vertex files
        format - file format
        Returns:
        graph at the given location
        See Also:
        describeGraphFilesAsync(List, Format)
      • readGraphFilesAsync

        public PgxFuture<PgxGraph> readGraphFilesAsync​(java.util.List<java.lang.String> filePaths,
                                                       @Nullable
                                                       java.lang.String newGraphName)
        Loads the graph contained in the files at the given paths.

        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.

        Parameters:
        filePaths - paths to the vertex files
        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.
        Returns:
        graph at the given location
        See Also:
        describeGraphFilesAsync(List)
      • readGraphFilesAsync

        public PgxFuture<PgxGraph> readGraphFilesAsync​(java.util.List<java.lang.String> filePaths,
                                                       @Nullable
                                                       Format format,
                                                       @Nullable
                                                       java.lang.String newGraphName)
        Loads the graph contained in the files at the given paths.

        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.

        Parameters:
        filePaths - paths to the graph files
        format - file format
        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.
        Returns:
        graph at the given location
        See Also:
        describeGraphFilesAsync(List, Format)
      • readGraphFilesAsync

        public PgxFuture<PgxGraph> readGraphFilesAsync​(java.lang.String vertexFilePath,
                                                       java.lang.String edgeFilePath)
        Loads the graph contained in the files at the given paths.

        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.

        Parameters:
        vertexFilePath - path to the vertex file
        edgeFilePath - path to the edge file
        Returns:
        graph at the given location
        See Also:
        describeGraphFilesAsync(String, String)
      • readGraphFilesAsync

        public PgxFuture<PgxGraph> readGraphFilesAsync​(java.lang.String vertexFilePath,
                                                       java.lang.String edgeFilePath,
                                                       @Nullable
                                                       Format format)
        Loads the graph contained in the files at the given paths.

        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.

        Parameters:
        vertexFilePath - path to the vertex file
        edgeFilePath - path to the edge file
        format - file format
        Returns:
        graph at the given location
        See Also:
        describeGraphFilesAsync(String, String, Format)
      • readGraphFilesAsync

        public PgxFuture<PgxGraph> readGraphFilesAsync​(java.lang.String vertexFilePath,
                                                       java.lang.String edgeFilePath,
                                                       @Nullable
                                                       java.lang.String newGraphName)
        Loads the graph contained in the files at the given paths.

        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.

        Parameters:
        vertexFilePath - path to the vertex file
        edgeFilePath - path to the edge file
        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.
        Returns:
        graph at the given location
        See Also:
        describeGraphFilesAsync(String, String)
      • readGraphFilesAsync

        public PgxFuture<PgxGraph> readGraphFilesAsync​(java.lang.String vertexFilePath,
                                                       java.lang.String edgeFilePath,
                                                       @Nullable
                                                       Format format,
                                                       @Nullable
                                                       java.lang.String newGraphName)
        Loads the graph contained in the files at the given paths.

        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.

        Parameters:
        vertexFilePath - path to the vertex file
        edgeFilePath - path to the edge file
        format - file format
        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.
        Returns:
        graph at the given location
        See Also:
        describeGraphFilesAsync(String, String, Format)
      • readGraphFilesAsync

        public PgxFuture<PgxGraph> readGraphFilesAsync​(java.util.List<java.lang.String> vertexFilePaths,
                                                       java.util.List<java.lang.String> edgeFilePaths)
        Loads the graph contained in the files at the given paths.

        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.

        Parameters:
        vertexFilePaths - paths to the vertex files
        edgeFilePaths - paths to the edge files
        Returns:
        graph at the given location
        See Also:
        describeGraphFilesAsync(List, List)
      • readGraphFilesAsync

        public PgxFuture<PgxGraph> readGraphFilesAsync​(java.util.List<java.lang.String> vertexFilePaths,
                                                       java.util.List<java.lang.String> edgeFilePaths,
                                                       @Nullable
                                                       Format format)
        Loads the graph contained in the files at the given paths.

        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.

        Parameters:
        vertexFilePaths - paths to the vertex files
        edgeFilePaths - paths to the edge files
        format - file format
        Returns:
        graph at the given location
        See Also:
        describeGraphFilesAsync(List, List, Format)
      • readGraphFilesAsync

        public PgxFuture<PgxGraph> readGraphFilesAsync​(java.util.List<java.lang.String> vertexFilePaths,
                                                       java.util.List<java.lang.String> edgeFilePaths,
                                                       @Nullable
                                                       java.lang.String newGraphName)
        Loads the graph contained in the files at the given paths.

        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.

        Parameters:
        vertexFilePaths - paths to the vertex files
        edgeFilePaths - paths to the edge files
        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.
        Returns:
        graph at the given location
        See Also:
        describeGraphFilesAsync(List, List)
      • readGraphFilesAsync

        public PgxFuture<PgxGraph> readGraphFilesAsync​(java.util.List<java.lang.String> vertexFilePaths,
                                                       java.util.List<java.lang.String> edgeFilePaths,
                                                       @Nullable
                                                       Format format,
                                                       @Nullable
                                                       java.lang.String newGraphName)
        Loads the graph contained in the files at the given paths.

        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.

        Parameters:
        vertexFilePaths - paths to the vertex files
        edgeFilePaths - paths to the edge files
        format - file format
        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.
        Returns:
        graph at the given location
        See Also:
        describeGraphFilesAsync(List, List, Format)
      • readGraphWithPropertiesAsync

        public PgxFuture<PgxGraph> readGraphWithPropertiesAsync​(java.lang.String path)
        Reads a graph and its properties, specified by a path to a graph config, into memory.
        Parameters:
        path - a path to a graph config, e.g. 'path/to/config.json' or 'http://myserver.com/my-config.json'
        See Also:
        Path syntax documentation
      • readSubgraph

        public GenericSubgraphReader readSubgraph()
        Creates a new subgraph reader with which it is possible to parameterize the loading of a subgraph
        Returns:
        a subgraph reader object with which it is possible to parameterize the loading
        Since:
        22.1.1
      • readGraphWithPropertiesAsync

        public 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.
        Parameters:
        path - a path to a graph config, e.g. '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.
        See Also:
        Path syntax documentation
      • readGraphWithPropertiesAsync

        public PgxFuture<PgxGraph> readGraphWithPropertiesAsync​(GraphConfig config)
        Reads a graph and its properties, specified in the graph config, into memory.
        Parameters:
        config - the graph config
      • readGraphWithPropertiesAsync

        public PgxFuture<PgxGraph> readGraphWithPropertiesAsync​(GraphConfig config,
                                                                @Nullable
                                                                java.lang.String newGraphName)
        Reads a graph and its properties, specified a graph config, into memory.
        Parameters:
        config - the graph config
        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.
      • readGraphWithPropertiesAsync

        public PgxFuture<PgxGraph> readGraphWithPropertiesAsync​(GraphConfig config,
                                                                boolean updateIfNotFresh)
        Reads a graph and its properties, specified in the graph config, into memory.
        Parameters:
        config - the graph config
        updateIfNotFresh - if a newer data version exists in the backing data source (see PgxGraph.isFresh()), this flag tells whether to read it and create another snapshot inside PGX. If the "snapshots_source" field of config is SnapshotsSource.REFRESH, the returned graph may have multiple snapshots, depending on whether previous reads with the same config occurred; otherwise, if the "snapshots_source" field is SnapshotsSource.CHANGE_SET, only the most recent snapshot (either pre-existing or freshly read) will be visible
      • readGraphWithPropertiesAsync

        public PgxFuture<PgxGraph> readGraphWithPropertiesAsync​(GraphConfig config,
                                                                boolean updateIfNotFresh,
                                                                java.lang.String newGraphName)
        Reads a graph and its properties, specified in the graph config, into memory.
        Parameters:
        config - the graph config
        updateIfNotFresh - if a newer data version exists in the backing data source (see PgxGraph.isFresh()), this flag tells whether to read it and create another snapshot inside PGX. If the "snapshots_source" field of config is SnapshotsSource.REFRESH, the returned graph may have multiple snapshots, depending on whether previous reads with the same config occurred; otherwise, if the "snapshots_source" field is SnapshotsSource.CHANGE_SET, only the most recent snapshot (either pre-existing or freshly read) will be visible
        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.
      • readGraphWithPropertiesAsync

        public PgxFuture<PgxGraph> readGraphWithPropertiesAsync​(GraphConfig config,
                                                                long maxAge,
                                                                java.util.concurrent.TimeUnit maxAgeTimeUnit)
        Reads a graph and its properties, specified in the graph config, into memory.
        Parameters:
        config - the graph config
        maxAge - 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 parameter
      • readGraphWithPropertiesAsync

        public 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 in the graph config, into memory.
        Parameters:
        config - the graph config
        maxAge - 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 parameter
        blockIfFull - 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.
      • readGraphByNameAsync

        public PgxFuture<PgxGraph> readGraphByNameAsync​(java.lang.String graphName,
                                                        GraphSource source)
        Reads a graph identified by the given name into memory.
        Parameters:
        graphName - the name of the graph
        source - type of the source from where to load the graph from
        Since:
        21.3.0
      • readGraphByNameAsync

        public PgxFuture<PgxGraph> readGraphByNameAsync​(java.lang.String schemaName,
                                                        java.lang.String graphName,
                                                        GraphSource source)
        Reads a graph identified by the given name into memory.
        Parameters:
        schemaName - the name of the schema
        graphName - the name of the graph
        source - type of the source from where to load the graph from
        Since:
        23.1.0
      • readGraphByNameAsync

        public PgxFuture<PgxGraph> readGraphByNameAsync​(java.lang.String graphName,
                                                        GraphSource source,
                                                        ReadGraphOption... options)
        Reads a graph identified by the given name into memory.
        Parameters:
        graphName - the name of the graph
        source - type of the source from where to load the graph
        options - options for loading the graph. List of possible ReadGraphOptions below:

        OPTIMIZED_FOR_UPDATES: Specify if the loaded graph will be optimized for updates (Default).
        OPTIMIZED_FOR_READ: Specify if the loaded graph will be optimized for reads.
        SYNCHRONIZABLE: If used and graph cannot be synchronized, PGX will throw an Exception.
        ON_MISSING_VERTEX_IGNORE_EDGE: Ignore edges with missing source/destination vertex (without logging).
        ON_MISSING_VERTEX_IGNORE_EDGE_LOG: Ignore edges with missing source/destination vertex and log every ignored edge.
        ON_MISSING_VERTEX_IGNORE_EDGE_LOG_ONCE: Ignore edges with missing source/destination vertex and log the first ignored edge.
        ON_MISSING_VERTEX_ERROR: Throw an error when an edge misses source/destination vertex (Default).

        Since:
        22.2
      • readGraphByNameAsync

        public PgxFuture<PgxGraph> readGraphByNameAsync​(java.lang.String schemaName,
                                                        java.lang.String graphName,
                                                        GraphSource source,
                                                        ReadGraphOption... options)
        Reads a graph identified by the given schema name and graph name into memory.
        Parameters:
        schemaName - the name of the schema
        graphName - the name of the graph
        source - type of the source from where to load the graph
        options - options for loading the graph. List of possible ReadGraphOptions below:

        OPTIMIZED_FOR_UPDATES: Specify if the loaded graph will be optimized for updates (Default).
        OPTIMIZED_FOR_READ: Specify if the loaded graph will be optimized for reads.
        SYNCHRONIZABLE: If used and graph cannot be synchronized, PGX will throw an Exception.
        ON_MISSING_VERTEX_IGNORE_EDGE: Ignore edges with missing source/destination vertex (without logging).
        ON_MISSING_VERTEX_IGNORE_EDGE_LOG: Ignore edges with missing source/destination vertex and log every ignored edge.
        ON_MISSING_VERTEX_IGNORE_EDGE_LOG_ONCE: Ignore edges with missing source/destination vertex and log the first ignored edge.
        ON_MISSING_VERTEX_ERROR: Throw an error when an edge misses source/destination vertex (Default).

        Since:
        23.1.0
      • readGraphAsOfAsync

        public PgxFuture<PgxGraph> readGraphAsOfAsync​(GraphConfig config,
                                                      GraphMetaData metaData,
                                                      java.lang.String newGraphName)
        Reads a graph and its properties of a specific version (metaData) into memory.
        Parameters:
        config - the graph config
        metaData - the metaData object returned by (GraphConfig) identifying the version to be checked out
        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.
        See Also:
        setSnapshotAsync(PgxGraph, GraphMetaData)
      • readGraphAsOfAsync

        public PgxFuture<PgxGraph> readGraphAsOfAsync​(GraphConfig config,
                                                      long creationTimestamp)
        Reads a graph and its properties of a specific version (creationTimestamp) into memory. The creationTimestamp must be a valid version of the graph.
        Parameters:
        config - the graph config
        creationTimestamp - the creation timestamp (milliseconds since jan 1st 1970) identifying the version to be checked out
        See Also:
        setSnapshotAsync(PgxGraph, long)
      • readGraphAsOfAsync

        public PgxFuture<PgxGraph> readGraphAsOfAsync​(GraphConfig config,
                                                      long creationTimestamp,
                                                      java.lang.String newGraphName)
        Reads a graph and its properties of a specific version (creationTimestamp) into memory. The creationTimestamp must be a valid version of the graph.
        Parameters:
        config - the graph config
        creationTimestamp - the creation timestamp (milliseconds since jan 1st 1970) identifying the version to be checked out
        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.
        See Also:
        setSnapshotAsync(PgxGraph, long)
      • getGraphAsync

        public PgxFuture<PgxGraph> getGraphAsync​(java.lang.String name)
        References a graph with name name loaded inside PGX. The search for the snapshot to return is done according to the following rules: - first, PGX searches among the snapshots the session is already referencing, if it finds any it returns the most recent one belonging to the graph with name name - if no graph with name name is already being referenced, PGX searches among published graphs and, if the search is successful, it returns the most recent snapshots of the published graph with name name

        Multiple calls of this method with the same parameters will return different PgxGraph objects referencing the same graph, with the server keeping track of how many references a session has to each graph. Therefore, a graph is released within the server either if: - all the references are moved to another graph (e.g. via setSnapshot(PgxGraph, long) - the PgxGraph.destroy() method is called on one reference: note that this invalidates all references

        The graph will be first looked up in the session private namespace, if it is not found there it will be looked up in the public namespace. If a graph with the given name is not found in either the private or public namespace, null will be returned. A call to this will be semantically the same as the following code:

        
         PgxGraph g = session.getGraph(Namespace.PRIVATE, name);
         if (g == null) {
           g = session.getGraph(Namespace.PUBLIC, name);
         }
         

        Parameters:
        name - the name of the graph
        Returns:
        the graph with the given name. null if no such graph exists
        See Also:
        getGraphAsync(Namespace, String), Namespace.PRIVATE, Namespace.PUBLIC
      • getGraphAsync

        public PgxFuture<PgxGraph> getGraphAsync​(Namespace namespace,
                                                 java.lang.String name)
        References a graph with name name within the given namespace: - if namespace is Namespace.PRIVATE, than the search occurs on already referenced snapshots of the graph with name name and the most recent snapshot is returned - if namespace is Namespace.PUBLIC, then the search occurs on published graphs and the most recent snapshot of the published graph with name name is returned - if namespace is null, then the PRIVATE namespace is searched first and, if no snapshot is found, the PUBLIC namespace is then searched, according to the shadowing rules

        Multiple calls of this method with the same parameters will return different PgxGraph objects referencing the same graph, with the server keeping track of how many references a session has to each graph. Therefore, a graph is released within the server either if: - all the references are moved to another graph (e.g. via setSnapshot(PgxGraph, long) - the PgxGraph.destroy() method is called on one reference: note that this invalidates all references

        Parameters:
        namespace - the namespace where to look up the graph. can be null, which implies same behavior as getGraphAsync(String)
        name - the name of the graph
        Returns:
        the graph with the given name from the given namespace. null if no such graph exists
        Since:
        19.4.0
        See Also:
        getGraphAsync(String), Namespace.PRIVATE, Namespace.PUBLIC
      • getGraphsAsync

        public PgxFuture<java.util.List<java.lang.String>> getGraphsAsync​(Namespace namespace)
        Returns a collection of graph names accessible under the given namespace.
        Returns:
        a collection of accessible graphs
        Since:
        19.4.0
      • compileProgramCodeAsync

        public PgxFuture<CompiledProgram> compileProgramCodeAsync​(java.lang.String code)
        Compiles a Green-Marl program for parallel execution with all optimizations enabled.
        Parameters:
        code - the Green-Marl code to compile
      • compileProgramCodeAsync

        public PgxFuture<CompiledProgram> compileProgramCodeAsync​(java.lang.String code,
                                                                  boolean overwrite)
        Compiles a Green-Marl program for parallel execution with all optimizations enabled.
        Parameters:
        code - the Green-Marl code to compile
        overwrite - if the procedure in the given code already exists, overwrite if true, throw an exception otherwise
      • compileProgramCodeAsync

        public PgxFuture<CompiledProgram> compileProgramCodeAsync​(java.lang.String code,
                                                                  boolean overwrite,
                                                                  boolean parallel,
                                                                  java.util.List<GmCompilerOptimization> disabledOptimizations,
                                                                  boolean verbose)
        Compiles a Green-Marl program.
        Parameters:
        code - the Green-Marl code to compile
        parallel - if false, the compiled program will be optimized for sequential execution
        disabledOptimizations - list of compiler optimizations to disable
        verbose - if true, the compiler will output compilation stages
      • getPgqlResultSetAsync

        public PgxFuture<PgqlResultSet> getPgqlResultSetAsync​(java.lang.String id)
        Gets a PGQL result set by ID.
        Parameters:
        id - the PGQL result set ID
        Returns:
        the requested PGQL result set or NULL if no such result set exists for this session
      • getAvailableCompiledProgramIdsAsync

        public PgxFuture<java.util.Set<java.lang.String>> getAvailableCompiledProgramIdsAsync()
        Gets the set of available compiled program IDs.
        Returns:
        the set of available compiled program IDs.
      • getCompiledProgramAsync

        public PgxFuture<CompiledProgram> getCompiledProgramAsync​(java.lang.String id)
        Gets a compiled program by ID.
        Parameters:
        id - the ID of the compiled program
        Returns:
        the compiled program.
      • getAvailableSnapshotsAsync

        public PgxFuture<java.util.Deque<GraphMetaData>> getAvailableSnapshotsAsync​(PgxGraph graph)
        Gets a list of the GraphMetaData information of available in-memory snapshots of graph.
        Parameters:
        graph - the graph whose information is returned; note that graph can reference any snapshot of the graph (see setSnapshot(PgxGraph, long)): all snapshots GraphMetaData objects will be retrieved anyway
        Returns:
        A list of graph meta data objects, each belonging to a snapshot of graph currently loaded into memory. The list is sorted by descending order based on the GraphMetaData.getCreationTimestamp() value (milliseconds since Jan 1st 1970) - the timestamp when the snapshot was created.
      • setSnapshotAsync

        public PgxFuture<java.lang.Void> setSnapshotAsync​(PgxGraph graph,
                                                          long creationTimestamp)
        Sets a graph to a specific snapshot. You can use this method to jump back and forth in time between various snapshots of the same graph. If successful, the given graph will point to the requested snapshot after the returned future completes.
        Parameters:
        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 out
      • setSnapshotAsync

        public PgxFuture<java.lang.Void> setSnapshotAsync​(PgxGraph graph,
                                                          GraphMetaData metaData)
        Sets a graph to a specific snapshot. You can use this method to jump back and forth in time between various snapshots of the same graph. If successful, the given graph will point to the requested snapshot after the returned future completes.
        Parameters:
        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(PgxGraph) identifying the version to be checked out
      • setSnapshotAsync

        public PgxFuture<java.lang.Void> setSnapshotAsync​(PgxGraph graph,
                                                          GraphMetaData metaData,
                                                          boolean forceDeleteTransientProperties)
        Sets a graph to a specific snapshot. You can use this method to jump back and forth in time between various snapshots of the same graph. If successful, the given graph will point to the requested snapshot after the returned future completes.
        Parameters:
        graph - the graph to be checked out to a different snapshot version
        metaData - the metaData object returned by (GraphConfig) identifying the version to be checked out
        forceDeleteTransientProperties - 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.
      • setSnapshotAsync

        public PgxFuture<java.lang.Void> setSnapshotAsync​(PgxGraph graph,
                                                          long creationTimestamp,
                                                          boolean forceDeleteTransientProperties)
        Sets a graph to a specific snapshot. You can use this method to jump back and forth in time between various snapshots of the same graph. If successful, the given graph will point to the requested snapshot after the returned future completes.
        Parameters:
        graph - the graph to be checked out to a different snapshot version
        creationTimestamp - the creation timestamp (milliseconds since Jan 1st 1970) identifying the version to be checked out
        forceDeleteTransientProperties - 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.
      • queryPgqlAsync

        public PgxFuture<PgqlResultSet> queryPgqlAsync​(java.lang.String pgqlString)
        Submits a pattern matching query with a ON-clause. The ON-clause indicates the graph on which the query will be executed. The graph name in the ON-clause is evaluated with the same semantics as getGraphAsync(String).
        Parameters:
        pgqlString - query string in PGQL
        Returns:
        the query result set
      • preparePgqlAsync

        public PgxFuture<PgxPreparedStatement> preparePgqlAsync​(java.lang.String pgqlString)
        Prepares a pattern matching query with a ON-clause. The ON-clause indicates the graph on which the query will be executed. The graph name in the ON-clause is evaluated with the same semantics as getGraphAsync(String).
        Parameters:
        pgqlString - query string in PGQL
        Returns:
        a prepared statement object
      • executePgqlAsync

        public PgxFuture<PgqlResultSet> executePgqlAsync​(java.lang.String pgqlString)
        Submits any query with a ON-clause. The ON-clause indicates the graph on which the query will be executed. The graph name in the ON-clause is evaluated with the same semantics as getGraphAsync(String).
        Parameters:
        pgqlString - query string in PGQL
        Returns:
        the query result set
      • explainPgqlAsync

        public PgxFuture<Operation> explainPgqlAsync​(java.lang.String pgqlString)
        Explain the execution plan of a pattern matching query. Note: Different PGX versions may return different execution plans.
        Parameters:
        pgqlString - query string in PGQL
        Returns:
        the query plan
      • createSetAsync

        public <T> PgxFuture<ScalarSet<T>> createSetAsync​(PropertyType contentType,
                                                          java.lang.String name)
        Creates a set of scalars.
        Parameters:
        contentType - content type of the set.
        name - the set's name.
        Returns:
        A named ScalarSet of content type contentType.
      • createSequenceAsync

        public <T> PgxFuture<ScalarSequence<T>> createSequenceAsync​(PropertyType contentType,
                                                                    java.lang.String name)
        Creates a sequence of scalars.
        Parameters:
        contentType - content type of the sequence.
        name - the sequence's name.
        Returns:
        A named ScalarSequence of content type contentType.
      • createMapAsync

        public <K,​V> PgxFuture<PgxMap<K,​V>> createMapAsync​(PropertyType keyType,
                                                                       PropertyType valueType,
                                                                       java.lang.String name)
        Creates a map.
        Parameters:
        keyType - key content type of the map.
        valueType - value content type of the map.
        name - the map's name.
        Returns:
        A named PgxMap of key content type keyType and value content type valueType.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • describeGraphFile

        public GraphConfig describeGraphFile​(java.lang.String path)
                                      throws java.util.concurrent.ExecutionException,
                                             java.lang.InterruptedException
        Blocking version of describeGraphFileAsync(String). Calls describeGraphFileAsync(String) and waits for the returned PgxFuture to 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.
      • describeGraphFile

        public GraphConfig describeGraphFile​(java.lang.String path,
                                             @Nullable
                                             Format format)
                                      throws java.util.concurrent.ExecutionException,
                                             java.lang.InterruptedException
        Blocking version of describeGraphFileAsync(String, Format). Calls describeGraphFileAsync(String, Format) and waits for the returned PgxFuture to 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.
      • describeGraphFiles

        public GraphConfig describeGraphFiles​(java.util.List<java.lang.String> filePaths)
                                       throws java.util.concurrent.ExecutionException,
                                              java.lang.InterruptedException
        Blocking version of describeGraphFilesAsync(List). Calls describeGraphFilesAsync(List) and waits for the returned PgxFuture to 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.
      • describeGraphFiles

        public GraphConfig describeGraphFiles​(java.util.List<java.lang.String> filePaths,
                                              @Nullable
                                              Format format)
                                       throws java.util.concurrent.ExecutionException,
                                              java.lang.InterruptedException
        Blocking version of describeGraphFilesAsync(List, Format). Calls describeGraphFilesAsync(List, Format) and waits for the returned PgxFuture to 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.
      • describeGraphFiles

        public GraphConfig describeGraphFiles​(java.lang.String vertexFilePath,
                                              java.lang.String edgeFilePath)
                                       throws java.util.concurrent.ExecutionException,
                                              java.lang.InterruptedException
        Blocking version of describeGraphFilesAsync(String, String). Calls describeGraphFilesAsync(String, String) and waits for the returned PgxFuture to 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.
      • describeGraphFiles

        public GraphConfig describeGraphFiles​(java.lang.String vertexFilePath,
                                              java.lang.String edgeFilePath,
                                              @Nullable
                                              Format format)
                                       throws java.util.concurrent.ExecutionException,
                                              java.lang.InterruptedException
        Blocking version of describeGraphFilesAsync(String, String, Format). Calls describeGraphFilesAsync(String, String, Format) and waits for the returned PgxFuture to 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.
      • describeGraphFiles

        public GraphConfig describeGraphFiles​(java.util.List<java.lang.String> vertexFilePaths,
                                              java.util.List<java.lang.String> edgeFilePaths)
                                       throws java.util.concurrent.ExecutionException,
                                              java.lang.InterruptedException
        Blocking version of describeGraphFilesAsync(List, List). Calls describeGraphFilesAsync(List, List) and waits for the returned PgxFuture to 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.
      • describeGraphFiles

        public GraphConfig describeGraphFiles​(java.util.List<java.lang.String> vertexFilePaths,
                                              java.util.List<java.lang.String> edgeFilePaths,
                                              @Nullable
                                              Format format)
                                       throws java.util.concurrent.ExecutionException,
                                              java.lang.InterruptedException
        Blocking version of describeGraphFilesAsync(List, List, Format). Calls describeGraphFilesAsync(List, List, Format) and waits for the returned PgxFuture to 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.
      • readGraphFile

        public PgxGraph readGraphFile​(java.lang.String path)
                               throws java.util.concurrent.ExecutionException,
                                      java.lang.InterruptedException
        Blocking version of readGraphFileAsync(String). Calls readGraphFileAsync(String) and waits for the returned PgxFuture to 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.
      • readGraphFile

        public PgxGraph readGraphFile​(java.lang.String path,
                                      @Nullable
                                      Format format)
                               throws java.util.concurrent.ExecutionException,
                                      java.lang.InterruptedException
        Blocking version of readGraphFileAsync(String, Format). Calls readGraphFileAsync(String, Format) and waits for the returned PgxFuture to 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.
      • readGraphFile

        public PgxGraph readGraphFile​(java.lang.String path,
                                      @Nullable
                                      java.lang.String newGraphName)
                               throws java.util.concurrent.ExecutionException,
                                      java.lang.InterruptedException
        Blocking version of readGraphFileAsync(String, String). Calls readGraphFileAsync(String, String) and waits for the returned PgxFuture to 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.
      • readGraphFile

        public PgxGraph readGraphFile​(java.lang.String path,
                                      @Nullable
                                      Format format,
                                      @Nullable
                                      java.lang.String newGraphName)
                               throws java.util.concurrent.ExecutionException,
                                      java.lang.InterruptedException
        Blocking version of readGraphFileAsync(String, Format, String). Calls readGraphFileAsync(String, Format, String) and waits for the returned PgxFuture to 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.
      • readGraphFiles

        public PgxGraph readGraphFiles​(java.util.List<java.lang.String> filePaths)
                                throws java.util.concurrent.ExecutionException,
                                       java.lang.InterruptedException
        Blocking version of readGraphFilesAsync(List). Calls readGraphFilesAsync(List) and waits for the returned PgxFuture to 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.
      • readGraphFiles

        public PgxGraph readGraphFiles​(java.util.List<java.lang.String> filePaths,
                                       @Nullable
                                       Format format)
                                throws java.util.concurrent.ExecutionException,
                                       java.lang.InterruptedException
        Blocking version of readGraphFilesAsync(List, Format). Calls readGraphFilesAsync(List, Format) and waits for the returned PgxFuture to 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.
      • readGraphFiles

        public PgxGraph readGraphFiles​(java.util.List<java.lang.String> filePaths,
                                       @Nullable
                                       java.lang.String newGraphName)
                                throws java.util.concurrent.ExecutionException,
                                       java.lang.InterruptedException
        Blocking version of readGraphFilesAsync(List, String). Calls readGraphFilesAsync(List, String) and waits for the returned PgxFuture to 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.
      • readGraphFiles

        public PgxGraph readGraphFiles​(java.util.List<java.lang.String> filePaths,
                                       @Nullable
                                       Format format,
                                       @Nullable
                                       java.lang.String newGraphName)
                                throws java.util.concurrent.ExecutionException,
                                       java.lang.InterruptedException
        Blocking version of readGraphFilesAsync(List, String). Calls readGraphFilesAsync(List, String) and waits for the returned PgxFuture to 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.
      • readGraphFiles

        public PgxGraph readGraphFiles​(java.lang.String vertexFilePath,
                                       java.lang.String edgeFilePath)
                                throws java.util.concurrent.ExecutionException,
                                       java.lang.InterruptedException
        Blocking version of readGraphFilesAsync(String, String). Calls readGraphFilesAsync(String, String) and waits for the returned PgxFuture to 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.
      • readGraphFiles

        public PgxGraph readGraphFiles​(java.lang.String vertexFilePath,
                                       java.lang.String edgeFilePath,
                                       @Nullable
                                       Format format)
                                throws java.util.concurrent.ExecutionException,
                                       java.lang.InterruptedException
        Blocking version of readGraphFilesAsync(String, String, Format). Calls readGraphFilesAsync(String, String, Format) and waits for the returned PgxFuture to 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.
      • readGraphFiles

        public PgxGraph readGraphFiles​(java.lang.String vertexFilePath,
                                       java.lang.String edgeFilePath,
                                       @Nullable
                                       java.lang.String newGraphName)
                                throws java.util.concurrent.ExecutionException,
                                       java.lang.InterruptedException
        Blocking version of readGraphFilesAsync(String, String, String). Calls readGraphFilesAsync(String, String, String) and waits for the returned PgxFuture to 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.
      • readGraphFiles

        public PgxGraph readGraphFiles​(java.lang.String vertexFilePath,
                                       java.lang.String edgeFilePath,
                                       @Nullable
                                       Format format,
                                       @Nullable
                                       java.lang.String newGraphName)
                                throws java.util.concurrent.ExecutionException,
                                       java.lang.InterruptedException
        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.
      • readGraphFiles

        public PgxGraph readGraphFiles​(java.util.List<java.lang.String> vertexFilePaths,
                                       java.util.List<java.lang.String> edgeFilePaths)
                                throws java.util.concurrent.ExecutionException,
                                       java.lang.InterruptedException
        Blocking version of readGraphFilesAsync(List, List). Calls readGraphFilesAsync(List, List) and waits for the returned PgxFuture to 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.
      • readGraphFiles

        public PgxGraph readGraphFiles​(java.util.List<java.lang.String> vertexFilePaths,
                                       java.util.List<java.lang.String> edgeFilePaths,
                                       @Nullable
                                       Format format)
                                throws java.util.concurrent.ExecutionException,
                                       java.lang.InterruptedException
        Blocking version of readGraphFilesAsync(List, List, Format). Calls readGraphFilesAsync(List, List, Format) and waits for the returned PgxFuture to 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.
      • readGraphFiles

        public PgxGraph readGraphFiles​(java.util.List<java.lang.String> vertexFilePaths,
                                       java.util.List<java.lang.String> edgeFilePaths,
                                       @Nullable
                                       java.lang.String newGraphName)
                                throws java.util.concurrent.ExecutionException,
                                       java.lang.InterruptedException
        Blocking version of readGraphFilesAsync(List, List, String). Calls readGraphFilesAsync(List, List, String) and waits for the returned PgxFuture to 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.
      • readGraphFiles

        public PgxGraph readGraphFiles​(java.util.List<java.lang.String> vertexFilePaths,
                                       java.util.List<java.lang.String> edgeFilePaths,
                                       @Nullable
                                       Format format,
                                       @Nullable
                                       java.lang.String newGraphName)
                                throws java.util.concurrent.ExecutionException,
                                       java.lang.InterruptedException
        Blocking version of readGraphFilesAsync(List, List, Format, String). Calls readGraphFilesAsync(List, List, Format, String) and waits for the returned PgxFuture to 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.
      • readGraphWithProperties

        public PgxGraph readGraphWithProperties​(java.lang.String path)
                                         throws java.util.concurrent.ExecutionException,
                                                java.lang.InterruptedException
        Blocking version of readGraphWithPropertiesAsync(String). Calls readGraphWithPropertiesAsync(String) and waits for returned PgxFuture to 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.
      • readGraphWithProperties

        public PgxGraph readGraphWithProperties​(java.lang.String path,
                                                java.lang.String newGraphName)
                                         throws java.util.concurrent.ExecutionException,
                                                java.lang.InterruptedException
        Blocking version of readGraphWithPropertiesAsync(String, String). Calls readGraphWithPropertiesAsync(String, String) and waits for returned PgxFuture to 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.
      • readGraphWithProperties

        public PgxGraph readGraphWithProperties​(GraphConfig config)
                                         throws java.util.concurrent.ExecutionException,
                                                java.lang.InterruptedException
        Blocking version of readGraphWithPropertiesAsync(GraphConfig). Calls readGraphWithPropertiesAsync(GraphConfig) and waits for returned PgxFuture to 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.
      • readGraphAsOf

        public PgxGraph readGraphAsOf​(GraphConfig config,
                                      long creationTimestamp)
                               throws java.util.concurrent.ExecutionException,
                                      java.lang.InterruptedException
        Blocking version of readGraphAsOfAsync(GraphConfig, long). Calls readGraphAsOfAsync(GraphConfig, long) and waits for the returned PgxFuture to 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.
      • readGraphAsOf

        public PgxGraph readGraphAsOf​(GraphConfig config,
                                      long creationTimestamp,
                                      java.lang.String newGraphName)
                               throws java.util.concurrent.ExecutionException,
                                      java.lang.InterruptedException
        Blocking version of readGraphAsOfAsync(GraphConfig, long, String). Calls readGraphAsOfAsync(GraphConfig, long, String) and waits for the returned PgxFuture to 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.
      • getGraph

        public PgxGraph getGraph​(java.lang.String name)
                          throws java.util.concurrent.ExecutionException,
                                 java.lang.InterruptedException
        Blocking version of getGraphAsync(String). Calls getGraphAsync(String) and waits for returned PgxFuture to 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.
      • getGraph

        public PgxGraph getGraph​(Namespace namespace,
                                 java.lang.String name)
                          throws java.util.concurrent.ExecutionException,
                                 java.lang.InterruptedException
        Blocking version of getGraphAsync(String). Calls getGraphAsync(String) and waits for returned PgxFuture to 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.
      • getGraphs

        public java.util.List<java.lang.String> getGraphs​(Namespace namespace)
                                                   throws java.util.concurrent.ExecutionException,
                                                          java.lang.InterruptedException
        Blocking version of getGraphsAsync(Namespace). Calls getGraphsAsync(Namespace) and waits for returned PgxFuture to 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.
      • getAvailableSnapshots

        public java.util.Deque<GraphMetaData> getAvailableSnapshots​(PgxGraph snapshot)
                                                             throws java.lang.InterruptedException,
                                                                    java.util.concurrent.ExecutionException
        Blocking version of getAvailableSnapshotsAsync(PgxGraph). Calls getAvailableSnapshotsAsync(PgxGraph) and waits for returned PgxFuture to 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.
      • queryPgql

        public PgqlResultSet queryPgql​(java.lang.String pgqlString)
                                throws java.util.concurrent.ExecutionException,
                                       java.lang.InterruptedException
        Blocking version of queryPgql(String). Calls queryPgqlAsync(String) and waits for the returned PgxFuture to 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.
      • explainPgql

        public Operation explainPgql​(java.lang.String pgqlString)
                              throws java.util.concurrent.ExecutionException,
                                     java.lang.InterruptedException
        Blocking version of explainPgql(String). Calls explainPgqlAsync(String) and waits for the returned PgxFuture to 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.
      • executePgql

        public PgqlResultSet executePgql​(java.lang.String pgqlString)
                                  throws java.util.concurrent.ExecutionException,
                                         java.lang.InterruptedException
        Blocking version of executePgqlAsync(String). Calls executePgqlAsync(String) and waits for the returned PgxFuture to 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.
      • runConcurrentlyAsync

        public PgxFuture<java.util.List<?>> runConcurrentlyAsync​(java.util.List<java.util.function.Supplier<PgxFuture<?>>> asyncRequestsSuppliers)
        Submits lists of supplied functions to run concurrently in the server
        Parameters:
        asyncRequestsSuppliers - list of the asynchronous requests to execute concurrently
        Returns:
        the result of the asynchronous request
        Since:
        3.3.0
      • runConcurrently

        public java.util.List<?> runConcurrently​(java.util.List<java.util.function.Supplier<PgxFuture<?>>> asyncRequest)
        Blocking version of #runConcurrentlyAsync(List<Supplier>). Calls #runConcurrentlyAsync(List<Supplier>) and waits for returned PgxFuture to complete.
        Since:
        3.3.0