for (int i = 0; i < numKeys; i++) {
assertNull(dc0.get(i));
assertNull(dc2.get(i));
}
} else if (op == Operation.PUT || op == Operation.PUT_MAP || op == Operation.REPLACE) {
ConsistentHash ch = advancedCache(0).getComponentRegistry().getStateTransferManager().getCacheTopology().getReadConsistentHash();
// check that all values are the ones expected after state transfer
for (int i = 0; i < numKeys; i++) {
// check number of owners
int owners = 0;
if (dc0.get(i) != null) {
owners++;
}
if (dc2.get(i) != null) {
owners++;
}
assertEquals("Wrong number of owners", ch.locateOwners(i).size(), owners);
// check values were not overwritten with old values carried by state transfer
String expected = "after_st_" + i;
assertEquals(expected, cache(0).get(i));
assertEquals("after_st_" + i, cache(2).get(i));
}
} else { // PUT_IF_ABSENT
ConsistentHash ch = advancedCache(0).getComponentRegistry().getStateTransferManager().getCacheTopology().getReadConsistentHash();
for (int i = 0; i < numKeys; i++) {
// check number of owners
int owners = 0;
if (dc0.get(i) != null) {
owners++;
}
if (dc2.get(i) != null) {
owners++;
}
assertEquals("Wrong number of owners", ch.locateOwners(i).size(), owners);
String expected = "before_st_" + i;
assertEquals(expected, cache(0).get(i));
assertEquals(expected, cache(2).get(i));
}