public <K, V> Set<Integer> getLocalBucketSet(Region<K, V> region) { if (!region.getAttributes().getDataPolicy().withPartitioning()) { return null; } return this.localBucketSet; } }
@Override public final <K, V> Set<Integer> getLocalBucketSet(Region<K, V> region) { if (region.getAttributes().getPartitionAttributes() != null) { return getPRBucketSet((PartitionedRegion)region); } return null; }
private static Region createSubregion(Region region) { Region subregion = getSubregion(); if (subregion == null) { subregion = region.createSubregion(subregionName, region.getAttributes()); } return subregion; }
public PrimaryKeyIndex(String indexName, Region region,String fromClause, String indexedExpression, String projectionAttributes, String origFromClause, String origIndxExpr, String[] defintions, IndexStatistics indexStatistics) { super(indexName, region, fromClause, indexedExpression, projectionAttributes, origFromClause, origIndxExpr, defintions, indexStatistics); //TODO : Asif Check if the below is correct Class constr = region.getAttributes().getValueConstraint(); if (constr == null) constr = Object.class; this.indexResultType = new ObjectTypeImpl(constr); markValid(true); }
public final void setMasterTable(String masterTable) { this.masterTable = masterTable; if (this.masterTable != null) { final Region<?, ?> masterRegion = Misc.getRegionByPath(this.masterTable, true); this.masterResolver = (GfxdPartitionResolver)masterRegion.getAttributes() .getPartitionAttributes().getPartitionResolver(); } }
private boolean shouldRunInParallel(SnapshotOptions<K, V> options) { return ((SnapshotOptionsImpl<K, V>) options).isParallelMode() && region.getAttributes().getDataPolicy().withPartitioning() && !(region instanceof LocalDataSet); }
public Object call() throws Exception { Region cust = getCache().getRegion(D_REFERENCE); OneDestroyAndThenOneCreateCacheWriter wri = (OneDestroyAndThenOneCreateCacheWriter)cust.getAttributes().getCacheWriter(); wri.checkSuccess(); return null; } });
private void handleException(String string, Exception e, Region r) { if ((HydraUtil.isConcurrentTest() && e instanceof RegionDestroyedException)) { logInfo(string + " RegionDestroy expected during concurrent test. Contnuing test "); } if (e instanceof RegionDestroyedException && !r.getAttributes().getScope().equals(Scope.LOCAL)) { // region destroy is propogated to this jvm logInfo(string + " Region is already destroyed probably due to remote destroy, continuing with test"); removeAvailableRegion(r); } else { throw new TestException(string, e); } }
private int getPrID(final Optimizable opt) throws StandardException { assert opt != null: "opt is not expected to be null"; final Optimizable tab = opt.getBaseTable(); assert tab != null: "tab is not expected to be null"; Region<?, ?> r = tab.getTableDescriptor().getRegion(); if (r.getAttributes().getPartitionAttributes() != null) { return ((PartitionedRegion)r).getPRId(); } return -1; }
public static void HydraTask_validatePR() { int redundantCopies = testInstance.aRegion.getAttributes().getPartitionAttributes().getRedundantCopies(); ParRegUtil.verifyPRMetaData(testInstance.aRegion); ParRegUtil.verifyPrimaries(testInstance.aRegion, redundantCopies); ParRegUtil.verifyBucketCopies(testInstance.aRegion, redundantCopies); }
public Object call() { Cache cache = getCache(); Region region = cache.getRegion(regionName); TestPartitionListener listener = (TestPartitionListener) region.getAttributes().getPartitionAttributes().getPartitionListeners()[0]; return listener.getBucketsAndKeysRemoved(); } };
public Object call() { Cache cache = getCache(); Region region = cache.getRegion(regionName); TestPartitionListener listener = (TestPartitionListener) region.getAttributes().getPartitionAttributes().getPartitionListeners()[0]; return listener.getBucketsAndKeysAdded(); } };
public Object call() throws Exception { Region r = getCache().getRegion(rName); InvalidatePRListener l = (InvalidatePRListener)r.getAttributes().getCacheListeners()[0]; for (int i=0; i<=113; i++) { r.put(i, "value"+i); } Object callbackArg = "CallBACK"; l.callbackArg = callbackArg; r.invalidateRegion(callbackArg); return null; } });
public void testPartitionedRegionAttributesForCoLocation2(){ closeCache(); setXmlFile(findFile("coLocation.xml")); Cache c = getCache(); assertNotNull(c); Region cust = c.getRegion(Region.SEPARATOR+"Customer"); assertNotNull(cust); Region order = c.getRegion(Region.SEPARATOR+"Order"); assertNotNull(order); assertTrue(cust.getAttributes().getPartitionAttributes().getColocatedWith()==null); assertTrue(order.getAttributes().getPartitionAttributes().getColocatedWith().equals("Customer")); }
public void run() { getLogWriter().info("[testLonerClientEventsInServer] wait for client to fully connect"); final String pl = getRootRegion().getSubregion(name).getAttributes().getPoolName(); PoolImpl pi = (PoolImpl)PoolManager.find(pl); waitForClientToFullyConnect(pi); } });
public void run() { getLogWriter().info("[doTestSystemClientEventsInServer] wait for client to fully connect"); final String pl = getRootRegion().getSubregion(name).getAttributes().getPoolName(); PoolImpl pi = (PoolImpl)PoolManager.find(pl); waitForClientToFullyConnect(pi); } });
/** * Test EnableBridgeConflation region attribute * @since 4.2 */ public void testEnableBridgeConflationAttribute() throws CacheException { CacheCreation cache = new CacheCreation(); RegionAttributesCreation attrs = new RegionAttributesCreation(cache); attrs.setEnableBridgeConflation(true); cache.createRegion("root", attrs); testXml(cache); assertEquals(true, cache.getRegion("root").getAttributes().getEnableBridgeConflation()); }
public void run2() { final AttributesFactory factory = new AttributesFactory(); factory.setEnableOffHeapMemory(isOffHeap()); factory.setPartitionAttributes(new PartitionAttributesFactory() .setRedundantCopies(redundantCopies).create()); factory.setEvictionAttributes(firstEa); final Region pr = createRootRegion(name, factory.create()); assertNotNull(pr); assertEquals(firstEa, pr.getAttributes().getEvictionAttributes()); } };
public void testREPLICATE_PROXY() throws CacheException { CacheCreation cache = new CacheCreation(); RegionCreation root = (RegionCreation) cache.createRegion("replicateProxy", "REPLICATE_PROXY"); testXml(cache); GemFireCacheImpl c = (GemFireCacheImpl) getCache(); Region r = c.getRegion("replicateProxy"); assertNotNull(r); RegionAttributes ra = r.getAttributes(); assertEquals(DataPolicy.EMPTY, ra.getDataPolicy()); assertEquals(Scope.DISTRIBUTED_ACK, ra.getScope()); }
private void initialize(Region region) { setNumberOfEntries(region.size()); EvictionAttributes ea = region.getAttributes().getEvictionAttributes(); if (ea != null && ea.getAlgorithm().isLRUMemory()) { LocalRegion lr = (LocalRegion) region; LRUStatistics stats = ((AbstractLRURegionMap) lr.getRegionMap())._getLruList().stats(); setHeapSize(stats.getCounter()); } else { setHeapSize(-1); } }