Skip to content
Open
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 @@ -31,6 +31,7 @@
import com.google.cloud.bigtable.admin.v2.models.CreateBackupRequest;
import com.google.cloud.bigtable.admin.v2.models.CreateInstanceRequest;
import com.google.cloud.bigtable.admin.v2.models.CreateTableRequest;
import com.google.cloud.bigtable.admin.v2.models.Instance;
import com.google.cloud.bigtable.admin.v2.models.Instance.Type;
import com.google.cloud.bigtable.admin.v2.models.RestoreTableRequest;
import com.google.cloud.bigtable.admin.v2.models.RestoredTableResult;
Expand Down Expand Up @@ -78,6 +79,7 @@ public class BigtableBackupIT {

private static String targetCluster;
private static String targetClusterHot;
private static Instance testInstance;
private static Table testTable;
private static Table testTableHot;

Expand All @@ -98,9 +100,12 @@ public static void setUpClass() throws InterruptedException, IOException {
String newInstanceId = PrefixGenerator.newPrefix("backupIT");
targetClusterHot = newInstanceId + "-c1";

instanceAdmin.createInstance(
CreateInstanceRequest.of(newInstanceId)
.addCluster(targetClusterHot, testEnvRule.env().getPrimaryZone(), 1, StorageType.SSD));
testInstance =
instanceAdmin.createInstance(
CreateInstanceRequest.of(newInstanceId)
.setDisplayName("BigtableBackupIT")
.addCluster(
targetClusterHot, testEnvRule.env().getPrimaryZone(), 1, StorageType.SSD));

tableAdminHot =
BigtableTableAdminClient.create(
Expand All @@ -122,6 +127,13 @@ public static void tearDownClass() {
// Ignore.
}
}
if (testInstance != null) {
try {
instanceAdmin.deleteInstance(testInstance.getId());
} catch (Exception e) {
// Ignore.
}
}
}

private static void deleteBackupIgnoreErrors(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ public static void validatePlatform() throws IOException {
LOGGER.info("Creating cluster in zone: " + zones.get(0));
instanceAdmin.createInstance(
CreateInstanceRequest.of(instanceId)
.setDisplayName("BigtableCmekIT")
.addCmekCluster(clusterId1, zones.get(0), 1, StorageType.SSD, kmsKeyName));
// Create a table. Key is inherited from the cluster configuration
tableAdmin.createTable(CreateTableRequest.of(TEST_TABLE_ID).addFamily("cf"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public static void createInstance() throws IOException {
Instance instance =
client.createInstance(
CreateInstanceRequest.of(new PrefixGenerator().newPrefix())
.setDisplayName("BigtableMaterializedViewIT")
.addCluster("my-cluster", "us-east1-c", 3, StorageType.SSD));
instanceId = instance.getId();
tableAdminClient =
Expand Down
Loading