Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regenerate bigtable client #4318

Merged
merged 1 commit into from
Jan 10, 2019
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import com.google.bigtable.v2.RowFilter;
import com.google.bigtable.v2.SampleRowKeysRequest;
import com.google.bigtable.v2.SampleRowKeysResponse;
import com.google.cloud.bigtable.data.v2.internal.NameUtil;
import com.google.bigtable.v2.TableName;
import com.google.protobuf.ByteString;
import com.google.protobuf.GeneratedMessageV3;
import io.grpc.Status;
Expand Down Expand Up @@ -101,8 +101,9 @@ public void readRowsTest() throws Exception {
ReadRowsResponse expectedResponse =
ReadRowsResponse.newBuilder().setLastScannedRowKey(lastScannedRowKey).build();
mockBigtable.addResponse(expectedResponse);
String tableName = NameUtil.formatTableName("[PROJECT]", "[INSTANCE]", "[TABLE]");
ReadRowsRequest request = ReadRowsRequest.newBuilder().setTableName(tableName).build();
TableName tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
ReadRowsRequest request =
ReadRowsRequest.newBuilder().setTableName(tableName.toString()).build();

MockStreamObserver<ReadRowsResponse> responseObserver = new MockStreamObserver<>();

Expand All @@ -119,8 +120,9 @@ public void readRowsTest() throws Exception {
public void readRowsExceptionTest() throws Exception {
StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
mockBigtable.addException(exception);
String tableName = NameUtil.formatTableName("[PROJECT]", "[INSTANCE]", "[TABLE]");
ReadRowsRequest request = ReadRowsRequest.newBuilder().setTableName(tableName).build();
TableName tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
ReadRowsRequest request =
ReadRowsRequest.newBuilder().setTableName(tableName.toString()).build();

MockStreamObserver<ReadRowsResponse> responseObserver = new MockStreamObserver<>();

Expand All @@ -145,9 +147,9 @@ public void sampleRowKeysTest() throws Exception {
SampleRowKeysResponse expectedResponse =
SampleRowKeysResponse.newBuilder().setRowKey(rowKey).setOffsetBytes(offsetBytes).build();
mockBigtable.addResponse(expectedResponse);
String tableName = NameUtil.formatTableName("[PROJECT]", "[INSTANCE]", "[TABLE]");
TableName tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
SampleRowKeysRequest request =
SampleRowKeysRequest.newBuilder().setTableName(tableName).build();
SampleRowKeysRequest.newBuilder().setTableName(tableName.toString()).build();

MockStreamObserver<SampleRowKeysResponse> responseObserver = new MockStreamObserver<>();

Expand All @@ -165,9 +167,9 @@ public void sampleRowKeysTest() throws Exception {
public void sampleRowKeysExceptionTest() throws Exception {
StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
mockBigtable.addException(exception);
String tableName = NameUtil.formatTableName("[PROJECT]", "[INSTANCE]", "[TABLE]");
TableName tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
SampleRowKeysRequest request =
SampleRowKeysRequest.newBuilder().setTableName(tableName).build();
SampleRowKeysRequest.newBuilder().setTableName(tableName.toString()).build();

MockStreamObserver<SampleRowKeysResponse> responseObserver = new MockStreamObserver<>();

Expand All @@ -191,7 +193,7 @@ public void mutateRowTest() {
MutateRowResponse expectedResponse = MutateRowResponse.newBuilder().build();
mockBigtable.addResponse(expectedResponse);

String tableName = NameUtil.formatTableName("[PROJECT]", "[INSTANCE]", "[TABLE]");
TableName tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
ByteString rowKey = ByteString.copyFromUtf8("122");
List<Mutation> mutations = new ArrayList<>();

Expand All @@ -202,7 +204,7 @@ public void mutateRowTest() {
Assert.assertEquals(1, actualRequests.size());
MutateRowRequest actualRequest = (MutateRowRequest) actualRequests.get(0);

Assert.assertEquals(tableName, actualRequest.getTableName());
Assert.assertEquals(tableName, TableName.parse(actualRequest.getTableName()));
Assert.assertEquals(rowKey, actualRequest.getRowKey());
Assert.assertEquals(mutations, actualRequest.getMutationsList());
Assert.assertTrue(
Expand All @@ -218,7 +220,7 @@ public void mutateRowExceptionTest() throws Exception {
mockBigtable.addException(exception);

try {
String tableName = NameUtil.formatTableName("[PROJECT]", "[INSTANCE]", "[TABLE]");
TableName tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
ByteString rowKey = ByteString.copyFromUtf8("122");
List<Mutation> mutations = new ArrayList<>();

Expand All @@ -234,10 +236,13 @@ public void mutateRowExceptionTest() throws Exception {
public void mutateRowsTest() throws Exception {
MutateRowsResponse expectedResponse = MutateRowsResponse.newBuilder().build();
mockBigtable.addResponse(expectedResponse);
String tableName = NameUtil.formatTableName("[PROJECT]", "[INSTANCE]", "[TABLE]");
TableName tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
List<MutateRowsRequest.Entry> entries = new ArrayList<>();
MutateRowsRequest request =
MutateRowsRequest.newBuilder().setTableName(tableName).addAllEntries(entries).build();
MutateRowsRequest.newBuilder()
.setTableName(tableName.toString())
.addAllEntries(entries)
.build();

MockStreamObserver<MutateRowsResponse> responseObserver = new MockStreamObserver<>();

Expand All @@ -255,10 +260,13 @@ public void mutateRowsTest() throws Exception {
public void mutateRowsExceptionTest() throws Exception {
StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
mockBigtable.addException(exception);
String tableName = NameUtil.formatTableName("[PROJECT]", "[INSTANCE]", "[TABLE]");
TableName tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
List<MutateRowsRequest.Entry> entries = new ArrayList<>();
MutateRowsRequest request =
MutateRowsRequest.newBuilder().setTableName(tableName).addAllEntries(entries).build();
MutateRowsRequest.newBuilder()
.setTableName(tableName.toString())
.addAllEntries(entries)
.build();

MockStreamObserver<MutateRowsResponse> responseObserver = new MockStreamObserver<>();

Expand All @@ -284,7 +292,7 @@ public void checkAndMutateRowTest() {
CheckAndMutateRowResponse.newBuilder().setPredicateMatched(predicateMatched).build();
mockBigtable.addResponse(expectedResponse);

String tableName = NameUtil.formatTableName("[PROJECT]", "[INSTANCE]", "[TABLE]");
TableName tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
ByteString rowKey = ByteString.copyFromUtf8("122");
RowFilter predicateFilter = RowFilter.newBuilder().build();
List<Mutation> trueMutations = new ArrayList<>();
Expand All @@ -298,7 +306,7 @@ public void checkAndMutateRowTest() {
Assert.assertEquals(1, actualRequests.size());
CheckAndMutateRowRequest actualRequest = (CheckAndMutateRowRequest) actualRequests.get(0);

Assert.assertEquals(tableName, actualRequest.getTableName());
Assert.assertEquals(tableName, TableName.parse(actualRequest.getTableName()));
Assert.assertEquals(rowKey, actualRequest.getRowKey());
Assert.assertEquals(predicateFilter, actualRequest.getPredicateFilter());
Assert.assertEquals(trueMutations, actualRequest.getTrueMutationsList());
Expand All @@ -316,7 +324,7 @@ public void checkAndMutateRowExceptionTest() throws Exception {
mockBigtable.addException(exception);

try {
String tableName = NameUtil.formatTableName("[PROJECT]", "[INSTANCE]", "[TABLE]");
TableName tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
ByteString rowKey = ByteString.copyFromUtf8("122");
RowFilter predicateFilter = RowFilter.newBuilder().build();
List<Mutation> trueMutations = new ArrayList<>();
Expand All @@ -335,7 +343,7 @@ public void readModifyWriteRowTest() {
ReadModifyWriteRowResponse expectedResponse = ReadModifyWriteRowResponse.newBuilder().build();
mockBigtable.addResponse(expectedResponse);

String tableName = NameUtil.formatTableName("[PROJECT]", "[INSTANCE]", "[TABLE]");
TableName tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
ByteString rowKey = ByteString.copyFromUtf8("122");
List<ReadModifyWriteRule> rules = new ArrayList<>();

Expand All @@ -346,7 +354,7 @@ public void readModifyWriteRowTest() {
Assert.assertEquals(1, actualRequests.size());
ReadModifyWriteRowRequest actualRequest = (ReadModifyWriteRowRequest) actualRequests.get(0);

Assert.assertEquals(tableName, actualRequest.getTableName());
Assert.assertEquals(tableName, TableName.parse(actualRequest.getTableName()));
Assert.assertEquals(rowKey, actualRequest.getRowKey());
Assert.assertEquals(rules, actualRequest.getRulesList());
Assert.assertTrue(
Expand All @@ -362,7 +370,7 @@ public void readModifyWriteRowExceptionTest() throws Exception {
mockBigtable.addException(exception);

try {
String tableName = NameUtil.formatTableName("[PROJECT]", "[INSTANCE]", "[TABLE]");
TableName tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
ByteString rowKey = ByteString.copyFromUtf8("122");
List<ReadModifyWriteRule> rules = new ArrayList<>();

Expand Down
41 changes: 28 additions & 13 deletions google-cloud-clients/google-cloud-bigtable/synth.metadata
Original file line number Diff line number Diff line change
@@ -1,27 +1,42 @@
{
"updateTime": "2019-01-10T08:35:06.355856Z",
"sources": [
{
"generator": {
"name": "artman",
"version": "0.16.5",
"dockerImage": "googleapis/artman@sha256:5a96c2c5c6f9570cc9556b63dc9ce1838777fd9166b5b64e43ad8e0ecee2fe2c"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "5a57f0c13a358b2b15452bf2d67453774a5f6d4f",
"internalRef": "221837528"
"sha": "fb44301b2b667c56a0f2a361a5a7d3709d5f6a69",
"internalRef": "228622745"
}
},
}
],
"destinations": [
{
"git": {
"name": "googleapis-private",
"remote": "https://github.com/googleapis/googleapis-private.git",
"sha": "6aa8e1a447bb8d0367150356a28cb4d3f2332641",
"internalRef": "221340946"
"client": {
"source": "googleapis",
"apiName": "bigtable",
"apiVersion": "v2",
"language": "java",
"generator": "gapic",
"config": "google/bigtable/artman_bigtable.yaml"
}
},
{
"generator": {
"name": "artman",
"version": "0.16.0",
"dockerImage": "googleapis/artman@sha256:90f9d15e9bad675aeecd586725bce48f5667ffe7d5fc4d1e96d51ff34304815b"
"client": {
"source": "googleapis",
"apiName": "bigtable-admin",
"apiVersion": "v2",
"language": "java",
"generator": "gapic",
"config": "google/bigtable/admin/artman_bigtableadmin.yaml"
}
}
]
}
}