xinyuiscool commented on code in PR #1712:
URL: https://github.com/apache/samza/pull/1712#discussion_r1801606807
##########
samza-core/src/main/java/org/apache/samza/storage/blobstore/util/BlobStoreUtil.java:
##########
@@ -182,13 +182,13 @@ public CompletableFuture<SnapshotIndex>
getSnapshotIndex(String blobId, Metadata
return FutureUtil.executeAsyncWithRetries(opName, () -> {
ByteArrayOutputStream indexBlobStream = new ByteArrayOutputStream(); //
no need to close ByteArrayOutputStream
return blobStoreManager.get(blobId, indexBlobStream, metadata,
getDeleted).toCompletableFuture()
- .thenApplyAsync(f ->
snapshotIndexSerde.fromBytes(indexBlobStream.toByteArray()), executor)
- .handle((snapshotIndex, ex) -> {
- if (ex != null) {
+ .thenApplyAsync(f -> {
+ try {
+ return
snapshotIndexSerde.fromBytes(indexBlobStream.toByteArray());
+ } catch (Exception ex) {
Review Comment:
Compared to previous change, seems this will only log the blobId if the
serialization failed. Is that the case? Maybe we keep the previous exception
handling, just updating the exception msg to be something like "Unable to get
SnapshotIndex with blob ID...."?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]