Skip to content

Commit 0b5f11a

Browse files
chore: update package-info with gRPC GA Allowlist (#2430)
* chore: update package-info with gRPC GA Allowlist * lint * use Direct Google Access instead of DirectPath * use Direct Google Access * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Use Direct Google Access * update additional comments --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent a6af3dd commit 0b5f11a

File tree

4 files changed

+51
-6
lines changed

4 files changed

+51
-6
lines changed

google-cloud-storage/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@
269269
<dependency>io.grpc:grpc-netty-shaded</dependency>
270270
<!--
271271
defining a runtime dependency on this so it is on the default classpath for customers wanting
272-
to use direct path
272+
to use Direct Google Access
273273
-->
274274
<dependency>io.grpc:grpc-googleapis</dependency>
275275
<dependency>io.grpc:grpc-xds</dependency>

google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcStorageOptions.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ private Tuple<StorageSettings, Opts<UserProject>> resolveSettingsAndOpts() throw
158158
URI uri = URI.create(endpoint);
159159
String scheme = uri.getScheme();
160160
int port = uri.getPort();
161-
// Gax routes the endpoint into a method which can't handle schemes, unless for direct path
162-
// try and strip here if we can
161+
// Gax routes the endpoint into a method which can't handle schemes,
162+
// unless for Direct Google Access try and strip here if we can
163163
switch (scheme) {
164164
case "http":
165165
endpoint = String.format("%s:%s", uri.getHost(), port > 0 ? port : 80);
@@ -386,11 +386,11 @@ public Builder setTerminationAwaitDuration(Duration terminationAwaitDuration) {
386386
}
387387

388388
/**
389-
* Option which signifies the client should attempt to connect to gcs via Direct Path.
389+
* Option which signifies the client should attempt to connect to gcs via Direct Google Access.
390390
*
391391
* <p><i>NOTE</i>There is no need to specify a new endpoint via {@link #setHost(String)} as the
392392
* underlying code will translate the normal {@code https://storage.googleapis.com:443} into the
393-
* proper Direct Path URI for you.
393+
* proper Direct Google Access URI for you.
394394
*
395395
* @since 2.14.0 This new api is in preview and is subject to breaking changes.
396396
*/

google-cloud-storage/src/main/java/com/google/cloud/storage/package-info.java

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,51 @@
5656
* href="https://github.com/googleapis/java-storage/blob/main/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobWriteChannel.java">
5757
* BlobWriteChannel</a>.
5858
*
59+
* <p>The GCS Java client library includes support to GCS via gRPC. When using GCS from Google
60+
* Compute Engine (GCE) this library enable higher total throughput across large workloads that run
61+
* on hundreds or thousands of VMs.
62+
*
63+
* <p>At present, GCS gRPC is GA with Allowlist. To access this API, kindly contact the Google Cloud
64+
* Storage gRPC team at [email protected] with a list of GCS buckets you would like to
65+
* Allowlist. Please note that while the **service** is GA (with Allowlist), the client library
66+
* features remain experimental and subject to change without notice. The methods to create, list,
67+
* query, and delete HMAC keys and notifications are unavailable in gRPC transport.
68+
*
69+
* <p>This example shows how to enable gRPC with Direct Google Access only supported on Google
70+
* Compute Engine.
71+
*
72+
* <pre>{@code
73+
* StorageOptions options = StorageOptions.grpc().setAttemptDirectPath(true).build();
74+
* try (Storage storage = options.getService()) {
75+
* BlobId blobId = BlobId.of("bucket", "blob_name");
76+
* Blob blob = storage.get(blobId);
77+
* if (blob != null) {
78+
* byte[] prevContent = blob.getContent();
79+
* System.out.println(new String(prevContent, UTF_8));
80+
* WritableByteChannel channel = blob.writer();
81+
* channel.write(ByteBuffer.wrap("Updated content".getBytes(UTF_8)));
82+
* channel.close();
83+
* }
84+
* }
85+
* }</pre>
86+
*
87+
* <p>This example shows how to enable gRPC.
88+
*
89+
* <pre>{@code
90+
* StorageOptions options = StorageOptions.grpc().build();
91+
* try (Storage storage = options.getService()) {
92+
* BlobId blobId = BlobId.of("bucket", "blob_name");
93+
* Blob blob = storage.get(blobId);
94+
* if (blob != null) {
95+
* byte[] prevContent = blob.getContent();
96+
* System.out.println(new String(prevContent, UTF_8));
97+
* WritableByteChannel channel = blob.writer();
98+
* channel.write(ByteBuffer.wrap("Updated content".getBytes(UTF_8)));
99+
* channel.close();
100+
* }
101+
* }
102+
* }</pre>
103+
*
59104
* @see <a href="https://cloud.google.com/storage/">Google Cloud Storage</a>
60105
*/
61106
package com.google.cloud.storage;

samples/snippets/src/main/java/com/example/storage/QuickstartGrpcDpSample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public static void main(String... args) throws Exception {
3535
// The name for the new bucket
3636
String bucketName = args[0]; // "my-new-bucket";
3737

38-
// Creates the new bucket using a request to the gRPC API via DirectPath
38+
// Creates the new bucket using a request to the gRPC API via Direct Google Access
3939
Bucket bucket = storage.create(BucketInfo.of(bucketName));
4040

4141
System.out.printf("Bucket %s created.%n", bucket.getName());

0 commit comments

Comments
 (0)