createPR(vm0, redundancy); createPR(vm1, redundancy); createPR(vm2, redundancy); createData(vm0, 0, numBuckets, "a"); createDataWithRollback(vm0, 0, numBuckets, "b"); closeCache(vm0); closeCache(vm1); closeCache(vm2); AsyncInvocation a1 = createPRAsync(vm0, redundancy); AsyncInvocation a2 = createPRAsync(vm1, redundancy); AsyncInvocation a3 = createPRAsync(vm2, redundancy); checkData(vm0, 0, numBuckets, "a"); checkData(vm1, 0, numBuckets, "a"); checkData(vm2, 0, numBuckets, "a"); createData(vm0, 0, numBuckets, "b"); checkData(vm0, 0, numBuckets, "b"); checkData(vm1, 0, numBuckets, "b"); checkData(vm2, 0, numBuckets, "b");
@Override public void tearDown2() throws Exception { super.tearDown2(); invokeInEveryVM(new SerializableRunnable() { public void run() { TXManagerImpl.ALLOW_PERSISTENT_TRANSACTIONS = false; System.setProperty(DiskStoreImpl.RECOVER_VALUES_SYNC_PROPERTY_NAME, "false"); } }); }
public void run() { Cache cache = getCache(); getLogWriter().info("checking data in " + regionName); Region region = cache.getRegion(regionName); for(int i =startKey; i < endKey; i++) { assertEquals(value, region.get(i)); assertEquals(value, region.get(i + 113)); assertEquals(value, region.get(i + 113 * 2)); } assertEquals(null, region.get(endKey+113*3)); } };
@Override protected void createData(VM vm, final int startKey, final int endKey, final String value, final String regionName) { getLogWriter().info("creating runnable to create data for region " + regionName); SerializableRunnable createData = new SerializableRunnable() {
public void run() { Cache cache = getCache(); CacheTransactionManager tx = cache.getCacheTransactionManager(); Region region = cache.getRegion(PR_REGION_NAME); for(int i =startKey; i < endKey; i++) { tx.begin(); region.put(i, value); region.destroy(i + 113, value); region.invalidate(i + 113 * 2, value); tx.rollback(); } } };
public void run() { Cache cache = getCache(); getLogWriter().info("getting region " + regionName); Region region = cache.getRegion(regionName); for(int i =startKey; i < endKey; i++) { CacheTransactionManager tx = cache.getCacheTransactionManager(); tx.begin(); region.put(i, value); region.put(i + 113, value); region.put(i + 113 * 2, value); tx.commit(); } { // add a destroy to make sure bug 43063 is fixed CacheTransactionManager tx = cache.getCacheTransactionManager(); tx.begin(); region.put(endKey+113*3, value); tx.commit(); tx.begin(); region.remove(endKey+113*3); tx.commit(); } } };
@Override public void setUp() throws Exception { super.setUp(); invokeInEveryVM(new SerializableRunnable() { public void run() { TXManagerImpl.ALLOW_PERSISTENT_TRANSACTIONS = true; System.setProperty(DiskStoreImpl.RECOVER_VALUES_SYNC_PROPERTY_NAME, "true"); } }); }