Skip to content

Commit

Permalink
HDFS-9291. Fix TestInterDatanodeProtocol to be FsDataset-agnostic. (lei)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lei Xu committed Oct 26, 2015
1 parent 677a936 commit 37bf614
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1576,6 +1576,8 @@ Release 2.8.0 - UNRELEASED
HDFS-9284. fsck command should not print exception trace when file not
found. (Jagadesh Kiran N via wang)

HDFS-9291. Fix TestInterDatanodeProtocol to be FsDataset-agnostic. (lei)

OPTIMIZATIONS

HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,11 @@ Replica createReplicaWaitingToBeRecovered(
*/
Replica createReplicaUnderRecovery(ExtendedBlock block, long recoveryId)
throws IOException;

/**
* Check the stored files / data of a replica.
* @param replica a replica object.
* @throws IOException
*/
void checkStoredReplica(final Replica replica) throws IOException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -285,4 +285,11 @@ public Replica createReplicaUnderRecovery(
return rur;
}
}

@Override
public void checkStoredReplica(Replica replica) throws IOException {
Preconditions.checkArgument(replica instanceof ReplicaInfo);
ReplicaInfo r = (ReplicaInfo) replica;
FsDatasetImpl.checkReplicaFiles(r);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ public void testUpdateReplicaUnderRecovery() throws IOException {
Assert.assertEquals(ReplicaState.RUR, replica.getState());

//check meta data before update
FsDatasetImpl.checkReplicaFiles(replica);
cluster.getFsDatasetTestUtils(datanode).checkStoredReplica(replica);

//case "THIS IS NOT SUPPOSED TO HAPPEN"
//with (block length) != (stored replica's on disk length).
Expand Down

0 comments on commit 37bf614

Please sign in to comment.