HDFS-9291. Fix TestInterDatanodeProtocol to be FsDataset-agnostic. (lei)
This commit is contained in:
parent
677a936bf7
commit
37bf6141f1
|
@ -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
|
||||
|
|
|
@ -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