Skip to content

Commit 0313948

Browse files
chore: generate libraries at Wed Aug 20 23:03:06 UTC 2025
1 parent 8580fe1 commit 0313948

File tree

3 files changed

+19
-18
lines changed

3 files changed

+19
-18
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-datastore/tre
363363

364364
| Sample | Source Code | Try it |
365365
| --------------------------- | --------------------------------- | ------ |
366+
| Configure Connection Pool | [source code](https://github.com/googleapis/java-datastore/blob/main/samples/snippets/src/main/java/com/example/datastore/ConfigureConnectionPool.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-datastore&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/datastore/ConfigureConnectionPool.java) |
366367
| Quickstart Sample | [source code](https://github.com/googleapis/java-datastore/blob/main/samples/snippets/src/main/java/com/example/datastore/QuickstartSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-datastore&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/datastore/QuickstartSample.java) |
367368
| Avg Aggregation On Kind | [source code](https://github.com/googleapis/java-datastore/blob/main/samples/snippets/src/main/java/com/example/datastore/aggregation/AvgAggregationOnKind.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-datastore&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/datastore/aggregation/AvgAggregationOnKind.java) |
368369
| Avg Aggregation With Limit | [source code](https://github.com/googleapis/java-datastore/blob/main/samples/snippets/src/main/java/com/example/datastore/aggregation/AvgAggregationWithLimit.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-datastore&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/datastore/aggregation/AvgAggregationWithLimit.java) |

samples/snippets/src/main/java/com/example/datastore/ConfigureConnectionPool.java

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import com.google.cloud.datastore.v1.DatastoreSettings;
2525
import com.google.cloud.grpc.GrpcTransportOptions;
2626

27-
2827
public class ConfigureConnectionPool {
2928

3029
public static void main(String... args) throws Exception {
@@ -38,22 +37,25 @@ public static void main(String... args) throws Exception {
3837
.build())
3938
.build();
4039

41-
DatastoreOptions datastoreOptions = DatastoreOptions.newBuilder()
42-
.setProjectId("my-project")
43-
.setChannelProvider(channelProvider)
44-
.setTransportOptions(GrpcTransportOptions.newBuilder().build())
45-
.build();
40+
DatastoreOptions datastoreOptions =
41+
DatastoreOptions.newBuilder()
42+
.setProjectId("my-project")
43+
.setChannelProvider(channelProvider)
44+
.setTransportOptions(GrpcTransportOptions.newBuilder().build())
45+
.build();
4646

4747
ChannelPoolSettings channelPoolSettings =
4848
((InstantiatingGrpcChannelProvider) datastoreOptions.getTransportChannelProvider())
4949
.getChannelPoolSettings();
5050

51-
System.out.printf(String.format(
52-
"Connected with pool with InitialChannelCount: %d, MinChannelCount: %d, MaxChannelCount: %d",
53-
channelPoolSettings.getInitialChannelCount(), channelPoolSettings.getMinChannelCount(),
54-
channelPoolSettings.getMaxChannelCount()
55-
));
51+
System.out.printf(
52+
String.format(
53+
"Connected with pool with InitialChannelCount: %d, MinChannelCount: %d,"
54+
+ " MaxChannelCount: %d",
55+
channelPoolSettings.getInitialChannelCount(),
56+
channelPoolSettings.getMinChannelCount(),
57+
channelPoolSettings.getMaxChannelCount()));
5658
}
5759
}
5860

59-
// [END datastore_configure_connection_pool]
61+
// [END datastore_configure_connection_pool]

samples/snippets/src/test/java/com/example/datastore/ConfigureConnectionPoolIT.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,18 @@
2222
import org.junit.runner.RunWith;
2323
import org.junit.runners.JUnit4;
2424

25-
/**
26-
* Tests for ConfigureConnectionPool sample.
27-
*/
25+
/** Tests for ConfigureConnectionPool sample. */
2826
@RunWith(JUnit4.class)
2927
@SuppressWarnings("checkstyle:abbreviationaswordinname")
3028
public class ConfigureConnectionPoolIT {
3129

32-
@Rule
33-
public final SystemsOutRule systemsOutRule = new SystemsOutRule();
30+
@Rule public final SystemsOutRule systemsOutRule = new SystemsOutRule();
3431

3532
@Test
3633
public void testConfigureConnectionPool() throws Exception {
3734
ConfigureConnectionPool.main();
3835
systemsOutRule.assertContains(
39-
"Connected with pool with InitialChannelCount: 10, MinChannelCount: 5, MaxChannelCount: 200");
36+
"Connected with pool with InitialChannelCount: 10, MinChannelCount: 5, MaxChannelCount:"
37+
+ " 200");
4038
}
4139
}

0 commit comments

Comments
 (0)