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

This commit is contained in:
Lei Xu 2015-10-26 15:16:09 -07:00
parent 677a936bf7
commit 37bf6141f1
4 changed files with 17 additions and 1 deletions

View File

@ -1576,6 +1576,8 @@ Release 2.8.0 - UNRELEASED
HDFS-9284. fsck command should not print exception trace when file not HDFS-9284. fsck command should not print exception trace when file not
found. (Jagadesh Kiran N via wang) found. (Jagadesh Kiran N via wang)
HDFS-9291. Fix TestInterDatanodeProtocol to be FsDataset-agnostic. (lei)
OPTIMIZATIONS OPTIMIZATIONS
HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than

View File

@ -192,4 +192,11 @@ public interface FsDatasetTestUtils {
*/ */
Replica createReplicaUnderRecovery(ExtendedBlock block, long recoveryId) Replica createReplicaUnderRecovery(ExtendedBlock block, long recoveryId)
throws IOException; throws IOException;
/**
* Check the stored files / data of a replica.
* @param replica a replica object.
* @throws IOException
*/
void checkStoredReplica(final Replica replica) throws IOException;
} }

View File

@ -285,4 +285,11 @@ public class FsDatasetImplTestUtils implements FsDatasetTestUtils {
return rur; return rur;
} }
} }
@Override
public void checkStoredReplica(Replica replica) throws IOException {
Preconditions.checkArgument(replica instanceof ReplicaInfo);
ReplicaInfo r = (ReplicaInfo) replica;
FsDatasetImpl.checkReplicaFiles(r);
}
} }

View File

@ -359,7 +359,7 @@ public class TestInterDatanodeProtocol {
Assert.assertEquals(ReplicaState.RUR, replica.getState()); Assert.assertEquals(ReplicaState.RUR, replica.getState());
//check meta data before update //check meta data before update
FsDatasetImpl.checkReplicaFiles(replica); cluster.getFsDatasetTestUtils(datanode).checkStoredReplica(replica);
//case "THIS IS NOT SUPPOSED TO HAPPEN" //case "THIS IS NOT SUPPOSED TO HAPPEN"
//with (block length) != (stored replica's on disk length). //with (block length) != (stored replica's on disk length).