public String toString() { final StringBuilder sb = new StringBuilder(); sb.append(getClass().getName()); sb.append("[path='").append(getFullPath()); sb.append("';scope=").append(this.proxy.getScope()); sb.append("';dataPolicy=").append(this.proxy.getDataPolicy()); sb.append(" ;bucketIds=").append(this.buckets); return sb.append(']').toString(); }
@Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append(getClass().getName()); sb.append("[path='").append(getFullPath()); sb.append("';scope=").append(this.proxy.getScope()); sb.append("';dataPolicy=").append(this.proxy.getDataPolicy()); sb.append(" ;bucketIds=").append(this.buckets); return sb.append(']').toString(); }
/** * Test to see if there are any persistent child regions * of a partitioned region. */ public static boolean hasPersistentChildRegion( PartitionedRegion region) { for(PartitionedRegion child : getColocatedChildRegions(region)) { if(child.getDataPolicy().withPersistence()) { return true; } } return false; } }
/** * Test to see if there are any persistent child regions * of a partitioned region. */ public static boolean hasPersistentChildRegion( PartitionedRegion region) { for(PartitionedRegion child : getColocatedChildRegions(region)) { if(child.getDataPolicy().withPersistence()) { return true; } } return false; } }
private PartitionedRegion findPersistentRegionRecursively( PartitionedRegion pr) { if(pr.getDataPolicy().withPersistence()) { return pr; } for(PartitionedRegion child : ColocationHelper.getColocatedChildRegions(pr)) { PartitionedRegion leader = findPersistentRegionRecursively(child); if(leader != null) { return leader; } } return null; }
private PartitionedRegion findPersistentRegionRecursively( PartitionedRegion pr) { if(pr.getDataPolicy().withPersistence()) { return pr; } for(PartitionedRegion child : ColocationHelper.getColocatedChildRegions(pr)) { PartitionedRegion leader = findPersistentRegionRecursively(child); if(leader != null) { return leader; } } return null; }
/** * Creates a new RedundancyLogger. * @param prhaRedundancyProvider */ public RedundancyLogger(PRHARedundancyProvider prhaRedundancyProvider) { super(prhaRedundancyProvider); PartitionedRegion baseRegion = ColocationHelper.getLeaderRegion(redundancyProvider.prRegion); List<PartitionedRegion> colocatedRegions = ColocationHelper.getColocatedChildRegions(baseRegion); List<RegionStatus> allRegions = new ArrayList<RegionStatus>(colocatedRegions.size() + 1); if(baseRegion.getDataPolicy().withPersistence()) { allRegions.add(new RegionStatus(baseRegion)); } for(PartitionedRegion region : colocatedRegions) { if(region.getDataPolicy().withPersistence()) { allRegions.add(new RegionStatus(region)); } } this.regions = Collections.unmodifiableList(allRegions); this.allBucketsRecoveredFromDisk = redundancyProvider.getAllBucketsRecoveredFromDiskLatch(); this.membershipChanged = true; addListeners(); }
/** * Creates a new RedundancyLogger. * @param prhaRedundancyProvider */ public RedundancyLogger(PRHARedundancyProvider prhaRedundancyProvider) { super(prhaRedundancyProvider); this.logger = redundancyProvider.getLogger(); PartitionedRegion baseRegion = ColocationHelper.getLeaderRegion(redundancyProvider.prRegion); List<PartitionedRegion> colocatedRegions = ColocationHelper.getColocatedChildRegions(baseRegion); List<RegionStatus> allRegions = new ArrayList<RegionStatus>(colocatedRegions.size() + 1); if(baseRegion.getDataPolicy().withPersistence()) { allRegions.add(new RegionStatus(baseRegion)); } for(PartitionedRegion region : colocatedRegions) { if(region.getDataPolicy().withPersistence()) { allRegions.add(new RegionStatus(region)); } } this.regions = Collections.unmodifiableList(allRegions); this.allBucketsRecoveredFromDisk = redundancyProvider.getAllBucketsRecoveredFromDiskLatch(); this.membershipChanged = true; addListeners(); }
private boolean isRebalanceNecessary() { //Fixed partitions will always be rebalanced. //Persistent partitions that have recovered from disk will //also need to rebalance primaries return isRebalance || director.isRebalanceNecessary(leaderRegion.getRedundancyProvider().isRedundancyImpaired(), leaderRegion.getDataPolicy().withPersistence()); }
private boolean isRebalanceNecessary() { //Fixed partitions will always be rebalanced. //Persistent partitions that have recovered from disk will //also need to rebalance primaries return isRebalance || director.isRebalanceNecessary(leaderRegion.getRedundancyProvider().isRedundancyImpaired(), leaderRegion.getDataPolicy().withPersistence()); }
/** * Retrieve the set of members which are currently offline * for all buckets. */ public OfflineMemberDetailsImpl fetchOfflineMembers() { ProxyBucketRegion[] proxyBuckets = prRegion.getRegionAdvisor().getProxyBucketArray(); Set<PersistentMemberID>[] offlineMembers = new Set[proxyBuckets.length]; for(int i =0; i < proxyBuckets.length; i++) { ProxyBucketRegion proxy = proxyBuckets[i]; if(this.prRegion.getDataPolicy().withPersistence()) { Set<PersistentMemberID> persistedMembers = proxy.getPersistenceAdvisor().getMissingMembers(); if(persistedMembers == null) { persistedMembers = Collections.emptySet(); } offlineMembers[i] = persistedMembers; } else { offlineMembers[i] = Collections.emptySet(); } } return new OfflineMemberDetailsImpl(offlineMembers); }
/** * Retrieve the set of members which are currently offline * for all buckets. */ public OfflineMemberDetailsImpl fetchOfflineMembers() { ProxyBucketRegion[] proxyBuckets = prRegion.getRegionAdvisor().getProxyBucketArray(); Set<PersistentMemberID>[] offlineMembers = new Set[proxyBuckets.length]; for(int i =0; i < proxyBuckets.length; i++) { ProxyBucketRegion proxy = proxyBuckets[i]; if(this.prRegion.getDataPolicy().withPersistence()) { Set<PersistentMemberID> persistedMembers = proxy.getPersistenceAdvisor().getMissingMembers(); if(persistedMembers == null) { persistedMembers = Collections.emptySet(); } offlineMembers[i] = persistedMembers; } else { offlineMembers[i] = Collections.emptySet(); } } return new OfflineMemberDetailsImpl(offlineMembers); }
/** * Wait for in an progress backup. When we backup the whole DS, we need to make * sure we don't miss a bucket because it is in the process * of rebalancing. This doesn't wait for the whole backup to complete, * it only makes sure that this destroy will wait until the point * when we know that we that this bucket won't be destroyed on this member * in the backup unless it was backed up on the target member. */ private void waitForInProgressBackup() { BackupManager backupManager = getPartitionedRegion().getGemFireCache().getBackupManager(); if(getPartitionedRegion().getDataPolicy().withPersistence() && backupManager != null) { backupManager.waitForBackup(); } }
/** * Wait for in an progress backup. When we backup the whole DS, we need to make * sure we don't miss a bucket because it is in the process * of rebalancing. This doesn't wait for the whole backup to complete, * it only makes sure that this destroy will wait until the point * when we know that we that this bucket won't be destroyed on this member * in the backup unless it was backed up on the target member. */ private void waitForInProgressBackup() { BackupManager backupManager = getPartitionedRegion().getGemFireCache().getBackupManager(); if(getPartitionedRegion().getDataPolicy().withPersistence() && backupManager != null) { backupManager.waitForBackup(); } }
public void recoverFromDiskRecursively() { recoverFromDisk(); List<PartitionedRegion> colocatedWithList = ColocationHelper.getColocatedChildRegions(partitionedRegion); for(PartitionedRegion childPR : colocatedWithList) { if(childPR.getDataPolicy().withPersistence()) { ProxyBucketRegion[] childBucketArray = childPR.getRegionAdvisor().getProxyBucketArray(); if(childBucketArray != null) { ProxyBucketRegion childBucket = childBucketArray[getBucketId()]; childBucket.recoverFromDisk(); } } } }
public void recoverFromDiskRecursively() { recoverFromDisk(); List<PartitionedRegion> colocatedWithList = ColocationHelper.getColocatedChildRegions(partitionedRegion); for(PartitionedRegion childPR : colocatedWithList) { if(childPR.getDataPolicy().withPersistence()) { ProxyBucketRegion[] childBucketArray = childPR.getRegionAdvisor().getProxyBucketArray(); if(childBucketArray != null) { ProxyBucketRegion childBucket = childBucketArray[getBucketId()]; childBucket.recoverFromDisk(); } } } }
protected String getHDFSEventQueueName() { if (!this.getDataPolicy().withHDFS()) return null; String colocatedWith = this.getPartitionAttributes().getColocatedWith(); String eventQueueName; if (colocatedWith != null) { PartitionedRegion leader = ColocationHelper.getLeaderRegionName(this); eventQueueName = HDFSStoreFactoryImpl.getEventQueueName(leader .getFullPath()); } else { eventQueueName = HDFSStoreFactoryImpl.getEventQueueName(getFullPath()); } return eventQueueName; }
protected String getHDFSEventQueueName() { if (!this.getDataPolicy().withHDFS()) return null; String colocatedWith = this.getPartitionAttributes().getColocatedWith(); String eventQueueName; if (colocatedWith != null) { PartitionedRegion leader = ColocationHelper.getLeaderRegionName(this); eventQueueName = HDFSStoreFactoryImpl.getEventQueueName(leader .getFullPath()); } else { eventQueueName = HDFSStoreFactoryImpl.getEventQueueName(getFullPath()); } return eventQueueName; }
profile.dataPolicy = getDataPolicy(); profile.hasCacheLoader = basicGetLoader() != null; profile.hasCacheWriter = basicGetWriter() != null;
profile.dataPolicy = getDataPolicy(); profile.hasCacheLoader = basicGetLoader() != null; profile.hasCacheWriter = basicGetWriter() != null;