Package oracle.pgx.api.admin
Interface Control
-
public interface Control
Encapsulates all administrative functions of PGX
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ALL_PATHS_PROXY_MAP_KEY
static java.lang.String
COLLECTION_PROXY_MAP_KEY
static java.lang.String
COMPONENTS_PROXY_MAP_KEY
static java.lang.String
FUTURE_MAP_KEY
static java.lang.String
MAP_PROXY_MAP_KEY
static java.lang.String
PGQL_RESULTS_KEY
static java.lang.String
PROPERTY_PROXY_MAP_KEY
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description PgxFuture<com.fasterxml.jackson.databind.JsonNode>
addHost(java.lang.String hostname)
Adds a new follower to an existing PGX.D cluster.void
addUserData(java.lang.String sessionId, java.lang.String key, java.lang.Object data)
add session-private user data to a session.PgxFuture<oracle.pgx.common.pojo.admin.CacheStatistics>
freeCachedMemory()
Trigger memory cleanup to free unused graphs if RELEASE_MEMORY_THRESHOLD is reachedPgxFuture<oracle.pgx.common.pojo.admin.CacheStatistics>
freeCachedMemory(double threshold)
Trigger memory cleanup to free unused graphs if threshold is reachedPgxFuture<oracle.pgx.common.VersionInfo>
getExtendedVersion()
Gets an extended version.PgxFuture<java.util.Map<PgxConfig.Field,java.lang.Object>>
getPgxConfig()
Gets the pgx config.default PgxFuture<PgxConfig>
getPgxConfigObject()
Gets the pgx config asPgxConfig
objectPgxFuture<oracle.pgx.common.pojo.admin.ResourceElasticityStatus>
getResourceElasticityStatus()
Get the status of the cluster regarding elasticity-related resources.PgxFuture<com.fasterxml.jackson.databind.JsonNode>
getServerState()
Gets the server state.PgxFuture<java.util.Set<PgxGenericPermission>>
getSystemPermissions()
Get the roles of the current user.java.lang.Object
getUserData(SessionContext sessionContext, java.lang.String key)
get session-private user data by key.PgxFuture<java.lang.String>
getUsername()
Get the name of the current user.PgxFuture<java.util.Set<java.lang.String>>
getUserRoles()
Get the roles of the current user.PgxFuture<java.lang.String>
getVersion()
PgxFuture<java.lang.Boolean>
isGraphPreloadingDone()
Check if the preloading of the graphs is finishedPgxFuture<java.lang.Boolean>
isReady()
Check if the engine is ready to accept new requestsPgxFuture<java.lang.Boolean>
isRunning()
Check if the engine is currently upPgxFuture<java.lang.Void>
killSession(java.lang.String sessionId)
Kill session.PgxFuture<com.fasterxml.jackson.databind.JsonNode>
removeHost(java.lang.String hostname)
Removes a follower from an existing PGX.D cluster.PgxFuture<java.lang.Void>
setSessionIdleTimeout(java.lang.String sessionId, long idleTimeout, java.util.concurrent.TimeUnit unit)
updates the session with idle timeoutPgxFuture<java.lang.Void>
setSessionMaxMemorySize(java.lang.String sessionId, int size, oracle.pgx.common.MemoryUnit unit)
Set the maximum memory limit for the given session.PgxFuture<java.lang.Boolean>
shutdown(long timeout, java.util.concurrent.TimeUnit unit)
gracefully shuts down the engine and cleans up resources.PgxFuture<java.lang.Void>
shutdownNow()
forces the engine to stop and clean up resources.PgxFuture<java.lang.Void>
shutdownNowIfRunning()
PgxFuture<java.lang.Void>
start()
PgxFuture<java.lang.Void>
start(java.io.InputStream config)
PgxFuture<java.lang.Void>
start(java.lang.String json)
PgxFuture<java.lang.Void>
start(java.lang.String json, java.lang.String keystorePath, char[] keystorePassword)
PgxFuture<java.lang.Void>
start(java.util.Map<PgxConfig.Field,java.lang.Object> config)
default PgxFuture<java.lang.Void>
start(PgxConfig config)
PgxFuture<java.lang.Void>
unpinGraph(java.lang.String graphName)
Unpins the specified published graph so that if no session uses any of its snapshot, it can be removed.PgxFuture<java.lang.Void>
updateMaxAttainableResources(int memorySize, oracle.pgx.common.MemoryUnit memoryUnit)
Updates the maximum attainable resources the cluster can expect to grow to by joining additional machines.PgxFuture<java.lang.Void>
updatePgxConfig(java.io.InputStream config)
Replaces the current PGX config with the given configuration.PgxFuture<java.lang.Void>
updatePgxConfig(java.lang.String json)
Replaces the current PGX config with the given configuration.PgxFuture<java.lang.Void>
updatePgxConfig(java.util.Map<PgxConfig.Field,java.lang.Object> config)
Replaces the current PGX config with the given configuration.default PgxFuture<java.lang.Void>
updatePgxConfig(PgxConfig config)
Replaces the current PGX config with the given configuration.
-
-
-
Field Detail
-
FUTURE_MAP_KEY
static final java.lang.String FUTURE_MAP_KEY
- See Also:
- Constant Field Values
-
PROPERTY_PROXY_MAP_KEY
static final java.lang.String PROPERTY_PROXY_MAP_KEY
- See Also:
- Constant Field Values
-
ALL_PATHS_PROXY_MAP_KEY
static final java.lang.String ALL_PATHS_PROXY_MAP_KEY
- See Also:
- Constant Field Values
-
COLLECTION_PROXY_MAP_KEY
static final java.lang.String COLLECTION_PROXY_MAP_KEY
- See Also:
- Constant Field Values
-
COMPONENTS_PROXY_MAP_KEY
static final java.lang.String COMPONENTS_PROXY_MAP_KEY
- See Also:
- Constant Field Values
-
MAP_PROXY_MAP_KEY
static final java.lang.String MAP_PROXY_MAP_KEY
- See Also:
- Constant Field Values
-
PGQL_RESULTS_KEY
static final java.lang.String PGQL_RESULTS_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getVersion
PgxFuture<java.lang.String> getVersion()
-
getExtendedVersion
PgxFuture<oracle.pgx.common.VersionInfo> getExtendedVersion()
Gets an extended version.- Returns:
- VersionInfo object
-
getPgxConfig
PgxFuture<java.util.Map<PgxConfig.Field,java.lang.Object>> getPgxConfig()
Gets the pgx config.- Returns:
- current PGX server configuration as JSON string
-
getPgxConfigObject
default PgxFuture<PgxConfig> getPgxConfigObject()
Gets the pgx config asPgxConfig
object- Returns:
- current PGX server configuration
-
start
PgxFuture<java.lang.Void> start()
-
start
PgxFuture<java.lang.Void> start(java.util.Map<PgxConfig.Field,java.lang.Object> config)
-
start
PgxFuture<java.lang.Void> start(java.io.InputStream config)
-
start
PgxFuture<java.lang.Void> start(java.lang.String json)
-
start
PgxFuture<java.lang.Void> start(java.lang.String json, java.lang.String keystorePath, char[] keystorePassword)
-
isRunning
PgxFuture<java.lang.Boolean> isRunning()
Check if the engine is currently up- Returns:
- true if engine is currently running and using less than RUNNING_MEMORY_USAGE_RATIO, false otherwise
-
isReady
PgxFuture<java.lang.Boolean> isReady()
Check if the engine is ready to accept new requests- Returns:
- true if engine is using less than READINESS_MEMORY_USAGE_RATIO , false otherwise
-
isGraphPreloadingDone
PgxFuture<java.lang.Boolean> isGraphPreloadingDone()
Check if the preloading of the graphs is finished- Returns:
- true if the graph preloading is done, false otherwise
-
shutdownNowIfRunning
PgxFuture<java.lang.Void> shutdownNowIfRunning()
-
shutdown
PgxFuture<java.lang.Boolean> shutdown(long timeout, java.util.concurrent.TimeUnit unit)
gracefully shuts down the engine and cleans up resources. All currently enqueued tasks will be worked off prior shut down, new incoming requests get rejected. This call blocks until shut down is complete or timed out.- Returns:
- true if gracefully shut down. false if timed out before shut down.
-
shutdownNow
PgxFuture<java.lang.Void> shutdownNow()
forces the engine to stop and clean up resources. Currently running tasks are interrupted. New incoming requests get rejected.
Throws an exception when current tasks didn't finish after a short grace period.
-
freeCachedMemory
PgxFuture<oracle.pgx.common.pojo.admin.CacheStatistics> freeCachedMemory()
Trigger memory cleanup to free unused graphs if RELEASE_MEMORY_THRESHOLD is reached
-
freeCachedMemory
PgxFuture<oracle.pgx.common.pojo.admin.CacheStatistics> freeCachedMemory(double threshold)
Trigger memory cleanup to free unused graphs if threshold is reached
-
unpinGraph
PgxFuture<java.lang.Void> unpinGraph(java.lang.String graphName)
Unpins the specified published graph so that if no session uses any of its snapshot, it can be removed.- Parameters:
graphName
- name of the published graph to unpin
-
getServerState
@BetaApi PgxFuture<com.fasterxml.jackson.databind.JsonNode> getServerState()
Gets the server state.- Returns:
- server inspection information
- Since:
- 2.7.0
-
killSession
PgxFuture<java.lang.Void> killSession(java.lang.String sessionId)
Kill session.- Parameters:
sessionId
- the session to be killed
-
setSessionIdleTimeout
PgxFuture<java.lang.Void> setSessionIdleTimeout(java.lang.String sessionId, long idleTimeout, java.util.concurrent.TimeUnit unit)
updates the session with idle timeout- Parameters:
sessionId
- the session to be mutatedidleTimeout
- if notnegative
, tries to overwrite session idle timeoutunit
- time unit of idleTimeout
-
addUserData
void addUserData(java.lang.String sessionId, java.lang.String key, java.lang.Object data)
add session-private user data to a session. The data gets freed once the session dies. The data can later be retrieved by the given key usinggetUserData(SessionContext, String)
. If data with the same key already exists, it will be overwritten.This method is thread safe.
- Parameters:
sessionId
- the ID of the target sessionkey
-data
-- Throws:
java.util.concurrent.RejectedExecutionException
- if no such session existsjava.lang.IllegalStateException
- if engine is not running
-
getUserData
java.lang.Object getUserData(SessionContext sessionContext, java.lang.String key)
get session-private user data by key.- Parameters:
sessionContext
- context of the session the data was previously added tokey
-- Returns:
- the user data associated with given key,
null
if no such data was set. - Throws:
java.util.concurrent.RejectedExecutionException
- if no such session existsjava.lang.IllegalStateException
- if engine is not running
-
addHost
PgxFuture<com.fasterxml.jackson.databind.JsonNode> addHost(java.lang.String hostname)
Adds a new follower to an existing PGX.D cluster. Only one follower can be joining at a time. The request is propagated to all existing machines in the cluster to prepare them for hand-shaking with the new machine. The response contains a list of existing host names in the cluster. Can be invoked repeatedly with the same hostname until the hostname appears in the response, which means the follower successfully joined. Only implemented in distributed mode.- Parameters:
hostname
- hostname of the new follower to join the cluster- Returns:
- json array containing existing host names in the cluster
- Throws:
java.util.concurrent.RejectedExecutionException
- if there is already another follower joining or if the joining operation failed- Since:
- 24.1.0
-
removeHost
PgxFuture<com.fasterxml.jackson.databind.JsonNode> removeHost(java.lang.String hostname)
Removes a follower from an existing PGX.D cluster. Only one follower can be leaving at a time. The request is propagated to all existing machines in the cluster to prepare them for severing the connections with the machine. The cluster must not hold any data (graphs, frames, collections, ...) for a follower to be able to leave. The response contains a list of current host names in the cluster. Can be invoked repeatedly with the same hostname until the hostname is no longer in the response, which means the follower successfully left. Only implemented in distributed mode.- Parameters:
hostname
- hostname of the follower to leave the cluster- Returns:
- json array containing current host names in the cluster
- Throws:
java.util.concurrent.RejectedExecutionException
- if there is already another follower leaving or if the leaving operation failed- Since:
- 24.1.0
-
updatePgxConfig
default PgxFuture<java.lang.Void> updatePgxConfig(PgxConfig config)
Replaces the current PGX config with the given configuration. This only affects static permissions (i.e. non-graph) and redaction rules for pre-loaded graphs. Existing permissions on graphs and frames will not be changed.- Parameters:
config
- the new PGX config- Returns:
- Since:
- 20.1.0
-
updatePgxConfig
PgxFuture<java.lang.Void> updatePgxConfig(java.util.Map<PgxConfig.Field,java.lang.Object> config)
Replaces the current PGX config with the given configuration. This only affects static permissions (i.e. non-graph) and redaction rules for pre-loaded graphs. Existing permissions on graphs and frames will not be changed.- Parameters:
config
- the new PGX config- Returns:
- Since:
- 20.1.0
-
updatePgxConfig
PgxFuture<java.lang.Void> updatePgxConfig(java.io.InputStream config)
Replaces the current PGX config with the given configuration. This only affects static permissions (i.e. non-graph) and redaction rules for pre-loaded graphs. Existing permissions on graphs and frames will not be changed.- Parameters:
config
- stream that can be read to a new PGX config- Returns:
- Since:
- 20.1.0
-
updatePgxConfig
PgxFuture<java.lang.Void> updatePgxConfig(java.lang.String json)
Replaces the current PGX config with the given configuration. This only affects static permissions (i.e. non-graph) and redaction rules for pre-loaded graphs. Existing permissions on graphs and frames will not be changed.- Parameters:
json
- JSON string representing the new PGX config- Returns:
- Since:
- 20.1.0
-
setSessionMaxMemorySize
PgxFuture<java.lang.Void> setSessionMaxMemorySize(java.lang.String sessionId, int size, oracle.pgx.common.MemoryUnit unit)
Set the maximum memory limit for the given session.- Parameters:
sessionId
- on which session to apply the memory limitsize
- memory limit to be set relative to the provided MemoryUnitunit
- the MemoryUnit to use for the given size Only supports MemoryUnit.MEGABYTE, MemoryUnit.GIGABYTE, and MemoryUnit.TERABYTE Requires SERVER_MANAGE permission- Since:
- 20.2.1
-
updateMaxAttainableResources
PgxFuture<java.lang.Void> updateMaxAttainableResources(int memorySize, oracle.pgx.common.MemoryUnit memoryUnit)
Updates the maximum attainable resources the cluster can expect to grow to by joining additional machines. For the memory resources, setting the value lower or equal than the sum of physical memory of the existing machines in the cluster signals the cluster that no further growth is currently possible, however it does not require the cluster to shrink. Only implemented in distributed mode.- Parameters:
memorySize
- new maximum attainable memory limit set relative to the provided MemoryUnitmemoryUnit
- the MemoryUnit to use for the given memorySize Only supports MemoryUnit.MEGABYTE, MemoryUnit.GIGABYTE, and MemoryUnit.TERABYTE- Since:
- 24.1.0
-
getUsername
PgxFuture<java.lang.String> getUsername()
Get the name of the current user. Returnsnull
in embedded mode- Returns:
- the name of the current user
- Since:
- 21.3.0
-
getUserRoles
PgxFuture<java.util.Set<java.lang.String>> getUserRoles()
Get the roles of the current user. Returnsnull
in embedded mode- Returns:
- the roles of the current user
- Since:
- 21.3.0
-
getSystemPermissions
PgxFuture<java.util.Set<PgxGenericPermission>> getSystemPermissions()
Get the roles of the current user. Returnsnull
in embedded mode- Returns:
- the roles of the current user
- Since:
- 21.3.0
-
getResourceElasticityStatus
PgxFuture<oracle.pgx.common.pojo.admin.ResourceElasticityStatus> getResourceElasticityStatus()
Get the status of the cluster regarding elasticity-related resources. Only implemented in distributed mode.- Returns:
- the resource elasticity status
- Since:
- 24.1.0
-
-