http://git-wip-us.apache.org/repos/asf/geode/blob/a4458531/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapStringKey2.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapStringKey2.java index a92b2b1..43a24a8 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapStringKey2.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapStringKey2.java @@ -15,21 +15,29 @@ 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 @@ -37,16 +45,31 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha // 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). */ public class VersionedStatsRegionEntryHeapStringKey2 extends VersionedStatsRegionEntryHeap { public VersionedStatsRegionEntryHeapStringKey2(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; long tmpBits2 = 0L; @@ -77,9 +100,11 @@ public class VersionedStatsRegionEntryHeapStringKey2 extends VersionedStatsRegio 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; @@ -88,10 +113,11 @@ public class VersionedStatsRegionEntryHeapStringKey2 extends VersionedStatsRegio private static final AtomicLongFieldUpdater<VersionedStatsRegionEntryHeapStringKey2> lastModifiedUpdater = AtomicLongFieldUpdater.newUpdater(VersionedStatsRegionEntryHeapStringKey2.class, "lastModified"); + private volatile Object value; @Override - protected final Object getValueField() { + protected Object getValueField() { return this.value; } @@ -111,7 +137,7 @@ public class VersionedStatsRegionEntryHeapStringKey2 extends VersionedStatsRegio /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -122,21 +148,24 @@ public class VersionedStatsRegionEntryHeapStringKey2 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(); @@ -146,7 +175,7 @@ public class VersionedStatsRegionEntryHeapStringKey2 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); @@ -156,6 +185,7 @@ public class VersionedStatsRegionEntryHeapStringKey2 extends VersionedStatsRegio private volatile long lastAccessed; private volatile int hitCount; private volatile int missCount; + private static final AtomicIntegerFieldUpdater<VersionedStatsRegionEntryHeapStringKey2> hitCountUpdater = AtomicIntegerFieldUpdater.newUpdater(VersionedStatsRegionEntryHeapStringKey2.class, "hitCount"); @@ -164,7 +194,7 @@ public class VersionedStatsRegionEntryHeapStringKey2 extends VersionedStatsRegio "missCount"); @Override - public final long getLastAccessed() throws InternalStatisticsDisabledException { + public long getLastAccessed() throws InternalStatisticsDisabledException { return this.lastAccessed; } @@ -173,12 +203,12 @@ public class VersionedStatsRegionEntryHeapStringKey2 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; } @@ -191,14 +221,15 @@ public class VersionedStatsRegionEntryHeapStringKey2 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; @@ -210,7 +241,10 @@ public class VersionedStatsRegionEntryHeapStringKey2 extends VersionedStatsRegio return true; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // versioned code private VersionSource memberID; private short entryVersionLowBytes; @@ -227,6 +261,7 @@ public class VersionedStatsRegionEntryHeapStringKey2 extends VersionedStatsRegio return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -244,6 +279,7 @@ public class VersionedStatsRegionEntryHeapStringKey2 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(); @@ -273,6 +309,7 @@ public class VersionedStatsRegionEntryHeapStringKey2 extends VersionedStatsRegio } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public VersionTag asVersionTag() { VersionTag tag = VersionTag.create(memberID); tag.setEntryVersion(getEntryVersion()); @@ -305,8 +342,11 @@ public class VersionedStatsRegionEntryHeapStringKey2 extends VersionedStatsRegio 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. @@ -325,7 +365,7 @@ public class VersionedStatsRegionEntryHeapStringKey2 extends VersionedStatsRegio } @Override - public final Object getKey() { + public Object getKey() { int keylen = getKeyLength(); char[] chars = new char[keylen]; long tmpBits1 = this.bits1; @@ -355,6 +395,7 @@ public class VersionedStatsRegionEntryHeapStringKey2 extends VersionedStatsRegio } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + @Override public boolean isKeyEqual(Object k) { if (k instanceof String) { @@ -397,5 +438,7 @@ public class VersionedStatsRegionEntryHeapStringKey2 extends VersionedStatsRegio } 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/VersionedStatsRegionEntryHeapUUIDKey.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapUUIDKey.java index f9d280e..ae66cb3 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapUUIDKey.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryHeapUUIDKey.java @@ -15,43 +15,70 @@ 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.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 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). */ public class VersionedStatsRegionEntryHeapUUIDKey extends VersionedStatsRegionEntryHeap { - public VersionedStatsRegionEntryHeapUUIDKey(RegionEntryContext context, UUID key, Object value) { - super(context, value); + public VersionedStatsRegionEntryHeapUUIDKey(RegionEntryContext context, UUID key, + + + + 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; @@ -59,10 +86,11 @@ public class VersionedStatsRegionEntryHeapUUIDKey extends VersionedStatsRegionEn private volatile long lastModified; private static final AtomicLongFieldUpdater<VersionedStatsRegionEntryHeapUUIDKey> lastModifiedUpdater = AtomicLongFieldUpdater.newUpdater(VersionedStatsRegionEntryHeapUUIDKey.class, "lastModified"); + private volatile Object value; @Override - protected final Object getValueField() { + protected Object getValueField() { return this.value; } @@ -82,7 +110,7 @@ public class VersionedStatsRegionEntryHeapUUIDKey extends VersionedStatsRegionEn /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -93,21 +121,24 @@ public class VersionedStatsRegionEntryHeapUUIDKey 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(); @@ -117,7 +148,7 @@ public class VersionedStatsRegionEntryHeapUUIDKey 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); @@ -127,13 +158,14 @@ public class VersionedStatsRegionEntryHeapUUIDKey extends VersionedStatsRegionEn private volatile long lastAccessed; private volatile int hitCount; private volatile int missCount; + private static final AtomicIntegerFieldUpdater<VersionedStatsRegionEntryHeapUUIDKey> hitCountUpdater = AtomicIntegerFieldUpdater.newUpdater(VersionedStatsRegionEntryHeapUUIDKey.class, "hitCount"); private static final AtomicIntegerFieldUpdater<VersionedStatsRegionEntryHeapUUIDKey> missCountUpdater = AtomicIntegerFieldUpdater.newUpdater(VersionedStatsRegionEntryHeapUUIDKey.class, "missCount"); @Override - public final long getLastAccessed() throws InternalStatisticsDisabledException { + public long getLastAccessed() throws InternalStatisticsDisabledException { return this.lastAccessed; } @@ -142,12 +174,12 @@ public class VersionedStatsRegionEntryHeapUUIDKey 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; } @@ -160,14 +192,15 @@ public class VersionedStatsRegionEntryHeapUUIDKey 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; @@ -179,7 +212,10 @@ public class VersionedStatsRegionEntryHeapUUIDKey extends VersionedStatsRegionEn return true; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // versioned code private VersionSource memberID; private short entryVersionLowBytes; @@ -196,6 +232,7 @@ public class VersionedStatsRegionEntryHeapUUIDKey extends VersionedStatsRegionEn return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -213,6 +250,7 @@ public class VersionedStatsRegionEntryHeapUUIDKey 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(); @@ -242,6 +280,7 @@ public class VersionedStatsRegionEntryHeapUUIDKey extends VersionedStatsRegionEn } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public VersionTag asVersionTag() { VersionTag tag = VersionTag.create(memberID); tag.setEntryVersion(getEntryVersion()); @@ -274,13 +313,16 @@ public class VersionedStatsRegionEntryHeapUUIDKey extends VersionedStatsRegionEn 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); } @@ -293,5 +335,8 @@ public class VersionedStatsRegionEntryHeapUUIDKey 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/VersionedStatsRegionEntryOffHeapIntKey.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapIntKey.java index dc7124d..8e245d1 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapIntKey.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapIntKey.java @@ -15,46 +15,74 @@ 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.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 +// stats: 1 +// versioned: 1 +// offheap: 1 // 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 VersionedStatsRegionEntryOffHeapIntKey extends VersionedStatsRegionEntryOffHeap { public VersionedStatsRegionEntryOffHeapIntKey(RegionEntryContext context, int 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; @@ -63,6 +91,7 @@ public class VersionedStatsRegionEntryOffHeapIntKey extends VersionedStatsRegion private static final AtomicLongFieldUpdater<VersionedStatsRegionEntryOffHeapIntKey> lastModifiedUpdater = AtomicLongFieldUpdater.newUpdater(VersionedStatsRegionEntryOffHeapIntKey.class, "lastModified"); + /** * All access done using ohAddrUpdater so it is used even though the compiler can not tell it is. */ @@ -93,13 +122,19 @@ public class VersionedStatsRegionEntryOffHeapIntKey extends VersionedStatsRegion // 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); } @@ -115,7 +150,9 @@ public class VersionedStatsRegionEntryOffHeapIntKey extends VersionedStatsRegion } @Override + @Released + public void release() { OffHeapRegionEntryHelper.releaseEntry(this); } @@ -139,7 +176,7 @@ public class VersionedStatsRegionEntryOffHeapIntKey extends VersionedStatsRegion /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -150,21 +187,24 @@ public class VersionedStatsRegionEntryOffHeapIntKey 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(); @@ -174,7 +214,7 @@ public class VersionedStatsRegionEntryOffHeapIntKey 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); @@ -184,6 +224,7 @@ public class VersionedStatsRegionEntryOffHeapIntKey extends VersionedStatsRegion private volatile long lastAccessed; private volatile int hitCount; private volatile int missCount; + private static final AtomicIntegerFieldUpdater<VersionedStatsRegionEntryOffHeapIntKey> hitCountUpdater = AtomicIntegerFieldUpdater.newUpdater(VersionedStatsRegionEntryOffHeapIntKey.class, "hitCount"); @@ -192,7 +233,7 @@ public class VersionedStatsRegionEntryOffHeapIntKey extends VersionedStatsRegion "missCount"); @Override - public final long getLastAccessed() throws InternalStatisticsDisabledException { + public long getLastAccessed() throws InternalStatisticsDisabledException { return this.lastAccessed; } @@ -201,12 +242,12 @@ public class VersionedStatsRegionEntryOffHeapIntKey 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; } @@ -219,14 +260,15 @@ public class VersionedStatsRegionEntryOffHeapIntKey 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; @@ -238,7 +280,10 @@ public class VersionedStatsRegionEntryOffHeapIntKey extends VersionedStatsRegion return true; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // versioned code private VersionSource memberID; private short entryVersionLowBytes; @@ -255,6 +300,7 @@ public class VersionedStatsRegionEntryOffHeapIntKey extends VersionedStatsRegion return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -272,6 +318,7 @@ public class VersionedStatsRegionEntryOffHeapIntKey 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(); @@ -301,6 +348,7 @@ public class VersionedStatsRegionEntryOffHeapIntKey extends VersionedStatsRegion } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public VersionTag asVersionTag() { VersionTag tag = VersionTag.create(memberID); tag.setEntryVersion(getEntryVersion()); @@ -333,12 +381,17 @@ public class VersionedStatsRegionEntryOffHeapIntKey extends VersionedStatsRegion 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; } @@ -349,5 +402,8 @@ public class VersionedStatsRegionEntryOffHeapIntKey extends VersionedStatsRegion } 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/VersionedStatsRegionEntryOffHeapLongKey.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapLongKey.java index 8acd7a7..9cafe9d 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapLongKey.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapLongKey.java @@ -15,46 +15,74 @@ 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.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 +// 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 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 VersionedStatsRegionEntryOffHeapLongKey extends VersionedStatsRegionEntryOffHeap { public VersionedStatsRegionEntryOffHeapLongKey(RegionEntryContext context, long 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; @@ -63,6 +91,7 @@ public class VersionedStatsRegionEntryOffHeapLongKey extends VersionedStatsRegio private static final AtomicLongFieldUpdater<VersionedStatsRegionEntryOffHeapLongKey> lastModifiedUpdater = AtomicLongFieldUpdater.newUpdater(VersionedStatsRegionEntryOffHeapLongKey.class, "lastModified"); + /** * All access done using ohAddrUpdater so it is used even though the compiler can not tell it is. */ @@ -93,13 +122,19 @@ public class VersionedStatsRegionEntryOffHeapLongKey extends VersionedStatsRegio // 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); } @@ -115,7 +150,9 @@ public class VersionedStatsRegionEntryOffHeapLongKey extends VersionedStatsRegio } @Override + @Released + public void release() { OffHeapRegionEntryHelper.releaseEntry(this); } @@ -139,7 +176,7 @@ public class VersionedStatsRegionEntryOffHeapLongKey extends VersionedStatsRegio /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -150,21 +187,24 @@ public class VersionedStatsRegionEntryOffHeapLongKey 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(); @@ -174,7 +214,7 @@ public class VersionedStatsRegionEntryOffHeapLongKey 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); @@ -184,6 +224,7 @@ public class VersionedStatsRegionEntryOffHeapLongKey extends VersionedStatsRegio private volatile long lastAccessed; private volatile int hitCount; private volatile int missCount; + private static final AtomicIntegerFieldUpdater<VersionedStatsRegionEntryOffHeapLongKey> hitCountUpdater = AtomicIntegerFieldUpdater.newUpdater(VersionedStatsRegionEntryOffHeapLongKey.class, "hitCount"); @@ -192,7 +233,7 @@ public class VersionedStatsRegionEntryOffHeapLongKey extends VersionedStatsRegio "missCount"); @Override - public final long getLastAccessed() throws InternalStatisticsDisabledException { + public long getLastAccessed() throws InternalStatisticsDisabledException { return this.lastAccessed; } @@ -201,12 +242,12 @@ public class VersionedStatsRegionEntryOffHeapLongKey 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; } @@ -219,14 +260,15 @@ public class VersionedStatsRegionEntryOffHeapLongKey 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; @@ -238,7 +280,10 @@ public class VersionedStatsRegionEntryOffHeapLongKey extends VersionedStatsRegio return true; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // versioned code private VersionSource memberID; private short entryVersionLowBytes; @@ -255,6 +300,7 @@ public class VersionedStatsRegionEntryOffHeapLongKey extends VersionedStatsRegio return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -272,6 +318,7 @@ public class VersionedStatsRegionEntryOffHeapLongKey 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(); @@ -301,6 +348,7 @@ public class VersionedStatsRegionEntryOffHeapLongKey extends VersionedStatsRegio } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public VersionTag asVersionTag() { VersionTag tag = VersionTag.create(memberID); tag.setEntryVersion(getEntryVersion()); @@ -333,12 +381,15 @@ public class VersionedStatsRegionEntryOffHeapLongKey extends VersionedStatsRegio 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; } @@ -349,5 +400,8 @@ public class VersionedStatsRegionEntryOffHeapLongKey extends VersionedStatsRegio } 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/VersionedStatsRegionEntryOffHeapObjectKey.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapObjectKey.java index c0c6705..a9fceeb 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapObjectKey.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapObjectKey.java @@ -15,46 +15,74 @@ 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.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 +// 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). */ public class VersionedStatsRegionEntryOffHeapObjectKey extends VersionedStatsRegionEntryOffHeap { public VersionedStatsRegionEntryOffHeapObjectKey(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; @@ -63,6 +91,7 @@ public class VersionedStatsRegionEntryOffHeapObjectKey extends VersionedStatsReg private static final AtomicLongFieldUpdater<VersionedStatsRegionEntryOffHeapObjectKey> lastModifiedUpdater = AtomicLongFieldUpdater.newUpdater(VersionedStatsRegionEntryOffHeapObjectKey.class, "lastModified"); + /** * All access done using ohAddrUpdater so it is used even though the compiler can not tell it is. */ @@ -94,13 +123,19 @@ public class VersionedStatsRegionEntryOffHeapObjectKey extends VersionedStatsReg // 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); } @@ -116,7 +151,9 @@ public class VersionedStatsRegionEntryOffHeapObjectKey extends VersionedStatsReg } @Override + @Released + public void release() { OffHeapRegionEntryHelper.releaseEntry(this); } @@ -140,7 +177,7 @@ public class VersionedStatsRegionEntryOffHeapObjectKey extends VersionedStatsReg /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -151,21 +188,24 @@ public class VersionedStatsRegionEntryOffHeapObjectKey extends VersionedStatsReg /** * @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(); @@ -175,7 +215,7 @@ public class VersionedStatsRegionEntryOffHeapObjectKey extends VersionedStatsReg } @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); @@ -185,6 +225,7 @@ public class VersionedStatsRegionEntryOffHeapObjectKey extends VersionedStatsReg private volatile long lastAccessed; private volatile int hitCount; private volatile int missCount; + private static final AtomicIntegerFieldUpdater<VersionedStatsRegionEntryOffHeapObjectKey> hitCountUpdater = AtomicIntegerFieldUpdater.newUpdater(VersionedStatsRegionEntryOffHeapObjectKey.class, "hitCount"); @@ -193,7 +234,7 @@ public class VersionedStatsRegionEntryOffHeapObjectKey extends VersionedStatsReg "missCount"); @Override - public final long getLastAccessed() throws InternalStatisticsDisabledException { + public long getLastAccessed() throws InternalStatisticsDisabledException { return this.lastAccessed; } @@ -202,12 +243,12 @@ public class VersionedStatsRegionEntryOffHeapObjectKey extends VersionedStatsReg } @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; } @@ -220,14 +261,15 @@ public class VersionedStatsRegionEntryOffHeapObjectKey extends VersionedStatsReg } @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; @@ -239,7 +281,10 @@ public class VersionedStatsRegionEntryOffHeapObjectKey extends VersionedStatsReg return true; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // versioned code private VersionSource memberID; private short entryVersionLowBytes; @@ -256,6 +301,7 @@ public class VersionedStatsRegionEntryOffHeapObjectKey extends VersionedStatsReg return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -273,6 +319,7 @@ public class VersionedStatsRegionEntryOffHeapObjectKey extends VersionedStatsReg } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public void setVersions(VersionTag tag) { this.memberID = tag.getMemberID(); int eVersion = tag.getEntryVersion(); @@ -302,6 +349,7 @@ public class VersionedStatsRegionEntryOffHeapObjectKey extends VersionedStatsReg } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public VersionTag asVersionTag() { VersionTag tag = VersionTag.create(memberID); tag.setEntryVersion(getEntryVersion()); @@ -334,13 +382,19 @@ public class VersionedStatsRegionEntryOffHeapObjectKey extends VersionedStatsReg 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/VersionedStatsRegionEntryOffHeapStringKey1.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapStringKey1.java index 66e8b8b..0832fc1 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapStringKey1.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapStringKey1.java @@ -15,42 +15,66 @@ 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.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 +// 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). */ public class VersionedStatsRegionEntryOffHeapStringKey1 extends VersionedStatsRegionEntryOffHeap { public VersionedStatsRegionEntryOffHeapStringKey1(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) { @@ -69,9 +93,11 @@ public class VersionedStatsRegionEntryOffHeapStringKey1 extends VersionedStatsRe } 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; @@ -80,6 +106,7 @@ public class VersionedStatsRegionEntryOffHeapStringKey1 extends VersionedStatsRe private static final AtomicLongFieldUpdater<VersionedStatsRegionEntryOffHeapStringKey1> lastModifiedUpdater = AtomicLongFieldUpdater.newUpdater(VersionedStatsRegionEntryOffHeapStringKey1.class, "lastModified"); + /** * All access done using ohAddrUpdater so it is used even though the compiler can not tell it is. */ @@ -111,13 +138,19 @@ public class VersionedStatsRegionEntryOffHeapStringKey1 extends VersionedStatsRe // 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); } @@ -133,7 +166,9 @@ public class VersionedStatsRegionEntryOffHeapStringKey1 extends VersionedStatsRe } @Override + @Released + public void release() { OffHeapRegionEntryHelper.releaseEntry(this); } @@ -157,7 +192,7 @@ public class VersionedStatsRegionEntryOffHeapStringKey1 extends VersionedStatsRe /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -168,21 +203,24 @@ public class VersionedStatsRegionEntryOffHeapStringKey1 extends VersionedStatsRe /** * @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(); @@ -192,7 +230,7 @@ public class VersionedStatsRegionEntryOffHeapStringKey1 extends VersionedStatsRe } @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); @@ -202,6 +240,7 @@ public class VersionedStatsRegionEntryOffHeapStringKey1 extends VersionedStatsRe private volatile long lastAccessed; private volatile int hitCount; private volatile int missCount; + private static final AtomicIntegerFieldUpdater<VersionedStatsRegionEntryOffHeapStringKey1> hitCountUpdater = AtomicIntegerFieldUpdater.newUpdater(VersionedStatsRegionEntryOffHeapStringKey1.class, "hitCount"); @@ -210,7 +249,7 @@ public class VersionedStatsRegionEntryOffHeapStringKey1 extends VersionedStatsRe "missCount"); @Override - public final long getLastAccessed() throws InternalStatisticsDisabledException { + public long getLastAccessed() throws InternalStatisticsDisabledException { return this.lastAccessed; } @@ -219,12 +258,12 @@ public class VersionedStatsRegionEntryOffHeapStringKey1 extends VersionedStatsRe } @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; } @@ -237,14 +276,15 @@ public class VersionedStatsRegionEntryOffHeapStringKey1 extends VersionedStatsRe } @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; @@ -256,7 +296,10 @@ public class VersionedStatsRegionEntryOffHeapStringKey1 extends VersionedStatsRe return true; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // versioned code private VersionSource memberID; private short entryVersionLowBytes; @@ -273,6 +316,7 @@ public class VersionedStatsRegionEntryOffHeapStringKey1 extends VersionedStatsRe return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -290,6 +334,7 @@ public class VersionedStatsRegionEntryOffHeapStringKey1 extends VersionedStatsRe } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public void setVersions(VersionTag tag) { this.memberID = tag.getMemberID(); int eVersion = tag.getEntryVersion(); @@ -319,6 +364,7 @@ public class VersionedStatsRegionEntryOffHeapStringKey1 extends VersionedStatsRe } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public VersionTag asVersionTag() { VersionTag tag = VersionTag.create(memberID); tag.setEntryVersion(getEntryVersion()); @@ -351,8 +397,11 @@ public class VersionedStatsRegionEntryOffHeapStringKey1 extends VersionedStatsRe return this.regionVersionLowBytes; } + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // key code + private final long bits1; private int getKeyLength() { @@ -366,7 +415,7 @@ public class VersionedStatsRegionEntryOffHeapStringKey1 extends VersionedStatsRe } @Override - public final Object getKey() { + public Object getKey() { int keylen = getKeyLength(); char[] chars = new char[keylen]; long tmpBits1 = this.bits1; @@ -385,6 +434,7 @@ public class VersionedStatsRegionEntryOffHeapStringKey1 extends VersionedStatsRe } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + @Override public boolean isKeyEqual(Object k) { if (k instanceof String) { @@ -414,5 +464,8 @@ public class VersionedStatsRegionEntryOffHeapStringKey1 extends VersionedStatsRe } 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/VersionedStatsRegionEntryOffHeapStringKey2.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapStringKey2.java index af2e1a0..dbccb16 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapStringKey2.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapStringKey2.java @@ -15,42 +15,66 @@ 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.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 +// 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). */ public class VersionedStatsRegionEntryOffHeapStringKey2 extends VersionedStatsRegionEntryOffHeap { public VersionedStatsRegionEntryOffHeapStringKey2(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; @@ -81,9 +105,11 @@ public class VersionedStatsRegionEntryOffHeapStringKey2 extends VersionedStatsRe 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; @@ -92,6 +118,7 @@ public class VersionedStatsRegionEntryOffHeapStringKey2 extends VersionedStatsRe private static final AtomicLongFieldUpdater<VersionedStatsRegionEntryOffHeapStringKey2> lastModifiedUpdater = AtomicLongFieldUpdater.newUpdater(VersionedStatsRegionEntryOffHeapStringKey2.class, "lastModified"); + /** * All access done using ohAddrUpdater so it is used even though the compiler can not tell it is. */ @@ -123,13 +150,19 @@ public class VersionedStatsRegionEntryOffHeapStringKey2 extends VersionedStatsRe // 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); } @@ -145,7 +178,9 @@ public class VersionedStatsRegionEntryOffHeapStringKey2 extends VersionedStatsRe } @Override + @Released + public void release() { OffHeapRegionEntryHelper.releaseEntry(this); } @@ -169,7 +204,7 @@ public class VersionedStatsRegionEntryOffHeapStringKey2 extends VersionedStatsRe /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -180,21 +215,24 @@ public class VersionedStatsRegionEntryOffHeapStringKey2 extends VersionedStatsRe /** * @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(); @@ -204,7 +242,7 @@ public class VersionedStatsRegionEntryOffHeapStringKey2 extends VersionedStatsRe } @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); @@ -214,6 +252,7 @@ public class VersionedStatsRegionEntryOffHeapStringKey2 extends VersionedStatsRe private volatile long lastAccessed; private volatile int hitCount; private volatile int missCount; + private static final AtomicIntegerFieldUpdater<VersionedStatsRegionEntryOffHeapStringKey2> hitCountUpdater = AtomicIntegerFieldUpdater.newUpdater(VersionedStatsRegionEntryOffHeapStringKey2.class, "hitCount"); @@ -222,7 +261,7 @@ public class VersionedStatsRegionEntryOffHeapStringKey2 extends VersionedStatsRe "missCount"); @Override - public final long getLastAccessed() throws InternalStatisticsDisabledException { + public long getLastAccessed() throws InternalStatisticsDisabledException { return this.lastAccessed; } @@ -231,12 +270,12 @@ public class VersionedStatsRegionEntryOffHeapStringKey2 extends VersionedStatsRe } @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; } @@ -249,14 +288,15 @@ public class VersionedStatsRegionEntryOffHeapStringKey2 extends VersionedStatsRe } @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; @@ -268,7 +308,10 @@ public class VersionedStatsRegionEntryOffHeapStringKey2 extends VersionedStatsRe return true; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // versioned code private VersionSource memberID; private short entryVersionLowBytes; @@ -285,6 +328,7 @@ public class VersionedStatsRegionEntryOffHeapStringKey2 extends VersionedStatsRe return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -302,6 +346,7 @@ public class VersionedStatsRegionEntryOffHeapStringKey2 extends VersionedStatsRe } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public void setVersions(VersionTag tag) { this.memberID = tag.getMemberID(); int eVersion = tag.getEntryVersion(); @@ -331,6 +376,7 @@ public class VersionedStatsRegionEntryOffHeapStringKey2 extends VersionedStatsRe } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public VersionTag asVersionTag() { VersionTag tag = VersionTag.create(memberID); tag.setEntryVersion(getEntryVersion()); @@ -363,8 +409,11 @@ public class VersionedStatsRegionEntryOffHeapStringKey2 extends VersionedStatsRe 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. @@ -383,7 +432,7 @@ public class VersionedStatsRegionEntryOffHeapStringKey2 extends VersionedStatsRe } @Override - public final Object getKey() { + public Object getKey() { int keylen = getKeyLength(); char[] chars = new char[keylen]; long tmpBits1 = this.bits1; @@ -413,6 +462,7 @@ public class VersionedStatsRegionEntryOffHeapStringKey2 extends VersionedStatsRe } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + @Override public boolean isKeyEqual(Object k) { if (k instanceof String) { @@ -455,5 +505,7 @@ public class VersionedStatsRegionEntryOffHeapStringKey2 extends VersionedStatsRe } 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/VersionedStatsRegionEntryOffHeapUUIDKey.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapUUIDKey.java index 6985727..f367421 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapUUIDKey.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedStatsRegionEntryOffHeapUUIDKey.java @@ -15,48 +15,75 @@ 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.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.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 +// 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). */ public class VersionedStatsRegionEntryOffHeapUUIDKey extends VersionedStatsRegionEntryOffHeap { public VersionedStatsRegionEntryOffHeapUUIDKey(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; @@ -65,6 +92,7 @@ public class VersionedStatsRegionEntryOffHeapUUIDKey extends VersionedStatsRegio private static final AtomicLongFieldUpdater<VersionedStatsRegionEntryOffHeapUUIDKey> lastModifiedUpdater = AtomicLongFieldUpdater.newUpdater(VersionedStatsRegionEntryOffHeapUUIDKey.class, "lastModified"); + /** * All access done using ohAddrUpdater so it is used even though the compiler can not tell it is. */ @@ -95,13 +123,19 @@ public class VersionedStatsRegionEntryOffHeapUUIDKey extends VersionedStatsRegio // 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); } @@ -117,7 +151,9 @@ public class VersionedStatsRegionEntryOffHeapUUIDKey extends VersionedStatsRegio } @Override + @Released + public void release() { OffHeapRegionEntryHelper.releaseEntry(this); } @@ -141,7 +177,7 @@ public class VersionedStatsRegionEntryOffHeapUUIDKey extends VersionedStatsRegio /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -152,21 +188,24 @@ public class VersionedStatsRegionEntryOffHeapUUIDKey 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(); @@ -176,7 +215,7 @@ public class VersionedStatsRegionEntryOffHeapUUIDKey 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); @@ -186,6 +225,7 @@ public class VersionedStatsRegionEntryOffHeapUUIDKey extends VersionedStatsRegio private volatile long lastAccessed; private volatile int hitCount; private volatile int missCount; + private static final AtomicIntegerFieldUpdater<VersionedStatsRegionEntryOffHeapUUIDKey> hitCountUpdater = AtomicIntegerFieldUpdater.newUpdater(VersionedStatsRegionEntryOffHeapUUIDKey.class, "hitCount"); @@ -194,7 +234,7 @@ public class VersionedStatsRegionEntryOffHeapUUIDKey extends VersionedStatsRegio "missCount"); @Override - public final long getLastAccessed() throws InternalStatisticsDisabledException { + public long getLastAccessed() throws InternalStatisticsDisabledException { return this.lastAccessed; } @@ -203,12 +243,12 @@ public class VersionedStatsRegionEntryOffHeapUUIDKey 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; } @@ -221,14 +261,15 @@ public class VersionedStatsRegionEntryOffHeapUUIDKey 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; @@ -240,7 +281,10 @@ public class VersionedStatsRegionEntryOffHeapUUIDKey extends VersionedStatsRegio return true; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // versioned code private VersionSource memberID; private short entryVersionLowBytes; @@ -257,6 +301,7 @@ public class VersionedStatsRegionEntryOffHeapUUIDKey extends VersionedStatsRegio return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -274,6 +319,7 @@ public class VersionedStatsRegionEntryOffHeapUUIDKey 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(); @@ -303,6 +349,7 @@ public class VersionedStatsRegionEntryOffHeapUUIDKey extends VersionedStatsRegio } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public VersionTag asVersionTag() { VersionTag tag = VersionTag.create(memberID); tag.setEntryVersion(getEntryVersion()); @@ -335,13 +382,16 @@ public class VersionedStatsRegionEntryOffHeapUUIDKey extends VersionedStatsRegio 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); } @@ -354,5 +404,8 @@ public class VersionedStatsRegionEntryOffHeapUUIDKey extends VersionedStatsRegio } 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/VersionedThinDiskLRURegionEntryHeapIntKey.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapIntKey.java index 405dac5..76fbcae 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapIntKey.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryHeapIntKey.java @@ -15,46 +15,76 @@ 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.cache.persistence.DiskRecoveryStore; + 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.util.concurrent.CustomEntryConcurrentHashMap.HashEntry; // macros whose definition changes this class: -// disk: DISK -// lru: LRU +// disk: 1 +// lru: 1 // stats: STATS -// versioned: VERSIONED +// 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 VersionedThinDiskLRURegionEntryHeapIntKey extends VersionedThinDiskLRURegionEntryHeap { public VersionedThinDiskLRURegionEntryHeapIntKey(RegionEntryContext context, int key, - Object value) { - super(context, (value instanceof RecoveredEntry ? null : value)); + + + + Object value + + + + ) { + super(context, + + (value instanceof RecoveredEntry ? null : value) + + + + ); // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + initialize(context, value); + + + this.key = key; + } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // common code protected int hash; private HashEntry<Object, Object> next; @@ -63,10 +93,11 @@ public class VersionedThinDiskLRURegionEntryHeapIntKey extends VersionedThinDisk private static final AtomicLongFieldUpdater<VersionedThinDiskLRURegionEntryHeapIntKey> lastModifiedUpdater = AtomicLongFieldUpdater.newUpdater(VersionedThinDiskLRURegionEntryHeapIntKey.class, "lastModified"); + private volatile Object value; @Override - protected final Object getValueField() { + protected Object getValueField() { return this.value; } @@ -86,7 +117,7 @@ public class VersionedThinDiskLRURegionEntryHeapIntKey extends VersionedThinDisk /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -97,19 +128,22 @@ public class VersionedThinDiskLRURegionEntryHeapIntKey extends VersionedThinDisk /** * @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 + // disk code + protected void initialize(RegionEntryContext drs, Object value) { boolean isBackup; if (drs instanceof LocalRegion) { @@ -126,7 +160,7 @@ public class VersionedThinDiskLRURegionEntryHeapIntKey extends VersionedThinDisk } @Override - public final synchronized int updateAsyncEntrySize(EnableLRU capacityController) { + public synchronized int updateAsyncEntrySize(EnableLRU capacityController) { int oldSize = getEntrySize(); int newSize = capacityController.entrySize(getKeyForSizing(), null); setEntrySize(newSize); @@ -134,7 +168,9 @@ public class VersionedThinDiskLRURegionEntryHeapIntKey extends VersionedThinDisk return delta; } + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + private void diskInitialize(RegionEntryContext context, Object value) { DiskRecoveryStore drs = (DiskRecoveryStore) context; DiskStoreImpl ds = drs.getDiskStore(); @@ -159,7 +195,6 @@ public class VersionedThinDiskLRURegionEntryHeapIntKey extends VersionedThinDisk void setDiskId(RegionEntry old) { this.id = ((AbstractDiskRegionEntry) old).getDiskId(); } - // // inlining DiskId // // always have these fields // /** @@ -199,105 +234,110 @@ public class VersionedThinDiskLRURegionEntryHeapIntKey extends VersionedThinDisk // // persistent // /** unique entry identifier * */ // private long keyId; + + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // lru code @Override public void setDelayedDiskId(LocalRegion r) { + DiskStoreImpl ds = r.getDiskStore(); long maxOplogSize = ds.getMaxOplogSize(); this.id = DiskId.createDiskId(maxOplogSize, false /* over flow only */, ds.needsLinkedList()); + + + } - 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 + // versioned code private VersionSource memberID; private short entryVersionLowBytes; @@ -314,6 +354,7 @@ public class VersionedThinDiskLRURegionEntryHeapIntKey extends VersionedThinDisk return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -331,6 +372,7 @@ public class VersionedThinDiskLRURegionEntryHeapIntKey extends VersionedThinDisk } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public void setVersions(VersionTag tag) { this.memberID = tag.getMemberID(); int eVersion = tag.getEntryVersion(); @@ -360,6 +402,7 @@ public class VersionedThinDiskLRURegionEntryHeapIntKey extends VersionedThinDisk } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public VersionTag asVersionTag() { VersionTag tag = VersionTag.create(memberID); tag.setEntryVersion(getEntryVersion()); @@ -392,12 +435,17 @@ public class VersionedThinDiskLRURegionEntryHeapIntKey extends VersionedThinDisk 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; } @@ -408,5 +456,8 @@ public class VersionedThinDiskLRURegionEntryHeapIntKey extends VersionedThinDisk } return false; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp } +
