| /*========================================================================= |
| * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved. |
| * This product is protected by U.S. and international copyright |
| * and intellectual property laws. Pivotal products are covered by |
| * more patents listed at http://www.pivotal.io/patents. |
| *========================================================================= |
| */ |
| |
| package com.gemstone.gemfire.internal.cache; |
| |
| import java.util.Collection; |
| import java.util.Collections; |
| import java.util.List; |
| import java.util.Set; |
| |
| import com.gemstone.gemfire.cache.CacheWriter; |
| import com.gemstone.gemfire.cache.CacheWriterException; |
| import com.gemstone.gemfire.cache.DataPolicy; |
| import com.gemstone.gemfire.cache.EntryEvent; |
| import com.gemstone.gemfire.cache.EntryNotFoundException; |
| import com.gemstone.gemfire.cache.Operation; |
| import com.gemstone.gemfire.cache.TimeoutException; |
| import com.gemstone.gemfire.cache.TransactionId; |
| import com.gemstone.gemfire.cache.query.internal.IndexUpdater; |
| import com.gemstone.gemfire.distributed.internal.DM; |
| import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember; |
| import com.gemstone.gemfire.internal.ByteArrayDataInput; |
| import com.gemstone.gemfire.internal.InternalStatisticsDisabledException; |
| import com.gemstone.gemfire.internal.cache.lru.LRUEntry; |
| import com.gemstone.gemfire.internal.cache.lru.NewLRUClockHand; |
| import com.gemstone.gemfire.internal.cache.tier.sockets.ClientProxyMembershipID; |
| import com.gemstone.gemfire.internal.cache.versions.RegionVersionVector; |
| import com.gemstone.gemfire.internal.cache.versions.VersionHolder; |
| import com.gemstone.gemfire.internal.cache.versions.VersionSource; |
| import com.gemstone.gemfire.internal.cache.versions.VersionStamp; |
| import com.gemstone.gemfire.internal.cache.versions.VersionTag; |
| import com.gemstone.gemfire.internal.i18n.LocalizedStrings; |
| |
| /** |
| * Internal implementation of {@link RegionMap}for regions whose DataPolicy is |
| * proxy. Proxy maps are always empty. |
| * |
| * @since 5.0 |
| * |
| * @author Darrel Schneider |
| * |
| */ |
| final class ProxyRegionMap implements RegionMap { |
| |
| /** An internal Listener for index maintenance for SQLFabric. */ |
| private final IndexUpdater indexUpdater; |
| |
| protected ProxyRegionMap(LocalRegion owner, Attributes attr, |
| InternalRegionArguments internalRegionArgs) { |
| this.owner = owner; |
| this.attr = attr; |
| if (internalRegionArgs != null) { |
| this.indexUpdater = internalRegionArgs.getIndexUpdater(); |
| } |
| else { |
| this.indexUpdater = null; |
| } |
| } |
| |
| public final IndexUpdater getIndexUpdater() { |
| return this.indexUpdater; |
| } |
| |
| /** |
| * the region that owns this map |
| */ |
| private final LocalRegion owner; |
| |
| private final Attributes attr; |
| |
| public RegionEntryFactory getEntryFactory() |
| { |
| throw new UnsupportedOperationException(); |
| } |
| |
| public Attributes getAttributes() { |
| return this.attr; |
| } |
| |
| public void setOwner(Object r) { |
| throw new UnsupportedOperationException(); |
| } |
| public void changeOwner(LocalRegion r) { |
| throw new UnsupportedOperationException(); |
| } |
| |
| public int size() { |
| return 0; |
| } |
| |
| public boolean isEmpty() { |
| return true; |
| } |
| |
| public Set keySet() { |
| return Collections.EMPTY_SET; |
| } |
| |
| public Collection<RegionEntry> regionEntries() { |
| return Collections.emptySet(); |
| } |
| |
| @Override |
| public Collection<RegionEntry> regionEntriesInVM() { |
| return Collections.emptySet(); |
| } |
| |
| public boolean containsKey(Object key) { |
| return false; |
| } |
| |
| public RegionEntry getEntry(Object key) { |
| return null; |
| } |
| |
| public RegionEntry putEntryIfAbsent(Object key, RegionEntry re) { |
| return null; |
| } |
| |
| @SuppressWarnings({ "rawtypes", "unchecked" }) |
| public Set<VersionSource> clear(RegionVersionVector rvv) { |
| // nothing needs to be done |
| RegionVersionVector v = this.owner.getVersionVector(); |
| if (v != null) { |
| return v.getDepartedMembersSet(); |
| } else { |
| return Collections.emptySet(); |
| } |
| } |
| |
| public void diskClear() { |
| // nothing needs to be done |
| } |
| |
| public RegionEntry initRecoveredEntry(Object key, DiskEntry.RecoveredEntry value) { |
| throw new UnsupportedOperationException(); |
| } |
| public RegionEntry updateRecoveredEntry(Object key, DiskEntry.RecoveredEntry value) { |
| throw new UnsupportedOperationException(); |
| } |
| |
| /** |
| * Used to modify an existing RegionEntry or create a new one when processing |
| * the values obtained during a getInitialImage. |
| */ |
| public boolean initialImagePut(Object key, long lastModified, Object newValue, |
| boolean wasRecovered, boolean deferLRUCallback, VersionTag version, InternalDistributedMember sender, boolean forceValue) |
| { |
| throw new UnsupportedOperationException(); |
| } |
| |
| public boolean destroy(EntryEventImpl event, |
| boolean inTokenMode, |
| boolean duringRI, |
| boolean cacheWrite, |
| boolean isEviction, |
| Object expectedOldValue, |
| boolean removeRecoveredEntry) |
| throws CacheWriterException, EntryNotFoundException, TimeoutException { |
| if (event.getOperation().isLocal()) { |
| throw new EntryNotFoundException(event.getKey().toString()); |
| } |
| if (cacheWrite) { |
| this.owner.cacheWriteBeforeDestroy(event, expectedOldValue); |
| } |
| owner.recordEvent(event); |
| this.owner.basicDestroyPart2(markerEntry, event, inTokenMode, false /*Clear conflict occured */, duringRI, true); |
| this.owner.basicDestroyPart3(markerEntry, event, inTokenMode, duringRI, true, expectedOldValue); |
| return true; |
| } |
| |
| public boolean invalidate(EntryEventImpl event, boolean invokeCallbacks, |
| boolean forceNewEntry, boolean forceCallback) |
| throws EntryNotFoundException { |
| |
| if (event.getOperation().isLocal()) { |
| throw new EntryNotFoundException(event.getKey().toString()); |
| } |
| this.owner.cacheWriteBeforeInvalidate(event, invokeCallbacks, forceNewEntry); |
| this.owner.recordEvent(event); |
| this.owner.basicInvalidatePart2(markerEntry, event, false /*Clear conflict occurred */, true); |
| this.owner.basicInvalidatePart3(markerEntry, event, true); |
| return true; |
| } |
| |
| public void evictEntry(Object key) { |
| // noop |
| } |
| public void evictValue(Object key) { |
| // noop |
| } |
| |
| /** |
| * Used by basicPut to signal the caller that the put was successful. |
| */ |
| private static final RegionEntry markerEntry = new ProxyRegionEntry(); |
| |
| public RegionEntry basicPut(EntryEventImpl event, |
| long lastModified, |
| boolean ifNew, |
| boolean ifOld, |
| Object expectedOldValue, |
| boolean requireOldValue, |
| boolean overwriteDestroyed) |
| throws CacheWriterException, TimeoutException { |
| if (!event.isOriginRemote() && event.getOperation() != Operation.REPLACE) { // bug 42167 - don't convert replace to CREATE |
| event.makeCreate(); |
| } |
| final CacheWriter cacheWriter = this.owner.basicGetWriter(); |
| final boolean cacheWrite = !event.isOriginRemote() && !event.isNetSearch() && !event.getInhibitDistribution() && event.isGenerateCallbacks() |
| && (cacheWriter != null |
| || this.owner.hasServerProxy() |
| || this.owner.scope.isDistributed()); |
| if (cacheWrite) { |
| final Set netWriteRecipients; |
| if (cacheWriter == null && this.owner.scope.isDistributed()) { |
| CacheDistributionAdvisor cda = |
| ((DistributedRegion)this.owner).getDistributionAdvisor(); |
| netWriteRecipients = cda.adviseNetWrite(); |
| } |
| else { |
| netWriteRecipients = null; |
| } |
| if (event.getOperation() != Operation.REPLACE) { // bug #42167 - makeCreate() causes REPLACE to eventually become UPDATE |
| event.makeCreate(); |
| } |
| this.owner.cacheWriteBeforePut(event, netWriteRecipients, |
| cacheWriter, requireOldValue, expectedOldValue); |
| } |
| |
| owner.recordEvent(event); |
| lastModified = // fix for bug 40129 |
| this.owner.basicPutPart2(event, markerEntry, true, |
| lastModified, false /*Clear conflict occurred */); |
| // invoke SQLFabric index manager if present |
| final IndexUpdater indexUpdater = getIndexUpdater(); |
| if (indexUpdater != null) { |
| // postEvent not required to be invoked since this is currently used |
| // only for FK checks |
| indexUpdater.onEvent(this.owner, event, markerEntry); |
| } |
| this.owner.basicPutPart3(event, markerEntry, true, |
| lastModified, true, ifNew, ifOld, expectedOldValue, requireOldValue); |
| return markerEntry; |
| } |
| |
| public void writeSyncIfPresent(Object key, Runnable runner) { |
| // nothing needed |
| } |
| |
| public void removeIfDestroyed(Object key) { |
| // nothing needed |
| } |
| |
| public void txApplyDestroy(Object key, TransactionId txId, |
| TXRmtEvent txEvent, boolean inTokenMode, boolean inRI, Operation op, EventID eventId, Object aCallbackArgument,List<EntryEventImpl> pendingCallbacks,FilterRoutingInfo filterRoutingInfo,ClientProxyMembershipID bridgeContext, |
| boolean isOriginRemote, TXEntryState txEntryState, VersionTag versionTag, long tailKey) { |
| this.owner.txApplyDestroyPart2(markerEntry, key, inTokenMode, false /*Clear conflict occured */); |
| if (!inTokenMode) { |
| if (txEvent != null) { |
| txEvent.addDestroy(this.owner, markerEntry, key,aCallbackArgument); |
| } |
| if (AbstractRegionMap.shouldCreateCBEvent(this.owner, |
| false, !inTokenMode)) { |
| // fix for bug 39526 |
| EntryEventImpl e = AbstractRegionMap.createCBEvent(this.owner, op, |
| key, null, txId, txEvent, eventId, aCallbackArgument,filterRoutingInfo,bridgeContext, txEntryState, versionTag, tailKey); |
| boolean cbEventInPending = false; |
| try { |
| AbstractRegionMap.switchEventOwnerAndOriginRemote(e, txEntryState == null); |
| if (pendingCallbacks == null) { |
| this.owner |
| .invokeTXCallbacks(EnumListenerEvent.AFTER_DESTROY, e, true/* callDispatchListenerEvent */); |
| } else { |
| pendingCallbacks.add(e); |
| cbEventInPending = true; |
| } |
| } finally { |
| if (!cbEventInPending) e.release(); |
| } |
| } |
| } |
| } |
| |
| public void txApplyInvalidate(Object key, Object newValue, boolean didDestroy, |
| TransactionId txId, TXRmtEvent txEvent, boolean localOp, |
| EventID eventId, Object aCallbackArgument,List<EntryEventImpl> pendingCallbacks,FilterRoutingInfo filterRoutingInfo,ClientProxyMembershipID bridgeContext, TXEntryState txEntryState, VersionTag versionTag, long tailKey) { |
| this.owner.txApplyInvalidatePart2(markerEntry, key, didDestroy, true, false /*Clear conflic occured */); |
| if (this.owner.isInitialized()) { |
| if (txEvent != null) { |
| txEvent.addInvalidate(this.owner, markerEntry, key, newValue,aCallbackArgument); |
| } |
| if (AbstractRegionMap.shouldCreateCBEvent(this.owner, |
| true, this.owner.isInitialized())) { |
| // fix for bug 39526 |
| boolean cbEventInPending = false; |
| EntryEventImpl e = AbstractRegionMap.createCBEvent(this.owner, |
| localOp ? Operation.LOCAL_INVALIDATE : Operation.INVALIDATE, |
| key, newValue, txId, txEvent, eventId, aCallbackArgument,filterRoutingInfo,bridgeContext, txEntryState, versionTag, tailKey); |
| try { |
| AbstractRegionMap.switchEventOwnerAndOriginRemote(e, txEntryState == null); |
| if (pendingCallbacks == null) { |
| this.owner.invokeTXCallbacks(EnumListenerEvent.AFTER_INVALIDATE, e, |
| true/* callDispatchListenerEvent */); |
| } else { |
| pendingCallbacks.add(e); |
| cbEventInPending = true; |
| } |
| } finally { |
| if (!cbEventInPending) e.release(); |
| } |
| } |
| } |
| } |
| |
| public void txApplyPut(Operation p_putOp, Object key, Object newValue, |
| boolean didDestroy, TransactionId txId, TXRmtEvent txEvent, |
| EventID eventId, Object aCallbackArgument, List<EntryEventImpl> pendingCallbacks,FilterRoutingInfo filterRoutingInfo,ClientProxyMembershipID bridgeContext, TXEntryState txEntryState, VersionTag versionTag, long tailKey) { |
| Operation putOp = p_putOp.getCorrespondingCreateOp(); |
| long lastMod = owner.cacheTimeMillis(); |
| this.owner.txApplyPutPart2(markerEntry, key, newValue, lastMod, true, |
| didDestroy, false /*Clear conflict occured */); |
| if (this.owner.isInitialized()) { |
| if (txEvent != null) { |
| txEvent.addPut(putOp, this.owner, markerEntry, key, newValue,aCallbackArgument); |
| } |
| if (AbstractRegionMap.shouldCreateCBEvent(this.owner, |
| false, this.owner.isInitialized())) { |
| // fix for bug 39526 |
| boolean cbEventInPending = false; |
| EntryEventImpl e = AbstractRegionMap.createCBEvent(this.owner, putOp, key, |
| newValue, txId, txEvent, eventId, aCallbackArgument,filterRoutingInfo,bridgeContext, txEntryState, versionTag, tailKey); |
| try { |
| AbstractRegionMap.switchEventOwnerAndOriginRemote(e, txEntryState == null); |
| if (pendingCallbacks == null) { |
| this.owner |
| .invokeTXCallbacks(EnumListenerEvent.AFTER_CREATE, e, true/* callDispatchListenerEvent */); |
| } else { |
| pendingCallbacks.add(e); |
| cbEventInPending = true; |
| } |
| } finally { |
| if (!cbEventInPending) e.release(); |
| } |
| } |
| } |
| } |
| |
| // LRUMapCallbacks methods |
| public void lruUpdateCallback() { |
| // nothing needed |
| } |
| |
| public boolean disableLruUpdateCallback() { |
| // nothing needed |
| return false; |
| } |
| |
| public void enableLruUpdateCallback() { |
| // nothing needed |
| } |
| |
| @Override |
| public void decTxRefCount(RegionEntry e) { |
| // nothing needed |
| } |
| |
| public final boolean lruLimitExceeded() { |
| return false; |
| } |
| |
| public void lruCloseStats() { |
| // nothing needed |
| } |
| |
| public void resetThreadLocals() { |
| // nothing needed |
| } |
| |
| public void removeEntry(Object key, RegionEntry entry, boolean updateStats) { |
| // nothing to do |
| } |
| |
| public void removeEntry(Object key, RegionEntry re, boolean updateStat, |
| EntryEventImpl event, LocalRegion owner, IndexUpdater indexUpdater) { |
| // nothing to do |
| } |
| |
| /** |
| * Provides a dummy implementation of RegionEntry so that basicPut can return |
| * an instance that make the upper levels think it did the put. |
| */ |
| public static class ProxyRegionEntry implements RegionEntry |
| { |
| |
| public long getLastModified() { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| public long getLastAccessed() throws InternalStatisticsDisabledException { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| public long getHitCount() throws InternalStatisticsDisabledException { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| public long getMissCount() throws InternalStatisticsDisabledException { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| public VersionStamp getVersionStamp() { |
| return null; |
| } |
| |
| public boolean isTombstone() { |
| return false; |
| } |
| |
| public VersionTag generateVersionTag(VersionSource member, |
| boolean withDelta, LocalRegion region, EntryEventImpl event) { |
| return null; // proxies don't do versioning |
| } |
| |
| public void processVersionTag(EntryEvent ev) { |
| return; |
| } |
| |
| public void makeTombstone(LocalRegion r, VersionTag isOperationRemote) { |
| return; |
| } |
| |
| public void updateStatsForPut(long lastModifiedTime) { |
| // do nothing; called by LocalRegion.updateStatsForPut |
| } |
| |
| public void setRecentlyUsed() { |
| // do nothing; called by LocalRegion.updateStatsForPut |
| } |
| |
| public void updateStatsForGet(boolean hit, long time) { |
| // do nothing; no entry stats |
| } |
| |
| public void txDidDestroy(long currTime) { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| public void resetCounts() throws InternalStatisticsDisabledException { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| public void removePhase1(LocalRegion r, boolean isClear) { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| public void removePhase2() { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| public boolean isRemoved() { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| public boolean isRemovedPhase2() { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| public boolean fillInValue(LocalRegion r, |
| InitialImageOperation.Entry entry, ByteArrayDataInput in, DM mgr) { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| public boolean isOverflowedToDisk(LocalRegion r, DistributedRegion.DiskPosition dp) { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| public Object getKey() { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| public Object getValue(RegionEntryContext context) { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| @Override |
| public Object getValueRetain(RegionEntryContext context) { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| public void setValue(RegionEntryContext context, Object value) { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| @Override |
| public Object prepareValueForCache(RegionEntryContext r, Object val, boolean isEntryUpdate) { |
| throw new IllegalStateException("Should never be called"); |
| } |
| |
| // @Override |
| // public void _setValue(Object value) { |
| // throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| // } |
| |
| @Override |
| public Object _getValue() { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| @Override |
| public Token getValueAsToken() { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| @Override |
| public Object _getValueRetain(RegionEntryContext context, boolean decompress) { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| @Override |
| public Object getTransformedValue() { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| @Override |
| public Object getValueInVM(RegionEntryContext context) { |
| return null; // called by TXRmtEvent.createEvent |
| } |
| |
| public Object getValueOnDisk(LocalRegion r) |
| throws EntryNotFoundException { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| public Object getValueOnDiskOrBuffer(LocalRegion r) |
| throws EntryNotFoundException { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| /* (non-Javadoc) |
| * @see com.gemstone.gemfire.internal.cache.RegionEntry#getSerializedValueOnDisk(com.gemstone.gemfire.internal.cache.LocalRegion) |
| */ |
| public Object getSerializedValueOnDisk(LocalRegion localRegion) { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| public boolean initialImagePut(LocalRegion region, long lastModified, |
| Object newValue, boolean wasRecovered, boolean versionTagAccepted) { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| public boolean initialImageInit(LocalRegion region, long lastModified, |
| Object newValue, boolean create, boolean wasRecovered, boolean versionTagAccepted) { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| public boolean destroy(LocalRegion region, |
| EntryEventImpl event, |
| boolean inTokenMode, |
| boolean cacheWrite, |
| Object expectedOldValue, |
| boolean forceDestroy, |
| boolean removeRecoveredEntry) |
| throws CacheWriterException, EntryNotFoundException, TimeoutException { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| public boolean getValueWasResultOfSearch() { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| public void setValueResultOfSearch(boolean v) { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| public boolean dispatchListenerEvents(EntryEventImpl event) throws InterruptedException { |
| // note that we don't synchronize on the RE before dispatching |
| // events |
| event.invokeCallbacks(event.getRegion(), event.inhibitCacheListenerNotification(), false); |
| return true; |
| } |
| |
| public boolean hasStats() { |
| return false; |
| } |
| |
| public Object getValueInVMOrDiskWithoutFaultIn(LocalRegion owner) |
| { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| @Override |
| public Object getValueOffHeapOrDiskWithoutFaultIn(LocalRegion owner) { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| /* (non-Javadoc) |
| * @see com.gemstone.gemfire.internal.cache.RegionEntry#concurrencyCheck(com.gemstone.gemfire.internal.cache.LocalRegion, com.gemstone.gemfire.internal.cache.versions.VersionTag, com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember, com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember) |
| */ |
| public void processVersionTag(LocalRegion r, VersionTag tag, |
| InternalDistributedMember thisVM, InternalDistributedMember sender) { |
| return; |
| } |
| |
| @Override |
| public boolean isUpdateInProgress() { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| @Override |
| public void setUpdateInProgress(boolean underUpdate) { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| @Override |
| public boolean isMarkedForEviction() { |
| throw new UnsupportedOperationException(LocalizedStrings |
| .ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0 |
| .toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| @Override |
| public void setMarkedForEviction() { |
| throw new UnsupportedOperationException(LocalizedStrings |
| .ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0 |
| .toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| @Override |
| public void clearMarkedForEviction() { |
| throw new UnsupportedOperationException(LocalizedStrings |
| .ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0 |
| .toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| @Override |
| public boolean isValueNull() { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| @Override |
| public boolean isInvalid() { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| @Override |
| public boolean isDestroyed() { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| @Override |
| public void setValueToNull() { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| @Override |
| public boolean isInvalidOrRemoved() { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| @Override |
| public boolean isDestroyedOrRemoved() { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| @Override |
| public boolean isDestroyedOrRemovedButNotTombstone() { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| @Override |
| public void returnToPool() { |
| // TODO Auto-generated method stub |
| |
| } |
| |
| @Override |
| public void setValueWithTombstoneCheck(Object value, EntryEvent event) |
| throws RegionClearedException { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| @Override |
| public boolean isCacheListenerInvocationInProgress() { |
| // TODO Auto-generated method stub |
| return false; |
| } |
| |
| @Override |
| public void setCacheListenerInvocationInProgress(boolean isListenerInvoked) { |
| // TODO Auto-generated method stub |
| |
| } |
| |
| @Override |
| public void setValue(RegionEntryContext context, Object value, |
| EntryEventImpl event) throws RegionClearedException { |
| throw new UnsupportedOperationException(LocalizedStrings.ProxyRegionMap_NO_ENTRY_SUPPORT_ON_REGIONS_WITH_DATAPOLICY_0.toLocalizedString(DataPolicy.EMPTY)); |
| } |
| |
| @Override |
| public boolean isInUseByTransaction() { |
| return false; |
| } |
| |
| @Override |
| public void setInUseByTransaction(boolean v) { |
| } |
| |
| @Override |
| public void incRefCount() { |
| } |
| |
| @Override |
| public void decRefCount(NewLRUClockHand lruList, LocalRegion lr) { |
| } |
| |
| @Override |
| public void resetRefCount(NewLRUClockHand lruList) { |
| } |
| |
| @Override |
| public Object prepareValueForCache(RegionEntryContext r, Object val, |
| EntryEventImpl event, boolean isEntryUpdate) { |
| throw new IllegalStateException("Should never be called"); |
| } |
| } |
| |
| public void lruUpdateCallback(int n) { |
| //do nothing |
| } |
| |
| public void lruEntryFaultIn(LRUEntry entry) { |
| //do nothing. |
| |
| } |
| |
| public void copyRecoveredEntries(RegionMap rm) { |
| throw new IllegalStateException("copyRecoveredEntries should never be called on proxy"); |
| } |
| |
| public boolean removeTombstone(RegionEntry re, VersionHolder destroyedVersion, boolean isEviction, boolean isScheduledTombstone) { |
| throw new IllegalStateException("removeTombstone should never be called on a proxy"); |
| } |
| |
| public boolean isTombstoneNotNeeded(RegionEntry re, int destroyedVersion) { |
| throw new IllegalStateException("removeTombstone should never be called on a proxy"); |
| } |
| |
| |
| /* (non-Javadoc) |
| * @see com.gemstone.gemfire.internal.cache.RegionMap#unscheduleTombstone(com.gemstone.gemfire.internal.cache.RegionEntry) |
| */ |
| public void unscheduleTombstone(RegionEntry re) { |
| } |
| |
| public void setEntryFactory(RegionEntryFactory f) { |
| throw new IllegalStateException("Should not be called on a ProxyRegionMap"); |
| } |
| |
| @Override |
| public void updateEntryVersion(EntryEventImpl event) { |
| // Do nothing. Not applicable for clients. |
| } |
| |
| @Override |
| public RegionEntry getEntryInVM(Object key) { |
| return null; |
| } |
| |
| @Override |
| public RegionEntry getOperationalEntryInVM(Object key) { |
| return null; |
| } |
| |
| @Override |
| public int sizeInVM() { |
| return 0; |
| } |
| |
| @Override |
| public void close() { |
| } |
| } |