public DataPolicy getDataPolicy() { if (this.event != null) { return this.event.getRegion().getAttributes().getDataPolicy(); } return null; }
public Set<Region<?, ?>> rootRegions() { preOp(); Set<Region<?, ?>> rRegions = new HashSet<Region<?,?>>(); Iterator<LocalRegion> it = this.cache.rootRegions().iterator(); while (it.hasNext()) { LocalRegion lr = it.next(); if (!lr.getAttributes().getDataPolicy().withStorage()) { rRegions.add(new ProxyRegion(this, lr)); } } return Collections.unmodifiableSet(rRegions); }
public Set<Region<?, ?>> rootRegions() { preOp(); Set<Region<?, ?>> rRegions = new HashSet<Region<?,?>>(); Iterator<LocalRegion> it = this.cache.rootRegions().iterator(); while (it.hasNext()) { LocalRegion lr = it.next(); if (!lr.getAttributes().getDataPolicy().withStorage()) { rRegions.add(new ProxyRegion(this, lr)); } } return Collections.unmodifiableSet(rRegions); }
public DataPolicy getDataPolicy() { if (this.event != null) { return this.event.getRegion().getAttributes().getDataPolicy(); } return null; }
static boolean checkExpectedOldValue(@Unretained Object expectedOldValue, @Unretained Object actualValue, LocalRegion lr) { if (Token.isInvalid(expectedOldValue)) { return (actualValue == null) || Token.isInvalid(actualValue); } else { boolean isCompressedOffHeap = lr.getAttributes().getOffHeap() && lr.getAttributes().getCompressor() != null; return checkEquals(expectedOldValue, actualValue, isCompressedOffHeap); } }
/** * This implementation only checks readiness and scope */ public Lock getDistributedLock(Object key) throws IllegalStateException { checkReadiness(); checkForLimitedOrNoAccess(); Scope theScope = getAttributes().getScope(); Assert.assertTrue(theScope == Scope.LOCAL); throw new IllegalStateException(LocalizedStrings.LocalRegion_ONLY_SUPPORTED_FOR_GLOBAL_SCOPE_NOT_LOCAL.toLocalizedString()); }
/** * This implementation only checks readiness and scope */ public Lock getRegionDistributedLock() throws IllegalStateException { checkReadiness(); checkForLimitedOrNoAccess(); Scope theScope = getAttributes().getScope(); Assert.assertTrue(theScope == Scope.LOCAL); throw new IllegalStateException(LocalizedStrings.LocalRegion_ONLY_SUPPORTED_FOR_GLOBAL_SCOPE_NOT_LOCAL.toLocalizedString()); }
/** * This implementation only checks readiness and scope */ public Lock getRegionDistributedLock() throws IllegalStateException { checkReadiness(); checkForLimitedOrNoAccess(); Scope theScope = getAttributes().getScope(); Assert.assertTrue(theScope == Scope.LOCAL); throw new IllegalStateException(LocalizedStrings.LocalRegion_ONLY_SUPPORTED_FOR_GLOBAL_SCOPE_NOT_LOCAL.toLocalizedString()); }
/** * This implementation only checks readiness and scope */ public Lock getDistributedLock(Object key) throws IllegalStateException { checkReadiness(); checkForLimitedOrNoAccess(); Scope theScope = getAttributes().getScope(); Assert.assertTrue(theScope == Scope.LOCAL); throw new IllegalStateException(LocalizedStrings.LocalRegion_ONLY_SUPPORTED_FOR_GLOBAL_SCOPE_NOT_LOCAL.toLocalizedString()); }
/************** Public Methods ************************/ Object doNetSearch() throws TimeoutException { resetResults(); RegionAttributes attrs = region.getAttributes(); this.requestInProgress=true; Scope scope = attrs.getScope(); Assert.assertTrue(scope != Scope.LOCAL); netSearchForBlob(); this.requestInProgress=false; return this.result; }
/************** Public Methods ************************/ Object doNetSearch() throws TimeoutException { resetResults(); RegionAttributes attrs = region.getAttributes(); this.requestInProgress=true; Scope scope = attrs.getScope(); Assert.assertTrue(scope != Scope.LOCAL); netSearchForBlob(); this.requestInProgress=false; return this.result; }
/** * Returns true if this region's config indicates that it will use a disk store. * Added for bug 42055. */ protected boolean usesDiskStore(RegionAttributes ra) { return !isProxy() && (getAttributes().getDataPolicy().withPersistence() || isOverflowEnabled()); }
/** * Returns true if this region's config indicates that it will use a disk store. * Added for bug 42055. */ protected boolean usesDiskStore(RegionAttributes ra) { return !isProxy() && (getAttributes().getDataPolicy().withPersistence() || isOverflowEnabled()); }
protected boolean includeLocalRegion(LocalRegion region) { return (region.getEvictionAttributes().getAlgorithm().isLRUHeap() && region.getAttributes().getOffHeap()); }
private void handleMessageRetry(LocalRegion region, EntryEventImpl clientEvent) { if (clientEvent.isPossibleDuplicate()) { if (region.getAttributes().getConcurrencyChecksEnabled()) { // recover the version tag from other servers clientEvent.setRegion(region); if (!recoverVersionTagForRetriedOperation(clientEvent)) { // no-one has seen this event clientEvent.setPossibleDuplicate(false); } } } }
/** * throws an exception when cloning is disabled while using delta * @param event */ private void validateDelta(EntryEventImpl event) { if (event.getDeltaBytes() != null && !event.getRegion().getAttributes().getCloningEnabled()) { throw new UnsupportedOperationInTransactionException( LocalizedStrings.TXState_DELTA_WITHOUT_CLONING_CANNOT_BE_USED_IN_TX .toLocalizedString()); } }
public boolean isCustomEvictionEnabled() { return getRegion().getDataPolicy().withHDFS() && (getRegion().getAttributes().getCustomEvictionAttributes() != null); }
/** * Create a continuous query on the given pool * @param cq the CQ to create on the server */ public Object create(CqQueryImpl cq) { pool.getRITracker().addCq(cq, cq.isDurable()); byte regionDataPolicyOrdinal = cq.getCqBaseRegion()==null ? (byte) 0 : cq.getCqBaseRegion() .getAttributes().getDataPolicy().ordinal; return CreateCQOp.execute(this.pool, cq.getName(), cq.getQueryString(), CqStateImpl.RUNNING, cq.isDurable(), regionDataPolicyOrdinal); }
/** * Create a continuous query on the given server and return the initial query results. * @param cq the CQ to create on the server */ public SelectResults createWithIR(CqQueryImpl cq) { pool.getRITracker().addCq(cq, cq.isDurable()); byte regionDataPolicyOrdinal = cq.getCqBaseRegion()==null ? (byte) 0 : cq.getCqBaseRegion() .getAttributes().getDataPolicy().ordinal; return CreateCQWithIROp.execute(this.pool, cq.getName(), cq .getQueryString(), CqStateImpl.RUNNING, cq.isDurable(),regionDataPolicyOrdinal); }
private boolean mustEvict() { LocalRegion owner = _getOwner(); InternalResourceManager resourceManager = owner.getCache().getResourceManager(); final boolean monitorStateIsEviction; if (!owner.getAttributes().getOffHeap()) { monitorStateIsEviction = resourceManager.getHeapMonitor().getState().isEviction(); } else { monitorStateIsEviction = resourceManager.getOffHeapMonitor().getState().isEviction(); } return monitorStateIsEviction && this.sizeInVM() > 0; }