Skip to content

Commit

Permalink
Merge branch 'main' into notifsamples
Browse files Browse the repository at this point in the history
  • Loading branch information
sydney-munro committed Mar 30, 2022
2 parents be1fac7 + c65b9d3 commit 5ff03b3
Show file tree
Hide file tree
Showing 49 changed files with 3,013 additions and 2,389 deletions.
30 changes: 30 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,35 @@
# Changelog

## [2.6.0](https://github.com/googleapis/java-storage/compare/v2.5.1...v2.6.0) (2022-03-30)


### Features

* replace enum with string representation for predefined ACLs and public_access_prevention ([#1323](https://github.com/googleapis/java-storage/issues/1323)) ([4dd1a88](https://github.com/googleapis/java-storage/commit/4dd1a8800317343bb0cd575864683e580f9ccd29))


### Bug Fixes

* **java:** add configurations for Storage tests ([#1305](https://github.com/googleapis/java-storage/issues/1305)) ([2bacf92](https://github.com/googleapis/java-storage/commit/2bacf92799e8a0fbdc1b5cfcfc6ef8d806a53fa3))
* update boundary checking of BlobReadChannel when limit() is used ([#1324](https://github.com/googleapis/java-storage/issues/1324)) ([f21f624](https://github.com/googleapis/java-storage/commit/f21f624f1645b5ada350c04c774f9f113e76e971))


### Dependencies

* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.9.0 ([#1321](https://github.com/googleapis/java-storage/issues/1321)) ([f48d8dd](https://github.com/googleapis/java-storage/commit/f48d8dd09e918ba4a54fccaebf65feaba4f6e206))


### Documentation

* adjust retry settings for hmac samples ([#1303](https://github.com/googleapis/java-storage/issues/1303)) ([d0c5361](https://github.com/googleapis/java-storage/commit/d0c5361e9e4996f8a99754381e5a28a843e6de2a))

### [2.5.1](https://github.com/googleapis/java-storage/compare/v2.5.0...v2.5.1) (2022-03-28)


### Dependencies

* update dependency com.google.cloud:google-cloud-pubsub to v1.116.2 ([#1310](https://github.com/googleapis/java-storage/issues/1310)) ([fb64493](https://github.com/googleapis/java-storage/commit/fb644932d4350b4e33481abda8cc8f498f9da85e))

## [2.5.0](https://github.com/googleapis/java-storage/compare/v2.4.5...v2.5.0) (2022-03-25)


Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -41,7 +41,7 @@ If you are using Maven without BOM, add this to your dependencies:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-storage</artifactId>
<version>2.5.0</version>
<version>2.5.1</version>
</dependency>

```
Expand Down
4 changes: 2 additions & 2 deletions gapic-google-cloud-storage-v2/pom.xml
Expand Up @@ -4,13 +4,13 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.api.grpc</groupId>
<artifactId>gapic-google-cloud-storage-v2</artifactId>
<version>2.5.1-alpha-SNAPSHOT</version><!-- {x-version-update:gapic-google-cloud-storage-v2:current} -->
<version>2.6.1-alpha-SNAPSHOT</version><!-- {x-version-update:gapic-google-cloud-storage-v2:current} -->
<name>gapic-google-cloud-storage-v2</name>
<description>GRPC library for gapic-google-cloud-storage-v2</description>
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-storage-parent</artifactId>
<version>2.5.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage:current} -->
<version>2.6.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage:current} -->
</parent>
<dependencies>
<dependency>
Expand Down
Expand Up @@ -436,8 +436,8 @@ public final Bucket createBucket(String parent, Bucket bucket, String bucketId)
* .setParent(ProjectName.of("[PROJECT]").toString())
* .setBucket(Bucket.newBuilder().build())
* .setBucketId("bucketId-1603305307")
* .setPredefinedAcl(PredefinedBucketAcl.forNumber(0))
* .setPredefinedDefaultObjectAcl(PredefinedObjectAcl.forNumber(0))
* .setPredefinedAcl("predefinedAcl1207041188")
* .setPredefinedDefaultObjectAcl("predefinedDefaultObjectAcl2109168048")
* .build();
* Bucket response = storageClient.createBucket(request);
* }
Expand All @@ -463,8 +463,8 @@ public final Bucket createBucket(CreateBucketRequest request) {
* .setParent(ProjectName.of("[PROJECT]").toString())
* .setBucket(Bucket.newBuilder().build())
* .setBucketId("bucketId-1603305307")
* .setPredefinedAcl(PredefinedBucketAcl.forNumber(0))
* .setPredefinedDefaultObjectAcl(PredefinedObjectAcl.forNumber(0))
* .setPredefinedAcl("predefinedAcl1207041188")
* .setPredefinedDefaultObjectAcl("predefinedDefaultObjectAcl2109168048")
* .build();
* ApiFuture<Bucket> future = storageClient.createBucketCallable().futureCall(request);
* // Do something.
Expand Down Expand Up @@ -1089,8 +1089,8 @@ public final Bucket updateBucket(Bucket bucket, FieldMask updateMask) {
* .setBucket(Bucket.newBuilder().build())
* .setIfMetagenerationMatch(1043427781)
* .setIfMetagenerationNotMatch(1025430873)
* .setPredefinedAcl(PredefinedBucketAcl.forNumber(0))
* .setPredefinedDefaultObjectAcl(PredefinedObjectAcl.forNumber(0))
* .setPredefinedAcl("predefinedAcl1207041188")
* .setPredefinedDefaultObjectAcl("predefinedDefaultObjectAcl2109168048")
* .setUpdateMask(FieldMask.newBuilder().build())
* .setCommonRequestParams(CommonRequestParams.newBuilder().build())
* .build();
Expand Down Expand Up @@ -1118,8 +1118,8 @@ public final Bucket updateBucket(UpdateBucketRequest request) {
* .setBucket(Bucket.newBuilder().build())
* .setIfMetagenerationMatch(1043427781)
* .setIfMetagenerationNotMatch(1025430873)
* .setPredefinedAcl(PredefinedBucketAcl.forNumber(0))
* .setPredefinedDefaultObjectAcl(PredefinedObjectAcl.forNumber(0))
* .setPredefinedAcl("predefinedAcl1207041188")
* .setPredefinedDefaultObjectAcl("predefinedDefaultObjectAcl2109168048")
* .setUpdateMask(FieldMask.newBuilder().build())
* .setCommonRequestParams(CommonRequestParams.newBuilder().build())
* .build();
Expand Down Expand Up @@ -1576,7 +1576,7 @@ public final ListNotificationsPagedResponse listNotifications(ListNotificationsR
* ComposeObjectRequest.newBuilder()
* .setDestination(Object.newBuilder().build())
* .addAllSourceObjects(new ArrayList<ComposeObjectRequest.SourceObject>())
* .setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0))
* .setDestinationPredefinedAcl("destinationPredefinedAcl1111125814")
* .setIfGenerationMatch(-1086241088)
* .setIfMetagenerationMatch(1043427781)
* .setKmsKey(
Expand Down Expand Up @@ -1608,7 +1608,7 @@ public final Object composeObject(ComposeObjectRequest request) {
* ComposeObjectRequest.newBuilder()
* .setDestination(Object.newBuilder().build())
* .addAllSourceObjects(new ArrayList<ComposeObjectRequest.SourceObject>())
* .setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0))
* .setDestinationPredefinedAcl("destinationPredefinedAcl1111125814")
* .setIfGenerationMatch(-1086241088)
* .setIfMetagenerationMatch(1043427781)
* .setKmsKey(
Expand Down Expand Up @@ -1949,7 +1949,7 @@ public final Object updateObject(Object object, FieldMask updateMask) {
* .setIfGenerationNotMatch(1475720404)
* .setIfMetagenerationMatch(1043427781)
* .setIfMetagenerationNotMatch(1025430873)
* .setPredefinedAcl(PredefinedObjectAcl.forNumber(0))
* .setPredefinedAcl("predefinedAcl1207041188")
* .setUpdateMask(FieldMask.newBuilder().build())
* .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
* .setCommonRequestParams(CommonRequestParams.newBuilder().build())
Expand Down Expand Up @@ -1980,7 +1980,7 @@ public final Object updateObject(UpdateObjectRequest request) {
* .setIfGenerationNotMatch(1475720404)
* .setIfMetagenerationMatch(1043427781)
* .setIfMetagenerationNotMatch(1025430873)
* .setPredefinedAcl(PredefinedObjectAcl.forNumber(0))
* .setPredefinedAcl("predefinedAcl1207041188")
* .setUpdateMask(FieldMask.newBuilder().build())
* .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
* .setCommonRequestParams(CommonRequestParams.newBuilder().build())
Expand Down Expand Up @@ -2238,7 +2238,7 @@ public final UnaryCallable<ListObjectsRequest, ListObjectsResponse> listObjectsC
* .setSourceObject("sourceObject1196439354")
* .setSourceGeneration(1232209852)
* .setRewriteToken("rewriteToken80654285")
* .setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0))
* .setDestinationPredefinedAcl("destinationPredefinedAcl1111125814")
* .setIfGenerationMatch(-1086241088)
* .setIfGenerationNotMatch(1475720404)
* .setIfMetagenerationMatch(1043427781)
Expand Down Expand Up @@ -2285,7 +2285,7 @@ public final RewriteResponse rewriteObject(RewriteObjectRequest request) {
* .setSourceObject("sourceObject1196439354")
* .setSourceGeneration(1232209852)
* .setRewriteToken("rewriteToken80654285")
* .setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0))
* .setDestinationPredefinedAcl("destinationPredefinedAcl1111125814")
* .setIfGenerationMatch(-1086241088)
* .setIfGenerationNotMatch(1475720404)
* .setIfMetagenerationMatch(1043427781)
Expand Down
Expand Up @@ -197,7 +197,7 @@ public void getBucketTest() throws Exception {
.setRetentionPolicy(Bucket.RetentionPolicy.newBuilder().build())
.setIamConfig(Bucket.IamConfig.newBuilder().build())
.setSatisfiesPzs(true)
.setCustomPlacementConfig(Bucket.CustomPlacementConfig.newBuilder().build())
.setAutoclass(Bucket.Autoclass.newBuilder().build())
.build();
mockStorage.addResponse(expectedResponse);

Expand Down Expand Up @@ -260,7 +260,7 @@ public void getBucketTest2() throws Exception {
.setRetentionPolicy(Bucket.RetentionPolicy.newBuilder().build())
.setIamConfig(Bucket.IamConfig.newBuilder().build())
.setSatisfiesPzs(true)
.setCustomPlacementConfig(Bucket.CustomPlacementConfig.newBuilder().build())
.setAutoclass(Bucket.Autoclass.newBuilder().build())
.build();
mockStorage.addResponse(expectedResponse);

Expand Down Expand Up @@ -323,7 +323,7 @@ public void createBucketTest() throws Exception {
.setRetentionPolicy(Bucket.RetentionPolicy.newBuilder().build())
.setIamConfig(Bucket.IamConfig.newBuilder().build())
.setSatisfiesPzs(true)
.setCustomPlacementConfig(Bucket.CustomPlacementConfig.newBuilder().build())
.setAutoclass(Bucket.Autoclass.newBuilder().build())
.build();
mockStorage.addResponse(expectedResponse);

Expand Down Expand Up @@ -392,7 +392,7 @@ public void createBucketTest2() throws Exception {
.setRetentionPolicy(Bucket.RetentionPolicy.newBuilder().build())
.setIamConfig(Bucket.IamConfig.newBuilder().build())
.setSatisfiesPzs(true)
.setCustomPlacementConfig(Bucket.CustomPlacementConfig.newBuilder().build())
.setAutoclass(Bucket.Autoclass.newBuilder().build())
.build();
mockStorage.addResponse(expectedResponse);

Expand Down Expand Up @@ -549,7 +549,7 @@ public void lockBucketRetentionPolicyTest() throws Exception {
.setRetentionPolicy(Bucket.RetentionPolicy.newBuilder().build())
.setIamConfig(Bucket.IamConfig.newBuilder().build())
.setSatisfiesPzs(true)
.setCustomPlacementConfig(Bucket.CustomPlacementConfig.newBuilder().build())
.setAutoclass(Bucket.Autoclass.newBuilder().build())
.build();
mockStorage.addResponse(expectedResponse);

Expand Down Expand Up @@ -613,7 +613,7 @@ public void lockBucketRetentionPolicyTest2() throws Exception {
.setRetentionPolicy(Bucket.RetentionPolicy.newBuilder().build())
.setIamConfig(Bucket.IamConfig.newBuilder().build())
.setSatisfiesPzs(true)
.setCustomPlacementConfig(Bucket.CustomPlacementConfig.newBuilder().build())
.setAutoclass(Bucket.Autoclass.newBuilder().build())
.build();
mockStorage.addResponse(expectedResponse);

Expand Down Expand Up @@ -927,7 +927,7 @@ public void updateBucketTest() throws Exception {
.setRetentionPolicy(Bucket.RetentionPolicy.newBuilder().build())
.setIamConfig(Bucket.IamConfig.newBuilder().build())
.setSatisfiesPzs(true)
.setCustomPlacementConfig(Bucket.CustomPlacementConfig.newBuilder().build())
.setAutoclass(Bucket.Autoclass.newBuilder().build())
.build();
mockStorage.addResponse(expectedResponse);

Expand Down Expand Up @@ -1337,7 +1337,7 @@ public void composeObjectTest() throws Exception {
ComposeObjectRequest.newBuilder()
.setDestination(Object.newBuilder().build())
.addAllSourceObjects(new ArrayList<ComposeObjectRequest.SourceObject>())
.setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0))
.setDestinationPredefinedAcl("destinationPredefinedAcl1111125814")
.setIfGenerationMatch(-1086241088)
.setIfMetagenerationMatch(1043427781)
.setKmsKey(
Expand Down Expand Up @@ -1381,7 +1381,7 @@ public void composeObjectExceptionTest() throws Exception {
ComposeObjectRequest.newBuilder()
.setDestination(Object.newBuilder().build())
.addAllSourceObjects(new ArrayList<ComposeObjectRequest.SourceObject>())
.setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0))
.setDestinationPredefinedAcl("destinationPredefinedAcl1111125814")
.setIfGenerationMatch(-1086241088)
.setIfMetagenerationMatch(1043427781)
.setKmsKey(
Expand Down Expand Up @@ -1926,7 +1926,7 @@ public void rewriteObjectTest() throws Exception {
.setSourceObject("sourceObject1196439354")
.setSourceGeneration(1232209852)
.setRewriteToken("rewriteToken80654285")
.setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0))
.setDestinationPredefinedAcl("destinationPredefinedAcl1111125814")
.setIfGenerationMatch(-1086241088)
.setIfGenerationNotMatch(1475720404)
.setIfMetagenerationMatch(1043427781)
Expand Down Expand Up @@ -2012,7 +2012,7 @@ public void rewriteObjectExceptionTest() throws Exception {
.setSourceObject("sourceObject1196439354")
.setSourceGeneration(1232209852)
.setRewriteToken("rewriteToken80654285")
.setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0))
.setDestinationPredefinedAcl("destinationPredefinedAcl1111125814")
.setIfGenerationMatch(-1086241088)
.setIfGenerationNotMatch(1475720404)
.setIfMetagenerationMatch(1043427781)
Expand Down
4 changes: 2 additions & 2 deletions google-cloud-storage/pom.xml
Expand Up @@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>google-cloud-storage</artifactId>
<version>2.5.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage:current} -->
<version>2.6.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage:current} -->
<packaging>jar</packaging>
<name>Google Cloud Storage</name>
<url>https://github.com/googleapis/java-storage</url>
Expand All @@ -12,7 +12,7 @@
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-storage-parent</artifactId>
<version>2.5.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage:current} -->
<version>2.6.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage:current} -->
</parent>
<properties>
<site.installationModule>google-cloud-storage</site.installationModule>
Expand Down
Expand Up @@ -125,6 +125,10 @@ public int read(ByteBuffer byteBuffer) throws IOException {
}
final int toRead =
Math.toIntExact(Math.min(limit - position, Math.max(byteBuffer.remaining(), chunkSize)));
if (toRead <= 0) {
endOfStream = true;
return -1;
}
try {
ResultRetryAlgorithm<?> algorithm =
retryAlgorithmManager.getForObjectsGet(storageObject, requestOptions);
Expand Down
@@ -0,0 +1,5 @@
[
{
"interfaces":["com.google.cloud.storage.spi.v1.StorageRpc"]
}
]
@@ -0,0 +1,4 @@
[{
"name":"com.google.cloud.storage.BlobInfo$ImmutableEmptyMap",
"methods":[{"name":"<init>","parameterTypes":[] }]}
]
Expand Up @@ -149,7 +149,13 @@ public static Collection<Object[]> testCases() throws IOException {
.setMappings(new RpcMethodMappings())
.setProjectId("conformance-tests")
.setHost(TEST_BENCH.getBaseUri().replaceAll("https?://", ""))
.setTestAllowFilter(RetryTestCaseResolver.includeAll())
.setTestAllowFilter(
RetryTestCaseResolver.includeAll()
.and(
(m, trc) ->
trc.getScenarioId()
< 7) // Temporarily exclude resumable media scenarios
)
.build();

List<RetryTestCase> retryTestCases = resolver.getRetryTestCases();
Expand Down
Expand Up @@ -111,13 +111,21 @@ final class TestRetryConformance {
.map(s -> s.replace("return-", ""))
.collect(Collectors.joining("_"));
this.bucketName =
String.format("%s_s%03d-%s-m%03d_bkt1", BASE_ID, scenarioId, instructionsString, mappingId);
String.format(
"%s_s%03d-%s-m%03d_bkt1",
BASE_ID, scenarioId, instructionsString.toLowerCase(), mappingId);
this.bucketName2 =
String.format("%s_s%03d-%s-m%03d_bkt2", BASE_ID, scenarioId, instructionsString, mappingId);
String.format(
"%s_s%03d-%s-m%03d_bkt2",
BASE_ID, scenarioId, instructionsString.toLowerCase(), mappingId);
this.userProject =
String.format("%s_s%03d-%s-m%03d_prj1", BASE_ID, scenarioId, instructionsString, mappingId);
String.format(
"%s_s%03d-%s-m%03d_prj1",
BASE_ID, scenarioId, instructionsString.toLowerCase(), mappingId);
this.objectName =
String.format("%s_s%03d-%s-m%03d_obj1", BASE_ID, scenarioId, instructionsString, mappingId);
String.format(
"%s_s%03d-%s-m%03d_obj1",
BASE_ID, scenarioId, instructionsString.toLowerCase(), mappingId);
}

public String getProjectId() {
Expand Down

0 comments on commit 5ff03b3

Please sign in to comment.