Class AdbGraphClient

java.lang.Object
oracle.pg.rdbms.AdbGraphClient
All Implemented Interfaces:
AutoCloseable

public class AdbGraphClient extends Object implements AutoCloseable
ADB Graph Client. We recommend to close this
  • Constructor Details

    • AdbGraphClient

      public AdbGraphClient(AdbGraphClientConfiguration config)
      Creates a new ADB Graph Client.
      Parameters:
      config - the ADB Graph Client configuration.
  • Method Details

    • isAttached

      public boolean isAttached()
      Checks if the Autonomous Database is currently attached to an environment.
      Returns:
      true if the Autonomous Database is currently attached to an environment. False otherwise.
    • getEnvironmentStatus

      public EnvironmentStatus getEnvironmentStatus()
      Fetches the EnvironmentStatus of the Autonomous Database.
      Returns:
      the EnvironmentStatus of the Autonomous Database.
    • startEnvironment

      public Job startEnvironment(int memory)
      Starts attaching the Autonomous Database to a new environment.
      Parameters:
      memory - the amount of system memory (in gigabytes) to allocate on the attached environment.
      Returns:
      a Job which completes once attachment operation completes.
      Throws:
      IllegalStateException - if the Autonomous Database is currently not in EnvironmentStatus.DETACHED state
    • stopEnvironment

      public Job stopEnvironment()
      Starts detaching the Autonomous Database from the current environment. Note: all in-memory data will be lost
      Returns:
      a Job which completes once detachment operation completes.
      Throws:
      IllegalStateException - if the Autonomous Database is currently not in EnvironmentStatus.ATTACHED state
    • restartEnvironment

      public Job restartEnvironment()
      Starts re-attaching the Autonomous Database to a new environment.
      Returns:
      a Job which completes once re-attachment operation completes.
      Throws:
      IllegalStateException - if the Autonomous Database is currently not in EnvironmentStatus.ATTACHED state
    • getPgxInstance

      public ServerInstance getPgxInstance()
      Gets the PGX ServerInstance object of an attached environment which can be used to create a new PgxSession for in-memory graph analysis.
      Returns:
      the PGX ServerInstance of the Autonomous Database.
    • getCurrentMemory

      public double getCurrentMemory()
      Gets the current environment's allocated memory. Only returns the memory if environment is in attached status.
      Returns:
      the allocated memory for the currently attached environment. The results' units are in Gigabytes and in decimal format.
    • getAvailableMemory

      public double getAvailableMemory()
      Gets the available memory for environments to allocate. Only returns the memory if environment is in detached status.
      Returns:
      the available memory for the environments to allocate. The results' units are in Gigabytes and in decimal format.
    • close

      public void close()
      Closes this client object.
      Specified by:
      close in interface AutoCloseable
    • getConfig

      public AdbGraphClientConfiguration getConfig()
      The configuration of this client.
      Returns:
      the configuration of this client.
    • getEndpoint

      public URI getEndpoint()
      The endpoint used by this client.
      Returns:
      the endpoint.