http://git-wip-us.apache.org/repos/asf/geode/blob/a4458531/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapObjectKey.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapObjectKey.java index ac7d3c7..5712148 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapObjectKey.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapObjectKey.java @@ -15,36 +15,48 @@ package org.apache.geode.internal.cache; // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + + + import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; + import java.util.concurrent.atomic.AtomicLongFieldUpdater; + import org.apache.geode.cache.EntryEvent; + import org.apache.geode.internal.cache.lru.EnableLRU; + import org.apache.geode.internal.InternalStatisticsDisabledException; + import org.apache.geode.internal.cache.lru.LRUClockNode; import org.apache.geode.internal.cache.lru.NewLRUClockHand; + import org.apache.geode.distributed.internal.membership.InternalDistributedMember; import org.apache.geode.internal.cache.versions.VersionSource; import org.apache.geode.internal.cache.versions.VersionStamp; import org.apache.geode.internal.cache.versions.VersionTag; + import org.apache.geode.internal.offheap.OffHeapRegionEntryHelper; import org.apache.geode.internal.offheap.annotations.Released; import org.apache.geode.internal.offheap.annotations.Retained; import org.apache.geode.internal.offheap.annotations.Unretained; + import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry; // macros whose definition changes this class: // disk: DISK -// lru: LRU -// stats: STATS -// versioned: VERSIONED -// offheap: OFFHEAP +// lru: 1 +// stats: 1 +// versioned: 1 +// offheap: 1 // One of the following key macros must be defined: -// key object: KEY_OBJECT +// key object: 1 // key int: KEY_INT // key long: KEY_LONG // key uuid: KEY_UUID // key string1: KEY_STRING1 // key string2: KEY_STRING2 + /** * Do not modify this class. It was generated. Instead modify LeafRegionEntry.cpp and then run * ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory). @@ -52,13 +64,31 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha public class VersionedStatsLRURegionEntryOffHeapObjectKey extends VersionedStatsLRURegionEntryOffHeap { public VersionedStatsLRURegionEntryOffHeapObjectKey(RegionEntryContext context, Object key, - @Retained Object value) { - super(context, value); + + @Retained + + Object value + + + + ) { + super(context, + + + + value + + ); // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + + + this.key = key; + } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // common code protected int hash; private HashEntry<Object, Object> next; @@ -67,6 +97,7 @@ public class VersionedStatsLRURegionEntryOffHeapObjectKey private static final AtomicLongFieldUpdater<VersionedStatsLRURegionEntryOffHeapObjectKey> lastModifiedUpdater = AtomicLongFieldUpdater.newUpdater(VersionedStatsLRURegionEntryOffHeapObjectKey.class, "lastModified"); + /** * All access done using ohAddrUpdater so it is used even though the compiler can not tell it is. */ @@ -98,13 +129,19 @@ public class VersionedStatsLRURegionEntryOffHeapObjectKey // DO NOT modify this class. It was generated from LeafRegionEntry.cpp @Override + @Unretained protected void setValueField(@Unretained Object v) { + + + OffHeapRegionEntryHelper.setValue(this, v); } @Override + @Retained + public Object _getValueRetain(RegionEntryContext context, boolean decompress) { return OffHeapRegionEntryHelper._getValueRetain(this, decompress, context); } @@ -120,7 +157,9 @@ public class VersionedStatsLRURegionEntryOffHeapObjectKey } @Override + @Released + public void release() { OffHeapRegionEntryHelper.releaseEntry(this); } @@ -144,7 +183,7 @@ public class VersionedStatsLRURegionEntryOffHeapObjectKey /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -155,117 +194,121 @@ public class VersionedStatsLRURegionEntryOffHeapObjectKey /** * @see HashEntry#getNextEntry() */ - public final HashEntry<Object, Object> getNextEntry() { + public HashEntry<Object, Object> getNextEntry() { return this.next; } /** * @see HashEntry#setNextEntry */ - public final void setNextEntry(final HashEntry<Object, Object> n) { + public void setNextEntry(final HashEntry<Object, Object> n) { this.next = n; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // lru code @Override public void setDelayedDiskId(LocalRegion r) { + + + // nothing needed for LRUs with no disk + } - public final synchronized int updateEntrySize(EnableLRU capacityController) { + public synchronized int updateEntrySize(EnableLRU capacityController) { return updateEntrySize(capacityController, _getValue()); // OFHEAP: _getValue ok w/o incing // refcount because we are synced and // only getting the size } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp - public final synchronized int updateEntrySize(EnableLRU capacityController, Object value) { + + public synchronized int updateEntrySize(EnableLRU capacityController, Object value) { int oldSize = getEntrySize(); int newSize = capacityController.entrySize(getKeyForSizing(), value); setEntrySize(newSize); int delta = newSize - oldSize; - // if ( debug ) log( "updateEntrySize key=" + getKey() - // + (_getValue() == Token.INVALID ? " invalid" : - // (_getValue() == Token.LOCAL_INVALID ? "local_invalid" : - // (_getValue()==null ? " evicted" : " valid"))) - // + " oldSize=" + oldSize - // + " newSize=" + this.size ); return delta; } - public final boolean testRecentlyUsed() { + public boolean testRecentlyUsed() { return areAnyBitsSet(RECENTLY_USED); } @Override - public final void setRecentlyUsed() { + public void setRecentlyUsed() { setBits(RECENTLY_USED); } - public final void unsetRecentlyUsed() { + public void unsetRecentlyUsed() { clearBits(~RECENTLY_USED); } - public final boolean testEvicted() { + public boolean testEvicted() { return areAnyBitsSet(EVICTED); } - public final void setEvicted() { + public void setEvicted() { setBits(EVICTED); } - public final void unsetEvicted() { + public void unsetEvicted() { clearBits(~EVICTED); } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + private LRUClockNode nextLRU; private LRUClockNode prevLRU; private int size; - public final void setNextLRUNode(LRUClockNode next) { + public void setNextLRUNode(LRUClockNode next) { this.nextLRU = next; } - public final LRUClockNode nextLRUNode() { + public LRUClockNode nextLRUNode() { return this.nextLRU; } - public final void setPrevLRUNode(LRUClockNode prev) { + public void setPrevLRUNode(LRUClockNode prev) { this.prevLRU = prev; } - public final LRUClockNode prevLRUNode() { + public LRUClockNode prevLRUNode() { return this.prevLRU; } - public final int getEntrySize() { + public int getEntrySize() { return this.size; } - protected final void setEntrySize(int size) { + protected void setEntrySize(int size) { this.size = size; } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp - // @Override - // public StringBuilder appendFieldsToString(final StringBuilder sb) { - // StringBuilder result = super.appendFieldsToString(sb); - // result.append("; prev=").append(this.prevLRU==null?"null":"not null"); - // result.append("; next=").append(this.nextLRU==null?"null":"not null"); - // return result; - // } + @Override public Object getKeyForSizing() { + // default implementation. return getKey(); + + + } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // stats code @Override - public final void updateStatsForGet(boolean hit, long time) { + public void updateStatsForGet(boolean hit, long time) { setLastAccessed(time); if (hit) { incrementHitCount(); @@ -275,7 +318,7 @@ public class VersionedStatsLRURegionEntryOffHeapObjectKey } @Override - protected final void setLastModifiedAndAccessedTimes(long lastModified, long lastAccessed) { + protected void setLastModifiedAndAccessedTimes(long lastModified, long lastAccessed) { _setLastModified(lastModified); if (!DISABLE_ACCESS_TIME_UPDATE_ON_PUT) { setLastAccessed(lastAccessed); @@ -285,6 +328,7 @@ public class VersionedStatsLRURegionEntryOffHeapObjectKey private volatile long lastAccessed; private volatile int hitCount; private volatile int missCount; + private static final AtomicIntegerFieldUpdater<VersionedStatsLRURegionEntryOffHeapObjectKey> hitCountUpdater = AtomicIntegerFieldUpdater.newUpdater(VersionedStatsLRURegionEntryOffHeapObjectKey.class, "hitCount"); @@ -293,7 +337,7 @@ public class VersionedStatsLRURegionEntryOffHeapObjectKey "missCount"); @Override - public final long getLastAccessed() throws InternalStatisticsDisabledException { + public long getLastAccessed() throws InternalStatisticsDisabledException { return this.lastAccessed; } @@ -302,12 +346,12 @@ public class VersionedStatsLRURegionEntryOffHeapObjectKey } @Override - public final long getHitCount() throws InternalStatisticsDisabledException { + public long getHitCount() throws InternalStatisticsDisabledException { return this.hitCount & 0xFFFFFFFFL; } @Override - public final long getMissCount() throws InternalStatisticsDisabledException { + public long getMissCount() throws InternalStatisticsDisabledException { return this.missCount & 0xFFFFFFFFL; } @@ -320,14 +364,15 @@ public class VersionedStatsLRURegionEntryOffHeapObjectKey } @Override - public final void resetCounts() throws InternalStatisticsDisabledException { + public void resetCounts() throws InternalStatisticsDisabledException { hitCountUpdater.set(this, 0); missCountUpdater.set(this, 0); } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + @Override - public final void txDidDestroy(long currTime) { + public void txDidDestroy(long currTime) { setLastModified(currTime); setLastAccessed(currTime); this.hitCount = 0; @@ -339,7 +384,10 @@ public class VersionedStatsLRURegionEntryOffHeapObjectKey return true; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // versioned code private VersionSource memberID; private short entryVersionLowBytes; @@ -356,6 +404,7 @@ public class VersionedStatsLRURegionEntryOffHeapObjectKey return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -373,6 +422,7 @@ public class VersionedStatsLRURegionEntryOffHeapObjectKey } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public void setVersions(VersionTag tag) { this.memberID = tag.getMemberID(); int eVersion = tag.getEntryVersion(); @@ -402,6 +452,7 @@ public class VersionedStatsLRURegionEntryOffHeapObjectKey } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public VersionTag asVersionTag() { VersionTag tag = VersionTag.create(memberID); tag.setEntryVersion(getEntryVersion()); @@ -434,13 +485,19 @@ public class VersionedStatsLRURegionEntryOffHeapObjectKey return this.regionVersionLowBytes; } + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // key code + private final Object key; @Override - public final Object getKey() { + public Object getKey() { return this.key; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp } +
http://git-wip-us.apache.org/repos/asf/geode/blob/a4458531/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapStringKey1.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapStringKey1.java index 18954bc..410cbee 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapStringKey1.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapStringKey1.java @@ -15,36 +15,48 @@ package org.apache.geode.internal.cache; // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + + + import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; + import java.util.concurrent.atomic.AtomicLongFieldUpdater; + import org.apache.geode.cache.EntryEvent; + import org.apache.geode.internal.cache.lru.EnableLRU; + import org.apache.geode.internal.InternalStatisticsDisabledException; + import org.apache.geode.internal.cache.lru.LRUClockNode; import org.apache.geode.internal.cache.lru.NewLRUClockHand; + import org.apache.geode.distributed.internal.membership.InternalDistributedMember; import org.apache.geode.internal.cache.versions.VersionSource; import org.apache.geode.internal.cache.versions.VersionStamp; import org.apache.geode.internal.cache.versions.VersionTag; + import org.apache.geode.internal.offheap.OffHeapRegionEntryHelper; import org.apache.geode.internal.offheap.annotations.Released; import org.apache.geode.internal.offheap.annotations.Retained; import org.apache.geode.internal.offheap.annotations.Unretained; + import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry; // macros whose definition changes this class: // disk: DISK -// lru: LRU -// stats: STATS -// versioned: VERSIONED -// offheap: OFFHEAP +// lru: 1 +// stats: 1 +// versioned: 1 +// offheap: 1 // One of the following key macros must be defined: // key object: KEY_OBJECT // key int: KEY_INT // key long: KEY_LONG // key uuid: KEY_UUID -// key string1: KEY_STRING1 +// key string1: 1 // key string2: KEY_STRING2 + /** * Do not modify this class. It was generated. Instead modify LeafRegionEntry.cpp and then run * ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory). @@ -52,9 +64,23 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha public class VersionedStatsLRURegionEntryOffHeapStringKey1 extends VersionedStatsLRURegionEntryOffHeap { public VersionedStatsLRURegionEntryOffHeapStringKey1(RegionEntryContext context, String key, - @Retained Object value, boolean byteEncode) { - super(context, value); + + @Retained + + Object value + + , boolean byteEncode + + ) { + super(context, + + + + value + + ); // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // caller has already confirmed that key.length <= MAX_INLINE_STRING_KEY long tmpBits1 = 0L; if (byteEncode) { @@ -73,9 +99,11 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey1 } tmpBits1 |= key.length(); this.bits1 = tmpBits1; + } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // common code protected int hash; private HashEntry<Object, Object> next; @@ -84,6 +112,7 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey1 private static final AtomicLongFieldUpdater<VersionedStatsLRURegionEntryOffHeapStringKey1> lastModifiedUpdater = AtomicLongFieldUpdater.newUpdater(VersionedStatsLRURegionEntryOffHeapStringKey1.class, "lastModified"); + /** * All access done using ohAddrUpdater so it is used even though the compiler can not tell it is. */ @@ -115,13 +144,19 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey1 // DO NOT modify this class. It was generated from LeafRegionEntry.cpp @Override + @Unretained protected void setValueField(@Unretained Object v) { + + + OffHeapRegionEntryHelper.setValue(this, v); } @Override + @Retained + public Object _getValueRetain(RegionEntryContext context, boolean decompress) { return OffHeapRegionEntryHelper._getValueRetain(this, decompress, context); } @@ -137,7 +172,9 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey1 } @Override + @Released + public void release() { OffHeapRegionEntryHelper.releaseEntry(this); } @@ -161,7 +198,7 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey1 /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -172,117 +209,121 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey1 /** * @see HashEntry#getNextEntry() */ - public final HashEntry<Object, Object> getNextEntry() { + public HashEntry<Object, Object> getNextEntry() { return this.next; } /** * @see HashEntry#setNextEntry */ - public final void setNextEntry(final HashEntry<Object, Object> n) { + public void setNextEntry(final HashEntry<Object, Object> n) { this.next = n; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // lru code @Override public void setDelayedDiskId(LocalRegion r) { + + + // nothing needed for LRUs with no disk + } - public final synchronized int updateEntrySize(EnableLRU capacityController) { + public synchronized int updateEntrySize(EnableLRU capacityController) { return updateEntrySize(capacityController, _getValue()); // OFHEAP: _getValue ok w/o incing // refcount because we are synced and // only getting the size } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp - public final synchronized int updateEntrySize(EnableLRU capacityController, Object value) { + + public synchronized int updateEntrySize(EnableLRU capacityController, Object value) { int oldSize = getEntrySize(); int newSize = capacityController.entrySize(getKeyForSizing(), value); setEntrySize(newSize); int delta = newSize - oldSize; - // if ( debug ) log( "updateEntrySize key=" + getKey() - // + (_getValue() == Token.INVALID ? " invalid" : - // (_getValue() == Token.LOCAL_INVALID ? "local_invalid" : - // (_getValue()==null ? " evicted" : " valid"))) - // + " oldSize=" + oldSize - // + " newSize=" + this.size ); return delta; } - public final boolean testRecentlyUsed() { + public boolean testRecentlyUsed() { return areAnyBitsSet(RECENTLY_USED); } @Override - public final void setRecentlyUsed() { + public void setRecentlyUsed() { setBits(RECENTLY_USED); } - public final void unsetRecentlyUsed() { + public void unsetRecentlyUsed() { clearBits(~RECENTLY_USED); } - public final boolean testEvicted() { + public boolean testEvicted() { return areAnyBitsSet(EVICTED); } - public final void setEvicted() { + public void setEvicted() { setBits(EVICTED); } - public final void unsetEvicted() { + public void unsetEvicted() { clearBits(~EVICTED); } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + private LRUClockNode nextLRU; private LRUClockNode prevLRU; private int size; - public final void setNextLRUNode(LRUClockNode next) { + public void setNextLRUNode(LRUClockNode next) { this.nextLRU = next; } - public final LRUClockNode nextLRUNode() { + public LRUClockNode nextLRUNode() { return this.nextLRU; } - public final void setPrevLRUNode(LRUClockNode prev) { + public void setPrevLRUNode(LRUClockNode prev) { this.prevLRU = prev; } - public final LRUClockNode prevLRUNode() { + public LRUClockNode prevLRUNode() { return this.prevLRU; } - public final int getEntrySize() { + public int getEntrySize() { return this.size; } - protected final void setEntrySize(int size) { + protected void setEntrySize(int size) { this.size = size; } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp - // @Override - // public StringBuilder appendFieldsToString(final StringBuilder sb) { - // StringBuilder result = super.appendFieldsToString(sb); - // result.append("; prev=").append(this.prevLRU==null?"null":"not null"); - // result.append("; next=").append(this.nextLRU==null?"null":"not null"); - // return result; - // } + @Override public Object getKeyForSizing() { + + + // inline keys always report null for sizing since the size comes from the entry size return null; + } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // stats code @Override - public final void updateStatsForGet(boolean hit, long time) { + public void updateStatsForGet(boolean hit, long time) { setLastAccessed(time); if (hit) { incrementHitCount(); @@ -292,7 +333,7 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey1 } @Override - protected final void setLastModifiedAndAccessedTimes(long lastModified, long lastAccessed) { + protected void setLastModifiedAndAccessedTimes(long lastModified, long lastAccessed) { _setLastModified(lastModified); if (!DISABLE_ACCESS_TIME_UPDATE_ON_PUT) { setLastAccessed(lastAccessed); @@ -302,6 +343,7 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey1 private volatile long lastAccessed; private volatile int hitCount; private volatile int missCount; + private static final AtomicIntegerFieldUpdater<VersionedStatsLRURegionEntryOffHeapStringKey1> hitCountUpdater = AtomicIntegerFieldUpdater.newUpdater(VersionedStatsLRURegionEntryOffHeapStringKey1.class, "hitCount"); @@ -310,7 +352,7 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey1 "missCount"); @Override - public final long getLastAccessed() throws InternalStatisticsDisabledException { + public long getLastAccessed() throws InternalStatisticsDisabledException { return this.lastAccessed; } @@ -319,12 +361,12 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey1 } @Override - public final long getHitCount() throws InternalStatisticsDisabledException { + public long getHitCount() throws InternalStatisticsDisabledException { return this.hitCount & 0xFFFFFFFFL; } @Override - public final long getMissCount() throws InternalStatisticsDisabledException { + public long getMissCount() throws InternalStatisticsDisabledException { return this.missCount & 0xFFFFFFFFL; } @@ -337,14 +379,15 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey1 } @Override - public final void resetCounts() throws InternalStatisticsDisabledException { + public void resetCounts() throws InternalStatisticsDisabledException { hitCountUpdater.set(this, 0); missCountUpdater.set(this, 0); } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + @Override - public final void txDidDestroy(long currTime) { + public void txDidDestroy(long currTime) { setLastModified(currTime); setLastAccessed(currTime); this.hitCount = 0; @@ -356,7 +399,10 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey1 return true; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // versioned code private VersionSource memberID; private short entryVersionLowBytes; @@ -373,6 +419,7 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey1 return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -390,6 +437,7 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey1 } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public void setVersions(VersionTag tag) { this.memberID = tag.getMemberID(); int eVersion = tag.getEntryVersion(); @@ -419,6 +467,7 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey1 } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public VersionTag asVersionTag() { VersionTag tag = VersionTag.create(memberID); tag.setEntryVersion(getEntryVersion()); @@ -451,8 +500,11 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey1 return this.regionVersionLowBytes; } + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // key code + private final long bits1; private int getKeyLength() { @@ -466,7 +518,7 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey1 } @Override - public final Object getKey() { + public Object getKey() { int keylen = getKeyLength(); char[] chars = new char[keylen]; long tmpBits1 = this.bits1; @@ -485,6 +537,7 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey1 } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + @Override public boolean isKeyEqual(Object k) { if (k instanceof String) { @@ -514,5 +567,8 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey1 } return false; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp } + http://git-wip-us.apache.org/repos/asf/geode/blob/a4458531/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapStringKey2.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapStringKey2.java index 8ddbdc9..264aa02 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapStringKey2.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapStringKey2.java @@ -15,36 +15,48 @@ package org.apache.geode.internal.cache; // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + + + import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; + import java.util.concurrent.atomic.AtomicLongFieldUpdater; + import org.apache.geode.cache.EntryEvent; + import org.apache.geode.internal.cache.lru.EnableLRU; + import org.apache.geode.internal.InternalStatisticsDisabledException; + import org.apache.geode.internal.cache.lru.LRUClockNode; import org.apache.geode.internal.cache.lru.NewLRUClockHand; + import org.apache.geode.distributed.internal.membership.InternalDistributedMember; import org.apache.geode.internal.cache.versions.VersionSource; import org.apache.geode.internal.cache.versions.VersionStamp; import org.apache.geode.internal.cache.versions.VersionTag; + import org.apache.geode.internal.offheap.OffHeapRegionEntryHelper; import org.apache.geode.internal.offheap.annotations.Released; import org.apache.geode.internal.offheap.annotations.Retained; import org.apache.geode.internal.offheap.annotations.Unretained; + import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry; // macros whose definition changes this class: // disk: DISK -// lru: LRU -// stats: STATS -// versioned: VERSIONED -// offheap: OFFHEAP +// lru: 1 +// stats: 1 +// versioned: 1 +// offheap: 1 // One of the following key macros must be defined: // key object: KEY_OBJECT // key int: KEY_INT // key long: KEY_LONG // key uuid: KEY_UUID // key string1: KEY_STRING1 -// key string2: KEY_STRING2 +// key string2: 1 + /** * Do not modify this class. It was generated. Instead modify LeafRegionEntry.cpp and then run * ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory). @@ -52,9 +64,23 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha public class VersionedStatsLRURegionEntryOffHeapStringKey2 extends VersionedStatsLRURegionEntryOffHeap { public VersionedStatsLRURegionEntryOffHeapStringKey2(RegionEntryContext context, String key, - @Retained Object value, boolean byteEncode) { - super(context, value); + + @Retained + + Object value + + , boolean byteEncode + + ) { + super(context, + + + + value + + ); // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // caller has already confirmed that key.length <= MAX_INLINE_STRING_KEY long tmpBits1 = 0L; long tmpBits2 = 0L; @@ -85,9 +111,11 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey2 tmpBits1 |= key.length(); this.bits1 = tmpBits1; this.bits2 = tmpBits2; + } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // common code protected int hash; private HashEntry<Object, Object> next; @@ -96,6 +124,7 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey2 private static final AtomicLongFieldUpdater<VersionedStatsLRURegionEntryOffHeapStringKey2> lastModifiedUpdater = AtomicLongFieldUpdater.newUpdater(VersionedStatsLRURegionEntryOffHeapStringKey2.class, "lastModified"); + /** * All access done using ohAddrUpdater so it is used even though the compiler can not tell it is. */ @@ -127,13 +156,19 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey2 // DO NOT modify this class. It was generated from LeafRegionEntry.cpp @Override + @Unretained protected void setValueField(@Unretained Object v) { + + + OffHeapRegionEntryHelper.setValue(this, v); } @Override + @Retained + public Object _getValueRetain(RegionEntryContext context, boolean decompress) { return OffHeapRegionEntryHelper._getValueRetain(this, decompress, context); } @@ -149,7 +184,9 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey2 } @Override + @Released + public void release() { OffHeapRegionEntryHelper.releaseEntry(this); } @@ -173,7 +210,7 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey2 /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -184,117 +221,121 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey2 /** * @see HashEntry#getNextEntry() */ - public final HashEntry<Object, Object> getNextEntry() { + public HashEntry<Object, Object> getNextEntry() { return this.next; } /** * @see HashEntry#setNextEntry */ - public final void setNextEntry(final HashEntry<Object, Object> n) { + public void setNextEntry(final HashEntry<Object, Object> n) { this.next = n; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // lru code @Override public void setDelayedDiskId(LocalRegion r) { + + + // nothing needed for LRUs with no disk + } - public final synchronized int updateEntrySize(EnableLRU capacityController) { + public synchronized int updateEntrySize(EnableLRU capacityController) { return updateEntrySize(capacityController, _getValue()); // OFHEAP: _getValue ok w/o incing // refcount because we are synced and // only getting the size } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp - public final synchronized int updateEntrySize(EnableLRU capacityController, Object value) { + + public synchronized int updateEntrySize(EnableLRU capacityController, Object value) { int oldSize = getEntrySize(); int newSize = capacityController.entrySize(getKeyForSizing(), value); setEntrySize(newSize); int delta = newSize - oldSize; - // if ( debug ) log( "updateEntrySize key=" + getKey() - // + (_getValue() == Token.INVALID ? " invalid" : - // (_getValue() == Token.LOCAL_INVALID ? "local_invalid" : - // (_getValue()==null ? " evicted" : " valid"))) - // + " oldSize=" + oldSize - // + " newSize=" + this.size ); return delta; } - public final boolean testRecentlyUsed() { + public boolean testRecentlyUsed() { return areAnyBitsSet(RECENTLY_USED); } @Override - public final void setRecentlyUsed() { + public void setRecentlyUsed() { setBits(RECENTLY_USED); } - public final void unsetRecentlyUsed() { + public void unsetRecentlyUsed() { clearBits(~RECENTLY_USED); } - public final boolean testEvicted() { + public boolean testEvicted() { return areAnyBitsSet(EVICTED); } - public final void setEvicted() { + public void setEvicted() { setBits(EVICTED); } - public final void unsetEvicted() { + public void unsetEvicted() { clearBits(~EVICTED); } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + private LRUClockNode nextLRU; private LRUClockNode prevLRU; private int size; - public final void setNextLRUNode(LRUClockNode next) { + public void setNextLRUNode(LRUClockNode next) { this.nextLRU = next; } - public final LRUClockNode nextLRUNode() { + public LRUClockNode nextLRUNode() { return this.nextLRU; } - public final void setPrevLRUNode(LRUClockNode prev) { + public void setPrevLRUNode(LRUClockNode prev) { this.prevLRU = prev; } - public final LRUClockNode prevLRUNode() { + public LRUClockNode prevLRUNode() { return this.prevLRU; } - public final int getEntrySize() { + public int getEntrySize() { return this.size; } - protected final void setEntrySize(int size) { + protected void setEntrySize(int size) { this.size = size; } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp - // @Override - // public StringBuilder appendFieldsToString(final StringBuilder sb) { - // StringBuilder result = super.appendFieldsToString(sb); - // result.append("; prev=").append(this.prevLRU==null?"null":"not null"); - // result.append("; next=").append(this.nextLRU==null?"null":"not null"); - // return result; - // } + @Override public Object getKeyForSizing() { + + + // inline keys always report null for sizing since the size comes from the entry size return null; + } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // stats code @Override - public final void updateStatsForGet(boolean hit, long time) { + public void updateStatsForGet(boolean hit, long time) { setLastAccessed(time); if (hit) { incrementHitCount(); @@ -304,7 +345,7 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey2 } @Override - protected final void setLastModifiedAndAccessedTimes(long lastModified, long lastAccessed) { + protected void setLastModifiedAndAccessedTimes(long lastModified, long lastAccessed) { _setLastModified(lastModified); if (!DISABLE_ACCESS_TIME_UPDATE_ON_PUT) { setLastAccessed(lastAccessed); @@ -314,6 +355,7 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey2 private volatile long lastAccessed; private volatile int hitCount; private volatile int missCount; + private static final AtomicIntegerFieldUpdater<VersionedStatsLRURegionEntryOffHeapStringKey2> hitCountUpdater = AtomicIntegerFieldUpdater.newUpdater(VersionedStatsLRURegionEntryOffHeapStringKey2.class, "hitCount"); @@ -322,7 +364,7 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey2 "missCount"); @Override - public final long getLastAccessed() throws InternalStatisticsDisabledException { + public long getLastAccessed() throws InternalStatisticsDisabledException { return this.lastAccessed; } @@ -331,12 +373,12 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey2 } @Override - public final long getHitCount() throws InternalStatisticsDisabledException { + public long getHitCount() throws InternalStatisticsDisabledException { return this.hitCount & 0xFFFFFFFFL; } @Override - public final long getMissCount() throws InternalStatisticsDisabledException { + public long getMissCount() throws InternalStatisticsDisabledException { return this.missCount & 0xFFFFFFFFL; } @@ -349,14 +391,15 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey2 } @Override - public final void resetCounts() throws InternalStatisticsDisabledException { + public void resetCounts() throws InternalStatisticsDisabledException { hitCountUpdater.set(this, 0); missCountUpdater.set(this, 0); } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + @Override - public final void txDidDestroy(long currTime) { + public void txDidDestroy(long currTime) { setLastModified(currTime); setLastAccessed(currTime); this.hitCount = 0; @@ -368,7 +411,10 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey2 return true; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // versioned code private VersionSource memberID; private short entryVersionLowBytes; @@ -385,6 +431,7 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey2 return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -402,6 +449,7 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey2 } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public void setVersions(VersionTag tag) { this.memberID = tag.getMemberID(); int eVersion = tag.getEntryVersion(); @@ -431,6 +479,7 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey2 } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public VersionTag asVersionTag() { VersionTag tag = VersionTag.create(memberID); tag.setEntryVersion(getEntryVersion()); @@ -463,8 +512,11 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey2 return this.regionVersionLowBytes; } + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // key code + // strlen is encoded in lowest 6 bits (max strlen is 63) // character encoding info is in bits 7 and 8 // The other bits are used to encoded character data. @@ -483,7 +535,7 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey2 } @Override - public final Object getKey() { + public Object getKey() { int keylen = getKeyLength(); char[] chars = new char[keylen]; long tmpBits1 = this.bits1; @@ -513,6 +565,7 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey2 } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + @Override public boolean isKeyEqual(Object k) { if (k instanceof String) { @@ -555,5 +608,7 @@ public class VersionedStatsLRURegionEntryOffHeapStringKey2 } return false; } + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp } + http://git-wip-us.apache.org/repos/asf/geode/blob/a4458531/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapUUIDKey.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapUUIDKey.java index d81fded..a96f381 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapUUIDKey.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsLRURegionEntryOffHeapUUIDKey.java @@ -15,37 +15,50 @@ package org.apache.geode.internal.cache; // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + + + import java.util.UUID; + import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; + import java.util.concurrent.atomic.AtomicLongFieldUpdater; + import org.apache.geode.cache.EntryEvent; + import org.apache.geode.internal.cache.lru.EnableLRU; + import org.apache.geode.internal.InternalStatisticsDisabledException; + import org.apache.geode.internal.cache.lru.LRUClockNode; import org.apache.geode.internal.cache.lru.NewLRUClockHand; + import org.apache.geode.distributed.internal.membership.InternalDistributedMember; import org.apache.geode.internal.cache.versions.VersionSource; import org.apache.geode.internal.cache.versions.VersionStamp; import org.apache.geode.internal.cache.versions.VersionTag; + import org.apache.geode.internal.offheap.OffHeapRegionEntryHelper; import org.apache.geode.internal.offheap.annotations.Released; import org.apache.geode.internal.offheap.annotations.Retained; import org.apache.geode.internal.offheap.annotations.Unretained; + import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry; // macros whose definition changes this class: // disk: DISK -// lru: LRU -// stats: STATS -// versioned: VERSIONED -// offheap: OFFHEAP +// lru: 1 +// stats: 1 +// versioned: 1 +// offheap: 1 // One of the following key macros must be defined: // key object: KEY_OBJECT // key int: KEY_INT // key long: KEY_LONG -// key uuid: KEY_UUID +// key uuid: 1 // key string1: KEY_STRING1 // key string2: KEY_STRING2 + /** * Do not modify this class. It was generated. Instead modify LeafRegionEntry.cpp and then run * ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory). @@ -53,14 +66,30 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha public class VersionedStatsLRURegionEntryOffHeapUUIDKey extends VersionedStatsLRURegionEntryOffHeap { public VersionedStatsLRURegionEntryOffHeapUUIDKey(RegionEntryContext context, UUID key, - @Retained Object value) { - super(context, value); + + @Retained + + Object value + + + + ) { + super(context, + + + + value + + ); // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + this.keyMostSigBits = key.getMostSignificantBits(); this.keyLeastSigBits = key.getLeastSignificantBits(); + } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // common code protected int hash; private HashEntry<Object, Object> next; @@ -69,6 +98,7 @@ public class VersionedStatsLRURegionEntryOffHeapUUIDKey private static final AtomicLongFieldUpdater<VersionedStatsLRURegionEntryOffHeapUUIDKey> lastModifiedUpdater = AtomicLongFieldUpdater.newUpdater(VersionedStatsLRURegionEntryOffHeapUUIDKey.class, "lastModified"); + /** * All access done using ohAddrUpdater so it is used even though the compiler can not tell it is. */ @@ -100,13 +130,19 @@ public class VersionedStatsLRURegionEntryOffHeapUUIDKey // DO NOT modify this class. It was generated from LeafRegionEntry.cpp @Override + @Unretained protected void setValueField(@Unretained Object v) { + + + OffHeapRegionEntryHelper.setValue(this, v); } @Override + @Retained + public Object _getValueRetain(RegionEntryContext context, boolean decompress) { return OffHeapRegionEntryHelper._getValueRetain(this, decompress, context); } @@ -122,7 +158,9 @@ public class VersionedStatsLRURegionEntryOffHeapUUIDKey } @Override + @Released + public void release() { OffHeapRegionEntryHelper.releaseEntry(this); } @@ -146,7 +184,7 @@ public class VersionedStatsLRURegionEntryOffHeapUUIDKey /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -157,117 +195,121 @@ public class VersionedStatsLRURegionEntryOffHeapUUIDKey /** * @see HashEntry#getNextEntry() */ - public final HashEntry<Object, Object> getNextEntry() { + public HashEntry<Object, Object> getNextEntry() { return this.next; } /** * @see HashEntry#setNextEntry */ - public final void setNextEntry(final HashEntry<Object, Object> n) { + public void setNextEntry(final HashEntry<Object, Object> n) { this.next = n; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // lru code @Override public void setDelayedDiskId(LocalRegion r) { + + + // nothing needed for LRUs with no disk + } - public final synchronized int updateEntrySize(EnableLRU capacityController) { + public synchronized int updateEntrySize(EnableLRU capacityController) { return updateEntrySize(capacityController, _getValue()); // OFHEAP: _getValue ok w/o incing // refcount because we are synced and // only getting the size } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp - public final synchronized int updateEntrySize(EnableLRU capacityController, Object value) { + + public synchronized int updateEntrySize(EnableLRU capacityController, Object value) { int oldSize = getEntrySize(); int newSize = capacityController.entrySize(getKeyForSizing(), value); setEntrySize(newSize); int delta = newSize - oldSize; - // if ( debug ) log( "updateEntrySize key=" + getKey() - // + (_getValue() == Token.INVALID ? " invalid" : - // (_getValue() == Token.LOCAL_INVALID ? "local_invalid" : - // (_getValue()==null ? " evicted" : " valid"))) - // + " oldSize=" + oldSize - // + " newSize=" + this.size ); return delta; } - public final boolean testRecentlyUsed() { + public boolean testRecentlyUsed() { return areAnyBitsSet(RECENTLY_USED); } @Override - public final void setRecentlyUsed() { + public void setRecentlyUsed() { setBits(RECENTLY_USED); } - public final void unsetRecentlyUsed() { + public void unsetRecentlyUsed() { clearBits(~RECENTLY_USED); } - public final boolean testEvicted() { + public boolean testEvicted() { return areAnyBitsSet(EVICTED); } - public final void setEvicted() { + public void setEvicted() { setBits(EVICTED); } - public final void unsetEvicted() { + public void unsetEvicted() { clearBits(~EVICTED); } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + private LRUClockNode nextLRU; private LRUClockNode prevLRU; private int size; - public final void setNextLRUNode(LRUClockNode next) { + public void setNextLRUNode(LRUClockNode next) { this.nextLRU = next; } - public final LRUClockNode nextLRUNode() { + public LRUClockNode nextLRUNode() { return this.nextLRU; } - public final void setPrevLRUNode(LRUClockNode prev) { + public void setPrevLRUNode(LRUClockNode prev) { this.prevLRU = prev; } - public final LRUClockNode prevLRUNode() { + public LRUClockNode prevLRUNode() { return this.prevLRU; } - public final int getEntrySize() { + public int getEntrySize() { return this.size; } - protected final void setEntrySize(int size) { + protected void setEntrySize(int size) { this.size = size; } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp - // @Override - // public StringBuilder appendFieldsToString(final StringBuilder sb) { - // StringBuilder result = super.appendFieldsToString(sb); - // result.append("; prev=").append(this.prevLRU==null?"null":"not null"); - // result.append("; next=").append(this.nextLRU==null?"null":"not null"); - // return result; - // } + @Override public Object getKeyForSizing() { + + + // inline keys always report null for sizing since the size comes from the entry size return null; + } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // stats code @Override - public final void updateStatsForGet(boolean hit, long time) { + public void updateStatsForGet(boolean hit, long time) { setLastAccessed(time); if (hit) { incrementHitCount(); @@ -277,7 +319,7 @@ public class VersionedStatsLRURegionEntryOffHeapUUIDKey } @Override - protected final void setLastModifiedAndAccessedTimes(long lastModified, long lastAccessed) { + protected void setLastModifiedAndAccessedTimes(long lastModified, long lastAccessed) { _setLastModified(lastModified); if (!DISABLE_ACCESS_TIME_UPDATE_ON_PUT) { setLastAccessed(lastAccessed); @@ -287,6 +329,7 @@ public class VersionedStatsLRURegionEntryOffHeapUUIDKey private volatile long lastAccessed; private volatile int hitCount; private volatile int missCount; + private static final AtomicIntegerFieldUpdater<VersionedStatsLRURegionEntryOffHeapUUIDKey> hitCountUpdater = AtomicIntegerFieldUpdater.newUpdater(VersionedStatsLRURegionEntryOffHeapUUIDKey.class, "hitCount"); @@ -295,7 +338,7 @@ public class VersionedStatsLRURegionEntryOffHeapUUIDKey "missCount"); @Override - public final long getLastAccessed() throws InternalStatisticsDisabledException { + public long getLastAccessed() throws InternalStatisticsDisabledException { return this.lastAccessed; } @@ -304,12 +347,12 @@ public class VersionedStatsLRURegionEntryOffHeapUUIDKey } @Override - public final long getHitCount() throws InternalStatisticsDisabledException { + public long getHitCount() throws InternalStatisticsDisabledException { return this.hitCount & 0xFFFFFFFFL; } @Override - public final long getMissCount() throws InternalStatisticsDisabledException { + public long getMissCount() throws InternalStatisticsDisabledException { return this.missCount & 0xFFFFFFFFL; } @@ -322,14 +365,15 @@ public class VersionedStatsLRURegionEntryOffHeapUUIDKey } @Override - public final void resetCounts() throws InternalStatisticsDisabledException { + public void resetCounts() throws InternalStatisticsDisabledException { hitCountUpdater.set(this, 0); missCountUpdater.set(this, 0); } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + @Override - public final void txDidDestroy(long currTime) { + public void txDidDestroy(long currTime) { setLastModified(currTime); setLastAccessed(currTime); this.hitCount = 0; @@ -341,7 +385,10 @@ public class VersionedStatsLRURegionEntryOffHeapUUIDKey return true; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // versioned code private VersionSource memberID; private short entryVersionLowBytes; @@ -358,6 +405,7 @@ public class VersionedStatsLRURegionEntryOffHeapUUIDKey return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -375,6 +423,7 @@ public class VersionedStatsLRURegionEntryOffHeapUUIDKey } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public void setVersions(VersionTag tag) { this.memberID = tag.getMemberID(); int eVersion = tag.getEntryVersion(); @@ -404,6 +453,7 @@ public class VersionedStatsLRURegionEntryOffHeapUUIDKey } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public VersionTag asVersionTag() { VersionTag tag = VersionTag.create(memberID); tag.setEntryVersion(getEntryVersion()); @@ -436,13 +486,16 @@ public class VersionedStatsLRURegionEntryOffHeapUUIDKey return this.regionVersionLowBytes; } + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // key code + private final long keyMostSigBits; private final long keyLeastSigBits; @Override - public final Object getKey() { + public Object getKey() { return new UUID(this.keyMostSigBits, this.keyLeastSigBits); } @@ -455,5 +508,8 @@ public class VersionedStatsLRURegionEntryOffHeapUUIDKey } return false; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp } + http://git-wip-us.apache.org/repos/asf/geode/blob/a4458531/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapIntKey.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapIntKey.java index f04210e..a0dcca1 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapIntKey.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapIntKey.java @@ -15,41 +15,69 @@ package org.apache.geode.internal.cache; // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + + + import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; + import java.util.concurrent.atomic.AtomicLongFieldUpdater; + import org.apache.geode.cache.EntryEvent; + import org.apache.geode.internal.InternalStatisticsDisabledException; + import org.apache.geode.distributed.internal.membership.InternalDistributedMember; import org.apache.geode.internal.cache.versions.VersionSource; import org.apache.geode.internal.cache.versions.VersionStamp; import org.apache.geode.internal.cache.versions.VersionTag; + import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry; // macros whose definition changes this class: // disk: DISK // lru: LRU -// stats: STATS -// versioned: VERSIONED +// stats: 1 +// versioned: 1 // offheap: OFFHEAP // One of the following key macros must be defined: // key object: KEY_OBJECT -// key int: KEY_INT +// key int: 1 // key long: KEY_LONG // key uuid: KEY_UUID // key string1: KEY_STRING1 // key string2: KEY_STRING2 + /** * Do not modify this class. It was generated. Instead modify LeafRegionEntry.cpp and then run * ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory). */ public class VersionedStatsRegionEntryHeapIntKey extends VersionedStatsRegionEntryHeap { - public VersionedStatsRegionEntryHeapIntKey(RegionEntryContext context, int key, Object value) { - super(context, value); + public VersionedStatsRegionEntryHeapIntKey(RegionEntryContext context, int key, + + + + Object value + + + + ) { + super(context, + + + + value + + ); // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + + + this.key = key; + } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // common code protected int hash; private HashEntry<Object, Object> next; @@ -57,10 +85,11 @@ public class VersionedStatsRegionEntryHeapIntKey extends VersionedStatsRegionEnt private volatile long lastModified; private static final AtomicLongFieldUpdater<VersionedStatsRegionEntryHeapIntKey> lastModifiedUpdater = AtomicLongFieldUpdater.newUpdater(VersionedStatsRegionEntryHeapIntKey.class, "lastModified"); + private volatile Object value; @Override - protected final Object getValueField() { + protected Object getValueField() { return this.value; } @@ -80,7 +109,7 @@ public class VersionedStatsRegionEntryHeapIntKey extends VersionedStatsRegionEnt /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -91,21 +120,24 @@ public class VersionedStatsRegionEntryHeapIntKey extends VersionedStatsRegionEnt /** * @see HashEntry#getNextEntry() */ - public final HashEntry<Object, Object> getNextEntry() { + public HashEntry<Object, Object> getNextEntry() { return this.next; } /** * @see HashEntry#setNextEntry */ - public final void setNextEntry(final HashEntry<Object, Object> n) { + public void setNextEntry(final HashEntry<Object, Object> n) { this.next = n; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // stats code @Override - public final void updateStatsForGet(boolean hit, long time) { + public void updateStatsForGet(boolean hit, long time) { setLastAccessed(time); if (hit) { incrementHitCount(); @@ -115,7 +147,7 @@ public class VersionedStatsRegionEntryHeapIntKey extends VersionedStatsRegionEnt } @Override - protected final void setLastModifiedAndAccessedTimes(long lastModified, long lastAccessed) { + protected void setLastModifiedAndAccessedTimes(long lastModified, long lastAccessed) { _setLastModified(lastModified); if (!DISABLE_ACCESS_TIME_UPDATE_ON_PUT) { setLastAccessed(lastAccessed); @@ -125,13 +157,14 @@ public class VersionedStatsRegionEntryHeapIntKey extends VersionedStatsRegionEnt private volatile long lastAccessed; private volatile int hitCount; private volatile int missCount; + private static final AtomicIntegerFieldUpdater<VersionedStatsRegionEntryHeapIntKey> hitCountUpdater = AtomicIntegerFieldUpdater.newUpdater(VersionedStatsRegionEntryHeapIntKey.class, "hitCount"); private static final AtomicIntegerFieldUpdater<VersionedStatsRegionEntryHeapIntKey> missCountUpdater = AtomicIntegerFieldUpdater.newUpdater(VersionedStatsRegionEntryHeapIntKey.class, "missCount"); @Override - public final long getLastAccessed() throws InternalStatisticsDisabledException { + public long getLastAccessed() throws InternalStatisticsDisabledException { return this.lastAccessed; } @@ -140,12 +173,12 @@ public class VersionedStatsRegionEntryHeapIntKey extends VersionedStatsRegionEnt } @Override - public final long getHitCount() throws InternalStatisticsDisabledException { + public long getHitCount() throws InternalStatisticsDisabledException { return this.hitCount & 0xFFFFFFFFL; } @Override - public final long getMissCount() throws InternalStatisticsDisabledException { + public long getMissCount() throws InternalStatisticsDisabledException { return this.missCount & 0xFFFFFFFFL; } @@ -158,14 +191,15 @@ public class VersionedStatsRegionEntryHeapIntKey extends VersionedStatsRegionEnt } @Override - public final void resetCounts() throws InternalStatisticsDisabledException { + public void resetCounts() throws InternalStatisticsDisabledException { hitCountUpdater.set(this, 0); missCountUpdater.set(this, 0); } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + @Override - public final void txDidDestroy(long currTime) { + public void txDidDestroy(long currTime) { setLastModified(currTime); setLastAccessed(currTime); this.hitCount = 0; @@ -177,7 +211,10 @@ public class VersionedStatsRegionEntryHeapIntKey extends VersionedStatsRegionEnt return true; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // versioned code private VersionSource memberID; private short entryVersionLowBytes; @@ -194,6 +231,7 @@ public class VersionedStatsRegionEntryHeapIntKey extends VersionedStatsRegionEnt return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -211,6 +249,7 @@ public class VersionedStatsRegionEntryHeapIntKey extends VersionedStatsRegionEnt } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public void setVersions(VersionTag tag) { this.memberID = tag.getMemberID(); int eVersion = tag.getEntryVersion(); @@ -240,6 +279,7 @@ public class VersionedStatsRegionEntryHeapIntKey extends VersionedStatsRegionEnt } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public VersionTag asVersionTag() { VersionTag tag = VersionTag.create(memberID); tag.setEntryVersion(getEntryVersion()); @@ -272,12 +312,17 @@ public class VersionedStatsRegionEntryHeapIntKey extends VersionedStatsRegionEnt return this.regionVersionLowBytes; } + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // key code + + + private final int key; @Override - public final Object getKey() { + public Object getKey() { return this.key; } @@ -288,5 +333,8 @@ public class VersionedStatsRegionEntryHeapIntKey extends VersionedStatsRegionEnt } return false; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp } + http://git-wip-us.apache.org/repos/asf/geode/blob/a4458531/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapLongKey.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapLongKey.java index 59657b0..4a4902e 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapLongKey.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapLongKey.java @@ -15,41 +15,69 @@ package org.apache.geode.internal.cache; // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + + + import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; + import java.util.concurrent.atomic.AtomicLongFieldUpdater; + import org.apache.geode.cache.EntryEvent; + import org.apache.geode.internal.InternalStatisticsDisabledException; + import org.apache.geode.distributed.internal.membership.InternalDistributedMember; import org.apache.geode.internal.cache.versions.VersionSource; import org.apache.geode.internal.cache.versions.VersionStamp; import org.apache.geode.internal.cache.versions.VersionTag; + import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry; // macros whose definition changes this class: // disk: DISK // lru: LRU -// stats: STATS -// versioned: VERSIONED +// stats: 1 +// versioned: 1 // offheap: OFFHEAP // One of the following key macros must be defined: // key object: KEY_OBJECT // key int: KEY_INT -// key long: KEY_LONG +// key long: 1 // key uuid: KEY_UUID // key string1: KEY_STRING1 // key string2: KEY_STRING2 + /** * Do not modify this class. It was generated. Instead modify LeafRegionEntry.cpp and then run * ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory). */ public class VersionedStatsRegionEntryHeapLongKey extends VersionedStatsRegionEntryHeap { - public VersionedStatsRegionEntryHeapLongKey(RegionEntryContext context, long key, Object value) { - super(context, value); + public VersionedStatsRegionEntryHeapLongKey(RegionEntryContext context, long key, + + + + Object value + + + + ) { + super(context, + + + + value + + ); // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + + + this.key = key; + } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // common code protected int hash; private HashEntry<Object, Object> next; @@ -57,10 +85,11 @@ public class VersionedStatsRegionEntryHeapLongKey extends VersionedStatsRegionEn private volatile long lastModified; private static final AtomicLongFieldUpdater<VersionedStatsRegionEntryHeapLongKey> lastModifiedUpdater = AtomicLongFieldUpdater.newUpdater(VersionedStatsRegionEntryHeapLongKey.class, "lastModified"); + private volatile Object value; @Override - protected final Object getValueField() { + protected Object getValueField() { return this.value; } @@ -80,7 +109,7 @@ public class VersionedStatsRegionEntryHeapLongKey extends VersionedStatsRegionEn /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -91,21 +120,24 @@ public class VersionedStatsRegionEntryHeapLongKey extends VersionedStatsRegionEn /** * @see HashEntry#getNextEntry() */ - public final HashEntry<Object, Object> getNextEntry() { + public HashEntry<Object, Object> getNextEntry() { return this.next; } /** * @see HashEntry#setNextEntry */ - public final void setNextEntry(final HashEntry<Object, Object> n) { + public void setNextEntry(final HashEntry<Object, Object> n) { this.next = n; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // stats code @Override - public final void updateStatsForGet(boolean hit, long time) { + public void updateStatsForGet(boolean hit, long time) { setLastAccessed(time); if (hit) { incrementHitCount(); @@ -115,7 +147,7 @@ public class VersionedStatsRegionEntryHeapLongKey extends VersionedStatsRegionEn } @Override - protected final void setLastModifiedAndAccessedTimes(long lastModified, long lastAccessed) { + protected void setLastModifiedAndAccessedTimes(long lastModified, long lastAccessed) { _setLastModified(lastModified); if (!DISABLE_ACCESS_TIME_UPDATE_ON_PUT) { setLastAccessed(lastAccessed); @@ -125,13 +157,14 @@ public class VersionedStatsRegionEntryHeapLongKey extends VersionedStatsRegionEn private volatile long lastAccessed; private volatile int hitCount; private volatile int missCount; + private static final AtomicIntegerFieldUpdater<VersionedStatsRegionEntryHeapLongKey> hitCountUpdater = AtomicIntegerFieldUpdater.newUpdater(VersionedStatsRegionEntryHeapLongKey.class, "hitCount"); private static final AtomicIntegerFieldUpdater<VersionedStatsRegionEntryHeapLongKey> missCountUpdater = AtomicIntegerFieldUpdater.newUpdater(VersionedStatsRegionEntryHeapLongKey.class, "missCount"); @Override - public final long getLastAccessed() throws InternalStatisticsDisabledException { + public long getLastAccessed() throws InternalStatisticsDisabledException { return this.lastAccessed; } @@ -140,12 +173,12 @@ public class VersionedStatsRegionEntryHeapLongKey extends VersionedStatsRegionEn } @Override - public final long getHitCount() throws InternalStatisticsDisabledException { + public long getHitCount() throws InternalStatisticsDisabledException { return this.hitCount & 0xFFFFFFFFL; } @Override - public final long getMissCount() throws InternalStatisticsDisabledException { + public long getMissCount() throws InternalStatisticsDisabledException { return this.missCount & 0xFFFFFFFFL; } @@ -158,14 +191,15 @@ public class VersionedStatsRegionEntryHeapLongKey extends VersionedStatsRegionEn } @Override - public final void resetCounts() throws InternalStatisticsDisabledException { + public void resetCounts() throws InternalStatisticsDisabledException { hitCountUpdater.set(this, 0); missCountUpdater.set(this, 0); } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + @Override - public final void txDidDestroy(long currTime) { + public void txDidDestroy(long currTime) { setLastModified(currTime); setLastAccessed(currTime); this.hitCount = 0; @@ -177,7 +211,10 @@ public class VersionedStatsRegionEntryHeapLongKey extends VersionedStatsRegionEn return true; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // versioned code private VersionSource memberID; private short entryVersionLowBytes; @@ -194,6 +231,7 @@ public class VersionedStatsRegionEntryHeapLongKey extends VersionedStatsRegionEn return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -211,6 +249,7 @@ public class VersionedStatsRegionEntryHeapLongKey extends VersionedStatsRegionEn } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public void setVersions(VersionTag tag) { this.memberID = tag.getMemberID(); int eVersion = tag.getEntryVersion(); @@ -240,6 +279,7 @@ public class VersionedStatsRegionEntryHeapLongKey extends VersionedStatsRegionEn } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public VersionTag asVersionTag() { VersionTag tag = VersionTag.create(memberID); tag.setEntryVersion(getEntryVersion()); @@ -272,12 +312,15 @@ public class VersionedStatsRegionEntryHeapLongKey extends VersionedStatsRegionEn return this.regionVersionLowBytes; } + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // key code + private final long key; @Override - public final Object getKey() { + public Object getKey() { return this.key; } @@ -288,5 +331,8 @@ public class VersionedStatsRegionEntryHeapLongKey extends VersionedStatsRegionEn } return false; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp } + http://git-wip-us.apache.org/repos/asf/geode/blob/a4458531/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapObjectKey.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapObjectKey.java index a603b94..657306b 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapObjectKey.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapObjectKey.java @@ -15,42 +15,69 @@ package org.apache.geode.internal.cache; // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + + + import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; + import java.util.concurrent.atomic.AtomicLongFieldUpdater; + import org.apache.geode.cache.EntryEvent; + import org.apache.geode.internal.InternalStatisticsDisabledException; + import org.apache.geode.distributed.internal.membership.InternalDistributedMember; import org.apache.geode.internal.cache.versions.VersionSource; import org.apache.geode.internal.cache.versions.VersionStamp; import org.apache.geode.internal.cache.versions.VersionTag; + import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry; // macros whose definition changes this class: // disk: DISK // lru: LRU -// stats: STATS -// versioned: VERSIONED +// stats: 1 +// versioned: 1 // offheap: OFFHEAP // One of the following key macros must be defined: -// key object: KEY_OBJECT +// key object: 1 // key int: KEY_INT // key long: KEY_LONG // key uuid: KEY_UUID // key string1: KEY_STRING1 // key string2: KEY_STRING2 + /** * Do not modify this class. It was generated. Instead modify LeafRegionEntry.cpp and then run * ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory). */ public class VersionedStatsRegionEntryHeapObjectKey extends VersionedStatsRegionEntryHeap { public VersionedStatsRegionEntryHeapObjectKey(RegionEntryContext context, Object key, - Object value) { - super(context, value); + + + + Object value + + + + ) { + super(context, + + + + value + + ); // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + + + this.key = key; + } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // common code protected int hash; private HashEntry<Object, Object> next; @@ -59,10 +86,11 @@ public class VersionedStatsRegionEntryHeapObjectKey extends VersionedStatsRegion private static final AtomicLongFieldUpdater<VersionedStatsRegionEntryHeapObjectKey> lastModifiedUpdater = AtomicLongFieldUpdater.newUpdater(VersionedStatsRegionEntryHeapObjectKey.class, "lastModified"); + private volatile Object value; @Override - protected final Object getValueField() { + protected Object getValueField() { return this.value; } @@ -82,7 +110,7 @@ public class VersionedStatsRegionEntryHeapObjectKey extends VersionedStatsRegion /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -93,21 +121,24 @@ public class VersionedStatsRegionEntryHeapObjectKey extends VersionedStatsRegion /** * @see HashEntry#getNextEntry() */ - public final HashEntry<Object, Object> getNextEntry() { + public HashEntry<Object, Object> getNextEntry() { return this.next; } /** * @see HashEntry#setNextEntry */ - public final void setNextEntry(final HashEntry<Object, Object> n) { + public void setNextEntry(final HashEntry<Object, Object> n) { this.next = n; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // stats code @Override - public final void updateStatsForGet(boolean hit, long time) { + public void updateStatsForGet(boolean hit, long time) { setLastAccessed(time); if (hit) { incrementHitCount(); @@ -117,7 +148,7 @@ public class VersionedStatsRegionEntryHeapObjectKey extends VersionedStatsRegion } @Override - protected final void setLastModifiedAndAccessedTimes(long lastModified, long lastAccessed) { + protected void setLastModifiedAndAccessedTimes(long lastModified, long lastAccessed) { _setLastModified(lastModified); if (!DISABLE_ACCESS_TIME_UPDATE_ON_PUT) { setLastAccessed(lastAccessed); @@ -127,6 +158,7 @@ public class VersionedStatsRegionEntryHeapObjectKey extends VersionedStatsRegion private volatile long lastAccessed; private volatile int hitCount; private volatile int missCount; + private static final AtomicIntegerFieldUpdater<VersionedStatsRegionEntryHeapObjectKey> hitCountUpdater = AtomicIntegerFieldUpdater.newUpdater(VersionedStatsRegionEntryHeapObjectKey.class, "hitCount"); @@ -135,7 +167,7 @@ public class VersionedStatsRegionEntryHeapObjectKey extends VersionedStatsRegion "missCount"); @Override - public final long getLastAccessed() throws InternalStatisticsDisabledException { + public long getLastAccessed() throws InternalStatisticsDisabledException { return this.lastAccessed; } @@ -144,12 +176,12 @@ public class VersionedStatsRegionEntryHeapObjectKey extends VersionedStatsRegion } @Override - public final long getHitCount() throws InternalStatisticsDisabledException { + public long getHitCount() throws InternalStatisticsDisabledException { return this.hitCount & 0xFFFFFFFFL; } @Override - public final long getMissCount() throws InternalStatisticsDisabledException { + public long getMissCount() throws InternalStatisticsDisabledException { return this.missCount & 0xFFFFFFFFL; } @@ -162,14 +194,15 @@ public class VersionedStatsRegionEntryHeapObjectKey extends VersionedStatsRegion } @Override - public final void resetCounts() throws InternalStatisticsDisabledException { + public void resetCounts() throws InternalStatisticsDisabledException { hitCountUpdater.set(this, 0); missCountUpdater.set(this, 0); } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + @Override - public final void txDidDestroy(long currTime) { + public void txDidDestroy(long currTime) { setLastModified(currTime); setLastAccessed(currTime); this.hitCount = 0; @@ -181,7 +214,10 @@ public class VersionedStatsRegionEntryHeapObjectKey extends VersionedStatsRegion return true; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // versioned code private VersionSource memberID; private short entryVersionLowBytes; @@ -198,6 +234,7 @@ public class VersionedStatsRegionEntryHeapObjectKey extends VersionedStatsRegion return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -215,6 +252,7 @@ public class VersionedStatsRegionEntryHeapObjectKey extends VersionedStatsRegion } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public void setVersions(VersionTag tag) { this.memberID = tag.getMemberID(); int eVersion = tag.getEntryVersion(); @@ -244,6 +282,7 @@ public class VersionedStatsRegionEntryHeapObjectKey extends VersionedStatsRegion } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public VersionTag asVersionTag() { VersionTag tag = VersionTag.create(memberID); tag.setEntryVersion(getEntryVersion()); @@ -276,13 +315,19 @@ public class VersionedStatsRegionEntryHeapObjectKey extends VersionedStatsRegion return this.regionVersionLowBytes; } + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // key code + private final Object key; @Override - public final Object getKey() { + public Object getKey() { return this.key; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp } + http://git-wip-us.apache.org/repos/asf/geode/blob/a4458531/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapStringKey1.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapStringKey1.java index 00eb20e..0a11afa 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapStringKey1.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapStringKey1.java @@ -15,38 +15,61 @@ package org.apache.geode.internal.cache; // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + + + import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; + import java.util.concurrent.atomic.AtomicLongFieldUpdater; + import org.apache.geode.cache.EntryEvent; + import org.apache.geode.internal.InternalStatisticsDisabledException; + import org.apache.geode.distributed.internal.membership.InternalDistributedMember; import org.apache.geode.internal.cache.versions.VersionSource; import org.apache.geode.internal.cache.versions.VersionStamp; import org.apache.geode.internal.cache.versions.VersionTag; + import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry; // macros whose definition changes this class: // disk: DISK // lru: LRU -// stats: STATS -// versioned: VERSIONED +// stats: 1 +// versioned: 1 // offheap: OFFHEAP // One of the following key macros must be defined: // key object: KEY_OBJECT // key int: KEY_INT // key long: KEY_LONG // key uuid: KEY_UUID -// key string1: KEY_STRING1 +// key string1: 1 // key string2: KEY_STRING2 + /** * Do not modify this class. It was generated. Instead modify LeafRegionEntry.cpp and then run * ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory). */ public class VersionedStatsRegionEntryHeapStringKey1 extends VersionedStatsRegionEntryHeap { public VersionedStatsRegionEntryHeapStringKey1(RegionEntryContext context, String key, - Object value, boolean byteEncode) { - super(context, value); + + + + Object value + + , boolean byteEncode + + ) { + super(context, + + + + value + + ); // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // caller has already confirmed that key.length <= MAX_INLINE_STRING_KEY long tmpBits1 = 0L; if (byteEncode) { @@ -65,9 +88,11 @@ public class VersionedStatsRegionEntryHeapStringKey1 extends VersionedStatsRegio } tmpBits1 |= key.length(); this.bits1 = tmpBits1; + } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // common code protected int hash; private HashEntry<Object, Object> next; @@ -76,10 +101,11 @@ public class VersionedStatsRegionEntryHeapStringKey1 extends VersionedStatsRegio private static final AtomicLongFieldUpdater<VersionedStatsRegionEntryHeapStringKey1> lastModifiedUpdater = AtomicLongFieldUpdater.newUpdater(VersionedStatsRegionEntryHeapStringKey1.class, "lastModified"); + private volatile Object value; @Override - protected final Object getValueField() { + protected Object getValueField() { return this.value; } @@ -99,7 +125,7 @@ public class VersionedStatsRegionEntryHeapStringKey1 extends VersionedStatsRegio /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -110,21 +136,24 @@ public class VersionedStatsRegionEntryHeapStringKey1 extends VersionedStatsRegio /** * @see HashEntry#getNextEntry() */ - public final HashEntry<Object, Object> getNextEntry() { + public HashEntry<Object, Object> getNextEntry() { return this.next; } /** * @see HashEntry#setNextEntry */ - public final void setNextEntry(final HashEntry<Object, Object> n) { + public void setNextEntry(final HashEntry<Object, Object> n) { this.next = n; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // stats code @Override - public final void updateStatsForGet(boolean hit, long time) { + public void updateStatsForGet(boolean hit, long time) { setLastAccessed(time); if (hit) { incrementHitCount(); @@ -134,7 +163,7 @@ public class VersionedStatsRegionEntryHeapStringKey1 extends VersionedStatsRegio } @Override - protected final void setLastModifiedAndAccessedTimes(long lastModified, long lastAccessed) { + protected void setLastModifiedAndAccessedTimes(long lastModified, long lastAccessed) { _setLastModified(lastModified); if (!DISABLE_ACCESS_TIME_UPDATE_ON_PUT) { setLastAccessed(lastAccessed); @@ -144,6 +173,7 @@ public class VersionedStatsRegionEntryHeapStringKey1 extends VersionedStatsRegio private volatile long lastAccessed; private volatile int hitCount; private volatile int missCount; + private static final AtomicIntegerFieldUpdater<VersionedStatsRegionEntryHeapStringKey1> hitCountUpdater = AtomicIntegerFieldUpdater.newUpdater(VersionedStatsRegionEntryHeapStringKey1.class, "hitCount"); @@ -152,7 +182,7 @@ public class VersionedStatsRegionEntryHeapStringKey1 extends VersionedStatsRegio "missCount"); @Override - public final long getLastAccessed() throws InternalStatisticsDisabledException { + public long getLastAccessed() throws InternalStatisticsDisabledException { return this.lastAccessed; } @@ -161,12 +191,12 @@ public class VersionedStatsRegionEntryHeapStringKey1 extends VersionedStatsRegio } @Override - public final long getHitCount() throws InternalStatisticsDisabledException { + public long getHitCount() throws InternalStatisticsDisabledException { return this.hitCount & 0xFFFFFFFFL; } @Override - public final long getMissCount() throws InternalStatisticsDisabledException { + public long getMissCount() throws InternalStatisticsDisabledException { return this.missCount & 0xFFFFFFFFL; } @@ -179,14 +209,15 @@ public class VersionedStatsRegionEntryHeapStringKey1 extends VersionedStatsRegio } @Override - public final void resetCounts() throws InternalStatisticsDisabledException { + public void resetCounts() throws InternalStatisticsDisabledException { hitCountUpdater.set(this, 0); missCountUpdater.set(this, 0); } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + @Override - public final void txDidDestroy(long currTime) { + public void txDidDestroy(long currTime) { setLastModified(currTime); setLastAccessed(currTime); this.hitCount = 0; @@ -198,7 +229,10 @@ public class VersionedStatsRegionEntryHeapStringKey1 extends VersionedStatsRegio return true; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // versioned code private VersionSource memberID; private short entryVersionLowBytes; @@ -215,6 +249,7 @@ public class VersionedStatsRegionEntryHeapStringKey1 extends VersionedStatsRegio return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -232,6 +267,7 @@ public class VersionedStatsRegionEntryHeapStringKey1 extends VersionedStatsRegio } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public void setVersions(VersionTag tag) { this.memberID = tag.getMemberID(); int eVersion = tag.getEntryVersion(); @@ -261,6 +297,7 @@ public class VersionedStatsRegionEntryHeapStringKey1 extends VersionedStatsRegio } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public VersionTag asVersionTag() { VersionTag tag = VersionTag.create(memberID); tag.setEntryVersion(getEntryVersion()); @@ -293,8 +330,11 @@ public class VersionedStatsRegionEntryHeapStringKey1 extends VersionedStatsRegio return this.regionVersionLowBytes; } + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // key code + private final long bits1; private int getKeyLength() { @@ -308,7 +348,7 @@ public class VersionedStatsRegionEntryHeapStringKey1 extends VersionedStatsRegio } @Override - public final Object getKey() { + public Object getKey() { int keylen = getKeyLength(); char[] chars = new char[keylen]; long tmpBits1 = this.bits1; @@ -327,6 +367,7 @@ public class VersionedStatsRegionEntryHeapStringKey1 extends VersionedStatsRegio } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + @Override public boolean isKeyEqual(Object k) { if (k instanceof String) { @@ -356,5 +397,8 @@ public class VersionedStatsRegionEntryHeapStringKey1 extends VersionedStatsRegio } return false; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp } +
