Skip to content

Commit

Permalink
Release BlockReader in CRC check
Browse files Browse the repository at this point in the history
  • Loading branch information
elega committed Sep 12, 2024
1 parent ae64e71 commit 38819af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion core/common/src/main/java/alluxio/Sessions.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ public class Sessions {
public static final int CACHE_UFS_SESSION_ID = -8;

public static final int LOAD_SESSION_ID = -9;
public static final int WORKER_CHECKSUM_CHECK_SESSION_ID = -10;

// internal session id base should be smaller than all predefined session ids
public static final long INTERNAL_SESSION_ID_BASE = -8;
public static final long INTERNAL_SESSION_ID_BASE = -11;

/** Map from SessionId to {@link alluxio.SessionInfo} object. */
private final Map<Long, SessionInfo> mSessions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -637,10 +637,10 @@ public Map<Long, BlockChecksum> calculateBlockChecksum(List<Long> blockIds) {
for (long blockId : blockIds) {
Future<?> future = mChecksumCalculationThreadPool.submit(() -> {
ByteBuffer bf = null;
try {
try (BlockReader br = mBlockStore.createBlockReader(
Sessions.WORKER_CHECKSUM_CHECK_SESSION_ID,
blockId, 0, false, Protocol.OpenUfsBlockOptions.getDefaultInstance())) {
CRC64 crc64 = new CRC64();
BlockReader br = mBlockStore.createBlockReader(
-1, blockId, 0, false, Protocol.OpenUfsBlockOptions.getDefaultInstance());
if (mChecksumCalculationUsingBufferPool) {
bf = NioHeapBufferPool.acquire(chunkSize);
} else {
Expand Down

0 comments on commit 38819af

Please sign in to comment.