Package io.stargate.sdk
Class ManagedServiceDeployment<SERVICE extends Service>
java.lang.Object
io.stargate.sdk.ManagedServiceDeployment<SERVICE>
- Type Parameters:
SERVICE- the type of the service in use
The http client implements:
- load balancing in healthy nodes of the same datacenter
- Fail-over across datacenter when no node available
-
Constructor Summary
ConstructorsConstructorDescriptionManagedServiceDeployment(ServiceDeployment<SERVICE> sDeploy) Initialize a managed topology from its definition. -
Method Summary
Modifier and TypeMethodDescriptionvoidFailing over from one DC to anothervoidFailing over from one Stargate node to another.Get available DC.Gets datacentersProvide the current Datacenter client.Get available DC.Retrieve an Api Rest URL still available in current DC or fail-over.Get the ApiTokenProvider of current DC.toString()voiduseDataCenter(String datacenter) Implementing fail-over cross DC for API and CqlSession when available.
-
Constructor Details
-
ManagedServiceDeployment
Initialize a managed topology from its definition.- Parameters:
sDeploy- deployment
-
-
Method Details
-
useDataCenter
Implementing fail-over cross DC for API and CqlSession when available.- Parameters:
datacenter- target datacenter
-
getLocalDatacenterClient
Provide the current Datacenter client.- Returns:
- the client for the current DC
-
lookupToken
Get the ApiTokenProvider of current DC. The resource should have been picked first and localDC set in StargateClient.- Returns:
- a token
-
lookupStargateNode
Retrieve an Api Rest URL still available in current DC or fail-over.- Returns:
- an APi Rest URL available
-
failOverDatacenter
public void failOverDatacenter()Failing over from one DC to another -
failOverStargateNode
Failing over from one Stargate node to another.- Parameters:
lb- current resource to be disabledt- source error
-
getDatacenters
Gets datacenters- Returns:
- value of datacenters
-
getAvailableDatacenters
Get available DC.- Returns:
- available dc
-
toString
-