Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

feat: [Cloud Memorystore for Redis] Support Multiple Read Replicas when creating Instance #547

Merged
merged 2 commits into from Nov 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -695,7 +695,8 @@ public final UnaryCallable<CreateInstanceRequest, Operation> createInstanceCalla
* @param updateMask Required. Mask of fields to update. At least one path must be supplied in
* this field. The elements of the repeated paths field may only include these fields from
* [Instance][google.cloud.redis.v1.Instance]:
* <p>&#42; `displayName` &#42; `labels` &#42; `memorySizeGb` &#42; `redisConfig`
* <p>&#42; `displayName` &#42; `labels` &#42; `memorySizeGb` &#42; `redisConfig` &#42;
* `replica_count`
* @param instance Required. Update description. Only fields specified in update_mask are updated.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
Expand Down Expand Up @@ -1167,7 +1168,7 @@ public final UnaryCallable<ExportInstanceRequest, Operation> exportInstanceCalla

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Initiates a failover of the master node to current replica node for a specific STANDARD tier
* Initiates a failover of the primary node to current replica node for a specific STANDARD tier
* Cloud Memorystore for Redis instance.
*
* <p>Sample code:
Expand Down Expand Up @@ -1200,7 +1201,7 @@ public final OperationFuture<Instance, OperationMetadata> failoverInstanceAsync(

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Initiates a failover of the master node to current replica node for a specific STANDARD tier
* Initiates a failover of the primary node to current replica node for a specific STANDARD tier
* Cloud Memorystore for Redis instance.
*
* <p>Sample code:
Expand Down Expand Up @@ -1233,7 +1234,7 @@ public final OperationFuture<Instance, OperationMetadata> failoverInstanceAsync(

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Initiates a failover of the master node to current replica node for a specific STANDARD tier
* Initiates a failover of the primary node to current replica node for a specific STANDARD tier
* Cloud Memorystore for Redis instance.
*
* <p>Sample code:
Expand All @@ -1258,7 +1259,7 @@ public final OperationFuture<Instance, OperationMetadata> failoverInstanceAsync(

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Initiates a failover of the master node to current replica node for a specific STANDARD tier
* Initiates a failover of the primary node to current replica node for a specific STANDARD tier
* Cloud Memorystore for Redis instance.
*
* <p>Sample code:
Expand All @@ -1283,7 +1284,7 @@ public final OperationFuture<Instance, OperationMetadata> failoverInstanceAsync(

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Initiates a failover of the master node to current replica node for a specific STANDARD tier
* Initiates a failover of the primary node to current replica node for a specific STANDARD tier
* Cloud Memorystore for Redis instance.
*
* <p>Sample code:
Expand Down
Expand Up @@ -15,7 +15,9 @@
*/

/**
* The interfaces provided are listed below, along with usage samples.
* A client to Google Cloud Memorystore for Redis API
*
* <p>The interfaces provided are listed below, along with usage samples.
*
* <p>======================= CloudRedisClient =======================
*
Expand Down
Expand Up @@ -57,7 +57,7 @@
* `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
* </ul>
*
* <p>Note that location_id must be refering to a GCP `region`; for example:
* <p>Note that location_id must be referring to a GCP `region`; for example:
*
* <ul>
* <li>`projects/redpepper-1290/locations/us-central1/instances/my-redis`
Expand Down Expand Up @@ -472,7 +472,7 @@ public final UnaryCallable<GetInstanceRequest, Instance> getInstanceCallable() {
*
* <p>The creation is executed asynchronously and callers may check the returned operation to
* track its progress. Once the operation is completed the Redis instance will be fully
* functional. Completed longrunning.Operation will contain the new instance object in the
* functional. The completed longrunning.Operation will contain the new instance object in the
* response field.
*
* <p>The returned operation is automatically deleted after a few hours, so there is no need to
Expand Down Expand Up @@ -524,7 +524,7 @@ public final OperationFuture<Instance, Any> createInstanceAsync(
*
* <p>The creation is executed asynchronously and callers may check the returned operation to
* track its progress. Once the operation is completed the Redis instance will be fully
* functional. Completed longrunning.Operation will contain the new instance object in the
* functional. The completed longrunning.Operation will contain the new instance object in the
* response field.
*
* <p>The returned operation is automatically deleted after a few hours, so there is no need to
Expand Down Expand Up @@ -576,7 +576,7 @@ public final OperationFuture<Instance, Any> createInstanceAsync(
*
* <p>The creation is executed asynchronously and callers may check the returned operation to
* track its progress. Once the operation is completed the Redis instance will be fully
* functional. Completed longrunning.Operation will contain the new instance object in the
* functional. The completed longrunning.Operation will contain the new instance object in the
* response field.
*
* <p>The returned operation is automatically deleted after a few hours, so there is no need to
Expand Down Expand Up @@ -612,7 +612,7 @@ public final OperationFuture<Instance, Any> createInstanceAsync(CreateInstanceRe
*
* <p>The creation is executed asynchronously and callers may check the returned operation to
* track its progress. Once the operation is completed the Redis instance will be fully
* functional. Completed longrunning.Operation will contain the new instance object in the
* functional. The completed longrunning.Operation will contain the new instance object in the
* response field.
*
* <p>The returned operation is automatically deleted after a few hours, so there is no need to
Expand Down Expand Up @@ -649,7 +649,7 @@ public final OperationFuture<Instance, Any> createInstanceAsync(CreateInstanceRe
*
* <p>The creation is executed asynchronously and callers may check the returned operation to
* track its progress. Once the operation is completed the Redis instance will be fully
* functional. Completed longrunning.Operation will contain the new instance object in the
* functional. The completed longrunning.Operation will contain the new instance object in the
* response field.
*
* <p>The returned operation is automatically deleted after a few hours, so there is no need to
Expand Down Expand Up @@ -696,7 +696,8 @@ public final UnaryCallable<CreateInstanceRequest, Operation> createInstanceCalla
* @param updateMask Required. Mask of fields to update. At least one path must be supplied in
* this field. The elements of the repeated paths field may only include these fields from
* [Instance][google.cloud.redis.v1beta1.Instance]:
* <p>&#42; `displayName` &#42; `labels` &#42; `memorySizeGb` &#42; `redisConfig`
* <p>&#42; `displayName` &#42; `labels` &#42; `memorySizeGb` &#42; `redisConfig` &#42;
* `replica_count`
* @param instance Required. Update description. Only fields specified in update_mask are updated.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
Expand Down Expand Up @@ -1164,7 +1165,7 @@ public final UnaryCallable<ExportInstanceRequest, Operation> exportInstanceCalla

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Initiates a failover of the master node to current replica node for a specific STANDARD tier
* Initiates a failover of the primary node to current replica node for a specific STANDARD tier
* Cloud Memorystore for Redis instance.
*
* <p>Sample code:
Expand Down Expand Up @@ -1197,7 +1198,7 @@ public final OperationFuture<Instance, Any> failoverInstanceAsync(

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Initiates a failover of the master node to current replica node for a specific STANDARD tier
* Initiates a failover of the primary node to current replica node for a specific STANDARD tier
* Cloud Memorystore for Redis instance.
*
* <p>Sample code:
Expand Down Expand Up @@ -1230,7 +1231,7 @@ public final OperationFuture<Instance, Any> failoverInstanceAsync(

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Initiates a failover of the master node to current replica node for a specific STANDARD tier
* Initiates a failover of the primary node to current replica node for a specific STANDARD tier
* Cloud Memorystore for Redis instance.
*
* <p>Sample code:
Expand All @@ -1255,7 +1256,7 @@ public final OperationFuture<Instance, Any> failoverInstanceAsync(

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Initiates a failover of the master node to current replica node for a specific STANDARD tier
* Initiates a failover of the primary node to current replica node for a specific STANDARD tier
* Cloud Memorystore for Redis instance.
*
* <p>Sample code:
Expand All @@ -1280,7 +1281,7 @@ public final OperationFuture<Instance, Any> failoverInstanceAsync(

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Initiates a failover of the master node to current replica node for a specific STANDARD tier
* Initiates a failover of the primary node to current replica node for a specific STANDARD tier
* Cloud Memorystore for Redis instance.
*
* <p>Sample code:
Expand Down
Expand Up @@ -15,7 +15,9 @@
*/

/**
* The interfaces provided are listed below, along with usage samples.
* A client to Google Cloud Memorystore for Redis API
*
* <p>The interfaces provided are listed below, along with usage samples.
*
* <p>======================= CloudRedisClient =======================
*
Expand All @@ -34,7 +36,7 @@
* `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
* </ul>
*
* <p>Note that location_id must be refering to a GCP `region`; for example:
* <p>Note that location_id must be referring to a GCP `region`; for example:
*
* <ul>
* <li>`projects/redpepper-1290/locations/us-central1/instances/my-redis`
Expand Down
Expand Up @@ -35,6 +35,7 @@
import com.google.protobuf.Timestamp;
import io.grpc.StatusRuntimeException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -194,6 +195,10 @@ public void getInstanceTest() throws Exception {
.setMemorySizeGb(34199707)
.setAuthorizedNetwork("authorizedNetwork1515554835")
.setPersistenceIamIdentity("persistenceIamIdentity1464017428")
.setReplicaCount(564075208)
.addAllNodes(new ArrayList<NodeInfo>())
.setReadEndpoint("readEndpoint294053195")
.setReadEndpointPort(-1676143102)
.build();
mockCloudRedis.addResponse(expectedResponse);

Expand Down Expand Up @@ -247,6 +252,10 @@ public void getInstanceTest2() throws Exception {
.setMemorySizeGb(34199707)
.setAuthorizedNetwork("authorizedNetwork1515554835")
.setPersistenceIamIdentity("persistenceIamIdentity1464017428")
.setReplicaCount(564075208)
.addAllNodes(new ArrayList<NodeInfo>())
.setReadEndpoint("readEndpoint294053195")
.setReadEndpointPort(-1676143102)
.build();
mockCloudRedis.addResponse(expectedResponse);

Expand Down Expand Up @@ -300,6 +309,10 @@ public void createInstanceTest() throws Exception {
.setMemorySizeGb(34199707)
.setAuthorizedNetwork("authorizedNetwork1515554835")
.setPersistenceIamIdentity("persistenceIamIdentity1464017428")
.setReplicaCount(564075208)
.addAllNodes(new ArrayList<NodeInfo>())
.setReadEndpoint("readEndpoint294053195")
.setReadEndpointPort(-1676143102)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -367,6 +380,10 @@ public void createInstanceTest2() throws Exception {
.setMemorySizeGb(34199707)
.setAuthorizedNetwork("authorizedNetwork1515554835")
.setPersistenceIamIdentity("persistenceIamIdentity1464017428")
.setReplicaCount(564075208)
.addAllNodes(new ArrayList<NodeInfo>())
.setReadEndpoint("readEndpoint294053195")
.setReadEndpointPort(-1676143102)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -434,6 +451,10 @@ public void updateInstanceTest() throws Exception {
.setMemorySizeGb(34199707)
.setAuthorizedNetwork("authorizedNetwork1515554835")
.setPersistenceIamIdentity("persistenceIamIdentity1464017428")
.setReplicaCount(564075208)
.addAllNodes(new ArrayList<NodeInfo>())
.setReadEndpoint("readEndpoint294053195")
.setReadEndpointPort(-1676143102)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -498,6 +519,10 @@ public void upgradeInstanceTest() throws Exception {
.setMemorySizeGb(34199707)
.setAuthorizedNetwork("authorizedNetwork1515554835")
.setPersistenceIamIdentity("persistenceIamIdentity1464017428")
.setReplicaCount(564075208)
.addAllNodes(new ArrayList<NodeInfo>())
.setReadEndpoint("readEndpoint294053195")
.setReadEndpointPort(-1676143102)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -562,6 +587,10 @@ public void upgradeInstanceTest2() throws Exception {
.setMemorySizeGb(34199707)
.setAuthorizedNetwork("authorizedNetwork1515554835")
.setPersistenceIamIdentity("persistenceIamIdentity1464017428")
.setReplicaCount(564075208)
.addAllNodes(new ArrayList<NodeInfo>())
.setReadEndpoint("readEndpoint294053195")
.setReadEndpointPort(-1676143102)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -626,6 +655,10 @@ public void importInstanceTest() throws Exception {
.setMemorySizeGb(34199707)
.setAuthorizedNetwork("authorizedNetwork1515554835")
.setPersistenceIamIdentity("persistenceIamIdentity1464017428")
.setReplicaCount(564075208)
.addAllNodes(new ArrayList<NodeInfo>())
.setReadEndpoint("readEndpoint294053195")
.setReadEndpointPort(-1676143102)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -690,6 +723,10 @@ public void exportInstanceTest() throws Exception {
.setMemorySizeGb(34199707)
.setAuthorizedNetwork("authorizedNetwork1515554835")
.setPersistenceIamIdentity("persistenceIamIdentity1464017428")
.setReplicaCount(564075208)
.addAllNodes(new ArrayList<NodeInfo>())
.setReadEndpoint("readEndpoint294053195")
.setReadEndpointPort(-1676143102)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -754,6 +791,10 @@ public void failoverInstanceTest() throws Exception {
.setMemorySizeGb(34199707)
.setAuthorizedNetwork("authorizedNetwork1515554835")
.setPersistenceIamIdentity("persistenceIamIdentity1464017428")
.setReplicaCount(564075208)
.addAllNodes(new ArrayList<NodeInfo>())
.setReadEndpoint("readEndpoint294053195")
.setReadEndpointPort(-1676143102)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -820,6 +861,10 @@ public void failoverInstanceTest2() throws Exception {
.setMemorySizeGb(34199707)
.setAuthorizedNetwork("authorizedNetwork1515554835")
.setPersistenceIamIdentity("persistenceIamIdentity1464017428")
.setReplicaCount(564075208)
.addAllNodes(new ArrayList<NodeInfo>())
.setReadEndpoint("readEndpoint294053195")
.setReadEndpointPort(-1676143102)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down