public static class AppProfile.SingleClusterRoutingPolicy implements AppProfile.RoutingPolicy
A RoutingPolicy that routes all requests to a specific cluster.
Implements
AppProfile.RoutingPolicyStatic Methods
fromProto(AppProfile.SingleClusterRouting proto)
public static AppProfile.SingleClusterRoutingPolicy fromProto(AppProfile.SingleClusterRouting proto)
Wraps a protobuf response.
This method is considered an internal implementation detail and not meant to be used by applications.
Parameter | |
---|---|
Name | Description |
proto | com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting |
Returns | |
---|---|
Type | Description |
AppProfile.SingleClusterRoutingPolicy |
of(String clusterId)
public static AppProfile.SingleClusterRoutingPolicy of(String clusterId)
Builds a new instance of the routing policy that will send all requests to the specified cluster.
Please note that atomic row transactions will be disabled.
Parameter | |
---|---|
Name | Description |
clusterId | String |
Returns | |
---|---|
Type | Description |
AppProfile.SingleClusterRoutingPolicy |
of(String clusterId, boolean allowTransactionWrites)
public static AppProfile.SingleClusterRoutingPolicy of(String clusterId, boolean allowTransactionWrites)
Builds a new instance of the routing policy that will send all requests to the specified cluster. This variant enables the ability to re-enable single row transactions at the cost of consistency.
Please see the online documentation for more details.
Parameters | |
---|---|
Name | Description |
clusterId | String |
allowTransactionWrites | boolean |
Returns | |
---|---|
Type | Description |
AppProfile.SingleClusterRoutingPolicy |
Methods
equals(Object o)
public boolean equals(Object o)
Parameter | |
---|---|
Name | Description |
o | Object |
Returns | |
---|---|
Type | Description |
boolean |
getAllowTransactionalWrites()
public boolean getAllowTransactionalWrites()
Checks if transactional writes are enabled.
Returns | |
---|---|
Type | Description |
boolean |
getClusterId()
public String getClusterId()
Gets the target cluster of this policy.
Returns | |
---|---|
Type | Description |
String |
hashCode()
public int hashCode()
Returns | |
---|---|
Type | Description |
int |