Skip to content

Commit 3c44e18

Browse files
samples: fix sample versions and clean up resource (#2196)
* samples: fix sample versions and clean up resource * update * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 1af628d commit 3c44e18

File tree

7 files changed

+22
-5
lines changed

7 files changed

+22
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
1919
<dependency>
2020
<groupId>com.google.cloud</groupId>
2121
<artifactId>libraries-bom</artifactId>
22-
<version>26.25.0</version>
22+
<version>26.37.0</version>
2323
<type>pom</type>
2424
<scope>import</scope>
2525
</dependency>
@@ -42,7 +42,7 @@ If you are using Maven without the BOM, add this to your dependencies:
4242
<dependency>
4343
<groupId>com.google.cloud</groupId>
4444
<artifactId>google-cloud-bigtable</artifactId>
45-
<version>2.36.0</version>
45+
<version>2.37.0</version>
4646
</dependency>
4747

4848
```

samples/install-without-bom/pom.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@
2525

2626

2727
<dependencies>
28+
<!-- {x-version-update-start:google-cloud-bigtable:released} -->
2829
<!-- [START bigtable_install_without_bom] -->
2930
<dependency>
3031
<groupId>com.google.cloud</groupId>
3132
<artifactId>google-cloud-bigtable</artifactId>
32-
<version>2.36.0</version>
33+
<version>2.37.0</version>
3334
</dependency>
3435
<!-- [END bigtable_install_without_bom] -->
36+
<!-- {x-version-update-end} -->
3537

3638
<dependency>
3739
<groupId>junit</groupId>

samples/snippets/pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,13 @@
2323
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2424
</properties>
2525

26-
2726
<!-- [START bigtable_install_with_bom] -->
2827
<dependencyManagement>
2928
<dependencies>
3029
<dependency>
3130
<groupId>com.google.cloud</groupId>
3231
<artifactId>libraries-bom</artifactId>
33-
<version>26.25.0</version>
32+
<version>26.37.0</version>
3433
<type>pom</type>
3534
<scope>import</scope>
3635
</dependency>

samples/snippets/src/main/java/com/example/bigtable/InstanceAdminExample.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ public void run() {
8787
addCluster();
8888
deleteCluster();
8989
deleteInstance();
90+
close();
91+
}
92+
93+
// Close the client
94+
void close() {
9095
adminClient.close();
9196
}
9297

samples/snippets/src/main/java/com/example/bigtable/TableAdminExample.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ public void run() {
108108
printModifiedColumnFamily();
109109
deleteColumnFamily();
110110
deleteTable();
111+
close();
112+
}
113+
114+
// Close the client
115+
void close() {
111116
adminClient.close();
112117
}
113118

samples/snippets/src/test/java/com/example/bigtable/InstanceAdminExampleTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ public void after() {
7878
if (adminClient.exists(instanceId)) {
7979
adminClient.deleteInstance(instanceId);
8080
}
81+
if (instanceAdmin != null) {
82+
instanceAdmin.close();
83+
}
8184
}
8285

8386
@Test

samples/snippets/src/test/java/com/example/bigtable/TableAdminExampleTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ public void after() {
7777
if (adminClient.exists(tableId)) {
7878
adminClient.deleteTable(tableId);
7979
}
80+
if (tableAdmin != null) {
81+
tableAdmin.close();
82+
}
8083
}
8184

8285
@Test

0 commit comments

Comments
 (0)