public Object call() throws Exception { Cache cache = getCache(); PartitionedRegion region = (PartitionedRegion) cache.getRegion(regionName); return new TreeSet<Integer>(region.getDataStore().getAllLocalBucketIds()); } };
public Object call() throws Exception { Cache cache = getCache(); PartitionedRegion region = (PartitionedRegion) cache.getRegion(regionName); return new TreeSet<Integer>(region.getDataStore().getAllLocalBucketIds()); } };
public Object call() throws Exception { Cache cache = getCache(); Region region = cache.getRegion(regionName); if (region instanceof PartitionedRegion) { PartitionedRegion pr = (PartitionedRegion)region; return new TreeSet<Integer>(pr.getDataStore().getAllLocalBucketIds()); } else { return null; } } };
public Object call() throws Exception { Cache cache = getCache(); PartitionedRegion region = (PartitionedRegion) cache.getRegion(regionName); return new TreeSet<Integer>(region.getDataStore().getAllLocalBucketIds()); } };
public Object call() throws Exception { Cache cache = getCache(); PartitionedRegion region = (PartitionedRegion) cache.getRegion(regionName); return new TreeSet<Integer>(region.getDataStore().getAllLocalBucketIds()); } };
public void run() { PartitionedRegion region = (PartitionedRegion) basicGetCache().getRegion(OrderPartitionedRegionName); MyResourceObserver observer = (MyResourceObserver) InternalResourceManager.getResourceObserver(); try { observer.waitForRegion(region, 60 * 1000); } catch (InterruptedException e) { throw new RuntimeException(e); } assertEquals(50, region.getDataStore().getAllLocalBucketIds().size()); assertEquals(25, region.getDataStore().getAllLocalPrimaryBucketIds().size()); } };
public void run() { PartitionedRegion region = (PartitionedRegion) basicGetCache().getRegion(OrderPartitionedRegionName); MyResourceObserver observer = (MyResourceObserver) InternalResourceManager.getResourceObserver(); try { observer.waitForRegion(region, 60 * 1000); } catch (InterruptedException e) { throw new RuntimeException(e); } assertEquals(2, region.getDataStore().getAllLocalBucketIds().size()); assertEquals(2, region.getDataStore().getAllLocalPrimaryBucketIds().size()); } };
public void run() { PartitionedRegion region1 = (PartitionedRegion) basicGetCache().getRegion(CustomerPartitionedRegionName); MyResourceObserver observer = (MyResourceObserver) InternalResourceManager.getResourceObserver(); try { observer.waitForRegion(region1, 60 * 1000); } catch (InterruptedException e) { throw new RuntimeException(e); } assertEquals(0, region1.getDataStore().getAllLocalBucketIds().size()); assertEquals(0, region1.getDataStore().getAllLocalPrimaryBucketIds().size()); } };
public void run() { PartitionedRegion region1 = (PartitionedRegion) basicGetCache().getRegion(CustomerPartitionedRegionName); MyResourceObserver observer = (MyResourceObserver) InternalResourceManager.getResourceObserver(); try { observer.waitForRegion(region1, 60 * 1000); } catch (InterruptedException e) { throw new RuntimeException(e); } assertEquals(2, region1.getDataStore().getAllLocalBucketIds().size()); assertEquals(2, region1.getDataStore().getAllLocalPrimaryBucketIds().size()); } };
public ConcurrentHashMap<Integer, Set<ServerBucketProfile>> getAllClientBucketProfilesTest() { ConcurrentHashMap<Integer, Set<ServerBucketProfile>> map = new ConcurrentHashMap<Integer, Set<ServerBucketProfile>>(); Map<Integer, List<BucketServerLocation66>> testMap = this.getAllClientBucketProfiles(); for (Integer bucketId : testMap.keySet()) { Set<ServerBucketProfile> parr = this.clientBucketProfilesMap.get(bucketId); map.put(bucketId, parr); } if (getPartitionedRegion().isDataStore()) { for (Integer bucketId : getPartitionedRegion().getDataStore().getAllLocalBucketIds()) { BucketProfile profile = getBucketAdvisor(bucketId).getLocalProfile(); if ((profile instanceof ServerBucketProfile) && profile.isHosting) { map.get(bucketId).add((ServerBucketProfile)profile); } } } if (logger.isDebugEnabled()) { logger.debug("This maps is sksk {} and size is {}", map, map.keySet().size()); } return map; }
public int entryCount(boolean localOnly) { if (localOnly) { if (this.isDataStore()) { return entryCount(this.dataStore.getAllLocalBucketIds()); } else { return 0; } } else { return entryCount(null); } }
public ConcurrentHashMap<Integer, Set<ServerBucketProfile>> getAllClientBucketProfilesTest() { ConcurrentHashMap<Integer, Set<ServerBucketProfile>> map = new ConcurrentHashMap<Integer, Set<ServerBucketProfile>>(); Map<Integer, List<BucketServerLocation66>> testMap = this.getAllClientBucketProfiles(); for (Integer bucketId : testMap.keySet()) { Set<ServerBucketProfile> parr = this.clientBucketProfilesMap.get(bucketId); map.put(bucketId, parr); } if (getPartitionedRegion().isDataStore()) { for (Integer bucketId : getPartitionedRegion().getDataStore().getAllLocalBucketIds()) { BucketProfile profile = getBucketAdvisor(bucketId).getLocalProfile(); if ((profile instanceof ServerBucketProfile) && profile.isHosting) { map.get(bucketId).add((ServerBucketProfile)profile); } } } if (getLogWriter().fineEnabled()) { getLogWriter().fine("This maps is sksk " + map + " and size is " + map.keySet().size()); } return map; }
public int entryCount(boolean localOnly) { if (localOnly) { if (this.isDataStore()) { return entryCount(getTXState(), new THashSet(this.dataStore.getAllLocalBucketIds())); } else { return 0; } } else { return entryCount(null); } }
public PRLoad getLoad(PartitionedRegion pr) { PartitionedRegionDataStore ds = pr.getDataStore(); int configuredBucketCount = pr.getTotalNumberOfBuckets(); PRLoad prLoad = new PRLoad( configuredBucketCount, pr.getLocalMaxMemory()); // key: bid, value: size for(Integer bidInt : ds.getAllLocalBucketIds()) { int bid = bidInt.intValue(); BucketAdvisor bucketAdvisor = pr.getRegionAdvisor(). getBucket(bid).getBucketAdvisor(); //Wait for a primary to exist for this bucket, because //it might be this member. bucketAdvisor.getPrimary(); boolean isPrimary = pr.getRegionAdvisor(). getBucket(bid).getBucketAdvisor().isPrimary(); prLoad.addBucket(bid, 1, isPrimary ? 1 : 0); } return prLoad; }
public PRLoad getLoad(PartitionedRegion pr) { PartitionedRegionDataStore ds = pr.getDataStore(); int configuredBucketCount = pr.getTotalNumberOfBuckets(); PRLoad prLoad = new PRLoad( configuredBucketCount, pr.getLocalMaxMemory()); // key: bid, value: size for(Integer bidInt : ds.getAllLocalBucketIds()) { int bid = bidInt.intValue(); BucketAdvisor bucketAdvisor = pr.getRegionAdvisor(). getBucket(bid).getBucketAdvisor(); //Wait for a primary to exist for this bucket, because //it might be this member. bucketAdvisor.getPrimary(); boolean isPrimary = pr.getRegionAdvisor(). getBucket(bid).getBucketAdvisor().isPrimary(); prLoad.addBucket(bid, 1, isPrimary ? 1 : 0); } return prLoad; }
public void initNumRows(LocalRegion r) { if (r.getPartitionAttributes() != null) { // get the sizes from individual buckets final PartitionedRegion pr = (PartitionedRegion)r; if (pr.getDataStore() != null) { if (pr.isHDFSReadWriteRegion()) { this.previousNumRows = -1; } else { this.previousNumRows = pr.entryCountEstimate(null, pr.getDataStore() .getAllLocalBucketIds(), false); } } } else { this.previousNumRows = r.size(); } if (r.getConcurrencyChecksEnabled()) { SanityManager.DEBUG_PRINT("info:" + GfxdConstants.TRACE_CONGLOM, "Concurrency checks enabled for table " + getQualifiedTableName()); } }
public void initNumRows(LocalRegion r) { if (r.getPartitionAttributes() != null) { // get the sizes from individual buckets final PartitionedRegion pr = (PartitionedRegion)r; if (pr.getDataStore() != null) { if (pr.isHDFSReadWriteRegion()) { this.previousNumRows = -1; } else { this.previousNumRows = pr.entryCountEstimate(null, pr.getDataStore() .getAllLocalBucketIds(), false); } } } else { this.previousNumRows = r.size(); } if (r.getConcurrencyChecksEnabled()) { SanityManager.DEBUG_PRINT("info:" + GfxdConstants.TRACE_CONGLOM, "Concurrency checks enabled for table " + getQualifiedTableName()); } }
public void initNumRows(LocalRegion r) { if (r.getPartitionAttributes() != null) { // get the sizes from individual buckets final PartitionedRegion pr = (PartitionedRegion)r; if (pr.getDataStore() != null) { if (pr.isHDFSReadWriteRegion()) { this.previousNumRows = -1; } else { this.previousNumRows = pr.entryCountEstimate(null, pr.getDataStore() .getAllLocalBucketIds(), false); } } } else { this.previousNumRows = r.size(); } if (r.getConcurrencyChecksEnabled()) { SanityManager.DEBUG_PRINT("info:" + GfxdConstants.TRACE_CONGLOM, "Concurrency checks enabled for table " + getQualifiedTableName()); } }
public PRLoad getLoad(PartitionedRegion pr) { PartitionedRegionDataStore ds = pr.getDataStore(); int configuredBucketCount = pr.getTotalNumberOfBuckets(); PRLoad prLoad = new PRLoad( configuredBucketCount, pr.getLocalMaxMemory()); // key: bid, value: size for(Integer bidInt : ds.getAllLocalBucketIds()) { int bid = bidInt.intValue(); long bucketSize = ds.getBucketSize(bid); if(bucketSize < MIN_BUCKET_SIZE) { bucketSize = MIN_BUCKET_SIZE; } BucketAdvisor bucketAdvisor = pr.getRegionAdvisor(). getBucket(bid).getBucketAdvisor(); //Wait for a primary to exist for this bucket, because //it might be this member. bucketAdvisor.getPrimary(); boolean isPrimary = pr.getRegionAdvisor(). getBucket(bid).getBucketAdvisor().isPrimary(); prLoad.addBucket(bid, bucketSize, isPrimary ? 1 : 0); } return prLoad; }
public PRLoad getLoad(PartitionedRegion pr) { PartitionedRegionDataStore ds = pr.getDataStore(); int configuredBucketCount = pr.getTotalNumberOfBuckets(); PRLoad prLoad = new PRLoad( configuredBucketCount, pr.getLocalMaxMemory()); // key: bid, value: size for(Integer bidInt : ds.getAllLocalBucketIds()) { int bid = bidInt.intValue(); long bucketSize = ds.getBucketSize(bid); if(bucketSize < MIN_BUCKET_SIZE) { bucketSize = MIN_BUCKET_SIZE; } BucketAdvisor bucketAdvisor = pr.getRegionAdvisor(). getBucket(bid).getBucketAdvisor(); //Wait for a primary to exist for this bucket, because //it might be this member. bucketAdvisor.getPrimary(); boolean isPrimary = pr.getRegionAdvisor(). getBucket(bid).getBucketAdvisor().isPrimary(); prLoad.addBucket(bid, bucketSize, isPrimary ? 1 : 0); } return prLoad; }