/** check to see if the partitioned region is locally destroyed or closed */ public boolean isPartitionedRegionOpen() { return !this.partitionedRegion.isLocallyDestroyed && !this.partitionedRegion.isClosed && !this.partitionedRegion.isDestroyed(); }
/** check to see if the partitioned region is locally destroyed or closed */ public boolean isPartitionedRegionOpen() { return !this.partitionedRegion.isLocallyDestroyed && !this.partitionedRegion.isClosed && !this.partitionedRegion.isDestroyed(); }
public boolean isDestroyed() { return this.proxy.isDestroyed(); }
public boolean isDestroyed() { return this.proxy.isDestroyed(); }
/** * add a partitioned region to the set of tracked partitioned regions. This is used to notify the regions when this * cache requires, or does not require notification of all region/entry events. */ public void addPartitionedRegion(PartitionedRegion r) { synchronized (GemFireCacheImpl.class) { synchronized (this.partitionedRegions) { if (r.isDestroyed()) { if (logger.isDebugEnabled()) { logger.debug("GemFireCache#addPartitionedRegion did not add destroyed {}", r); } return; } if (this.partitionedRegions.add(r)) { getCachePerfStats().incPartitionedRegions(1); } } } }
@Override public void run2() { try { if (!pr.isLocallyDestroyed && !pr.isClosed && !pr.isDestroyed()) { dm.putOutgoing(delayedInstance); } } catch (CancelException cce) { // cache is closed - can't send the message } finally { tm.cancel(); } } };
@Override public void run2() { try { if (!pr.isLocallyDestroyed && !pr.isClosed && !pr.isDestroyed()) { dm.putOutgoing(delayedInstance); } } catch (CancelException cce) { // cache is closed - can't send the message } finally { tm.cancel(); } } };
public void run2() throws CacheException { PartitionedRegion p = (PartitionedRegion) getCache().getRegion(r); assertNotNull(p); assertTrue(!p.isDestroyed()); Set allN = p.getAllNodes(); assertNotNull(allN); assertEquals(2, allN.size()); }} );
public void run2() throws CacheException { PartitionedRegion p = (PartitionedRegion) getCache().getRegion(r); assertNotNull(p); assertTrue(!p.isDestroyed()); Set allN = p.getAllNodes(); assertNotNull(allN); assertEquals(3, allN.size()); }} );
public void run2() throws CacheException { PartitionedRegion p = (PartitionedRegion) getCache().getRegion(r); assertNotNull(p); assertTrue(!p.isDestroyed()); Set allN = p.getAllNodes(); assertNotNull(allN); assertEquals(1, allN.size()); }} );
public boolean isReadyForPeek() { return !this.getPartitionedRegion().isDestroyed() && !this.isEmpty() && !this.eventSeqNumQueue.isEmpty() && getBucketAdvisor().isPrimary(); }
public boolean isReadyForPeek() { return !this.getPartitionedRegion().isDestroyed() && !this.isEmpty() && !this.eventSeqNumQueue.isEmpty() && getBucketAdvisor().isPrimary(); }
@Override public void memberRemoved(PersistentMemberID persistentID, boolean revoked) { if(!revoked) { return; } DistributedMember dmem = prRegion.getSystem().getDistributedMember(); if(logger.isDebugEnabled()) { logger.debug("Persistent Membership Listener invoked on DistributedMember = {} for removed memberId = {}", dmem, persistentID); } if (! prRegion.isCacheClosing() && !prRegion.isDestroyed() && !prRegion.isFixedPartitionedRegion()) { scheduleRedundancyRecovery(persistentID); } } }
/**Globally destroy the partitioned region by sending a message * to a data store to do the destroy. * @return true if the region was destroyed successfully */ private boolean destroyOnDataStore(Object aCallbackArgument) { RegionAdvisor advisor = getRegionAdvisor(); Set<InternalDistributedMember> attempted = new HashSet<InternalDistributedMember>(); checkReadiness(); while(!isDestroyed()) { Set<InternalDistributedMember> available = advisor.adviseInitializedDataStore(); available.removeAll(attempted); if(available.isEmpty()) { return false; } InternalDistributedMember next = available.iterator().next(); try { DestroyRegionOnDataStoreMessage.send(next, this, aCallbackArgument); return true; } catch(ReplyException e) { //try the next member if(logger.fineEnabled()) { logger.fine("Error destroying " + this + " on " + next, e); } } } return true; }
/** * This method is used to test the isDestroyed() functionality. * */ public void test012IsDestroyed() throws Exception { String regionName = "testIsDestroyed"; PartitionedRegion pr = (PartitionedRegion)PartitionedRegionTestHelper .createPartitionedRegion(regionName, String.valueOf(200), 0); pr.put(new Integer(1), new Integer(1)); pr.get(new Integer(1)); if (pr.isDestroyed()) { fail("PartitionedRegionSingleNodeOperationsJUnitTest:testIsDestroyed(): Returns true in isDestroyed method, before the region is destroyed"); } pr.destroyRegion(); if (!pr.isDestroyed()) { fail("PartitionedRegionSingleNodeOperationsJUnitTest:testIsDestroyed(): " + "Returns false in isDestroyed method, after the region is destroyed"); } if (logger.fineEnabled()) { logger .fine("PartitionedRegionSingleNodeOperationsJUnitTest - testIsDestroyed() Completed successfully ... "); } }
public void run2() throws CacheException { String[] regions = {rName0, rName1, rName2}; for (int rs = 0; rs < regions.length; rs++) { PartitionedRegion p = (PartitionedRegion) getCache().getRegion(regions[rs]); assertNotNull(p); assertTrue(!p.isDestroyed()); assertEquals(numBuckets, p.getTotalNumberOfBuckets()); try { for(int i = 0; i < p.getTotalNumberOfBuckets(); i++) { assertEquals(0, p.getRegionAdvisor().getBucketOwners(i).size()); assertEquals(0, p.getBucketOwnersForValidation(i).size()); } } catch (ForceReattemptException noGood) { fail("Unexpected force retry", noGood); } } } };
/** * add a partitioned region to the set of tracked partitioned regions. This is used to notify the regions when this * cache requires, or does not require notification of all region/entry events. */ public void addPartitionedRegion(PartitionedRegion r) { synchronized (GemFireCacheImpl.class) { synchronized (this.partitionedRegions) { if (r.isDestroyed()) { if (getLogger().fineEnabled()) { getLogger().fine("GemFireCache#addPartitionedRegion did not add destroyed " + r); } return; } if (this.partitionedRegions.add(r)) { getCachePerfStats().incPartitionedRegions(1); } } } }
/** A utility to check to see if a region has been created on * all of the VMs that host the regions this region is colocated with. */ public static boolean isColocationComplete(PartitionedRegion region) { Region prRoot = PartitionedRegionHelper.getPRRoot(region .getCache()); PartitionRegionConfig config = (PartitionRegionConfig) prRoot.get(region.getRegionIdentifier()); //Fix for bug 40075. There is race between this call and the region being concurrently //destroyed. if(config == null) { Assert.assertTrue(region.isDestroyed() || region.isClosed, "Region is not destroyed, but there is no entry in the prRoot for region " + region); return false; } return config.isColocationComplete(); }
/** A utility to check to see if a region has been created on * all of the VMs that host the regions this region is colocated with. */ public static boolean isColocationComplete(PartitionedRegion region) { Region prRoot = PartitionedRegionHelper.getPRRoot(region .getCache()); PartitionRegionConfig config = (PartitionRegionConfig) prRoot.get(region.getRegionIdentifier()); //Fix for bug 40075. There is race between this call and the region being concurrently //destroyed. if(config == null) { Assert.assertTrue(region.isDestroyed(), "Region is not destroyed, but there is no entry in the prRoot for region " + region); return false; } return config.isColocationComplete(); }
@Override public void memberRemoved(PersistentMemberID persistentID, boolean revoked) { if(!revoked) { return; } DistributedMember dmem = prRegion.getSystem().getDistributedMember(); if(getLogger().fineEnabled()) { getLogger().fine( "Persistent Membership Listener invoked on DistributedMember = " + dmem + " for removed memberId = " + persistentID); } if (! prRegion.isCacheClosing() && !prRegion.isDestroyed() && !prRegion.isFixedPartitionedRegion()) { scheduleRedundancyRecovery(persistentID); } } }