public Set<PartitionedRegion> getRegions() { return ((ParallelGatewaySenderQueue)(processors[0].getQueue())).getRegions(); }
public void addShadowPartitionedRegionForUserPR(PartitionedRegion pr) { // TODO Auto-generated method stub ((ParallelGatewaySenderQueue)this.queue).addShadowPartitionedRegionForUserPR(pr); }
public void addShadowPartitionedRegionForUserRR(DistributedRegion userRegion) { // TODO Auto-generated method stub ((ParallelGatewaySenderQueue)this.queue).addShadowPartitionedRegionForUserRR(userRegion); } }
final boolean isDebugEnabled = logger.isDebugEnabled(); PartitionedRegion prQ = getRandomShadowPR(); List batch = new ArrayList(); if (prQ == null || prQ.getLocalMaxMemory() == 0) { Thread.currentThread().interrupt(); blockProcesorThreadIfRequired(); return batch; if (areLocalBucketQueueRegionsPresent() && ((bId = getRandomPrimaryBucket(prQ)) != -1)) { GatewaySenderEventImpl object = (GatewaySenderEventImpl) peekAhead(prQ, bId); if (object != null) { GatewaySenderEventImpl copy = object.makeHeapCopyIfOffHeap(); this, batch.size(), size(), localSize()); blockProcesorThreadIfRequired();
addShadowPartitionedRegionForUserPR(ColocationHelper.getLeaderRegion(userPR)); return; if(!isUsedForHDFS() && userPR.getDataPolicy().withPersistence() && !sender.isPersistenceEnabled()){ throw new GatewaySenderException( LocalizedStrings.ParallelGatewaySenderQueue_NON_PERSISTENT_GATEWAY_SENDER_0_CAN_NOT_BE_ATTACHED_TO_PERSISTENT_REGION_1 + QSTRING + convertPathToName(userPR.getFullPath()); prQ = (PartitionedRegion)cache.getRegion(prQName); if (prQ == null) { prQName, ra, null, cache, sender, isUsedForHDFS()); handleShadowPRExistsScenario(cache, prQ); ((AbstractGatewaySender)sender).enqueueTempEvents(); afterRegionAdd(userPR); this.sender.lifeCycleLock.writeLock().unlock();
@Override protected void initializeMessageQueue(String id ) { Set<Region> targetRs = new HashSet<Region>(); for (LocalRegion region : ((GemFireCacheImpl)((AbstractGatewaySender)sender).getCache()) .getApplicationRegions()) { if (region.getAllGatewaySenderIds().contains(id)) { targetRs.add(region); } } if (logger.isDebugEnabled()) { logger.debug("The target Regions are(PGSEP) {}", targetRs); } if (sender.getIsHDFSQueue()) this.queue = new HDFSParallelGatewaySenderQueue(this.sender, targetRs, this.index, this.nDispatcher); else this.queue = new ParallelGatewaySenderQueue(this.sender, targetRs, this.index, this.nDispatcher); if(((ParallelGatewaySenderQueue)queue).localSize() > 0) { ((ParallelGatewaySenderQueue)queue).notifyEventProcessorIfRequired(); } }
addShadowPartitionedRegionForUserPR((PartitionedRegion)userRegion); }else{ addShadowPartitionedRegionForUserRR((DistributedRegion)userRegion); initializeConflationThreadPool();
addShadowPartitionedRegionForUserPR((PartitionedRegion)userRegion); initializeConflationThreadPool();
protected void addRemovedEvents(String prQPath, int bucketId, List<Object> shadowKeys) { buckToDispatchLock.lock(); boolean wasEmpty = regionToDispatchedKeysMap.isEmpty(); try { Map bucketIdToDispatchedKeys = (Map)regionToDispatchedKeysMap.get(prQPath); if (bucketIdToDispatchedKeys == null) { bucketIdToDispatchedKeys = new ConcurrentHashMap(); regionToDispatchedKeysMap.put(prQPath, bucketIdToDispatchedKeys); } addRemovedEventsToMap(bucketIdToDispatchedKeys, bucketId, shadowKeys); if (wasEmpty) { regionToDispatchedKeysMapEmpty.signal(); } } finally { buckToDispatchLock.unlock(); } }
protected void addRemovedEvent(PartitionedRegion prQ, int bucketId, Object key) { buckToDispatchLock.lock(); boolean wasEmpty = regionToDispatchedKeysMap.isEmpty(); try { Map bucketIdToDispatchedKeys = (Map)regionToDispatchedKeysMap.get(prQ.getFullPath()); if (bucketIdToDispatchedKeys == null) { bucketIdToDispatchedKeys = new ConcurrentHashMap(); regionToDispatchedKeysMap.put(prQ.getFullPath(), bucketIdToDispatchedKeys); } addRemovedEventToMap(bucketIdToDispatchedKeys, bucketId, key); if (wasEmpty) { regionToDispatchedKeysMapEmpty.signal(); } } finally { buckToDispatchLock.unlock(); } }
addRemovedEvent(prQ, bucketId, key);
public List peek(int batchSize, int timeToWait) throws InterruptedException, CacheException { PartitionedRegion prQ = getRandomShadowPR(); List batch = new ArrayList(); if (prQ == null || prQ.getLocalMaxMemory() == 0) { Thread.currentThread().interrupt(); blockProcesorThreadIfRequired(); return batch; if (areLocalBucketQueueRegionsPresent() && ((bId = getRandomPrimaryBucket(prQ)) != -1)) { GatewaySenderEventImpl object = (GatewaySenderEventImpl) peekAhead(prQ, bId); if (object != null) { GatewaySenderEventImpl copy = object.makeHeapCopyIfOffHeap(); + " the size of queue is " + size() + "localSize is : " + localSize()); blockProcesorThreadIfRequired();
addShadowPartitionedRegionForUserPR(ColocationHelper.getLeaderRegion(userPR)); + QSTRING + convertPathToName(userPR.getFullPath()); prQ = (PartitionedRegion)cache.getRegion(prQName); if (prQ == null) { prQName, ra, null, cache, sender, isUsedForHDFS()); handleShadowPRExistsScenario(cache, prQ); ((AbstractGatewaySender)sender).enqueTempEvents(); afterRegionAdd(userPR); this.sender.lifeCycleLock.writeLock().unlock();
@Override protected void initializeMessageQueue(String id ) { Set<Region> targetRs = new HashSet<Region>(); for (LocalRegion region : ((GemFireCacheImpl)((ParallelGatewaySenderImpl)sender).getCache()) .getApplicationRegions()) { if (region.getAllGatewaySenderIds().contains(id)) { targetRs.add(region); } } if (getLogger().fineEnabled()) { getLogger().fine("The target Regions are(PGSEP) " + targetRs); } if (sender.getIsHDFSQueue()) this.queue = new HDFSParallelGatewaySenderQueue(this.sender, targetRs, this.index, this.nDispatcher); else this.queue = new ParallelGatewaySenderQueue(this.sender, targetRs, this.index, this.nDispatcher); if(((ParallelGatewaySenderQueue)queue).localSize() > 0) { ((ParallelGatewaySenderQueue)queue).notifyEventProcessorIfRequired(); } }
protected void addRemovedEvents(String prQPath, int bucketId, List<Object> shadowKeys) { buckToDispatchLock.lock(); boolean wasEmpty = regionToDispatchedKeysMap.isEmpty(); try { Map bucketIdToDispatchedKeys = (Map)regionToDispatchedKeysMap.get(prQPath); if (bucketIdToDispatchedKeys == null) { bucketIdToDispatchedKeys = new ConcurrentHashMap(); regionToDispatchedKeysMap.put(prQPath, bucketIdToDispatchedKeys); } addRemovedEventsToMap(bucketIdToDispatchedKeys, bucketId, shadowKeys); if (wasEmpty) { regionToDispatchedKeysMapEmpty.signal(); } } finally { buckToDispatchLock.unlock(); } }
protected void addRemovedEvent(PartitionedRegion prQ, int bucketId, Object key) { StoppableReentrantLock lock = buckToDispatchLock; if (lock != null) { lock.lock(); boolean wasEmpty = regionToDispatchedKeysMap.isEmpty(); try { Map bucketIdToDispatchedKeys = (Map)regionToDispatchedKeysMap.get(prQ.getFullPath()); if (bucketIdToDispatchedKeys == null) { bucketIdToDispatchedKeys = new ConcurrentHashMap(); regionToDispatchedKeysMap.put(prQ.getFullPath(), bucketIdToDispatchedKeys); } addRemovedEventToMap(bucketIdToDispatchedKeys, bucketId, key); if (wasEmpty) { regionToDispatchedKeysMapEmpty.signal(); } } finally { lock.unlock(); } } }
addRemovedEvent(prQ, bucketId, key);
public Set<PartitionedRegion> getRegions() { return ((ParallelGatewaySenderQueue)(processors[0].getQueue())).getRegions(); }
protected void addRemovedEvents(PartitionedRegion prQ, int bucketId, List<Object> shadowKeys) { buckToDispatchLock.lock(); boolean wasEmpty = regionToDispatchedKeysMap.isEmpty(); try { Map bucketIdToDispatchedKeys = (Map)regionToDispatchedKeysMap.get(prQ.getFullPath()); if (bucketIdToDispatchedKeys == null) { bucketIdToDispatchedKeys = new ConcurrentHashMap(); regionToDispatchedKeysMap.put(prQ.getFullPath(), bucketIdToDispatchedKeys); } addRemovedEventsToMap(bucketIdToDispatchedKeys, bucketId, shadowKeys); if (wasEmpty) { regionToDispatchedKeysMapEmpty.signal(); } } finally { buckToDispatchLock.unlock(); } }
public void addShadowPartitionedRegionForUserRR(DistributedRegion userRegion) { // TODO Auto-generated method stub ((ParallelGatewaySenderQueue)this.queue).addShadowPartitionedRegionForUserRR(userRegion); }