Package oracle.pgx.api
Class ElasticityController
- java.lang.Object
-
- oracle.pgx.api.ElasticityController
-
public class ElasticityController extends java.lang.Object
A helper class that is able is call the elasticity-related endpoints for PGX.D.
-
-
Constructor Summary
Constructors Constructor Description ElasticityController(PgxFuture<Control> control)
Builds a ElasticityController given a PgxFuture<Control> object
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.fasterxml.jackson.databind.JsonNode
addHost(java.lang.String hostname)
Adds a new follower to the cluster.oracle.pgx.common.pojo.admin.ResourceElasticityStatus
getResourceElasticityStatus()
Returns various information for the state of the PGX.D cluster regarding elasticity (e.g.com.fasterxml.jackson.databind.JsonNode
removeHost(java.lang.String hostname)
Removes a follower from the cluster.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.
-
-
-
Method Detail
-
getResourceElasticityStatus
public oracle.pgx.common.pojo.admin.ResourceElasticityStatus getResourceElasticityStatus() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
Returns various information for the state of the PGX.D cluster regarding elasticity (e.g. available memory, requested memory, ...).- Returns:
- ResourceElasticityStatus object contains the elasticity status
- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
-
updateMaxAttainableResources
public java.lang.Void updateMaxAttainableResources(int memorySize, oracle.pgx.common.MemoryUnit memoryUnit) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
Updates the maximum attainable resources the cluster can expect to grow to by joining additional machines.- Parameters:
memorySize
- new maximum attainable memory limit set relative to the provided MemoryUnitmemoryUnit
- the MemoryUnit to use for the given memorySize- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
-
addHost
public com.fasterxml.jackson.databind.JsonNode addHost(java.lang.String hostname) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
Adds a new follower to the cluster.- Parameters:
hostname
- hostname of the new follower to join the cluster- Returns:
- json array containing existing host names in the cluster
- Throws:
RejectedExecutionException
- if there is already another follower joining or if the joining operation failedjava.lang.InterruptedException
java.util.concurrent.ExecutionException
-
removeHost
public com.fasterxml.jackson.databind.JsonNode removeHost(java.lang.String hostname) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
Removes a follower from the cluster.- Parameters:
hostname
- hostname of the follower to leave the cluster- Returns:
- json array containing current host names in the cluster
- Throws:
RejectedExecutionException
- if there is already another follower leaving or if the leaving operation failedjava.lang.InterruptedException
java.util.concurrent.ExecutionException
-
-