Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release BlockReader in CRC check #18695

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why change this value, can we set independent name? eg: CRC_CHECK_SESSION_ID

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
Loading