zuston commented on code in PR #2808:
URL: https://github.com/apache/uniffle/pull/2808#discussion_r4228640325
##########
client/src/main/java/org/apache/uniffle/client/impl/DecompressionWorker.java:
##########
@@ -115,49 +115,44 @@ public void add(int batchIndex, ShuffleDataResult
shuffleDataResult) {
for (BufferSegment bufferSegment : bufferSegments) {
CompletableFuture<ByteBuffer> f =
CompletableFuture.supplyAsync(
- () -> {
- try {
- if (segmentPermits.isPresent()) {
- segmentPermits.get().acquire();
- }
- } catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- LOG.warn("Interrupted while acquiring segment permit",
e);
- return null;
- }
-
- int offset = bufferSegment.getOffset();
- int length = bufferSegment.getLength();
- ByteBuffer buffer = sharedByteBuffer.duplicate();
- buffer.position(offset);
- buffer.limit(offset + length);
-
- int uncompressedLen = bufferSegment.getUncompressLength();
-
- long startBufferAllocation = System.currentTimeMillis();
- ByteBuffer dst =
- buffer.isDirect()
- ? ByteBuffer.allocateDirect(uncompressedLen)
- : ByteBuffer.allocate(uncompressedLen);
- decompressionBufferAllocationMillis.addAndGet(
- System.currentTimeMillis() - startBufferAllocation);
-
- long startDecompression = System.currentTimeMillis();
- codec.decompress(buffer, uncompressedLen, dst, 0);
- decompressionMillis.addAndGet(System.currentTimeMillis() -
startDecompression);
- decompressionBytes.addAndGet(length);
-
- nowMemoryUsed.addAndGet(uncompressedLen);
- resetPeekMemoryUsed();
-
- return dst;
- },
- getOrCreateExecutor())
- .exceptionally(
- ex -> {
- LOG.error("Errors on decompressing shuffle block", ex);
- return null;
- });
+ () -> {
+ try {
+ if (segmentPermits.isPresent()) {
+ segmentPermits.get().acquire();
+ }
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ LOG.warn("Interrupted while acquiring segment permit", e);
+ return null;
Review Comment:
the exception will be hold in the `CompleteFuture` , only it will get the
Exception when invoking `CompleteFuture.get`
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]