HDFS-11229. HDFS-11056 failed to close meta file. Contributed by Wei-Chiu Chuang.
This commit is contained in:
parent
b606e025f1
commit
2a28e8cf04
@ -1132,9 +1132,10 @@ private byte[] loadLastPartialChunkChecksum(
|
||||
int offsetInChecksum = BlockMetadataHeader.getHeaderSize() +
|
||||
(int)(onDiskLen / bytesPerChecksum * checksumSize);
|
||||
byte[] lastChecksum = new byte[checksumSize];
|
||||
RandomAccessFile raf = new RandomAccessFile(metaFile, "r");
|
||||
try (RandomAccessFile raf = new RandomAccessFile(metaFile, "r")) {
|
||||
raf.seek(offsetInChecksum);
|
||||
raf.read(lastChecksum, 0, checksumSize);
|
||||
}
|
||||
return lastChecksum;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user