Skip to content

Commit

Permalink
HDFS-17342. Fix checkstytle
Browse files Browse the repository at this point in the history
  • Loading branch information
haiyang1987 committed Jan 19, 2024
1 parent 6f5a1f4 commit 303ea21
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2030,16 +2030,16 @@ public void testCheckFilesWhenInvalidateMissingBlock() throws Exception {
util.writeFile(path, 1);
String bpid = cluster.getNameNode().getNamesystem().getBlockPoolId();
DataNode dn = cluster.getDataNodes().get(0);
FsDatasetImpl dataset = (FsDatasetImpl) dn.getFSDataset();
List<ReplicaInfo> replicaInfos = dataset.getFinalizedBlocks(bpid);
FsDatasetImpl dnFSDataset = (FsDatasetImpl) dn.getFSDataset();
List<ReplicaInfo> replicaInfos = dnFSDataset.getFinalizedBlocks(bpid);
assertEquals(1, replicaInfos.size());
DFSTestUtil.readFile(cluster.getFileSystem(), path);
LocatedBlock blk = util.getFileBlocks(path, 512).get(0);
ExtendedBlock block = blk.getBlock();

// Append a new block with an incremented generation stamp.
long newGS = block.getGenerationStamp() + 1;
dataset.append(block, newGS, 1024);
dnFSDataset.append(block, newGS, 1024);
block.setGenerationStamp(newGS);

DataNodeFaultInjector injector = new DataNodeFaultInjector() {
Expand Down Expand Up @@ -2070,7 +2070,7 @@ public void delay() {
try {
// Submit tasks for finalizing block.
Thread.sleep(1000);
dataset.finalizeBlock(block, false);
dnFSDataset.finalizeBlock(block, false);
} catch (Exception e) {
// Ignore exception
}
Expand All @@ -2084,7 +2084,7 @@ public void delay() {
}

// Validate the replica is exits.
assertNotNull(dataset.getReplicaInfo(blk.getBlock()));
assertNotNull(dnFSDataset.getReplicaInfo(blk.getBlock()));
} finally {
cluster.shutdown();
DataNodeFaultInjector.set(oldDnInjector);
Expand Down

0 comments on commit 303ea21

Please # to comment.