Package oracle.pg.rdbms
Class AdbGraphClient
- java.lang.Object
-
- oracle.pg.rdbms.AdbGraphClient
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class AdbGraphClient extends java.lang.Object implements java.lang.AutoCloseable
ADB Graph Client. We recommend to close this
-
-
Constructor Summary
Constructors Constructor Description AdbGraphClient(AdbGraphClientConfiguration config)
Creates a new ADB Graph Client.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes this client object.double
getAvailableMemory()
Gets the available memory for environments to allocate.AdbGraphClientConfiguration
getConfig()
The configuration of this client.double
getCurrentMemory()
Gets the current environment's allocated memory.java.net.URI
getEndpoint()
The endpoint used by this client.EnvironmentStatus
getEnvironmentStatus()
Fetches theEnvironmentStatus
of the Autonomous Database.ServerInstance
getPgxInstance()
Gets the PGXServerInstance
object of an attached environment which can be used to create a newPgxSession
for in-memory graph analysis.boolean
isAttached()
Checks if the Autonomous Database is currently attached to an environment.Job
restartEnvironment()
Starts re-attaching the Autonomous Database to a new environment.Job
startEnvironment(int memory)
Starts attaching the Autonomous Database to a new environment.Job
stopEnvironment()
Starts detaching the Autonomous Database from the current environment.
-
-
-
Constructor Detail
-
AdbGraphClient
public AdbGraphClient(AdbGraphClientConfiguration config)
Creates a new ADB Graph Client.- Parameters:
config
- the ADB Graph Client configuration.
-
-
Method Detail
-
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 theEnvironmentStatus
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:
java.lang.IllegalStateException
- if the Autonomous Database is currently not inEnvironmentStatus.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:
java.lang.IllegalStateException
- if the Autonomous Database is currently not inEnvironmentStatus.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:
java.lang.IllegalStateException
- if the Autonomous Database is currently not inEnvironmentStatus.ATTACHED
state
-
getPgxInstance
public ServerInstance getPgxInstance()
Gets the PGXServerInstance
object of an attached environment which can be used to create a newPgxSession
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 interfacejava.lang.AutoCloseable
-
getConfig
public AdbGraphClientConfiguration getConfig()
The configuration of this client.- Returns:
- the configuration of this client.
-
getEndpoint
public java.net.URI getEndpoint()
The endpoint used by this client.- Returns:
- the endpoint.
-
-