public int getEntryIdleTimeoutTimeLimit() { return this.ra.getEntryIdleTimeout().getTimeout(); }
public ExpirationAction getEntryIdleTimeoutAction() { return this.ra.getEntryIdleTimeout().getAction(); }
public int getEntryIdleTimeoutTimeLimit() { return this.ra.getEntryIdleTimeout().getTimeout(); }
public ExpirationAction getEntryIdleTimeoutAction() { return this.ra.getEntryIdleTimeout().getAction(); }
@Override protected ExpirationAttributes getIdleAttributes() { return getLocalRegion().getAttributes().getEntryIdleTimeout(); }
@Override protected ExpirationAttributes getIdleAttributes() { return getLocalRegion().getAttributes().getEntryIdleTimeout(); }
@Override public void run() { RegionAttributes attributes = getCache().getRegion(alterRegionName).getAttributes(); assertEquals(35464, attributes.getEvictionAttributes().getMaximum()); assertEquals(3453, attributes.getEntryIdleTimeout().getTimeout()); assertTrue(attributes.getEntryIdleTimeout().getAction().isDestroy()); assertEquals(7563, attributes.getEntryTimeToLive().getTimeout()); assertTrue(attributes.getEntryTimeToLive().getAction().isDestroy()); assertEquals(6234, attributes.getRegionIdleTimeout().getTimeout()); assertTrue(attributes.getRegionIdleTimeout().getAction().isDestroy()); assertEquals(4562, attributes.getRegionTimeToLive().getTimeout()); assertTrue(attributes.getRegionTimeToLive().getAction().isDestroy()); assertEquals(1, attributes.getAsyncEventQueueIds().size()); assertTrue(attributes.getAsyncEventQueueIds().contains(alterAsyncEventQueueId1)); assertEquals(1, attributes.getGatewaySenderIds().size()); assertTrue(attributes.getGatewaySenderIds().contains(alterGatewaySenderId1)); assertEquals(1, attributes.getCacheListeners().length); assertEquals("com.cadrdunit.RegionAlterCacheListenerA", attributes.getCacheListeners()[0].getClass().getName()); assertEquals("com.cadrdunit.RegionAlterCacheWriter", attributes.getCacheWriter().getClass().getName()); assertEquals("com.cadrdunit.RegionAlterCacheLoader", attributes.getCacheLoader().getClass().getName()); } });
@Override public void run() { RegionAttributes attributes = getCache().getRegion(alterRegionName).getAttributes(); assertEquals(35464, attributes.getEvictionAttributes().getMaximum()); assertEquals(3453, attributes.getEntryIdleTimeout().getTimeout()); assertTrue(attributes.getEntryIdleTimeout().getAction().isDestroy()); assertEquals(7563, attributes.getEntryTimeToLive().getTimeout()); assertTrue(attributes.getEntryTimeToLive().getAction().isDestroy()); assertEquals(6234, attributes.getRegionIdleTimeout().getTimeout()); assertTrue(attributes.getRegionIdleTimeout().getAction().isDestroy()); assertEquals(4562, attributes.getRegionTimeToLive().getTimeout()); assertTrue(attributes.getRegionTimeToLive().getAction().isDestroy()); assertEquals(1, attributes.getAsyncEventQueueIds().size()); assertTrue(attributes.getAsyncEventQueueIds().contains(alterAsyncEventQueueId1)); assertEquals(1, attributes.getGatewaySenderIds().size()); assertTrue(attributes.getGatewaySenderIds().contains(alterGatewaySenderId1)); assertEquals(1, attributes.getCacheListeners().length); assertEquals("com.cadrdunit.RegionAlterCacheListenerA", attributes.getCacheListeners()[0].getClass().getName()); assertEquals("com.cadrdunit.RegionAlterCacheWriter", attributes.getCacheWriter().getClass().getName()); assertEquals("com.cadrdunit.RegionAlterCacheLoader", attributes.getCacheLoader().getClass().getName()); } });
@Override public void run() { RegionAttributes attributes = getCache().getRegion(alterRegionName).getAttributes(); assertEquals(0, attributes.getEvictionAttributes().getMaximum()); assertEquals(0, attributes.getEntryIdleTimeout().getTimeout()); assertTrue(attributes.getEntryIdleTimeout().getAction().isDestroy()); assertEquals(7563, attributes.getEntryTimeToLive().getTimeout()); assertTrue(attributes.getEntryTimeToLive().getAction().isInvalidate()); assertEquals(0, attributes.getRegionIdleTimeout().getTimeout()); assertTrue(attributes.getRegionIdleTimeout().getAction().isInvalidate()); assertEquals(4562, attributes.getRegionTimeToLive().getTimeout()); assertTrue(attributes.getRegionTimeToLive().getAction().isDestroy()); assertEquals(0, attributes.getAsyncEventQueueIds().size()); assertEquals(0, attributes.getGatewaySenderIds().size()); assertEquals(0, attributes.getCacheListeners().length); } });
protected synchronized void sendValueRequest(final InternalDistributedMember sender) { // send a message to this responder asking for the value // do this on the waiting pool in case the send blocks // Always attempt to send the message to fix bug 37149 RegionAttributes attrs = this.region.getAttributes(); NetSearchRequestMessage.sendMessage(this, this.regionName, this.key, sender, this.remainingTimeout, attrs.getEntryTimeToLive().getTimeout(), attrs.getEntryIdleTimeout().getTimeout()); // if it turns out that we can't send a message to this member then // our membership listener should save the day and schedule a send // to someone else or give up and report a failed search. }
protected synchronized void sendValueRequest(final InternalDistributedMember sender, final LogWriterI18n log) { // send a message to this responder asking for the value // do this on the waiting pool in case the send blocks // Always attempt to send the message to fix bug 37149 RegionAttributes attrs = this.region.getAttributes(); NetSearchRequestMessage.sendMessage(this, this.regionName, this.key, sender, this.remainingTimeout, attrs.getEntryTimeToLive().getTimeout(), attrs.getEntryIdleTimeout().getTimeout()); // if it turns out that we can't send a message to this member then // our membership listener should save the day and schedule a send // to someone else or give up and report a failed search. }
private void validateExpirationAttributes(final RegionAttributes userRA, final PartitionRegionConfig prconf) { if (!userRA.getRegionIdleTimeout().equals(prconf.getRegionIdleTimeout())) { throw new IllegalStateException( LocalizedStrings.PartitionRegionConfigValidator_INCOMPATIBLE_EXPIRATION_ATTRIBUETS .toLocalizedString(new Object[] { " region idle timout " })); } if (!userRA.getRegionTimeToLive().equals(prconf.getRegionTimeToLive())) { throw new IllegalStateException( LocalizedStrings.PartitionRegionConfigValidator_INCOMPATIBLE_EXPIRATION_ATTRIBUETS .toLocalizedString(new Object[] { " region time to live " })); } if (!userRA.getEntryIdleTimeout().equals(prconf.getEntryIdleTimeout())) { throw new IllegalStateException( LocalizedStrings.PartitionRegionConfigValidator_INCOMPATIBLE_EXPIRATION_ATTRIBUETS .toLocalizedString(new Object[] { " entry idle timout " })); } if (!userRA.getEntryTimeToLive().equals(prconf.getEntryTimeToLive())) { throw new IllegalStateException( LocalizedStrings.PartitionRegionConfigValidator_INCOMPATIBLE_EXPIRATION_ATTRIBUETS .toLocalizedString(new Object[] { " entry time to live " })); } }
public void testSetEntryIdleTimeout() throws CacheException, IOException { Cache c = createCache(); Region r1 = null; try { RegionFactory factory = c.createRegionFactory(LOCAL); ExpirationAttributes ea = new ExpirationAttributes(7); r1 = factory.setEntryIdleTimeout(ea).create(this.r1Name); RegionAttributes ra = r1.getAttributes(); assertEquals(ea, ra.getEntryIdleTimeout()); } finally { cleanUpRegion(r1); } }
private void validateExpirationAttributes(final RegionAttributes userRA, final PartitionRegionConfig prconf) { //GemFireXD allows changing expiration attributes with ALTER TABLE. This will mismatch //with the configuration on other members during DDLReplay of Create Table on restart //of a node. defect #49728 has more details. if (!GemFireCacheImpl.gfxdSystem()) { if (!userRA.getRegionIdleTimeout().equals(prconf.getRegionIdleTimeout())) { throw new IllegalStateException( LocalizedStrings.PartitionRegionConfigValidator_INCOMPATIBLE_EXPIRATION_ATTRIBUETS .toLocalizedString(new Object[] { " region idle timout " })); } if (!userRA.getRegionTimeToLive().equals(prconf.getRegionTimeToLive())) { throw new IllegalStateException( LocalizedStrings.PartitionRegionConfigValidator_INCOMPATIBLE_EXPIRATION_ATTRIBUETS .toLocalizedString(new Object[] { " region time to live " })); } if (!userRA.getEntryIdleTimeout().equals(prconf.getEntryIdleTimeout())) { throw new IllegalStateException( LocalizedStrings.PartitionRegionConfigValidator_INCOMPATIBLE_EXPIRATION_ATTRIBUETS .toLocalizedString(new Object[] { " entry idle timout " })); } if (!userRA.getEntryTimeToLive().equals(prconf.getEntryTimeToLive())) { throw new IllegalStateException( LocalizedStrings.PartitionRegionConfigValidator_INCOMPATIBLE_EXPIRATION_ATTRIBUETS .toLocalizedString(new Object[] { " entry time to live " })); } } }
public void testSetEntryIdleTimeout() throws CacheException, IOException { ClientCache c = new ClientCacheFactory().create(); Region r1 = null; try { ClientRegionFactory factory = c.createClientRegionFactory(CACHING_PROXY); ExpirationAttributes ea = new ExpirationAttributes(7); r1 = factory.setEntryIdleTimeout(ea).create(this.r1Name); RegionAttributes ra = r1.getAttributes(); assertEquals(ea, ra.getEntryIdleTimeout()); } finally { cleanUpRegion(r1); } }
private synchronized void sendNetSearchRequest() { InternalDistributedMember nextResponder = nextAppropriateResponder(); if (nextResponder != null) { // Make a request to the next responder in the queue RegionAttributes attrs = this.region.getAttributes(); setSelectedNode(nextResponder); this.requestInProgress = true; this.remoteGetInProgress = true; NetSearchRequestMessage.sendMessage(this, this.regionName, this.key, nextResponder,this.remainingTimeout, attrs.getEntryTimeToLive().getTimeout(), attrs.getEntryIdleTimeout().getTimeout() ); } else { this.remoteGetInProgress = false; checkIfDone(); } } /**
private synchronized void sendNetSearchRequest() { InternalDistributedMember nextResponder = nextAppropriateResponder(); if (nextResponder != null) { // Make a request to the next responder in the queue RegionAttributes attrs = this.region.getAttributes(); setSelectedNode(nextResponder); this.requestInProgress = true; this.remoteGetInProgress = true; NetSearchRequestMessage.sendMessage(this, this.regionName, this.key, nextResponder,this.remainingTimeout, attrs.getEntryTimeToLive().getTimeout(), attrs.getEntryIdleTimeout().getTimeout() ); } else { this.remoteGetInProgress = false; checkIfDone(); } } /**
private boolean isEvictionOrExpirationSet(TableName refTable) { boolean isSet = false; Region<?, ?> refRegion = Misc.getRegionByPath(refTable .getFullTableNameAsRegionPath(), true); RegionAttributes<?, ?> rattrs = refRegion.getAttributes(); EvictionAction ea = rattrs.getEvictionAttributes().getAction(); if (!(ea == EvictionAction.NONE || ea == EvictionAction.OVERFLOW_TO_DISK) || rattrs.getEntryIdleTimeout().getTimeout() > 0 || rattrs.getEntryTimeToLive().getTimeout() > 0 || rattrs.getRegionIdleTimeout().getTimeout() > 0 || rattrs.getRegionTimeToLive().getTimeout() > 0) { isSet = true; } return isSet; }
private boolean isEvictionOrExpirationSet(TableName refTable) { boolean isSet = false; Region<?, ?> refRegion = Misc.getRegionByPath(refTable .getFullTableNameAsRegionPath(), true); RegionAttributes<?, ?> rattrs = refRegion.getAttributes(); EvictionAction ea = rattrs.getEvictionAttributes().getAction(); if (!(ea == EvictionAction.NONE || ea == EvictionAction.OVERFLOW_TO_DISK) || rattrs.getEntryIdleTimeout().getTimeout() > 0 || rattrs.getEntryTimeToLive().getTimeout() > 0 || rattrs.getRegionIdleTimeout().getTimeout() > 0 || rattrs.getRegionTimeToLive().getTimeout() > 0) { isSet = true; } return isSet; }
private boolean isEvictionOrExpirationSet(TableName refTable) { boolean isSet = false; Region<?, ?> refRegion = Misc.getRegionByPath(refTable .getFullTableNameAsRegionPath(), true); RegionAttributes<?, ?> rattrs = refRegion.getAttributes(); EvictionAction ea = rattrs.getEvictionAttributes().getAction(); if (!(ea == EvictionAction.NONE || ea == EvictionAction.OVERFLOW_TO_DISK) || rattrs.getEntryIdleTimeout().getTimeout() > 0 || rattrs.getEntryTimeToLive().getTimeout() > 0 || rattrs.getRegionIdleTimeout().getTimeout() > 0 || rattrs.getRegionTimeToLive().getTimeout() > 0) { isSet = true; } return isSet; }