CosmosContainerProactiveInitConfig Class
- java.
lang. Object - com.
azure. cosmos. CosmosContainerProactiveInitConfig
- com.
public final class CosmosContainerProactiveInitConfig
Encapsulates the list of container identities and no. of proactive connection regions.
Method Summary
Modifier and Type | Method and Description |
---|---|
List<Cosmos |
getCosmosContainerIdentities()
Gets the list of container identities. |
int |
getProactiveConnectionRegionsCount()
Gets the no. |
String | toString() |
Methods inherited from java.lang.Object
Method Details
getCosmosContainerIdentities
public List
Gets the list of container identities. The returned list is protected against modifications.
Returns:
getProactiveConnectionRegionsCount
public int getProactiveConnectionRegionsCount()
Gets the no. of proactive connection regions
Proactive connection regions constitute those regions where replicas of container partitions have connections opened to prior to performing any workload on the container. This way the latency associated with opening connections does not impact the latency associated with performing workloads on the container. These connections are opened synchronously when the CosmosClient/CosmosAsyncClient is built.
These proactive connection regions are a subset of the preferred regions configured through the CosmosClientBuilder. The first getProactiveConnectionRegionsCount() read regions from preferred regions are picked. In this context a write-region could also be a read-region but not vice-versa.
Consider a multi-master account with client configured with preferred regions - "US West" (write-region) and "US East" (write-region)
- If the no. of proactive regions is set to two, connections to "US West" and "US East" are opened proactively.
- If the no. of proactive regions is set to one, connections to "US West" are opened proactively.
Consider a single-master account with client configured with preferred regions - "US West" (read-region), "US East" (read-region) and "West Europe" (write-region)
- If the no. of proactive regions is set to two, connections to "US West" and "US East" are opened proactively. If your application has workloads which are write-heavy it is important to prioritize write regions in the list of preferred regions.
Returns:
toString
public String toString()
Overrides:
CosmosContainerProactiveInitConfig.toString()Applies to
Azure SDK for Java