use of org.apache.ignite.IgniteAtomicStamped in project ignite by apache.
the class GridCacheAbstractDataStructuresFailoverSelfTest method testAtomicStampedTopologyChange.
/**
* @throws Exception If failed.
*/
public void testAtomicStampedTopologyChange() throws Exception {
try (IgniteAtomicStamped atomic = grid(0).atomicStamped(STRUCTURE_NAME, 10, 10, true)) {
Ignite g = startGrid(NEW_IGNITE_INSTANCE_NAME);
IgniteBiTuple<Integer, Integer> t = g.atomicStamped(STRUCTURE_NAME, 10, 10, false).get();
assertEquals((Integer) 10, t.get1());
assertEquals((Integer) 10, t.get2());
g.atomicStamped(STRUCTURE_NAME, 10, 10, false).set(20, 20);
stopGrid(NEW_IGNITE_INSTANCE_NAME);
t = grid(0).atomicStamped(STRUCTURE_NAME, 10, 10, false).get();
assertEquals((Integer) 20, t.get1());
assertEquals((Integer) 20, t.get2());
}
}
Aggregations