StoreDefinition storeDef = ServerTestUtils.getStoreDefs(1).get(0);
Cluster cluster = ServerTestUtils.getLocalCluster(3, new int[][] { { 0, 1, 2, 3 },
{ 4, 5, 6, 7 }, { 8, 9, 10 } });
MetadataStore metadata = ServerTestUtils.createMetadataStore(cluster,
Arrays.asList(storeDef));
InvalidMetadataCheckingStore store = new InvalidMetadataCheckingStore(0,
new DoNothingStore<ByteArray, byte[], byte[]>(storeDef.getName()),
metadata);
try {
// remove partitions to node 0 on client side.
Cluster updatedCluster = ServerTestUtils.getLocalCluster(3, new int[][] { { 0, 1 },
{ 2, 4, 5, 6, 7 }, { 3, 8, 9, 10 } });
MetadataStore updatedMetadata = ServerTestUtils.createMetadataStore(updatedCluster,
Arrays.asList(storeDef));
doOperations(0, store, updatedMetadata, storeDef);
} catch(InvalidMetadataException e) {
throw new RuntimeException("Should not see any InvalidMetaDataException", e);