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.AutoCloseableADB 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 voidclose()Closes this client object.doublegetAvailableMemory()Gets the available memory for environments to allocate.AdbGraphClientConfigurationgetConfig()The configuration of this client.doublegetCurrentMemory()Gets the current environment's allocated memory.java.net.URIgetEndpoint()The endpoint used by this client.EnvironmentStatusgetEnvironmentStatus()Fetches theEnvironmentStatusof the Autonomous Database.ServerInstancegetPgxInstance()Gets the PGXServerInstanceobject of an attached environment which can be used to create a newPgxSessionfor in-memory graph analysis.booleanisAttached()Checks if the Autonomous Database is currently attached to an environment.JobrestartEnvironment()Starts re-attaching the Autonomous Database to a new environment.JobstartEnvironment(int memory)Starts attaching the Autonomous Database to a new environment.JobstopEnvironment()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 theEnvironmentStatusof the Autonomous Database.- Returns:
- the
EnvironmentStatusof 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
Jobwhich completes once attachment operation completes. - Throws:
java.lang.IllegalStateException- if the Autonomous Database is currently not inEnvironmentStatus.DETACHEDstate
-
stopEnvironment
public Job stopEnvironment()
Starts detaching the Autonomous Database from the current environment. Note: all in-memory data will be lost- Returns:
- a
Jobwhich completes once detachment operation completes. - Throws:
java.lang.IllegalStateException- if the Autonomous Database is currently not inEnvironmentStatus.ATTACHEDstate
-
restartEnvironment
public Job restartEnvironment()
Starts re-attaching the Autonomous Database to a new environment.- Returns:
- a
Jobwhich completes once re-attachment operation completes. - Throws:
java.lang.IllegalStateException- if the Autonomous Database is currently not inEnvironmentStatus.ATTACHEDstate
-
getPgxInstance
public ServerInstance getPgxInstance()
Gets the PGXServerInstanceobject of an attached environment which can be used to create a newPgxSessionfor in-memory graph analysis.- Returns:
- the PGX
ServerInstanceof 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:
closein 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.
-
-