@Override public long getEntrySize() { if (parRegion.isDataStore()) { return getPrStatistic(StatsKey.DATA_STORE_BYTES_IN_USE).longValue(); } else { return ManagementConstants.ZERO; } }
protected Set<BucketRegion> getLocalBucketRegions(PartitionedRegion pr) { Set<BucketRegion> localBucketRegions = new HashSet<BucketRegion>(); if (pr.isDataStore()) { localBucketRegions = pr.getDataStore().getAllLocalBucketRegions(); } return localBucketRegions; }
@Override protected void enableConcurrencyChecks() { if (supportsConcurrencyChecks()) { this.setConcurrencyChecksEnabled(true); assert !isDataStore(); } }
private byte hasRemoteFPAttrs() { List<FixedPartitionAttributesImpl> fpaList = this.getRegionAdvisor().adviseAllFixedPartitionAttributes(); Set<InternalDistributedMember> remoteDataStores = this.getRegionAdvisor().adviseDataStore(); if (!fpaList.isEmpty() || (this.fixedPAttrs != null && !this.fixedPAttrs.isEmpty())) { return 1; } if (isDataStore() || !remoteDataStores.isEmpty()) { return 2; } // This is an accessor and we need to wait for a datastore to see if there // are any fixed PRs. return 0; }
public ConcurrentHashMap<Integer, Set<ServerBucketProfile>> getAllClientBucketProfilesTest() { ConcurrentHashMap<Integer, Set<ServerBucketProfile>> map = new ConcurrentHashMap<Integer, Set<ServerBucketProfile>>(); Map<Integer, List<BucketServerLocation66>> testMap = new HashMap<>(this.getAllClientBucketProfiles()); for (Integer bucketId : testMap.keySet()) { Set<ServerBucketProfile> parr = new HashSet<>(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); } }
/** * Test Method: Get all {@link InternalDistributedMember}s known by this instance of the * PartitionedRegion. Note: A member is recognized as such when it partiticpates as a "data * store". * * @return a {@code HashSet} of {@link InternalDistributedMember}s or an empty {@code HashSet} */ public Set<InternalDistributedMember> getAllNodes() { Set<InternalDistributedMember> result = getRegionAdvisor().adviseDataStore(true); if (this.isDataStore()) { result.add(getDistributionManager().getId()); } return result; }
@Override public synchronized boolean putProfile(Profile p) { assert p instanceof CacheProfile; CacheProfile profile = (CacheProfile) p; PartitionedRegion pr = getPartitionedRegion(); if (profile.hasCacheLoader) { pr.setHaveCacheLoader(); } // don't keep FilterProfiles around in accessors. They're needed only for // routing messages in data stors if (profile.filterProfile != null) { if (!pr.isDataStore()) { profile.filterProfile = null; } } return super.putProfile(profile); }
if (getPartitionedRegion().isDataStore()) { for (Integer bucketId : getPartitionedRegion().getDataStore().getAllLocalBucketIds()) { BucketProfile profile = getBucketAdvisor(bucketId).getLocalProfile();
if (!this.partitionedRegion.isDataStore()) { if (logger.isDebugEnabled()) { logger.debug("handleRemoteManageBucket: local max memory is zero");
/** * partition region entry count is taken from all primary bucket entry count. Ideally it should * come from stats. to be done in 8.0 * */ @Override public long getEntryCount() { if (parRegion.isDataStore()) { int numLocalEntries = 0; Set<BucketRegion> localPrimaryBucketRegions = parRegion.getDataStore().getAllLocalPrimaryBucketRegions(); if (localPrimaryBucketRegions != null && localPrimaryBucketRegions.size() > 0) { for (BucketRegion br : localPrimaryBucketRegions) { // TODO soplog, fix this for griddb regions numLocalEntries += br.getRegionMap().sizeInVM() - br.getTombstoneCount(); } } return numLocalEntries; } else { return ManagementConstants.ZERO; } }
PartitionedRegion pr = (PartitionedRegion) region; Set<InternalDistributedMember> prMembers = pr.getRegionAdvisor().advisePrimaryOwners(); if (pr.isDataStore()) { InternalCache cache = (InternalCache) region.getCache();
return; if (!PRHARedundancyProvider.this.prRegion.isDataStore()) { return;
if (prconf.isFirstDataStoreCreated() && pr.isDataStore()) { validateDistributedEvictionAttributes(prconf.getEvictionAttributes());
private void setNetworkHopType(final Integer bucketId, final InternalDistributedMember targetNode) { if (this.isDataStore() && !getMyId().equals(targetNode)) { Set<ServerBucketProfile> profiles = this.getRegionAdvisor().getClientBucketProfiles(bucketId); if (profiles != null) { for (ServerBucketProfile profile : profiles) { if (profile.getDistributedMember().equals(targetNode)) { if (isProfileFromSameGroup(profile)) { if (this.getNetworkHopType() != NETWORK_HOP_TO_SAME_GROUP && logger.isDebugEnabled()) { logger.debug( "one-hop: cache op meta data staleness observed. Message is in same server group (byte 1)"); } this.setNetworkHopType((byte) NETWORK_HOP_TO_SAME_GROUP); } else { if (this.getNetworkHopType() != NETWORK_HOP_TO_DIFFERENT_GROUP && logger.isDebugEnabled()) { logger.debug( "one-hop: cache op meta data staleness observed. Message is to different server group (byte 2)"); } this.setNetworkHopType((byte) NETWORK_HOP_TO_DIFFERENT_GROUP); } this.setMetadataVersion((byte) profile.getVersion()); break; } } } } }
if (partitionedRegion.isDataStore() && partitionedRegion.getDataStore() != null && partitionedRegion.getDataPolicy() == DataPolicy.PERSISTENT_PARTITION) { int numBuckets = partitionedRegion.getTotalNumberOfBuckets();
if (isDataStore()) { ret = this.redundancyProvider.createBucketAtomically(bucketId, size, startTime, false, partitionName);
PartitionedRegionHelper.getPartitionedRegion(regionName, cache); if (parRegion != null && showMember) { if (parRegion.isDataStore()) {
if (isDataStore() && !prConfig.isFirstDataStoreCreated()) { prConfig.setDatastoreCreated(getEvictionAttributes());
if (!this.isDataStore() && supportsConcurrencyChecks()) { this.setConcurrencyChecksEnabled(!this.getConcurrencyChecksEnabled()); new CreateRegionProcessor(this).initializeRegion();