|
@@ -310,7 +310,7 @@ class FsDatasetImpl implements FsDatasetSpi<FsVolumeImpl> {
|
|
|
volumes = new FsVolumeList(volumeFailureInfos, datanode.getBlockScanner(),
|
|
|
blockChooserImpl);
|
|
|
asyncDiskService = new FsDatasetAsyncDiskService(datanode, this);
|
|
|
- asyncLazyPersistService = new RamDiskAsyncLazyPersistService(datanode);
|
|
|
+ asyncLazyPersistService = new RamDiskAsyncLazyPersistService(datanode, conf);
|
|
|
deletingBlock = new HashMap<String, Set<Long>>();
|
|
|
|
|
|
for (int idx = 0; idx < storage.getNumStorageDirs(); idx++) {
|
|
@@ -852,20 +852,20 @@ class FsDatasetImpl implements FsDatasetSpi<FsVolumeImpl> {
|
|
|
*/
|
|
|
static File[] copyBlockFiles(long blockId, long genStamp, File srcMeta,
|
|
|
File srcFile, File destRoot, boolean calculateChecksum,
|
|
|
- int smallBufferSize) throws IOException {
|
|
|
+ int smallBufferSize, final Configuration conf) throws IOException {
|
|
|
final File destDir = DatanodeUtil.idToBlockDir(destRoot, blockId);
|
|
|
final File dstFile = new File(destDir, srcFile.getName());
|
|
|
final File dstMeta = FsDatasetUtil.getMetaFile(dstFile, genStamp);
|
|
|
return copyBlockFiles(srcMeta, srcFile, dstMeta, dstFile, calculateChecksum,
|
|
|
- smallBufferSize);
|
|
|
+ smallBufferSize, conf);
|
|
|
}
|
|
|
|
|
|
static File[] copyBlockFiles(File srcMeta, File srcFile, File dstMeta,
|
|
|
File dstFile, boolean calculateChecksum,
|
|
|
- int smallBufferSize)
|
|
|
+ int smallBufferSize, final Configuration conf)
|
|
|
throws IOException {
|
|
|
if (calculateChecksum) {
|
|
|
- computeChecksum(srcMeta, dstMeta, srcFile, smallBufferSize);
|
|
|
+ computeChecksum(srcMeta, dstMeta, srcFile, smallBufferSize, conf);
|
|
|
} else {
|
|
|
try {
|
|
|
Storage.nativeCopyFileUnbuffered(srcMeta, dstMeta, true);
|
|
@@ -929,7 +929,7 @@ class FsDatasetImpl implements FsDatasetSpi<FsVolumeImpl> {
|
|
|
File[] blockFiles = copyBlockFiles(block.getBlockId(),
|
|
|
block.getGenerationStamp(), oldMetaFile, oldBlockFile,
|
|
|
targetVolume.getTmpDir(block.getBlockPoolId()),
|
|
|
- replicaInfo.isOnTransientStorage(), smallBufferSize);
|
|
|
+ replicaInfo.isOnTransientStorage(), smallBufferSize, conf);
|
|
|
|
|
|
ReplicaInfo newReplicaInfo = new ReplicaInPipeline(
|
|
|
replicaInfo.getBlockId(), replicaInfo.getGenerationStamp(),
|
|
@@ -958,9 +958,10 @@ class FsDatasetImpl implements FsDatasetSpi<FsVolumeImpl> {
|
|
|
* @throws IOException
|
|
|
*/
|
|
|
private static void computeChecksum(File srcMeta, File dstMeta,
|
|
|
- File blockFile, int smallBufferSize)
|
|
|
+ File blockFile, int smallBufferSize, final Configuration conf)
|
|
|
throws IOException {
|
|
|
- final DataChecksum checksum = BlockMetadataHeader.readDataChecksum(srcMeta);
|
|
|
+ final DataChecksum checksum = BlockMetadataHeader.readDataChecksum(srcMeta,
|
|
|
+ DFSUtil.getIoFileBufferSize(conf));
|
|
|
final byte[] data = new byte[1 << 16];
|
|
|
final byte[] crcs = new byte[checksum.getChecksumSize(data.length)];
|
|
|
|
|
@@ -2518,7 +2519,7 @@ class FsDatasetImpl implements FsDatasetSpi<FsVolumeImpl> {
|
|
|
final File dstMetaFile = FsDatasetUtil.getMetaFile(dstBlockFile, newGS);
|
|
|
return copyBlockFiles(replicaInfo.getMetaFile(),
|
|
|
replicaInfo.getBlockFile(),
|
|
|
- dstMetaFile, dstBlockFile, true, smallBufferSize);
|
|
|
+ dstMetaFile, dstBlockFile, true, smallBufferSize, conf);
|
|
|
}
|
|
|
|
|
|
@Override // FsDatasetSpi
|