/** * Returns true if this region has no storage * * @since 5.0 */ protected final boolean isProxy() { return getDataPolicy() == DataPolicy.EMPTY; }
/** ********************* CacheStatistics ******************************** */ public CacheStatistics getStatistics() { // prefer region destroyed exception over statistics disabled exception checkReadiness(); if (!this.statisticsEnabled) { throw new StatisticsDisabledException(LocalizedStrings.AbstractRegion_STATISTICS_DISABLED_FOR_REGION_0.toLocalizedString(getFullPath())); } return this; }
public static GfxdPartitionResolver getResolver(AbstractRegion region) { PartitionAttributes<?, ?> pattrs = region.getPartitionAttributes(); PartitionResolver<?, ?> resolver; if (pattrs != null && (resolver = pattrs.getPartitionResolver()) instanceof GfxdPartitionResolver) { return (GfxdPartitionResolver)resolver; } return null; }
public synchronized CacheLoader setCacheLoader(CacheLoader cl) { checkReadiness(); CacheLoader oldLoader = this.cacheLoader; assignCacheLoader(cl); cacheLoaderChanged(oldLoader); return oldLoader; }
public synchronized CacheWriter setCacheWriter(CacheWriter cacheWriter) { checkReadiness(); CacheWriter oldWriter = this.cacheWriter; assignCacheWriter(cacheWriter); cacheWriterChanged(oldWriter); return oldWriter; }
public synchronized CacheLoader setCacheLoader(CacheLoader cl) { checkReadiness(); if (cl != null && isBridgeLoader(cl)) { if (getPoolName() != null) { throw new IllegalStateException("A region with a connection pool can not have a BridgeLoader."); } } CacheLoader oldLoader = this.cacheLoader; assignCacheLoader(cl); cacheLoaderChanged(oldLoader); return oldLoader; }
getCache().getLoggerI18n().warning(LocalizedStrings.Mem_LRU_Eviction_Attribute_Reset, new Object[] { regionName,this.evictionAttributes.getMaximum(), this.partitionAttributes.getLocalMaxMemory() }); this.setEvictionController(this.evictionAttributes .createEvictionController(this, attrs.getEnableOffHeapMemory())); storeCacheListenersField(attrs.getCacheListeners()); assignCacheLoader(attrs.getCacheLoader()); assignCacheWriter(attrs.getCacheWriter()); this.regionTimeToLive = attrs.getRegionTimeToLive().getTimeout(); this.regionTimeToLiveExpirationAction = attrs.getRegionTimeToLive() .getAction(); setRegionTimeToLiveAtts(); this.regionIdleTimeout = attrs.getRegionIdleTimeout().getTimeout(); this.regionIdleTimeoutExpirationAction = attrs.getRegionIdleTimeout() .getAction(); setRegionIdleTimeoutAtts(); updateRegionExpiryPossible(); this.entryTimeToLive = attrs.getEntryTimeToLive().getTimeout(); this.entryTimeToLiveExpirationAction = attrs.getEntryTimeToLive() .getAction(); setEntryTimeToLiveAtts(); this.customEntryTimeToLive = attrs.getCustomEntryTimeToLive(); this.entryIdleTimeout = attrs.getEntryIdleTimeout().getTimeout(); this.entryIdleTimeoutExpirationAction = attrs.getEntryIdleTimeout() .getAction(); setEntryIdleTimeoutAtts(); this.customEntryIdleTimeout = attrs.getCustomEntryIdleTimeout();
public void clear() { checkReadiness(); checkForLimitedOrNoAccess(); RegionEventImpl regionEvent = new RegionEventImpl(this, Operation.REGION_CLEAR, null, false, getMyId(),generateEventID()); basicClear(regionEvent); }
long mostRecentAccessed = basicGetLastAccessedTime(); long mostRecentModified = basicGetLastModifiedTime(); Iterator subIt = subregions(false).iterator(); while (subIt.hasNext()) { try { basicSetLastAccessedTime(Math.max(mostRecentAccessed, mostRecentModified)); basicSetLastModifiedTime(mostRecentModified);
public synchronized CacheWriter setCacheWriter(CacheWriter cacheWriter) { checkReadiness(); if (cacheWriter != null && isBridgeWriter(cacheWriter)) { if (getPoolName() != null) { throw new IllegalStateException("A region with a connection pool can not have a BridgeWriter."); } } CacheWriter oldWriter = this.cacheWriter; assignCacheWriter(cacheWriter); cacheWriterChanged(oldWriter); return oldWriter; }
/** * {@inheritDoc} */ @Override public CustomEvictionAttributes setCustomEvictionAttributes(long newStart, long newInterval) { checkReadiness(); if (this.customEvictionAttributes == null) { throw new IllegalArgumentException( LocalizedStrings.AbstractRegion_NO_CUSTOM_EVICTION_SET .toLocalizedString(getFullPath())); } if (newStart == 0) { newStart = this.customEvictionAttributes.getEvictorStartTime(); } this.customEvictionAttributes = new CustomEvictionAttributesImpl( this.customEvictionAttributes.getCriteria(), newStart, newInterval, newStart == 0 && newInterval == 0); if (this.evService == null) { initilializeCustomEvictor(); } else {// we are changing the earlier one which is already started. EvictorService service = getEvictorTask(); service.changeEvictionInterval(newInterval); if (newStart != 0) service.changeStartTime(newStart); } return this.customEvictionAttributes; }
/** * Returns true if region subscribes to all events or is a replicate. * * @since 5.0 */ final boolean isAllEvents() { return getDataPolicy().withReplication() || getSubscriptionAttributes().getInterestPolicy().isAll(); }
protected StringBuilder getStringBuilder() { StringBuilder buf = new StringBuilder(); buf.append(getClass().getName()); buf.append("[path='") .append(getFullPath()) .append("';scope=") .append(getScope()) .append("';dataPolicy=") .append(this.dataPolicy); if (this.concurrencyChecksEnabled) { buf.append("; concurrencyChecksEnabled"); } return buf; }
public EvictorService getEvictorTask() { if (this.evService == null && (getCustomEvictionAttributes() != null) && !getCustomEvictionAttributes().isEvictIncoming()) { LogWriterI18n logger = getSystem().getLogWriter() .convertToLogWriterI18n(); if (logger.fineEnabled()) { logger .fine("LocalRegion.creating EvictorService " + this.getFullPath()); } this.evService = new EvictorService(getCustomEvictionAttributes() .getCriteria(), getCustomEvictionAttributes().getEvictorStartTime(), getCustomEvictionAttributes().getEvictorInterval(), TimeUnit.MILLISECONDS, this); if (logger.fineEnabled()) { logger.fine("LocalRegion.created EvictorService " + this.getFullPath()); } } return this.evService; }
String getRegionName() { return this.leftOperand.getRegion().getFullPath(); }
@Override public Map getAll(Collection keys, Object callback) { if (keys == null) { throw new NullPointerException("The collection of keys for getAll cannot be null"); } checkReadiness(); checkForLimitedOrNoAccess(); return keys.isEmpty()? new HashMap(): basicGetAll(keys, callback); }
checkReadiness(); long mostRecent = basicGetLastAccessedTime(); Iterator subIt = subregions(false).iterator(); while (subIt.hasNext()) { try {
checkReadiness(); long mostRecent = basicGetLastModifiedTime(); Iterator subIt = subregions(false).iterator(); while (subIt.hasNext()) { try {
RegionAttributes attrs = this.region.getAttributes(); Scope scope = attrs.getScope(); CacheLoader loader = ((AbstractRegion)region).basicGetLoader(); Assert.assertTrue(scope.isDistributed());
this.setEvictionController(this.evictionAttributes .createEvictionController(this, attrs.getOffHeap())); storeCacheListenersField(attrs.getCacheListeners()); assignCacheLoader(attrs.getCacheLoader()); assignCacheWriter(attrs.getCacheWriter()); this.regionTimeToLive = attrs.getRegionTimeToLive().getTimeout(); this.regionTimeToLiveExpirationAction = attrs.getRegionTimeToLive() .getAction(); setRegionTimeToLiveAtts(); this.regionIdleTimeout = attrs.getRegionIdleTimeout().getTimeout(); this.regionIdleTimeoutExpirationAction = attrs.getRegionIdleTimeout() .getAction(); setRegionIdleTimeoutAtts(); this.entryTimeToLive = attrs.getEntryTimeToLive().getTimeout(); this.entryTimeToLiveExpirationAction = attrs.getEntryTimeToLive() .getAction(); setEntryTimeToLiveAtts(); this.customEntryTimeToLive = attrs.getCustomEntryTimeToLive(); this.entryIdleTimeout = attrs.getEntryIdleTimeout().getTimeout(); this.entryIdleTimeoutExpirationAction = attrs.getEntryIdleTimeout() .getAction(); setEntryIdleTimeoutAtts(); this.customEntryIdleTimeout = attrs.getCustomEntryIdleTimeout(); updateEntryExpiryPossible(); this.statisticsEnabled = attrs.getStatisticsEnabled(); this.ignoreJTA = attrs.getIgnoreJTA(); this.loadFactor = attrs.getLoadFactor();