HDFS-9291. Fix TestInterDatanodeProtocol to be FsDataset-agnostic. (lei)
This commit is contained in:
parent
9850827c24
commit
ce02c438fd
|
@ -740,6 +740,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
|
||||
|
|
|
@ -192,4 +192,11 @@ public interface FsDatasetTestUtils {
|
|||
*/
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -285,4 +285,11 @@ public class FsDatasetImplTestUtils implements FsDatasetTestUtils {
|
|||
return rur;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkStoredReplica(Replica replica) throws IOException {
|
||||
Preconditions.checkArgument(replica instanceof ReplicaInfo);
|
||||
ReplicaInfo r = (ReplicaInfo) replica;
|
||||
FsDatasetImpl.checkReplicaFiles(r);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -359,7 +359,7 @@ public class TestInterDatanodeProtocol {
|
|||
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).
|
||||
|
|
Loading…
Reference in New Issue