Skip to content

Commit 3789d13

Browse files
chore: generate libraries at Wed Dec 4 18:25:42 UTC 2024
1 parent 8b8abac commit 3789d13

File tree

1 file changed

+22
-19
lines changed

1 file changed

+22
-19
lines changed

README.md

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -212,29 +212,29 @@ In this feature launch, the [Java Datastore client](https://github.com/googleapi
212212
The client can be built from the `grpc-experimental` branch on GitHub. For private preview, you can also download the artifact with the instructions provided below.
213213

214214
1. Download the datastore private preview package with dependencies:
215-
```python
216-
https://datastore-sdk-feature-release.web.app/google-cloud-datastore-2.20.0-grpc-experimental-1-SNAPSHOT-jar-with-dependencies.jar
217-
```
215+
```python
216+
https://datastore-sdk-feature-release.web.app/google-cloud-datastore-2.20.0-grpc-experimental-1-SNAPSHOT-jar-with-dependencies.jar
217+
```
218218
2. Run the following commands to install JDK locally:
219-
```python
220-
mvn install:install-file -Dfile=<path-to-downloaded-jar> -DgroupId=com.google.cloud -DartifactId=google-cloud-datastore -Dversion=2.20.0-grpc
221-
```
219+
```python
220+
mvn install:install-file -Dfile=<path-to-downloaded-jar> -DgroupId=com.google.cloud -DartifactId=google-cloud-datastore -Dversion=2.20.0-grpc
221+
```
222222
3. Edit your pom.xml to add above package to `<dependencies/>` section:
223-
```xml
224-
<dependency>
223+
```xml
224+
<dependency>
225225
<groupId>com.google.cloud</groupId>
226226
<artifactId>google-cloud-datastore</artifactId>
227227
<version>2.20.0-grpc-experimental-1-SNAPSHOT</version>
228-
</dependency>
229-
```
228+
</dependency>
229+
```
230230

231231
And if you have not yet, add below to `<repositories/>` section:
232-
```xml
233-
<repository>
234-
<id>local-repo</id>
235-
<url>file://${user.home}/.m2/repository</url>
236-
</repository>
237-
```
232+
```xml
233+
<repository>
234+
<id>local-repo</id>
235+
<url>file://${user.home}/.m2/repository</url>
236+
</repository>
237+
```
238238

239239
#### How to Use
240240
To opt-in to the gRPC transport behavior, simply add the below line of code (`setTransportOptions`) to your Datastore client instantiation.
@@ -286,7 +286,7 @@ There are new gRPC specific features available to use in this update.
286286

287287
##### Connection Pool
288288
A connection pool, also known as a channel pool, is a cache of database connections that are shared and reused to improve connection latency and performance. With this update, now you will be able to configure the channel pool to improve application performance. This section guides you in determining the optimal connection pool size and configuring it within the Java datastore client.
289-
To customize the number of channels your client uses, you can update the channel provider in the DatastoreOptions.
289+
To customize the number of channels your client uses, you can update the channel provider in the DatastoreOptions.
290290
###### Determine the best connection pool size
291291
The default connection pool size is right for most applications, and in most cases there's no need to change it.
292292

@@ -310,12 +310,15 @@ These steps are expressed in the following equations:
310310
```
311311

312312
###### Example
313-
Your application typically sends 50,000 requests per second, and the average latency is 10 ms. Divide 1,000 by 10 ms to determine that you can send 100 requests serially per second. Divide that number into 50,000 to get the parallelism needed to send 50,000 QPS: 500. Each channel can have at most 100 requests out concurrently, and your target channel utilization is between 10 and 50 concurrent streams. Therefore, to calculate the minimum, divide 500 by 50 to get 10. To find the maximum, divide 500 by 10 to get 50. This means that your channel pool size for this example should be between 10 and 50 connections.
313+
Your application typically sends 50,000 requests per second, and the average latency is 10 ms. Divide 1,000 by 10 ms to determine that you can send 100 requests serially per second.
314+
Divide that number into 50,000 to get the parallelism needed to send 50,000 QPS: 500. Each channel can have at most 100 requests out concurrently, and your target channel utilization
315+
is between 10 and 50 concurrent streams. Therefore, to calculate the minimum, divide 500 by 50 to get 10. To find the maximum, divide 500 by 10 to get 50. This means that your channel
316+
pool size for this example should be between 10 and 50 connections.
314317

315318
It is also important to monitor your traffic after making changes and adjust the number of connections in your pool if necessary.
316319

317320
###### Set the pool size
318-
The following code sample demonstrates how to configure the channel pool in the client libraries using `DatastoreOptions`.
321+
The following code sample demonstrates how to configure the channel pool in the client libraries using `DatastoreOptions`.
319322
See [ChannelPoolSettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.grpc.ChannelPoolSettings) and [Performance Best Practices](https://grpc.io/docs/guides/performance/) for more information on channel pools and best practices for performance.
320323

321324
Code Example

0 commit comments

Comments
 (0)