diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 3e84f801da..f90025d043 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigtable.git", - "sha": "ae6a61063a5b640d70fd7d4444cd199066f7c8e3" + "sha": "b0e72a352679d5cb6c226e7ccc7ab80089941326" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "5a6f30b8bb7672cf237c4f75d5aa96bfba170e7f" + "sha": "6726988c677bb78385868bfc48dbfa2fe981d44a" } } ] diff --git a/.github/release-please.yml b/.github/release-please.yml index dce2c84509..8ca7f9cabc 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -1,2 +1,3 @@ +bumpMinorPreMajor: true +handleGHRelease: true releaseType: java-yoshi -bumpMinorPreMajor: true \ No newline at end of file diff --git a/.kokoro/release/publish_javadoc11.sh b/.kokoro/release/publish_javadoc11.sh index 48d59447b6..2fe27e2c83 100755 --- a/.kokoro/release/publish_javadoc11.sh +++ b/.kokoro/release/publish_javadoc11.sh @@ -49,6 +49,13 @@ pushd target/docfx-yml python3 -m docuploader create-metadata \ --name ${NAME} \ --version ${VERSION} \ + --xrefs devsite://java/gax \ + --xrefs devsite://java/google-cloud-core \ + --xrefs devsite://java/api-common \ + --xrefs devsite://java/proto-google-common-protos \ + --xrefs devsite://java/google-api-client \ + --xrefs devsite://java/google-http-client \ + --xrefs devsite://java/protobuf \ --language java # upload yml to production bucket diff --git a/CHANGELOG.md b/CHANGELOG.md index f640e9ee45..bdbe807eac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +### [1.24.1](https://www.github.com/googleapis/java-bigtable/compare/v1.24.0...v1.24.1) (2021-05-11) + + +### Bug Fixes + +* filter limit constant ([#787](https://www.github.com/googleapis/java-bigtable/issues/787)) ([04f8ad4](https://www.github.com/googleapis/java-bigtable/commit/04f8ad463d1fa9efe0ab941ee5f3d0794baed814)) +* fix flaky test ([#798](https://www.github.com/googleapis/java-bigtable/issues/798)) ([83e0e8c](https://www.github.com/googleapis/java-bigtable/commit/83e0e8cf2cdbc143c10ce0f8b053096d61d5686f)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v1.1.0 ([#805](https://www.github.com/googleapis/java-bigtable/issues/805)) ([a498687](https://www.github.com/googleapis/java-bigtable/commit/a498687d15dd9af35c57b0df6d08c87ef36833da)) + + +### Documentation + +* update the comments in Cloud Bigtable RestoreTable API to reflect the new API capability ([#804](https://www.github.com/googleapis/java-bigtable/issues/804)) ([f5e5d5a](https://www.github.com/googleapis/java-bigtable/commit/f5e5d5ac196529d5b070ef5fd8118038fec2e2de)) + ## [1.24.0](https://www.github.com/googleapis/java-bigtable/compare/v1.23.2...v1.24.0) (2021-04-30) diff --git a/README.md b/README.md index 866f55f8fc..fe63b53f37 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file com.google.cloud libraries-bom - 20.1.0 + 20.3.0 pom import @@ -38,25 +38,25 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigtable - 1.23.1 + 1.24.0 ``` If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:20.1.0') +implementation platform('com.google.cloud:libraries-bom:20.3.0') compile 'com.google.cloud:google-cloud-bigtable' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigtable:1.23.1' +compile 'com.google.cloud:google-cloud-bigtable:1.24.0' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigtable" % "1.23.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigtable" % "1.24.0" ``` ## Authentication diff --git a/google-cloud-bigtable-bom/pom.xml b/google-cloud-bigtable-bom/pom.xml index 24394f95ee..2fa681e61a 100644 --- a/google-cloud-bigtable-bom/pom.xml +++ b/google-cloud-bigtable-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigtable-bom - 1.24.0 + 1.24.1 pom com.google.cloud @@ -72,32 +72,32 @@ com.google.cloud google-cloud-bigtable - 1.24.0 + 1.24.1 com.google.cloud google-cloud-bigtable-emulator - 0.133.0 + 0.133.1 com.google.api.grpc grpc-google-cloud-bigtable-admin-v2 - 1.24.0 + 1.24.1 com.google.api.grpc grpc-google-cloud-bigtable-v2 - 1.24.0 + 1.24.1 com.google.api.grpc proto-google-cloud-bigtable-admin-v2 - 1.24.0 + 1.24.1 com.google.api.grpc proto-google-cloud-bigtable-v2 - 1.24.0 + 1.24.1 diff --git a/google-cloud-bigtable-deps-bom/pom.xml b/google-cloud-bigtable-deps-bom/pom.xml index f13908c63f..9d76681b3f 100644 --- a/google-cloud-bigtable-deps-bom/pom.xml +++ b/google-cloud-bigtable-deps-bom/pom.xml @@ -12,7 +12,7 @@ com.google.cloud google-cloud-bigtable-deps-bom - 1.24.0 + 1.24.1 pom @@ -75,7 +75,7 @@ com.google.cloud google-cloud-shared-dependencies - 1.0.0 + 1.1.0 pom import diff --git a/google-cloud-bigtable-emulator/pom.xml b/google-cloud-bigtable-emulator/pom.xml index a9d94b24b5..2d6688cad1 100644 --- a/google-cloud-bigtable-emulator/pom.xml +++ b/google-cloud-bigtable-emulator/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-bigtable-emulator - 0.133.0 + 0.133.1 Google Cloud Java - Bigtable Emulator https://github.com/googleapis/java-bigtable @@ -14,7 +14,7 @@ com.google.cloud google-cloud-bigtable-parent - 1.24.0 + 1.24.1 scm:git:git@github.com:googleapis/java-bigtable.git @@ -80,14 +80,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 1.24.0 + 1.24.1 pom import com.google.cloud google-cloud-bigtable-bom - 1.24.0 + 1.24.1 pom import diff --git a/google-cloud-bigtable/pom.xml b/google-cloud-bigtable/pom.xml index 62e2882463..9d6f53c5eb 100644 --- a/google-cloud-bigtable/pom.xml +++ b/google-cloud-bigtable/pom.xml @@ -2,7 +2,7 @@ 4.0.0 google-cloud-bigtable - 1.24.0 + 1.24.1 jar Google Cloud Bigtable https://github.com/googleapis/java-bigtable @@ -12,11 +12,11 @@ com.google.cloud google-cloud-bigtable-parent - 1.24.0 + 1.24.1 - 1.24.0 + 1.24.1 google-cloud-bigtable @@ -39,14 +39,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 1.24.0 + 1.24.1 pom import com.google.cloud google-cloud-bigtable-bom - 1.24.0 + 1.24.1 pom import diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClient.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClient.java index d8b683878d..b194906689 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClient.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClient.java @@ -2621,7 +2621,7 @@ public final UnaryCallable listBackupsC // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Create a new table by restoring from a completed backup. The new table must be in the same - * instance as the instance containing the backup. The returned table [long-running + * project as the instance containing the backup. The returned table [long-running * operation][google.longrunning.Operation] can be used to track the progress of the operation, * and to cancel it. The [metadata][google.longrunning.Operation.metadata] field type is * [RestoreTableMetadata][google.bigtable.admin.RestoreTableMetadata]. The @@ -2653,7 +2653,7 @@ public final OperationFuture restoreTableAsync( // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Create a new table by restoring from a completed backup. The new table must be in the same - * instance as the instance containing the backup. The returned table [long-running + * project as the instance containing the backup. The returned table [long-running * operation][google.longrunning.Operation] can be used to track the progress of the operation, * and to cancel it. The [metadata][google.longrunning.Operation.metadata] field type is * [RestoreTableMetadata][google.bigtable.admin.RestoreTableMetadata]. The @@ -2685,7 +2685,7 @@ public final OperationFuture restoreTableAsync( // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Create a new table by restoring from a completed backup. The new table must be in the same - * instance as the instance containing the backup. The returned table [long-running + * project as the instance containing the backup. The returned table [long-running * operation][google.longrunning.Operation] can be used to track the progress of the operation, * and to cancel it. The [metadata][google.longrunning.Operation.metadata] field type is * [RestoreTableMetadata][google.bigtable.admin.RestoreTableMetadata]. The diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java index 765fa01205..986a0ca1a5 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java @@ -43,8 +43,8 @@ public final class Query implements Serializable { private static final long serialVersionUID = -316972783499434755L; - // bigtable can server the largest filter size of 20MB. - private static final int MAX_FILTER_SIZE = 20 * 1024 * 1024; + // bigtable can server the largest filter size of 20KB. + private static final int MAX_FILTER_SIZE = 20 * 1024; private final String tableId; private transient ReadRowsRequest.Builder builder = ReadRowsRequest.newBuilder(); @@ -170,7 +170,7 @@ public Query filter(Filters.Filter filter) { RowFilter rowFilter = filter.toProto(); Preconditions.checkArgument( - rowFilter.getSerializedSize() < MAX_FILTER_SIZE, "filter size can't be more than 20MB"); + rowFilter.getSerializedSize() < MAX_FILTER_SIZE, "filter size can't be more than 20KB"); builder.setFilter(rowFilter); return this; diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableBackupIT.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableBackupIT.java index 94bbfa1ab1..f0591ca6c7 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableBackupIT.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableBackupIT.java @@ -21,8 +21,7 @@ import static io.grpc.Status.Code.NOT_FOUND; import static org.junit.Assert.fail; -import com.google.api.core.ApiFuture; -import com.google.api.core.ApiFutures; +import com.google.api.gax.batching.Batcher; import com.google.api.gax.rpc.ApiException; import com.google.cloud.Policy; import com.google.cloud.bigtable.admin.v2.BigtableInstanceAdminClient; @@ -38,11 +37,10 @@ import com.google.cloud.bigtable.admin.v2.models.Table; import com.google.cloud.bigtable.admin.v2.models.UpdateBackupRequest; import com.google.cloud.bigtable.data.v2.BigtableDataClient; -import com.google.cloud.bigtable.data.v2.models.RowMutation; -import com.google.cloud.bigtable.test_helpers.env.AbstractTestEnv; +import com.google.cloud.bigtable.data.v2.models.RowMutationEntry; import com.google.cloud.bigtable.test_helpers.env.EmulatorEnv; import com.google.cloud.bigtable.test_helpers.env.TestEnvRule; -import com.google.common.collect.Lists; +import com.google.common.base.Stopwatch; import com.google.protobuf.ByteString; import io.grpc.StatusRuntimeException; import java.io.IOException; @@ -52,7 +50,10 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.logging.Logger; -import org.junit.*; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.ClassRule; +import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; import org.threeten.bp.Duration; @@ -60,56 +61,36 @@ @RunWith(JUnit4.class) public class BigtableBackupIT { - @ClassRule public static TestEnvRule testEnvRule = new TestEnvRule(); + @ClassRule public static final TestEnvRule testEnvRule = new TestEnvRule(); private static final Logger LOGGER = Logger.getLogger(BigtableBackupIT.class.getName()); private static final int[] BACKOFF_DURATION = {2, 4, 8, 16, 32, 64, 128, 256, 512, 1024}; - private static final String TEST_TABLE_SUFFIX = "test-table-for-backup-it"; - private static final String TEST_BACKUP_SUFFIX = "test-backup-for-backup-it"; - private static BigtableTableAdminClient tableAdmin; private static BigtableInstanceAdminClient instanceAdmin; private static BigtableDataClient dataClient; - private static String targetInstance; private static String targetCluster; private static Table testTable; - private static String prefix; @BeforeClass - public static void createClient() - throws IOException, InterruptedException, ExecutionException, TimeoutException { + public static void setUpClass() throws InterruptedException { assume() .withMessage("BigtableInstanceAdminClient is not supported on Emulator") .that(testEnvRule.env()) .isNotInstanceOf(EmulatorEnv.class); + tableAdmin = testEnvRule.env().getTableAdminClient(); instanceAdmin = testEnvRule.env().getInstanceAdminClient(); + dataClient = testEnvRule.env().getDataClient(); - targetCluster = AbstractTestEnv.TEST_CLUSTER_PREFIX + Instant.now().getEpochSecond(); - targetInstance = - AbstractTestEnv.TEST_INSTANCE_PREFIX + "backup-" + Instant.now().getEpochSecond(); - - instanceAdmin.createInstance( - CreateInstanceRequest.of(targetInstance) - .addCluster(targetCluster, testEnvRule.env().getPrimaryZone(), 3, StorageType.SSD) - .setDisplayName("backups-test-instance") - .addLabel("state", "readytodelete") - .setType(Type.PRODUCTION)); - - // Setup a prefix to avoid collisions between concurrent test runs - prefix = String.format("020%d", System.currentTimeMillis()); - - tableAdmin = testEnvRule.env().getTableAdminClientForInstance(targetInstance); - dataClient = testEnvRule.env().getDataClientForInstance(targetInstance); - + targetCluster = testEnvRule.env().getPrimaryClusterId(); testTable = createAndPopulateTestTable(tableAdmin, dataClient); } @AfterClass - public static void closeClient() { + public static void tearDownClass() { if (testTable != null) { try { tableAdmin.deleteTable(testTable.getId()); @@ -117,32 +98,13 @@ public static void closeClient() { // Ignore. } } - - if (targetInstance != null) { - instanceAdmin.deleteInstance(targetInstance); - } - - if (tableAdmin != null) { - tableAdmin.close(); - } - - if (dataClient != null) { - dataClient.close(); - } - } - - @Before - public void setup() { - if (tableAdmin == null) { - throw new AssumptionViolatedException( - "Required properties are not set, skipping integration tests."); - } } @Test - public void createAndGetBackupTest() throws InterruptedException { - Instant expireTime = Instant.now().plus(Duration.ofDays(15)); - String backupId = generateId(TEST_BACKUP_SUFFIX); + public void createAndGetBackupTest() { + String backupId = testEnvRule.env().newPrefix(); + Instant expireTime = Instant.now().plus(Duration.ofHours(6)); + CreateBackupRequest request = CreateBackupRequest.of(targetCluster, backupId) .setSourceTableId(testTable.getId()) @@ -185,9 +147,9 @@ public void createAndGetBackupTest() throws InterruptedException { } @Test - public void listBackupTest() throws InterruptedException { - String backupId1 = generateId("list-1-" + TEST_BACKUP_SUFFIX); - String backupId2 = generateId("list-2-" + TEST_BACKUP_SUFFIX); + public void listBackupTest() { + String backupId1 = testEnvRule.env().newPrefix(); + String backupId2 = testEnvRule.env().newPrefix(); try { tableAdmin.createBackup(createBackupRequest(backupId1)); @@ -206,8 +168,8 @@ public void listBackupTest() throws InterruptedException { } @Test - public void updateBackupTest() throws InterruptedException { - String backupId = generateId("update-" + TEST_BACKUP_SUFFIX); + public void updateBackupTest() { + String backupId = testEnvRule.env().newPrefix(); tableAdmin.createBackup(createBackupRequest(backupId)); Instant expireTime = Instant.now().plus(Duration.ofDays(20)); @@ -223,7 +185,7 @@ public void updateBackupTest() throws InterruptedException { @Test public void deleteBackupTest() throws InterruptedException { - String backupId = generateId("delete-" + TEST_BACKUP_SUFFIX); + String backupId = testEnvRule.env().newPrefix(); tableAdmin.createBackup(createBackupRequest(backupId)); tableAdmin.deleteBackup(targetCluster, backupId); @@ -248,8 +210,8 @@ public void deleteBackupTest() throws InterruptedException { @Test public void restoreTableTest() throws InterruptedException, ExecutionException { - String backupId = generateId("restore-" + TEST_BACKUP_SUFFIX); - String restoredTableId = generateId("restored-table"); + String backupId = testEnvRule.env().newPrefix(); + String restoredTableId = testEnvRule.env().newPrefix() + "-restore"; tableAdmin.createBackup(createBackupRequest(backupId)); // Wait 2 minutes so that the RestoreTable API will trigger an optimize restored @@ -282,62 +244,65 @@ public void restoreTableTest() throws InterruptedException, ExecutionException { @Test public void crossInstanceRestoreTest() throws InterruptedException, IOException, ExecutionException, TimeoutException { - String backupId = generateId("cross-" + TEST_BACKUP_SUFFIX); - String restoredTableId = generateId("restored-table-2"); - - // Set up a new instance to test cross-instance restore. The source backup is stored in this - // instance. - String sourceInstance = - AbstractTestEnv.TEST_INSTANCE_PREFIX + "backup-" + Instant.now().getEpochSecond(); - String sourceCluster = AbstractTestEnv.TEST_CLUSTER_PREFIX + Instant.now().getEpochSecond(); + String backupId = testEnvRule.env().newPrefix(); + String restoredTableId = testEnvRule.env().newPrefix(); + + // Create the backup + tableAdmin.createBackup( + CreateBackupRequest.of(targetCluster, backupId) + .setSourceTableId(testTable.getId()) + .setExpireTime(Instant.now().plus(Duration.ofHours(6)))); + + Stopwatch stopwatch = Stopwatch.createStarted(); + + // Set up a new instance to test cross-instance restore. The backup will be restored here + String targetInstance = testEnvRule.env().newPrefix(); instanceAdmin.createInstance( - CreateInstanceRequest.of(sourceInstance) - .addCluster(sourceCluster, testEnvRule.env().getSecondaryZone(), 3, StorageType.SSD) - .setDisplayName("backups-source-test-instance") + CreateInstanceRequest.of(targetInstance) + .addCluster(targetInstance, testEnvRule.env().getSecondaryZone(), 1, StorageType.SSD) + .setDisplayName("backups-dest-test-instance") .addLabel("state", "readytodelete") .setType(Type.PRODUCTION)); - BigtableTableAdminClient sourceTableAdmin = - testEnvRule.env().getTableAdminClientForInstance(sourceInstance); - Table sourceTable = - createAndPopulateTestTable( - sourceTableAdmin, testEnvRule.env().getDataClientForInstance(sourceInstance)); - sourceTableAdmin.createBackup( - CreateBackupRequest.of(sourceCluster, backupId) - .setSourceTableId(sourceTable.getId()) - .setExpireTime(Instant.now().plus(Duration.ofHours(6)))); - // Wait 2 minutes so that the RestoreTable API will trigger an optimize restored - // table operation. - Thread.sleep(120 * 1000); + try (BigtableTableAdminClient destTableAdmin = + testEnvRule.env().getTableAdminClientForInstance(targetInstance)) { - try { - RestoreTableRequest req = - RestoreTableRequest.of(sourceInstance, sourceCluster, backupId) - .setTableId(restoredTableId); - RestoredTableResult result = tableAdmin.restoreTable(req); - assertWithMessage("Incorrect restored table id") - .that(result.getTable().getId()) - .isEqualTo(restoredTableId); - assertWithMessage("Incorrect instance id") - .that(result.getTable().getInstanceId()) - .isEqualTo(targetInstance); - - // The assertion might be missing if the test is running against a HDD cluster or an - // optimization is not necessary. - assertWithMessage("Empty OptimizeRestoredTable token") - .that(result.getOptimizeRestoredTableOperationToken()) - .isNotNull(); - tableAdmin.awaitOptimizeRestoredTable(result.getOptimizeRestoredTableOperationToken()); - tableAdmin.getTable(restoredTableId); - } finally { - sourceTableAdmin.deleteBackup(sourceCluster, backupId); - instanceAdmin.deleteInstance(sourceInstance); + // Wait 2 minutes so that the RestoreTable API will trigger an optimize restored + // table operation. + Thread.sleep( + Duration.ofMinutes(2) + .minus(Duration.ofMillis(stopwatch.elapsed(TimeUnit.MILLISECONDS))) + .toMillis()); + + try { + RestoreTableRequest req = + RestoreTableRequest.of(testEnvRule.env().getInstanceId(), targetCluster, backupId) + .setTableId(restoredTableId); + RestoredTableResult result = destTableAdmin.restoreTable(req); + assertWithMessage("Incorrect restored table id") + .that(result.getTable().getId()) + .isEqualTo(restoredTableId); + assertWithMessage("Incorrect instance id") + .that(result.getTable().getInstanceId()) + .isEqualTo(targetInstance); + + // The assertion might be missing if the test is running against a HDD cluster or an + // optimization is not necessary. + assertWithMessage("Empty OptimizeRestoredTable token") + .that(result.getOptimizeRestoredTableOperationToken()) + .isNotNull(); + destTableAdmin.awaitOptimizeRestoredTable(result.getOptimizeRestoredTableOperationToken()); + destTableAdmin.getTable(restoredTableId); + } finally { + tableAdmin.deleteBackup(targetCluster, backupId); + instanceAdmin.deleteInstance(targetInstance); + } } } @Test - public void backupIamTest() throws InterruptedException { - String backupId = generateId("iam-" + TEST_BACKUP_SUFFIX); + public void backupIamTest() { + String backupId = testEnvRule.env().newPrefix(); try { tableAdmin.createBackup(createBackupRequest(backupId)); @@ -373,31 +338,24 @@ private CreateBackupRequest createBackupRequest(String backupId) { .setExpireTime(Instant.now().plus(Duration.ofDays(15))); } - private static String generateId(String name) { - return prefix + "-" + name; - } - private static Table createAndPopulateTestTable( BigtableTableAdminClient tableAdmin, BigtableDataClient dataClient) - throws InterruptedException, ExecutionException, TimeoutException { - Table testTable = - tableAdmin.createTable( - CreateTableRequest.of(generateId(TEST_TABLE_SUFFIX)).addFamily("cf1")); + throws InterruptedException { + String tableId = testEnvRule.env().newPrefix(); + Table testTable = tableAdmin.createTable(CreateTableRequest.of(tableId).addFamily("cf1")); // Populate test data. byte[] rowBytes = new byte[1024]; Random random = new Random(); random.nextBytes(rowBytes); - List> futures = Lists.newArrayList(); - for (int i = 0; i < 10; i++) { - ApiFuture future = - dataClient.mutateRowAsync( - RowMutation.create(testTable.getId(), "test-row-" + i) - .setCell("cf1", ByteString.EMPTY, ByteString.copyFrom(rowBytes))); - futures.add(future); + try (Batcher batcher = dataClient.newBulkMutationBatcher(tableId)) { + for (int i = 0; i < 10; i++) { + batcher.add( + RowMutationEntry.create("test-row-" + i) + .setCell("cf1", ByteString.EMPTY, ByteString.copyFrom(rowBytes))); + } } - ApiFutures.allAsList(futures).get(3, TimeUnit.MINUTES); return testTable; } } diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableCmekIT.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableCmekIT.java index 60af52d6bd..5e0e75564a 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableCmekIT.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableCmekIT.java @@ -33,7 +33,6 @@ import com.google.cloud.bigtable.admin.v2.models.StorageType; import com.google.cloud.bigtable.common.Status; import com.google.cloud.bigtable.common.Status.Code; -import com.google.cloud.bigtable.test_helpers.env.AbstractTestEnv; import com.google.cloud.bigtable.test_helpers.env.EmulatorEnv; import com.google.cloud.bigtable.test_helpers.env.TestEnvRule; import com.google.common.collect.ImmutableSet; @@ -89,7 +88,7 @@ public static void validatePlatform() throws IOException { assertThat(kmsKeyName).isNotNull(); assertThat(kmsKeyName).isNotEmpty(); - instanceId = AbstractTestEnv.TEST_INSTANCE_PREFIX + Instant.now().getEpochSecond(); + instanceId = testEnvRule.env().newPrefix(); clusterId1 = instanceId + "-c1"; clusterId2 = instanceId + "-c2"; clusterId3 = instanceId + "-c3"; diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableInstanceAdminClientIT.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableInstanceAdminClientIT.java index 9b41444c7f..67a3a01362 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableInstanceAdminClientIT.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableInstanceAdminClientIT.java @@ -15,7 +15,6 @@ */ package com.google.cloud.bigtable.admin.v2.it; -import static com.google.cloud.bigtable.test_helpers.env.AbstractTestEnv.TEST_APP_PREFIX; import static com.google.common.truth.Truth.assertThat; import static com.google.common.truth.Truth.assertWithMessage; import static com.google.common.truth.TruthJUnit.assume; @@ -32,7 +31,6 @@ import com.google.cloud.bigtable.admin.v2.models.StorageType; import com.google.cloud.bigtable.admin.v2.models.UpdateAppProfileRequest; import com.google.cloud.bigtable.admin.v2.models.UpdateInstanceRequest; -import com.google.cloud.bigtable.test_helpers.env.AbstractTestEnv; import com.google.cloud.bigtable.test_helpers.env.EmulatorEnv; import com.google.cloud.bigtable.test_helpers.env.TestEnvRule; import java.util.List; @@ -42,7 +40,6 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import org.threeten.bp.Instant; @RunWith(JUnit4.class) public class BigtableInstanceAdminClientIT { @@ -69,7 +66,7 @@ public void setUp() { @Test public void appProfileTest() { - String testAppProfile = TEST_APP_PREFIX + Instant.now().getEpochSecond(); + String testAppProfile = testEnvRule.env().newPrefix(); AppProfile newlyCreatedAppProfile = client.createAppProfile( @@ -118,8 +115,8 @@ public void iamUpdateTest() { /** To optimize test run time, instance & cluster creation is tested at the same time */ @Test public void instanceAndClusterCreationDeletionTest() { - String newInstanceId = AbstractTestEnv.TEST_INSTANCE_PREFIX + Instant.now().getEpochSecond(); - String newClusterId = newInstanceId + "-c1"; + String newInstanceId = testEnvRule.env().newPrefix(); + String newClusterId = newInstanceId; client.createInstance( CreateInstanceRequest.of(newInstanceId) @@ -155,7 +152,7 @@ public void instanceAndClusterCreationDeletionTest() { // This will avoid the need to copy any existing tables and will also reduce flakiness in case a // previous run failed to clean up a cluster in the secondary zone. private void clusterCreationDeletionTestHelper(String newInstanceId) { - String newClusterId = AbstractTestEnv.TEST_CLUSTER_PREFIX + Instant.now().getEpochSecond(); + String newClusterId = testEnvRule.env().newPrefix(); boolean isClusterDeleted = false; client.createCluster( CreateClusterRequest.of(newInstanceId, newClusterId) diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableTableAdminClientIT.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableTableAdminClientIT.java index 2dc64b6407..7bfee9ead9 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableTableAdminClientIT.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableTableAdminClientIT.java @@ -61,7 +61,7 @@ public class BigtableTableAdminClientIT { @Before public void setUp() { tableAdmin = testEnvRule.env().getTableAdminClient(); - tableId = testEnvRule.env().generateTableId(testNameRule.getMethodName()); + tableId = testEnvRule.env().newPrefix(); } @After diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/BulkMutateIT.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/BulkMutateIT.java index 402efd7b90..612cd7435a 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/BulkMutateIT.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/BulkMutateIT.java @@ -21,11 +21,13 @@ import com.google.api.gax.batching.FlowControlEventStats; import com.google.cloud.bigtable.data.v2.BigtableDataClient; import com.google.cloud.bigtable.data.v2.BigtableDataSettings; +import com.google.cloud.bigtable.data.v2.models.BulkMutation; import com.google.cloud.bigtable.data.v2.models.Query; import com.google.cloud.bigtable.data.v2.models.Row; import com.google.cloud.bigtable.data.v2.models.RowMutationEntry; import com.google.cloud.bigtable.test_helpers.env.TestEnvRule; import java.io.IOException; +import java.util.Objects; import java.util.UUID; import org.junit.ClassRule; import org.junit.Test; @@ -44,12 +46,14 @@ public void test() throws IOException, InterruptedException { // Set target latency really low so it'll trigger adjusting thresholds BigtableDataSettings.Builder builder = settings.toBuilder().enableBatchMutationLatencyBasedThrottling(2L); - BigtableDataClient client = BigtableDataClient.create(builder.build()); - BatcherImpl batcher = - (BatcherImpl) client.newBulkMutationBatcher(testEnvRule.env().getTableId()); - try { + + try (BigtableDataClient client = BigtableDataClient.create(builder.build()); + BatcherImpl batcher = + (BatcherImpl) + client.newBulkMutationBatcher(testEnvRule.env().getTableId())) { FlowControlEventStats events = batcher.getFlowController().getFlowControlEventStats(); - long initialThreashold = batcher.getFlowController().getCurrentElementCountLimit(); + long initialThreashold = + Objects.requireNonNull(batcher.getFlowController().getCurrentElementCountLimit()); assertThat(batcher.getFlowController().getCurrentElementCountLimit()) .isNotEqualTo(batcher.getFlowController().getMinElementCountLimit()); assertThat(batcher.getFlowController().getCurrentElementCountLimit()) @@ -77,8 +81,6 @@ public void test() throws IOException, InterruptedException { Query.create(testEnvRule.env().getTableId()) .rowKey(rowPrefix + "test-key" + initial)); assertThat(row.getCells()).hasSize(1); - } finally { - batcher.close(); } } } diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/QueryTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/QueryTest.java index bf6abcd168..a6204890b4 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/QueryTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/QueryTest.java @@ -123,7 +123,7 @@ public void filterTestWithExceptions() { assertThat(actualException).isInstanceOf(NullPointerException.class); actualException = null; - int maxFilterSize = 20 * 1024 * 1024; + int maxFilterSize = 20 * 1024; ByteString largeValue = ByteString.copyFrom(new byte[maxFilterSize + 1]); try { @@ -131,7 +131,7 @@ public void filterTestWithExceptions() { } catch (Exception ex) { actualException = ex; } - assertThat(actualException).hasMessageThat().contains("filter size can't be more than 20MB"); + assertThat(actualException).hasMessageThat().contains("filter size can't be more than 20KB"); } @Test diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/DynamicFlowControlCallableTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/DynamicFlowControlCallableTest.java index 426bcdc7c1..4db1f5a31f 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/DynamicFlowControlCallableTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/DynamicFlowControlCallableTest.java @@ -39,6 +39,7 @@ import java.util.Map; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; import org.junit.Before; import org.junit.Rule; import org.junit.Test; @@ -268,19 +269,30 @@ public ApiFuture> futureCall( private void createFlowControlEvent(final FlowController flowController) throws Exception { flowController.reserve(INITIAL_ELEMENT, 0); + final AtomicBoolean threadStarted = new AtomicBoolean(false); Thread t = new Thread( new Runnable() { @Override public void run() { try { + threadStarted.set(true); flowController.reserve(1, 0); } catch (Exception e) { } } }); t.start(); - Thread.sleep(10); + // Wait 5 seconds for the thread to start, and 50 milliseconds after it's started to make sure + // flowController.reserve(1, 0) is blocked and creates a throttling event. It should never take + // so long. + for (int i = 0; i < 1000; i++) { + if (threadStarted.get()) { + break; + } + Thread.sleep(5); + } + Thread.sleep(50); flowController.release(INITIAL_ELEMENT, 0); t.join(); flowController.release(1, 0); diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/AbstractTestEnv.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/AbstractTestEnv.java index 02b972ba48..b3c25db169 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/AbstractTestEnv.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/AbstractTestEnv.java @@ -15,6 +15,8 @@ */ package com.google.cloud.bigtable.test_helpers.env; +import com.google.api.core.ApiFuture; +import com.google.api.gax.rpc.NotFoundException; import com.google.cloud.bigtable.admin.v2.BigtableInstanceAdminClient; import com.google.cloud.bigtable.admin.v2.BigtableInstanceAdminSettings; import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; @@ -25,9 +27,16 @@ import com.google.cloud.bigtable.data.v2.BigtableDataClient; import com.google.cloud.bigtable.data.v2.BigtableDataSettings; import com.google.common.base.MoreObjects; +import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.atomic.AtomicInteger; import org.threeten.bp.Instant; import org.threeten.bp.temporal.ChronoUnit; @@ -38,10 +47,16 @@ */ public abstract class AbstractTestEnv { + /** + * Used for temporary resources created in tests. It will be combined with timestamp and a counter + * to create unique names which can be garbage collected. + */ private static final String PREFIX = "temp-"; - public static final String TEST_INSTANCE_PREFIX = "temp-instance-"; - public static final String TEST_CLUSTER_PREFIX = "temp-cluster-"; - public static final String TEST_APP_PREFIX = "temp-Ap-"; + + private static final AtomicInteger prefixCounter = new AtomicInteger(0); + private static final int SUFFIX = new Random().nextInt(Integer.MAX_VALUE); + + private String primaryClusterId = null; public enum ConnectionMode { DEFAULT, @@ -75,6 +90,38 @@ public abstract BigtableTableAdminClient getTableAdminClientForInstance(String i public abstract String getInstanceId(); + /** Try to guess the primary cluster id */ + public synchronized String getPrimaryClusterId() { + if (primaryClusterId != null) { + return primaryClusterId; + } + + List clusters = getInstanceAdminClient().listClusters(getInstanceId()); + Map byId = new HashMap<>(); + for (Cluster cluster : clusters) { + byId.put(cluster.getId(), cluster); + } + + Cluster cluster = null; + + cluster = byId.get(getInstanceId()); + if (cluster == null) { + // gcloud-devel setup + cluster = byId.get(getInstanceId() + "-cluster"); + } + if (cluster == null) { + cluster = byId.get(getInstanceId() + "-c0"); + } + primaryClusterId = + Preconditions.checkNotNull( + cluster, + "Failed to guess the primary cluster for projects/%s/instances/%s", + getProjectId(), + getInstanceId()) + .getId(); + return primaryClusterId; + } + public abstract String getTableId(); public abstract String getKmsKeyName(); @@ -83,16 +130,18 @@ public String getFamilyId() { return "cf"; } - public String generateTableId(String suffix) { - return newPrefix() + "-" + suffix; - } - - private static String newPrefix() { + public String newPrefix() { return newPrefix(Instant.now()); } private static String newPrefix(Instant instant) { - return String.format(PREFIX + "015%d", instant.getEpochSecond()); + // Sortable resource prefix - time, process identifier, serial counterck + return String.format( + "%s-%x-%x", newTimePrefix(instant), SUFFIX, prefixCounter.getAndIncrement()); + } + + private static String newTimePrefix(Instant instant) { + return String.format(PREFIX + "08%x", instant.getEpochSecond()); } public boolean isInstanceAdminSupported() { @@ -127,57 +176,166 @@ public List getMultipleZonesInSameRegion() { return ImmutableList.of("us-east1-b", "us-east1-c"); } - void cleanUpStale() { - cleanupStaleTables(); + void cleanUpStale() throws ExecutionException, InterruptedException, IOException { + String stalePrefix = newPrefix(Instant.now().minus(1, ChronoUnit.DAYS)); + + cleanupStaleTables(stalePrefix); if (isInstanceAdminSupported()) { - cleanUpStaleAppProfile(); - cleanUpStaleClusters(); - cleanUpStaleInstances(); + cleanUpStaleAppProfile(stalePrefix); + cleanUpStaleClusters(stalePrefix); + cleanUpStaleInstances(stalePrefix); } } - private void cleanupStaleTables() { - String stalePrefix = newPrefix(Instant.now().minus(1, ChronoUnit.DAYS)); - + /** + * Clean up AppProfile that were dynamically created in the default instance that have been + * orphaned. + * + * @param stalePrefix + */ + private void cleanupStaleTables(String stalePrefix) { for (String tableId : getTableAdminClient().listTables()) { if (!tableId.startsWith(PREFIX)) { continue; } if (stalePrefix.compareTo(tableId) > 0) { - getTableAdminClient().deleteTable(tableId); + try { + getTableAdminClient().deleteTable(tableId); + } catch (NotFoundException ignored) { + + } } } } - private void cleanUpStaleAppProfile() { - String staleAPPattern = TEST_APP_PREFIX + Instant.now().minus(1, ChronoUnit.DAYS); - + /** + * Clean up AppProfile that were dynamically created in the default instance that have been + * orphaned. + * + * @param stalePrefix + */ + private void cleanUpStaleAppProfile(String stalePrefix) { for (AppProfile appProfile : getInstanceAdminClient().listAppProfiles(getInstanceId())) { - String appProfileId = appProfile.getId(); - if (appProfileId.startsWith(staleAPPattern) && staleAPPattern.compareTo(appProfileId) > 0) { - getInstanceAdminClient().deleteAppProfile(getInstanceId(), appProfileId, true); + if (!appProfile.getId().startsWith(PREFIX)) { + continue; + } + boolean isNewerThanStale = appProfile.getId().compareTo(stalePrefix) > 0; + if (isNewerThanStale) { + continue; + } + try { + getInstanceAdminClient().deleteAppProfile(getInstanceId(), appProfile.getId(), true); + } catch (NotFoundException ignored) { + } } } - private void cleanUpStaleClusters() { - String staleClusterId = TEST_CLUSTER_PREFIX + Instant.now().minus(1, ChronoUnit.DAYS); - + /** + * Clean up clusters that were dynamically created in the default instance that have been + * orphaned. + * + * @param stalePrefix + */ + private void cleanUpStaleClusters(String stalePrefix) + throws ExecutionException, InterruptedException { for (Cluster cluster : getInstanceAdminClient().listClusters(getInstanceId())) { - String clusterId = cluster.getId(); - if (clusterId.startsWith(staleClusterId) && staleClusterId.compareTo(clusterId) > 0) { - getInstanceAdminClient().deleteCluster(getInstanceId(), clusterId); + if (!cluster.getId().startsWith(PREFIX)) { + continue; + } + boolean isNewerThanStale = cluster.getId().compareTo(stalePrefix) > 0; + if (isNewerThanStale) { + continue; + } + + try { + deleteBackups(getTableAdminClient(), cluster.getId()); + } catch (NotFoundException ignored) { + } + + try { + getInstanceAdminClient().deleteCluster(getInstanceId(), cluster.getId()); + } catch (NotFoundException ignored) { } } } - private void cleanUpStaleInstances() { - String staleInstanceId = TEST_INSTANCE_PREFIX + Instant.now().minus(1, ChronoUnit.DAYS); + /** + * Clean up dynamically created (non-default) instances that have been orphaned. + * + * @param stalePrefix + */ + private void cleanUpStaleInstances(String stalePrefix) + throws IOException, ExecutionException, InterruptedException { + for (Instance instance : getInstanceAdminClient().listInstances()) { + if (!instance.getId().startsWith(PREFIX)) { + continue; + } + boolean isNewerThanStale = instance.getId().compareTo(stalePrefix) > 0; + if (isNewerThanStale) { + continue; + } + try { + deleteInstance(instance.getId()); + } catch (NotFoundException ignored) { + + } + } + } + + /** Delete an instance with all of its resources. */ + private void deleteInstance(String instanceId) + throws IOException, ExecutionException, InterruptedException { + BigtableTableAdminSettings settings = + getTableAdminSettings().toBuilder().setInstanceId(instanceId).build(); + + // Delete all child resources (backups & clusters) that wont be automatically deleted + try (BigtableTableAdminClient tableAdmin = BigtableTableAdminClient.create(settings)) { + List clusters = getInstanceAdminClient().listClusters(instanceId); + + boolean isFirstCluster = true; + + for (Cluster cluster : clusters) { + deleteBackups(tableAdmin, cluster.getId()); + // Skip the first cluster so that it can be delete by deleteInstance (instances can't exist + // without clusters) + if (!isFirstCluster) { + try { + getInstanceAdminClient().deleteCluster(instanceId, cluster.getId()); + } catch (NotFoundException ignored) { + + } + } + isFirstCluster = false; + } + } + + // Delete everything else + try { + getInstanceAdminClient().deleteInstance(instanceId); + } catch (NotFoundException ignored) { + + } + } + + private void deleteBackups(BigtableTableAdminClient tableAdmin, String clusterId) + throws ExecutionException, InterruptedException { + List> futures = new ArrayList<>(); + + for (String backupId : tableAdmin.listBackups(clusterId)) { + ApiFuture f = tableAdmin.deleteBackupAsync(clusterId, backupId); + futures.add(f); + } - for (Instance ins : getInstanceAdminClient().listInstances()) { - String insId = ins.getId(); - if (insId.startsWith(staleInstanceId) && staleInstanceId.compareTo(insId) > 0) { - getInstanceAdminClient().deleteInstance(insId); + for (ApiFuture future : futures) { + try { + future.get(); + } catch (ExecutionException e) { + // Ignore not found + if (e.getCause() instanceof NotFoundException) { + continue; + } + throw e; } } } diff --git a/grpc-google-cloud-bigtable-admin-v2/pom.xml b/grpc-google-cloud-bigtable-admin-v2/pom.xml index f98e32a91e..56a8f3f7e2 100644 --- a/grpc-google-cloud-bigtable-admin-v2/pom.xml +++ b/grpc-google-cloud-bigtable-admin-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-bigtable-admin-v2 - 1.24.0 + 1.24.1 grpc-google-cloud-bigtable-admin-v2 GRPC library for grpc-google-cloud-bigtable-admin-v2 com.google.cloud google-cloud-bigtable-parent - 1.24.0 + 1.24.1 @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 1.24.0 + 1.24.1 pom import com.google.cloud google-cloud-bigtable-bom - 1.24.0 + 1.24.1 pom import diff --git a/grpc-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableTableAdminGrpc.java b/grpc-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableTableAdminGrpc.java index 3bbfc6bef7..84fe98d181 100644 --- a/grpc-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableTableAdminGrpc.java +++ b/grpc-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableTableAdminGrpc.java @@ -1363,7 +1363,7 @@ public void listBackups( * *
      * Create a new table by restoring from a completed backup. The new table
-     * must be in the same instance as the instance containing the backup.  The
+     * must be in the same project as the instance containing the backup.  The
      * returned table [long-running operation][google.longrunning.Operation] can
      * be used to track the progress of the operation, and to cancel it.  The
      * [metadata][google.longrunning.Operation.metadata] field type is
@@ -1929,7 +1929,7 @@ public void listBackups(
      *
      * 
      * Create a new table by restoring from a completed backup. The new table
-     * must be in the same instance as the instance containing the backup.  The
+     * must be in the same project as the instance containing the backup.  The
      * returned table [long-running operation][google.longrunning.Operation] can
      * be used to track the progress of the operation, and to cancel it.  The
      * [metadata][google.longrunning.Operation.metadata] field type is
@@ -2308,7 +2308,7 @@ public com.google.bigtable.admin.v2.ListBackupsResponse listBackups(
      *
      * 
      * Create a new table by restoring from a completed backup. The new table
-     * must be in the same instance as the instance containing the backup.  The
+     * must be in the same project as the instance containing the backup.  The
      * returned table [long-running operation][google.longrunning.Operation] can
      * be used to track the progress of the operation, and to cancel it.  The
      * [metadata][google.longrunning.Operation.metadata] field type is
@@ -2678,7 +2678,7 @@ protected BigtableTableAdminFutureStub build(
      *
      * 
      * Create a new table by restoring from a completed backup. The new table
-     * must be in the same instance as the instance containing the backup.  The
+     * must be in the same project as the instance containing the backup.  The
      * returned table [long-running operation][google.longrunning.Operation] can
      * be used to track the progress of the operation, and to cancel it.  The
      * [metadata][google.longrunning.Operation.metadata] field type is
diff --git a/grpc-google-cloud-bigtable-v2/pom.xml b/grpc-google-cloud-bigtable-v2/pom.xml
index 64117825d9..35bc5c24e1 100644
--- a/grpc-google-cloud-bigtable-v2/pom.xml
+++ b/grpc-google-cloud-bigtable-v2/pom.xml
@@ -4,13 +4,13 @@
   4.0.0
   com.google.api.grpc
   grpc-google-cloud-bigtable-v2
-  1.24.0
+  1.24.1
   grpc-google-cloud-bigtable-v2
   GRPC library for grpc-google-cloud-bigtable-v2
   
     com.google.cloud
     google-cloud-bigtable-parent
-    1.24.0
+    1.24.1
   
 
   
@@ -18,14 +18,14 @@
       
         com.google.cloud
         google-cloud-bigtable-deps-bom
-        1.24.0
+        1.24.1
         pom
         import
       
       
         com.google.cloud
         google-cloud-bigtable-bom
-        1.24.0
+        1.24.1
         pom
         import
       
diff --git a/pom.xml b/pom.xml
index 9ba6059b3f..f30ebf750c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
 
     google-cloud-bigtable-parent
     pom
-    1.24.0
+    1.24.1
     Google Cloud Bigtable Parent
     https://github.com/googleapis/java-bigtable
     
@@ -286,6 +286,39 @@
         
     
 
+    
+        
+            docFX
+            
+                
+                    
+                        org.apache.maven.plugins
+                        maven-javadoc-plugin
+                        3.2.0
+                        
+                            com.microsoft.doclet.DocFxDoclet
+                            false
+                            ${env.KOKORO_GFILE_DIR}/docfx-doclet-1.0-SNAPSHOT-jar-with-dependencies-172556.jar
+                            
+                                -outputpath ${project.build.directory}/docfx-yml
+                                
+                                -excludeclasses com\.google\.cloud\.bigtable\.admin\.v2\.internal\.:com\.google\.cloud\.bigtable\.admin\.v2\.BaseBigtableInstanceAdminClient:com\.google\.cloud\.bigtable\.admin\.v2\.BaseBigtableInstanceAdminSettings:com\.google\.cloud\.bigtable\.admin\.v2\.stub\.GrpcBigtableInstanceAdminCallableFactory:com\.google\.cloud\.bigtable\.admin\.v2\.stub\.GrpcBigtableInstanceAdminStub:com\.google\.cloud\.bigtable\.admin\.v2\.stub\.BigtableInstanceAdminStub:com\.google\.cloud\.bigtable\.admin\.v2\.BaseBigtableTableAdminClient:com\.google\.cloud\.bigtable\.admin\.v2\.BaseBigtableTableAdminSettings:com\.google\.cloud\.bigtable\.admin\.v2\.stub\.GrpcBigtableTableAdminCallableFactory:com\.google\.cloud\.bigtable\.admin\.v2\.stub\.GrpcBigtableTableAdminStub:com\.google\.cloud\.bigtable\.admin\.v2\.stub\.BigtableTableAdminStub:com\.google\.cloud\.bigtable\.admin\.v2\.stub\.EnhancedBigtableTableAdminStub:com\.google\.cloud\.bigtable\.data\.v2\.internal\.:com\.google\.cloud\.bigtable\.data\.v2\.BaseBigtableDataClient:com\.google\.cloud\.bigtable\.data\.v2\.BaseBigtableDataSettings:com\.google\.cloud\.bigtable\.data\.v2\.stub\.BigtableStub:com\.google\.cloud\.bigtable\.data\.v2\.stub\.BigtableStubSettings:com\.google\.cloud\.bigtable\.data\.v2\.stub\.GrpcBigtableStub:com\.google\.cloud\.bigtable\.data\.v2\.stub\.GrpcBigtableCallableFactory:com\.google\.cloud\.bigtable\.data\.v2\.stub\.EnhancedBigtableStub:com\.google\.cloud\.bigtable\.data\.v2\.stub\.mutaterows\.:com\.google\.cloud\.bigtable\.data\.v2\.stub\.readrows\.:com\.google\.cloud\.bigtable\.data\.v2\.stub\.metrics\.
+                            
+                        
+                        
+                            
+                                aggregate
+                                
+                                    aggregate
+                                
+                            
+                        
+                    
+                
+            
+        
+    
+
     
         proto-google-cloud-bigtable-v2
         grpc-google-cloud-bigtable-v2
diff --git a/proto-google-cloud-bigtable-admin-v2/pom.xml b/proto-google-cloud-bigtable-admin-v2/pom.xml
index 6e5614579d..d5c4f8a42f 100644
--- a/proto-google-cloud-bigtable-admin-v2/pom.xml
+++ b/proto-google-cloud-bigtable-admin-v2/pom.xml
@@ -4,13 +4,13 @@
   4.0.0
   com.google.api.grpc
   proto-google-cloud-bigtable-admin-v2
-  1.24.0
+  1.24.1
   proto-google-cloud-bigtable-admin-v2
   PROTO library for proto-google-cloud-bigtable-admin-v2
   
     com.google.cloud
     google-cloud-bigtable-parent
-    1.24.0
+    1.24.1
   
 
   
@@ -18,14 +18,14 @@
       
         com.google.cloud
         google-cloud-bigtable-deps-bom
-        1.24.0
+        1.24.1
         pom
         import
       
       
         com.google.cloud
         google-cloud-bigtable-bom
-        1.24.0
+        1.24.1
         pom
         import
       
diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableRequest.java
index 6025af320c..60162d220f 100644
--- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableRequest.java
+++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableRequest.java
@@ -178,8 +178,8 @@ public SourceCase getSourceCase() {
    *
    * 
    * Required. The name of the instance in which to create the restored
-   * table. This instance must be the parent of the source backup. Values are
-   * of the form `projects/<project>/instances/<instance>`.
+   * table. This instance must be in the same project as the source backup.
+   * Values are of the form `projects/<project>/instances/<instance>`.
    * 
* * @@ -205,8 +205,8 @@ public java.lang.String getParent() { * *
    * Required. The name of the instance in which to create the restored
-   * table. This instance must be the parent of the source backup. Values are
-   * of the form `projects/<project>/instances/<instance>`.
+   * table. This instance must be in the same project as the source backup.
+   * Values are of the form `projects/<project>/instances/<instance>`.
    * 
* * @@ -751,8 +751,8 @@ public Builder clearSource() { * *
      * Required. The name of the instance in which to create the restored
-     * table. This instance must be the parent of the source backup. Values are
-     * of the form `projects/<project>/instances/<instance>`.
+     * table. This instance must be in the same project as the source backup.
+     * Values are of the form `projects/<project>/instances/<instance>`.
      * 
* * @@ -777,8 +777,8 @@ public java.lang.String getParent() { * *
      * Required. The name of the instance in which to create the restored
-     * table. This instance must be the parent of the source backup. Values are
-     * of the form `projects/<project>/instances/<instance>`.
+     * table. This instance must be in the same project as the source backup.
+     * Values are of the form `projects/<project>/instances/<instance>`.
      * 
* * @@ -803,8 +803,8 @@ public com.google.protobuf.ByteString getParentBytes() { * *
      * Required. The name of the instance in which to create the restored
-     * table. This instance must be the parent of the source backup. Values are
-     * of the form `projects/<project>/instances/<instance>`.
+     * table. This instance must be in the same project as the source backup.
+     * Values are of the form `projects/<project>/instances/<instance>`.
      * 
* * @@ -828,8 +828,8 @@ public Builder setParent(java.lang.String value) { * *
      * Required. The name of the instance in which to create the restored
-     * table. This instance must be the parent of the source backup. Values are
-     * of the form `projects/<project>/instances/<instance>`.
+     * table. This instance must be in the same project as the source backup.
+     * Values are of the form `projects/<project>/instances/<instance>`.
      * 
* * @@ -849,8 +849,8 @@ public Builder clearParent() { * *
      * Required. The name of the instance in which to create the restored
-     * table. This instance must be the parent of the source backup. Values are
-     * of the form `projects/<project>/instances/<instance>`.
+     * table. This instance must be in the same project as the source backup.
+     * Values are of the form `projects/<project>/instances/<instance>`.
      * 
* * diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableRequestOrBuilder.java index 38df514193..f55e5f6108 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableRequestOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableRequestOrBuilder.java @@ -28,8 +28,8 @@ public interface RestoreTableRequestOrBuilder * *
    * Required. The name of the instance in which to create the restored
-   * table. This instance must be the parent of the source backup. Values are
-   * of the form `projects/<project>/instances/<instance>`.
+   * table. This instance must be in the same project as the source backup.
+   * Values are of the form `projects/<project>/instances/<instance>`.
    * 
* * @@ -44,8 +44,8 @@ public interface RestoreTableRequestOrBuilder * *
    * Required. The name of the instance in which to create the restored
-   * table. This instance must be the parent of the source backup. Values are
-   * of the form `projects/<project>/instances/<instance>`.
+   * table. This instance must be in the same project as the source backup.
+   * Values are of the form `projects/<project>/instances/<instance>`.
    * 
* * diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/bigtable_table_admin.proto b/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/bigtable_table_admin.proto index d979dba597..ff2076c50e 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/bigtable_table_admin.proto +++ b/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/bigtable_table_admin.proto @@ -270,7 +270,7 @@ service BigtableTableAdmin { } // Create a new table by restoring from a completed backup. The new table - // must be in the same instance as the instance containing the backup. The + // must be in the same project as the instance containing the backup. The // returned table [long-running operation][google.longrunning.Operation] can // be used to track the progress of the operation, and to cancel it. The // [metadata][google.longrunning.Operation.metadata] field type is @@ -335,8 +335,8 @@ service BigtableTableAdmin { // [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]. message RestoreTableRequest { // Required. The name of the instance in which to create the restored - // table. This instance must be the parent of the source backup. Values are - // of the form `projects//instances/`. + // table. This instance must be in the same project as the source backup. + // Values are of the form `projects//instances/`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { diff --git a/proto-google-cloud-bigtable-v2/pom.xml b/proto-google-cloud-bigtable-v2/pom.xml index 3ee74ae8ab..048e4f0331 100644 --- a/proto-google-cloud-bigtable-v2/pom.xml +++ b/proto-google-cloud-bigtable-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-bigtable-v2 - 1.24.0 + 1.24.1 proto-google-cloud-bigtable-v2 PROTO library for proto-google-cloud-bigtable-v2 com.google.cloud google-cloud-bigtable-parent - 1.24.0 + 1.24.1 @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 1.24.0 + 1.24.1 pom import com.google.cloud google-cloud-bigtable-bom - 1.24.0 + 1.24.1 pom import diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index de27513b5a..cc0f3cd084 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -29,7 +29,7 @@ com.google.cloud google-cloud-bigtable - 1.23.2 + 1.24.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index c31da14890..6dfd4afd3a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-bigtable - 1.24.0 + 1.24.1 diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index b16ea48c0c..82aa9ceca8 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -30,7 +30,7 @@ com.google.cloud libraries-bom - 20.2.0 + 20.3.0 pom import diff --git a/synth.metadata b/synth.metadata index 08240b29c8..a7baf3e0ff 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,22 +4,22 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigtable.git", - "sha": "b3bb7f77610e48e849766a6e9dbacb98fc3f9811" + "sha": "5ccc4be2ec871f0736b49a1990bc2a11993e65f4" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "1305ca41d554eb0725237561e34129373bb8cbc1", - "internalRef": "362856902" + "sha": "43d201c7deb4639441d0cbb1c734f1e974b566eb", + "internalRef": "372995286" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "8285c2b4cdbc3771d031ad91e1c4ec9e55fff45d" + "sha": "046994f491c02806aea60118e214a9edd67f5ab7" } } ], diff --git a/versions.txt b/versions.txt index 78e11ad7ee..b698eff4ce 100644 --- a/versions.txt +++ b/versions.txt @@ -1,9 +1,9 @@ # Format: # module:released-version:current-version -google-cloud-bigtable:1.24.0:1.24.0 -grpc-google-cloud-bigtable-admin-v2:1.24.0:1.24.0 -grpc-google-cloud-bigtable-v2:1.24.0:1.24.0 -proto-google-cloud-bigtable-admin-v2:1.24.0:1.24.0 -proto-google-cloud-bigtable-v2:1.24.0:1.24.0 -google-cloud-bigtable-emulator:0.133.0:0.133.0 +google-cloud-bigtable:1.24.1:1.24.1 +grpc-google-cloud-bigtable-admin-v2:1.24.1:1.24.1 +grpc-google-cloud-bigtable-v2:1.24.1:1.24.1 +proto-google-cloud-bigtable-admin-v2:1.24.1:1.24.1 +proto-google-cloud-bigtable-v2:1.24.1:1.24.1 +google-cloud-bigtable-emulator:0.133.1:0.133.1