Releases: googleapis/java-storage
v2.16.0
2.16.0 (2022-12-06)
Features
- Add {Compose,Rewrite,StartResumableWrite}Request.object_checksums and Bucket.RetentionPolicy.retention_duration (#1790) (31c1b18)
- Added a new retention_duration field of Duration type (31c1b18)
- Added object_checksums for compose/rewrite/startResumableWrite request (31c1b18)
Bug Fixes
- Removed WriteObject routing annotations (31c1b18)
Documentation
- Clarified relative resource names in gRPC IAM RPCs (31c1b18)
- Clarified the object can be deleted via DeleteObject (31c1b18)
- Updated the document link for
Naming Guidelines
(31c1b18)
Dependencies
- Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.1.0 (#1797) (b1d0266)
- Update dependency org.apache.httpcomponents:httpclient to v4.5.14 (#1795) (cf900f4)
- Update dependency org.apache.httpcomponents:httpcore to v4.4.16 (#1786) (3bf403e)
- Update dependency org.apache.httpcomponents:httpmime to v4.5.14 (#1796) (c9ee3ca)
- Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.18 (#1782) (5bc5176)
- Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.19 (#1791) (3184d65)
v2.15.1
v2.15.0
v2.14.0
2.14.0 (2022-10-26)
Google Cloud Storage gRPC API Preview
The first release of google-cloud-storage
with support for a subset of the Google Cloud Storage gRPC API which is in private preview. The most common operations have all been implemented and are available for experimentation.
Given not all public api surface of google-cloud-storage
classes are supported for gRPC a new annotation @TransportCompatibility
has been added to various classes, methods and fields/enum values to signal where that thing can be expected to work. As we implement more of the operations these annotations will be updated.
All new gRPC related APIs are annotated with @BetaApi
to denote they are in preview and the possibility of breaking change is present. At this time, opting to use any of the gRPC transport mode means you are okay with the possibility of a breaking change happening. When the APIs are out of preview, we will remove the @BetaApi
annotation to signal they are now considered stable and will not break outside a major version.
NOTICE: Using the gRPC transport is exclusive. Any operations which have not yet been implemented for gRPC will result in a runtime error. For those operations which are not yet implemented, please continue to use the existing HTTP transport.
Special thanks (in alphabetical order) to @BenWhitehead, @frankyn, @JesseLovelace and @sydney-munro for their hard work on this effort.
Notable Improvements
-
For all gRPC media related operations (upload/download) we are now more resource courteous then the corresponding HTTP counterpart. Buffers are fixed to their specified size (can't arbitrarily grow without bounds), are allocated lazily and only if necessary.
- Investigation into the possibility of backporting these improvements to the HTTP counterparts is ongoing
-
Preview support for Accessing GCS via gRPC
- Set the environment variable
GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS=true
, then run your program. - When configuring your
StorageOptions
mimic the following:StorageOptions.grpc() .setAttemptDirectPath(true) .build()
- Internally the default host endpoint
https://storage.googleapis.com:443
will be transformed to the applicablegoogle-c2p-experimental:///storage.googleapis.com
- Set the environment variable
-
Support for
java.time
types on model classes- Points in time are now represented with
java.time.OffsetDateTime
, while durations are represented withjava.time.Duration
- All existing
Long
centric methods are still present, but have been deprecated in favor of their correspondingjava.time
variant - At the next major version, these deprecated methods will be replaced with types from
java.time
and thejava.time
variant methods will be deprecated
- Points in time are now represented with
-
com.google.cloud.storage.Storage
now extendsjava.lang.AutoClosable
thereby allowing it to be used in a try-with-resource block.- When using gRPC transport be sure to call
Storage#close()
when complete so it can clean up the gRPC middleware and resources. - When using HTTP transport calling
Storage#close()
will gracefully no-op, allowing for the same style of use regardless of transport.
- When using gRPC transport be sure to call
-
When downloading an object via gRPC idle stream detection is now present which will restart a stream if it is determined to be idle and has remaining retry budget
-
Update equals()/hashCode() methods to follow the expected contract
-
The new gRPC transport based implementation continues to provide idempotency aware automatic retries the same as HTTP
-
Expanded test suite which should bring improved stability and reliability to both HTTP and gRPC transport implementations
-
New
com.google.cloud:google-cloud-storage-bom
maven bom available to use for coordinated dependency version resolution for multiple storage artifacts
Not yet implemented
-
All ACL specific operations.
- These will be implemented in the near future
- In the interim, reading and setting of ACLs and Default Object ACLs can be performed via Object/Bucket operations
-
All Notification related operations
- These will be implemented in the near future
- In the interim, please continue to use the HTTP transport
-
ReadChannel#capture()
,RestorableState<ReadChannel>#restore()
,WriteChannel#capture()
,RestorableState<WriteChannel>#restore()
,CopyWriter#capture()
andRestorableState<CopyWriter>#capture()
are not yet implemented.
- These use cases will be implemented in the near future. We are still determining the route we want to take.
- Batch and "bulk" operations which depend on batch
- GCS gRPC does not currently define a batch method whereas HTTP does. This means
Storage#batch()
is only supported for HTTP transport. - The following methods which currently depend on
Storage#batch()
are currently only supported for HTTP transport
com.google.cloud.storage.Storage#get(com.google.cloud.storage.BlobId...)
com.google.cloud.storage.Storage#get(java.lang.Iterable<com.google.cloud.storage.BlobId>)
com.google.cloud.storage.Storage#update(com.google.cloud.storage.BlobInfo...)
com.google.cloud.storage.Storage#update(java.lang.Iterable<com.google.cloud.storage.BlobInfo>)
com.google.cloud.storage.Storage#delete(com.google.cloud.storage.BlobId...)
com.google.cloud.storage.Storage#delete(java.lang.Iterable<com.google.cloud.storage.BlobId>)
- GCS gRPC does not currently define a batch method whereas HTTP does. This means
One-Time Inconveniences
-
All classes under
com.google.cloud.storage
which areSerializable
have newserialVersionUIDs
and are incompatible with any previous version.- Several classes had to change in order to support both HTTP and gRPC at the same time. We were able to preserve Source and Binary runtime level compatibility but had to break Serialization across versions.
- If you depend upon Java Serialization, please ensure you are using the same version of
google-cloud-storage
in both locations.
-
The cause chains of some Exceptions have changed.
- When using gRPC,
StorageException
causes will use the correspondingcom.google.api.gax.rpc.ApiException
for the failure type instead of the HTTPcom.google.api.client.googleapis.json.GoogleJsonError
- In an effort to preserve compatibility of your existing error handling code, we will translate from the gRPC error code to the similar HTTP Status code before constructing the
StorageException
preserving the integrity ofStorageException#getCode()
- In an effort to preserve compatibility of your existing error handling code, we will translate from the gRPC error code to the similar HTTP Status code before constructing the
- RetryHelper$RetryHelperException will no longer appear in exception cause chains for either HTTP or gRPC
- When using gRPC,
Not Supported
Given the nature of the gRPC transport a few things are explicitly not supported when using gRPC, and require HTTP transport. Attempting to use any of the following methods will result in a runtime error stating they are not supported for gRPC transport.
Storage#writer(URL)
does not work for gRPC. gRPC does not provide a means of exchanging an HTTP url for a resumable session idStorage#signUrl
is not supported for gRPC transport. Signed URLs explicitly generate HTTP urls and are only supported for the HTTP transport based implementation.Storage#generateSignedPostPolicyV4
is not supported for gRPC transport. Signed URLs explicitly generate HTTP urls and are only supported for the HTTP transport based implementation.
Known Issues
Features
Bug Fixes
- Properly implement GrpcBlobReadChannel#isOpen (#1733) (04e5166)
- Update BucketInfo.LifecycleRule.LifecycleCondition equals and hashCode to include match prefix and suffix (#1729) (9664e8a)
Dependencies
v2.13.1
v2.6.2
v2.13.0
2.13.0 (2022-10-03)
Features
- Regenerate gapic storage v2 client as of googleapis/googleapis@844d0f7 (#1673) (bd818b3)
Documentation
Dependencies
- Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.4 (#1685) (3d8f550)
- Update dependency gcp-releasetool to v1.8.9 (#1684) (54a5159)
- Update dependency importlib-metadata to v4.13.0 (#1682) (2487aff)
- Update dependency importlib-metadata to v5 (#1683) (020fe8c)
- Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.14 (#1643) (ab3a198)
- Update dependency org.junit.vintage:junit-vintage-engine to v5.9.1 (#1635) (ba85ab6)