public static void putOperation() { Region region = cache.getRegion(PartitionedRegionName); assertNotNull(region); final HashSet testKeysSet = new HashSet(); for (int i = (totalNumBuckets.intValue() * 10); i > 0; i--) { testKeysSet.add("execKey-" + i); } int j = 0; HashSet origVals = new HashSet(); for (Iterator i = testKeysSet.iterator(); i.hasNext();) { Integer val = new Integer(j++); origVals.add(val); region.put(i.next(), val); } }
public static void checkBucketsOnServer() { PartitionedRegion region = (PartitionedRegion)cache .getRegion(PartitionedRegionName); HashMap localBucket2RegionMap = (HashMap)region.getDataStore() .getSizeLocally(); getLogWriter().info( "Size of the " + PartitionedRegionName + " in this VM :- " + localBucket2RegionMap.size()); Set entrySet = localBucket2RegionMap.entrySet(); assertNotNull(entrySet); }
public static void getAll() { Region region = cache.getRegion(PartitionedRegionName); assertNotNull(region); final List testKeysList = new ArrayList(); for (int i = (totalNumBuckets.intValue() * 3); i > 0; i--) { testKeysList.add("execKey-" + i); } DistributedSystem.setThreadsSocketPolicy(false); try { int j = 0; Map origVals = new HashMap(); for (Iterator i = testKeysList.iterator(); i.hasNext();) { Integer val = new Integer(j++); Object key = i.next(); origVals.put(key, val); region.put(key, val); } Map resultMap = region.getAll(testKeysList); assertTrue(resultMap.equals(origVals)); pause(2000); Map secondResultMap = region.getAll(testKeysList); assertTrue(secondResultMap.equals(origVals)); } catch (Exception e) { fail("Test failed after the put operation", e); } }
public static void putAll() { Region region = cache.getRegion(PartitionedRegionName); assertNotNull(region); final List testKeysList = new ArrayList(); for (int i = (totalNumBuckets.intValue() * 3); i > 0; i--) { testKeysList.add("execKey-" + i); } DistributedSystem.setThreadsSocketPolicy(false); try { int j = 0; Map origVals = new HashMap(); for (Iterator i = testKeysList.iterator(); i.hasNext();) { Integer val = new Integer(j++); Object key = i.next(); origVals.put(key, val); region.put(key, val); } Map resultMap = region.getAll(testKeysList); assertTrue(resultMap.equals(origVals)); pause(2000); Map secondResultMap = region.getAll(testKeysList); assertTrue(secondResultMap.equals(origVals)); } catch (Exception e) { fail("Test failed after the put operation", e); } }
public static void FunctionExecution_Inline_Bug40714() { Region region = cache.getRegion(PartitionedRegionName); assertNotNull(region); final HashSet testKeysSet = new HashSet(); for (int i = (totalNumBuckets.intValue() * 10); i > 0; i--) {
public static void serverMultiKeyExecutionSocketTimeOut(Boolean isByName) { Region region = cache.getRegion(PartitionedRegionName); assertNotNull(region); final HashSet testKeysSet = new HashSet(); for (int i = (totalNumBuckets.intValue() * 2); i > 0; i--) {
public static void serverMultiKeyExecutionOnASingleBucket(Boolean isByName) { Region region = cache.getRegion(PartitionedRegionName); assertNotNull(region); final HashSet testKeysSet = new HashSet(); for (int i = (totalNumBuckets.intValue() * 2); i > 0; i--) {
public static void serverMultiKeyExecution_FunctionInvocationTargetException() { Region region = cache.getRegion(PartitionedRegionName); assertNotNull(region); final HashSet testKeysSet = new HashSet(); for (int i = (totalNumBuckets.intValue() * 2); i > 0; i--) {
public static void serverMultiKeyExecution(Boolean isByName) { Region region = cache.getRegion(PartitionedRegionName); assertNotNull(region); final HashSet testKeysSet = new HashSet(); for (int i = (totalNumBuckets.intValue() * 2); i > 0; i--) {
public static void serverMultiKeyExecution_Inline() { Region region = cache.getRegion(PartitionedRegionName); assertNotNull(region); final HashSet testKeysSet = new HashSet(); for (int i = (totalNumBuckets.intValue() * 2); i > 0; i--) {
public static void serverSingleKeyExecution_FunctionInvocationTargetException() { Region region = cache.getRegion(PartitionedRegionName); assertNotNull(region); final String testKey = "execKey"; final Set testKeysSet = new HashSet(); testKeysSet.add(testKey); DistributedSystem.setThreadsSocketPolicy(false); Function function = new TestFunction(true, TestFunction.TEST_FUNCTION_REEXECUTE_EXCEPTION); FunctionService.registerFunction(function); Execution dataSet = FunctionService.onRegion(region); region.put(testKey, new Integer(1)); try { ResultCollector rs = execute(dataSet, testKeysSet, Boolean.TRUE, function, false); ArrayList list = (ArrayList)rs.getResult(); assertTrue(((Integer)list.get(0)) >= 5); } catch (Exception ex) { ex.printStackTrace(); fail("This is not expected Exception", ex); } }
public static void serverSingleKeyExecution(Boolean isByName) { Region region = cache.getRegion(PartitionedRegionName); assertNotNull(region); final String testKey = "execKey"; final Set testKeysSet = new HashSet();
public static void serverAllKeyExecution(Boolean isByName) { Region region = cache.getRegion(PartitionedRegionName); assertNotNull(region); final HashSet testKeysSet = new HashSet(); for (int i = (totalNumBuckets.intValue() / 2); i > 0; i--) {
assertNotNull(region); final HashSet testKeysSet = new HashSet(); for (int i = (totalNumBuckets.intValue() * 10); i > 0; i--) {
public static void serverSingleKeyExecutionSocketTimeOut(Boolean isByName) { Region region = cache.getRegion(PartitionedRegionName); assertNotNull(region); final String testKey = "execKey"; final Set testKeysSet = new HashSet(); testKeysSet.add(testKey); DistributedSystem.setThreadsSocketPolicy(false); Function function = new TestFunction(true, TestFunction.TEST_FUNCTION_SOCKET_TIMEOUT); FunctionService.registerFunction(function); Execution dataSet = FunctionService.onRegion(region); region.put(testKey, new Integer(1)); try { ResultCollector rs = execute(dataSet, testKeysSet, Boolean.TRUE, function, isByName); assertEquals(Boolean.TRUE, ((List)rs.getResult()).get(0)); ResultCollector rs2 = execute(dataSet, testKeysSet, testKey, function, isByName); assertEquals(testKey, ((List)rs2.getResult()).get(0)); } catch (Exception ex) { ex.printStackTrace(); getLogWriter().info("Exception : ", ex); fail("Test failed after the put operation", ex); } }
public static void serverMultiKeyExecutionNoResult(Boolean isByName) { Region region = cache.getRegion(PartitionedRegionName); assertNotNull(region); final HashSet testKeysSet = new HashSet(); for (int i = (totalNumBuckets.intValue() * 2); i > 0; i--) {
public static void serverSingleKeyExecution_Inline() { Region region = cache.getRegion(PartitionedRegionName); assertNotNull(region); final String testKey = "execKey"; final Set testKeysSet = new HashSet();