Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5c9cecf

Browse files
authored
fix: update grpc bidi resumable uploads to validate ack'd object size (#2570)
* fix: update grpc bidi resumable uploads to validate ack'd object sizeFollow up to#2527Part 1, add tests and simulation server* fix: update grpc bidi resumable uploads to validate ack'd object sizeFollow up to#2527Cleanup unused inner-class* fix: update grpc bidi resumable uploads to validate ack'd object sizeFollow up to#2527Move request trimming inline rather than at the end* fix: update grpc bidi resumable uploads to validate ack'd object sizeFollow up to#2527Update GapicBidiUnbufferedWritableByteChannel to correctly handle failure scenarios {1, 2, 3, 4, 4_1, 4_2, 5, 7}Refactor ResumableSessionFailureScenario to accept Message and List rather than WriteObjectResponse and List<WriteObjectRequest>.The shape of BidiWriteObjectRequest/WriteObjectRequest and BidiWriteObjectResponse/WriteObjectResponse are largely the same (bidi has two extra fields) so rather than overloading toStorageException yet again, this time there is a single method for grpc messages that internally can branch when formatting the request. In this case, we're quite safe taking this relaxed typing because it is an internal API that is only called from a grpc context where protos will be used.* fix: update grpc bidi resumable uploads to validate ack'd object sizeFollow up to#2527Update GapicBidiUnbufferedWritableByteChannel to correctly handle partial consumption of contentTests passing now.Separate tracking of client detected errors and stream errors.When await is invoked, if a client detected error is present AND a stream error is present, the client detected error will take precedence. If a stream error happens and the client detected error has not yet been observed, the stream error will be added as a suppressed exception to the client detected error.* chore: fix failing tests
1 parent55a6d15 commit5c9cecf

File tree

8 files changed

+1340
-160
lines changed

8 files changed

+1340
-160
lines changed

‎google-cloud-storage/src/main/java/com/google/cloud/storage/BidiResumableWrite.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public StartResumableWriteResponse getRes() {
5252

5353
@Override
5454
publicBidiWriteObjectRequest.BuildernewBuilder() {
55-
returnwriteRequest.toBuilder();
55+
returnwriteRequest.toBuilder().clearWriteObjectSpec();
5656
}
5757

5858
@Override

‎google-cloud-storage/src/main/java/com/google/cloud/storage/BidiWriteCtx.java‎

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
packagecom.google.cloud.storage;
1818

19-
importstaticcom.google.cloud.storage.StorageV2ProtoUtils.fmtProto;
20-
2119
importcom.google.cloud.storage.BidiWriteCtx.BidiWriteObjectRequestBuilderFactory;
2220
importcom.google.cloud.storage.Crc32cValue.Crc32cLengthKnown;
2321
importcom.google.storage.v2.BidiWriteObjectRequest;
@@ -84,36 +82,5 @@ interface BidiWriteObjectRequestBuilderFactory {
8482

8583
@Nullable
8684
StringbucketName();
87-
88-
staticBidiSimpleWriteObjectRequestBuilderFactorysimple(BidiWriteObjectRequestreq) {
89-
returnnewBidiSimpleWriteObjectRequestBuilderFactory(req);
90-
}
91-
}
92-
93-
staticfinalclassBidiSimpleWriteObjectRequestBuilderFactory
94-
implementsBidiWriteObjectRequestBuilderFactory {
95-
privatefinalBidiWriteObjectRequestreq;
96-
97-
privateBidiSimpleWriteObjectRequestBuilderFactory(BidiWriteObjectRequestreq) {
98-
this.req =req;
99-
}
100-
101-
@Override
102-
publicBidiWriteObjectRequest.BuildernewBuilder() {
103-
returnreq.toBuilder();
104-
}
105-
106-
@Override
107-
public@NullableStringbucketName() {
108-
if (req.hasWriteObjectSpec() &&req.getWriteObjectSpec().hasResource()) {
109-
returnreq.getWriteObjectSpec().getResource().getBucket();
110-
}
111-
returnnull;
112-
}
113-
114-
@Override
115-
publicStringtoString() {
116-
return"SimpleBidiWriteObjectRequestBuilderFactory{" +"req=" +fmtProto(req) +'}';
117-
}
11885
}
11986
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp