You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ud...@apache.org on 2017/05/22 18:29:20 UTC
[24/69] [abbrv] geode git commit: GEODE-2929: remove superfluous uses
of final from internal classes
http://git-wip-us.apache.org/repos/asf/geode/blob/a4458531/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapStringKey2.java
index 2d4a4bb..a36ce1f 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapStringKey2.java
@@ -15,18 +15,26 @@
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.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.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
// macros whose definition changes this class:
// disk: DISK
-// lru: LRU
-// stats: STATS
+// lru: 1
+// stats: 1
// versioned: VERSIONED
// offheap: OFFHEAP
// One of the following key macros must be defined:
@@ -35,16 +43,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 VMStatsLRURegionEntryHeapStringKey2 extends VMStatsLRURegionEntryHeap {
- public VMStatsLRURegionEntryHeapStringKey2(RegionEntryContext context, String key, Object value,
- boolean byteEncode) {
- super(context, value);
+ public VMStatsLRURegionEntryHeapStringKey2(RegionEntryContext context, String key,
+
+
+
+ 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;
@@ -75,9 +98,11 @@ public class VMStatsLRURegionEntryHeapStringKey2 extends VMStatsLRURegionEntryHe
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;
@@ -85,10 +110,11 @@ public class VMStatsLRURegionEntryHeapStringKey2 extends VMStatsLRURegionEntryHe
private volatile long lastModified;
private static final AtomicLongFieldUpdater<VMStatsLRURegionEntryHeapStringKey2> lastModifiedUpdater =
AtomicLongFieldUpdater.newUpdater(VMStatsLRURegionEntryHeapStringKey2.class, "lastModified");
+
private volatile Object value;
@Override
- protected final Object getValueField() {
+ protected Object getValueField() {
return this.value;
}
@@ -108,7 +134,7 @@ public class VMStatsLRURegionEntryHeapStringKey2 extends VMStatsLRURegionEntryHe
/**
* @see HashEntry#getEntryHash()
*/
- public final int getEntryHash() {
+ public int getEntryHash() {
return this.hash;
}
@@ -119,117 +145,121 @@ public class VMStatsLRURegionEntryHeapStringKey2 extends VMStatsLRURegionEntryHe
/**
* @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();
@@ -239,7 +269,7 @@ public class VMStatsLRURegionEntryHeapStringKey2 extends VMStatsLRURegionEntryHe
}
@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);
@@ -249,13 +279,14 @@ public class VMStatsLRURegionEntryHeapStringKey2 extends VMStatsLRURegionEntryHe
private volatile long lastAccessed;
private volatile int hitCount;
private volatile int missCount;
+
private static final AtomicIntegerFieldUpdater<VMStatsLRURegionEntryHeapStringKey2> hitCountUpdater =
AtomicIntegerFieldUpdater.newUpdater(VMStatsLRURegionEntryHeapStringKey2.class, "hitCount");
private static final AtomicIntegerFieldUpdater<VMStatsLRURegionEntryHeapStringKey2> missCountUpdater =
AtomicIntegerFieldUpdater.newUpdater(VMStatsLRURegionEntryHeapStringKey2.class, "missCount");
@Override
- public final long getLastAccessed() throws InternalStatisticsDisabledException {
+ public long getLastAccessed() throws InternalStatisticsDisabledException {
return this.lastAccessed;
}
@@ -264,12 +295,12 @@ public class VMStatsLRURegionEntryHeapStringKey2 extends VMStatsLRURegionEntryHe
}
@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;
}
@@ -282,14 +313,15 @@ public class VMStatsLRURegionEntryHeapStringKey2 extends VMStatsLRURegionEntryHe
}
@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;
@@ -301,8 +333,12 @@ public class VMStatsLRURegionEntryHeapStringKey2 extends VMStatsLRURegionEntryHe
return true;
}
+
+
// 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.
@@ -321,7 +357,7 @@ public class VMStatsLRURegionEntryHeapStringKey2 extends VMStatsLRURegionEntryHe
}
@Override
- public final Object getKey() {
+ public Object getKey() {
int keylen = getKeyLength();
char[] chars = new char[keylen];
long tmpBits1 = this.bits1;
@@ -351,6 +387,7 @@ public class VMStatsLRURegionEntryHeapStringKey2 extends VMStatsLRURegionEntryHe
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
@Override
public boolean isKeyEqual(Object k) {
if (k instanceof String) {
@@ -393,5 +430,7 @@ public class VMStatsLRURegionEntryHeapStringKey2 extends VMStatsLRURegionEntryHe
}
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/VMStatsLRURegionEntryHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapUUIDKey.java
index 9a15385..e22bb15 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryHeapUUIDKey.java
@@ -15,41 +15,68 @@
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.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.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
// macros whose definition changes this class:
// disk: DISK
-// lru: LRU
-// stats: STATS
+// lru: 1
+// stats: 1
// versioned: VERSIONED
// 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 VMStatsLRURegionEntryHeapUUIDKey extends VMStatsLRURegionEntryHeap {
- public VMStatsLRURegionEntryHeapUUIDKey(RegionEntryContext context, UUID key, Object value) {
- super(context, value);
+ public VMStatsLRURegionEntryHeapUUIDKey(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;
@@ -57,10 +84,11 @@ public class VMStatsLRURegionEntryHeapUUIDKey extends VMStatsLRURegionEntryHeap
private volatile long lastModified;
private static final AtomicLongFieldUpdater<VMStatsLRURegionEntryHeapUUIDKey> lastModifiedUpdater =
AtomicLongFieldUpdater.newUpdater(VMStatsLRURegionEntryHeapUUIDKey.class, "lastModified");
+
private volatile Object value;
@Override
- protected final Object getValueField() {
+ protected Object getValueField() {
return this.value;
}
@@ -80,7 +108,7 @@ public class VMStatsLRURegionEntryHeapUUIDKey extends VMStatsLRURegionEntryHeap
/**
* @see HashEntry#getEntryHash()
*/
- public final int getEntryHash() {
+ public int getEntryHash() {
return this.hash;
}
@@ -91,117 +119,121 @@ public class VMStatsLRURegionEntryHeapUUIDKey extends VMStatsLRURegionEntryHeap
/**
* @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();
@@ -211,7 +243,7 @@ public class VMStatsLRURegionEntryHeapUUIDKey extends VMStatsLRURegionEntryHeap
}
@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);
@@ -221,13 +253,14 @@ public class VMStatsLRURegionEntryHeapUUIDKey extends VMStatsLRURegionEntryHeap
private volatile long lastAccessed;
private volatile int hitCount;
private volatile int missCount;
+
private static final AtomicIntegerFieldUpdater<VMStatsLRURegionEntryHeapUUIDKey> hitCountUpdater =
AtomicIntegerFieldUpdater.newUpdater(VMStatsLRURegionEntryHeapUUIDKey.class, "hitCount");
private static final AtomicIntegerFieldUpdater<VMStatsLRURegionEntryHeapUUIDKey> missCountUpdater =
AtomicIntegerFieldUpdater.newUpdater(VMStatsLRURegionEntryHeapUUIDKey.class, "missCount");
@Override
- public final long getLastAccessed() throws InternalStatisticsDisabledException {
+ public long getLastAccessed() throws InternalStatisticsDisabledException {
return this.lastAccessed;
}
@@ -236,12 +269,12 @@ public class VMStatsLRURegionEntryHeapUUIDKey extends VMStatsLRURegionEntryHeap
}
@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;
}
@@ -254,14 +287,15 @@ public class VMStatsLRURegionEntryHeapUUIDKey extends VMStatsLRURegionEntryHeap
}
@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;
@@ -273,13 +307,17 @@ public class VMStatsLRURegionEntryHeapUUIDKey extends VMStatsLRURegionEntryHeap
return true;
}
+
+
// 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);
}
@@ -292,5 +330,8 @@ public class VMStatsLRURegionEntryHeapUUIDKey extends VMStatsLRURegionEntryHeap
}
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/VMStatsLRURegionEntryOffHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapIntKey.java
index c6a7919..d01167b 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapIntKey.java
@@ -15,44 +15,72 @@
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.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.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
+// lru: 1
+// stats: 1
// versioned: VERSIONED
-// offheap: OFFHEAP
+// 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 VMStatsLRURegionEntryOffHeapIntKey extends VMStatsLRURegionEntryOffHeap {
public VMStatsLRURegionEntryOffHeapIntKey(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;
@@ -60,6 +88,7 @@ public class VMStatsLRURegionEntryOffHeapIntKey extends VMStatsLRURegionEntryOff
private volatile long lastModified;
private static final AtomicLongFieldUpdater<VMStatsLRURegionEntryOffHeapIntKey> lastModifiedUpdater =
AtomicLongFieldUpdater.newUpdater(VMStatsLRURegionEntryOffHeapIntKey.class, "lastModified");
+
/**
* All access done using ohAddrUpdater so it is used even though the compiler can not tell it is.
*/
@@ -90,13 +119,19 @@ public class VMStatsLRURegionEntryOffHeapIntKey extends VMStatsLRURegionEntryOff
// 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);
}
@@ -112,7 +147,9 @@ public class VMStatsLRURegionEntryOffHeapIntKey extends VMStatsLRURegionEntryOff
}
@Override
+
@Released
+
public void release() {
OffHeapRegionEntryHelper.releaseEntry(this);
}
@@ -136,7 +173,7 @@ public class VMStatsLRURegionEntryOffHeapIntKey extends VMStatsLRURegionEntryOff
/**
* @see HashEntry#getEntryHash()
*/
- public final int getEntryHash() {
+ public int getEntryHash() {
return this.hash;
}
@@ -147,117 +184,121 @@ public class VMStatsLRURegionEntryOffHeapIntKey extends VMStatsLRURegionEntryOff
/**
* @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();
@@ -267,7 +308,7 @@ public class VMStatsLRURegionEntryOffHeapIntKey extends VMStatsLRURegionEntryOff
}
@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);
@@ -277,13 +318,14 @@ public class VMStatsLRURegionEntryOffHeapIntKey extends VMStatsLRURegionEntryOff
private volatile long lastAccessed;
private volatile int hitCount;
private volatile int missCount;
+
private static final AtomicIntegerFieldUpdater<VMStatsLRURegionEntryOffHeapIntKey> hitCountUpdater =
AtomicIntegerFieldUpdater.newUpdater(VMStatsLRURegionEntryOffHeapIntKey.class, "hitCount");
private static final AtomicIntegerFieldUpdater<VMStatsLRURegionEntryOffHeapIntKey> missCountUpdater =
AtomicIntegerFieldUpdater.newUpdater(VMStatsLRURegionEntryOffHeapIntKey.class, "missCount");
@Override
- public final long getLastAccessed() throws InternalStatisticsDisabledException {
+ public long getLastAccessed() throws InternalStatisticsDisabledException {
return this.lastAccessed;
}
@@ -292,12 +334,12 @@ public class VMStatsLRURegionEntryOffHeapIntKey extends VMStatsLRURegionEntryOff
}
@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;
}
@@ -310,14 +352,15 @@ public class VMStatsLRURegionEntryOffHeapIntKey extends VMStatsLRURegionEntryOff
}
@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;
@@ -329,12 +372,18 @@ public class VMStatsLRURegionEntryOffHeapIntKey extends VMStatsLRURegionEntryOff
return true;
}
+
+
// 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;
}
@@ -345,5 +394,8 @@ public class VMStatsLRURegionEntryOffHeapIntKey extends VMStatsLRURegionEntryOff
}
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/VMStatsLRURegionEntryOffHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapLongKey.java
index 8e06b0f..51747da 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapLongKey.java
@@ -15,44 +15,72 @@
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.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.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
+// lru: 1
+// stats: 1
// versioned: VERSIONED
-// offheap: OFFHEAP
+// 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 VMStatsLRURegionEntryOffHeapLongKey extends VMStatsLRURegionEntryOffHeap {
public VMStatsLRURegionEntryOffHeapLongKey(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;
@@ -60,6 +88,7 @@ public class VMStatsLRURegionEntryOffHeapLongKey extends VMStatsLRURegionEntryOf
private volatile long lastModified;
private static final AtomicLongFieldUpdater<VMStatsLRURegionEntryOffHeapLongKey> lastModifiedUpdater =
AtomicLongFieldUpdater.newUpdater(VMStatsLRURegionEntryOffHeapLongKey.class, "lastModified");
+
/**
* All access done using ohAddrUpdater so it is used even though the compiler can not tell it is.
*/
@@ -90,13 +119,19 @@ public class VMStatsLRURegionEntryOffHeapLongKey extends VMStatsLRURegionEntryOf
// 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);
}
@@ -112,7 +147,9 @@ public class VMStatsLRURegionEntryOffHeapLongKey extends VMStatsLRURegionEntryOf
}
@Override
+
@Released
+
public void release() {
OffHeapRegionEntryHelper.releaseEntry(this);
}
@@ -136,7 +173,7 @@ public class VMStatsLRURegionEntryOffHeapLongKey extends VMStatsLRURegionEntryOf
/**
* @see HashEntry#getEntryHash()
*/
- public final int getEntryHash() {
+ public int getEntryHash() {
return this.hash;
}
@@ -147,117 +184,121 @@ public class VMStatsLRURegionEntryOffHeapLongKey extends VMStatsLRURegionEntryOf
/**
* @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();
@@ -267,7 +308,7 @@ public class VMStatsLRURegionEntryOffHeapLongKey extends VMStatsLRURegionEntryOf
}
@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);
@@ -277,13 +318,14 @@ public class VMStatsLRURegionEntryOffHeapLongKey extends VMStatsLRURegionEntryOf
private volatile long lastAccessed;
private volatile int hitCount;
private volatile int missCount;
+
private static final AtomicIntegerFieldUpdater<VMStatsLRURegionEntryOffHeapLongKey> hitCountUpdater =
AtomicIntegerFieldUpdater.newUpdater(VMStatsLRURegionEntryOffHeapLongKey.class, "hitCount");
private static final AtomicIntegerFieldUpdater<VMStatsLRURegionEntryOffHeapLongKey> missCountUpdater =
AtomicIntegerFieldUpdater.newUpdater(VMStatsLRURegionEntryOffHeapLongKey.class, "missCount");
@Override
- public final long getLastAccessed() throws InternalStatisticsDisabledException {
+ public long getLastAccessed() throws InternalStatisticsDisabledException {
return this.lastAccessed;
}
@@ -292,12 +334,12 @@ public class VMStatsLRURegionEntryOffHeapLongKey extends VMStatsLRURegionEntryOf
}
@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;
}
@@ -310,14 +352,15 @@ public class VMStatsLRURegionEntryOffHeapLongKey extends VMStatsLRURegionEntryOf
}
@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;
@@ -329,12 +372,16 @@ public class VMStatsLRURegionEntryOffHeapLongKey extends VMStatsLRURegionEntryOf
return true;
}
+
+
// 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;
}
@@ -345,5 +392,8 @@ public class VMStatsLRURegionEntryOffHeapLongKey extends VMStatsLRURegionEntryOf
}
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/VMStatsLRURegionEntryOffHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapObjectKey.java
index d844110..1c96722 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapObjectKey.java
@@ -15,44 +15,72 @@
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.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.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
+// lru: 1
+// stats: 1
// versioned: VERSIONED
-// offheap: OFFHEAP
+// 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 VMStatsLRURegionEntryOffHeapObjectKey extends VMStatsLRURegionEntryOffHeap {
public VMStatsLRURegionEntryOffHeapObjectKey(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;
@@ -61,6 +89,7 @@ public class VMStatsLRURegionEntryOffHeapObjectKey extends VMStatsLRURegionEntry
private static final AtomicLongFieldUpdater<VMStatsLRURegionEntryOffHeapObjectKey> lastModifiedUpdater =
AtomicLongFieldUpdater.newUpdater(VMStatsLRURegionEntryOffHeapObjectKey.class,
"lastModified");
+
/**
* All access done using ohAddrUpdater so it is used even though the compiler can not tell it is.
*/
@@ -91,13 +120,19 @@ public class VMStatsLRURegionEntryOffHeapObjectKey extends VMStatsLRURegionEntry
// 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);
}
@@ -113,7 +148,9 @@ public class VMStatsLRURegionEntryOffHeapObjectKey extends VMStatsLRURegionEntry
}
@Override
+
@Released
+
public void release() {
OffHeapRegionEntryHelper.releaseEntry(this);
}
@@ -137,7 +174,7 @@ public class VMStatsLRURegionEntryOffHeapObjectKey extends VMStatsLRURegionEntry
/**
* @see HashEntry#getEntryHash()
*/
- public final int getEntryHash() {
+ public int getEntryHash() {
return this.hash;
}
@@ -148,117 +185,121 @@ public class VMStatsLRURegionEntryOffHeapObjectKey extends VMStatsLRURegionEntry
/**
* @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();
@@ -268,7 +309,7 @@ public class VMStatsLRURegionEntryOffHeapObjectKey extends VMStatsLRURegionEntry
}
@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);
@@ -278,6 +319,7 @@ public class VMStatsLRURegionEntryOffHeapObjectKey extends VMStatsLRURegionEntry
private volatile long lastAccessed;
private volatile int hitCount;
private volatile int missCount;
+
private static final AtomicIntegerFieldUpdater<VMStatsLRURegionEntryOffHeapObjectKey> hitCountUpdater =
AtomicIntegerFieldUpdater.newUpdater(VMStatsLRURegionEntryOffHeapObjectKey.class, "hitCount");
private static final AtomicIntegerFieldUpdater<VMStatsLRURegionEntryOffHeapObjectKey> missCountUpdater =
@@ -285,7 +327,7 @@ public class VMStatsLRURegionEntryOffHeapObjectKey extends VMStatsLRURegionEntry
"missCount");
@Override
- public final long getLastAccessed() throws InternalStatisticsDisabledException {
+ public long getLastAccessed() throws InternalStatisticsDisabledException {
return this.lastAccessed;
}
@@ -294,12 +336,12 @@ public class VMStatsLRURegionEntryOffHeapObjectKey extends VMStatsLRURegionEntry
}
@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;
}
@@ -312,14 +354,15 @@ public class VMStatsLRURegionEntryOffHeapObjectKey extends VMStatsLRURegionEntry
}
@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;
@@ -331,13 +374,20 @@ public class VMStatsLRURegionEntryOffHeapObjectKey extends VMStatsLRURegionEntry
return true;
}
+
+
// 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/VMStatsLRURegionEntryOffHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapStringKey1.java
index 9aa6984..21d16a6 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapStringKey1.java
@@ -15,40 +15,64 @@
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.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.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
+// lru: 1
+// stats: 1
// versioned: VERSIONED
-// offheap: OFFHEAP
+// 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 VMStatsLRURegionEntryOffHeapStringKey1 extends VMStatsLRURegionEntryOffHeap {
public VMStatsLRURegionEntryOffHeapStringKey1(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) {
@@ -67,9 +91,11 @@ public class VMStatsLRURegionEntryOffHeapStringKey1 extends VMStatsLRURegionEntr
}
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;
@@ -78,6 +104,7 @@ public class VMStatsLRURegionEntryOffHeapStringKey1 extends VMStatsLRURegionEntr
private static final AtomicLongFieldUpdater<VMStatsLRURegionEntryOffHeapStringKey1> lastModifiedUpdater =
AtomicLongFieldUpdater.newUpdater(VMStatsLRURegionEntryOffHeapStringKey1.class,
"lastModified");
+
/**
* All access done using ohAddrUpdater so it is used even though the compiler can not tell it is.
*/
@@ -108,13 +135,19 @@ public class VMStatsLRURegionEntryOffHeapStringKey1 extends VMStatsLRURegionEntr
// 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);
}
@@ -130,7 +163,9 @@ public class VMStatsLRURegionEntryOffHeapStringKey1 extends VMStatsLRURegionEntr
}
@Override
+
@Released
+
public void release() {
OffHeapRegionEntryHelper.releaseEntry(this);
}
@@ -154,7 +189,7 @@ public class VMStatsLRURegionEntryOffHeapStringKey1 extends VMStatsLRURegionEntr
/**
* @see HashEntry#getEntryHash()
*/
- public final int getEntryHash() {
+ public int getEntryHash() {
return this.hash;
}
@@ -165,117 +200,121 @@ public class VMStatsLRURegionEntryOffHeapStringKey1 extends VMStatsLRURegionEntr
/**
* @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();
@@ -285,7 +324,7 @@ public class VMStatsLRURegionEntryOffHeapStringKey1 extends VMStatsLRURegionEntr
}
@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);
@@ -295,6 +334,7 @@ public class VMStatsLRURegionEntryOffHeapStringKey1 extends VMStatsLRURegionEntr
private volatile long lastAccessed;
private volatile int hitCount;
private volatile int missCount;
+
private static final AtomicIntegerFieldUpdater<VMStatsLRURegionEntryOffHeapStringKey1> hitCountUpdater =
AtomicIntegerFieldUpdater.newUpdater(VMStatsLRURegionEntryOffHeapStringKey1.class,
"hitCount");
@@ -303,7 +343,7 @@ public class VMStatsLRURegionEntryOffHeapStringKey1 extends VMStatsLRURegionEntr
"missCount");
@Override
- public final long getLastAccessed() throws InternalStatisticsDisabledException {
+ public long getLastAccessed() throws InternalStatisticsDisabledException {
return this.lastAccessed;
}
@@ -312,12 +352,12 @@ public class VMStatsLRURegionEntryOffHeapStringKey1 extends VMStatsLRURegionEntr
}
@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;
}
@@ -330,14 +370,15 @@ public class VMStatsLRURegionEntryOffHeapStringKey1 extends VMStatsLRURegionEntr
}
@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;
@@ -349,8 +390,12 @@ public class VMStatsLRURegionEntryOffHeapStringKey1 extends VMStatsLRURegionEntr
return true;
}
+
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// key code
+
private final long bits1;
private int getKeyLength() {
@@ -364,7 +409,7 @@ public class VMStatsLRURegionEntryOffHeapStringKey1 extends VMStatsLRURegionEntr
}
@Override
- public final Object getKey() {
+ public Object getKey() {
int keylen = getKeyLength();
char[] chars = new char[keylen];
long tmpBits1 = this.bits1;
@@ -383,6 +428,7 @@ public class VMStatsLRURegionEntryOffHeapStringKey1 extends VMStatsLRURegionEntr
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
@Override
public boolean isKeyEqual(Object k) {
if (k instanceof String) {
@@ -412,5 +458,8 @@ public class VMStatsLRURegionEntryOffHeapStringKey1 extends VMStatsLRURegionEntr
}
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/VMStatsLRURegionEntryOffHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapStringKey2.java
index 59c4d32..54818ae 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsLRURegionEntryOffHeapStringKey2.java
@@ -15,40 +15,64 @@
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.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.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
+// lru: 1
+// stats: 1
// versioned: VERSIONED
-// offheap: OFFHEAP
+// 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 VMStatsLRURegionEntryOffHeapStringKey2 extends VMStatsLRURegionEntryOffHeap {
public VMStatsLRURegionEntryOffHeapStringKey2(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;
@@ -79,9 +103,11 @@ public class VMStatsLRURegionEntryOffHeapStringKey2 extends VMStatsLRURegionEntr
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;
@@ -90,6 +116,7 @@ public class VMStatsLRURegionEntryOffHeapStringKey2 extends VMStatsLRURegionEntr
private static final AtomicLongFieldUpdater<VMStatsLRURegionEntryOffHeapStringKey2> lastModifiedUpdater =
AtomicLongFieldUpdater.newUpdater(VMStatsLRURegionEntryOffHeapStringKey2.class,
"lastModified");
+
/**
* All access done using ohAddrUpdater so it is used even though the compiler can not tell it is.
*/
@@ -120,13 +147,19 @@ public class VMStatsLRURegionEntryOffHeapStringKey2 extends VMStatsLRURegionEntr
// 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);
}
@@ -142,7 +175,9 @@ public class VMStatsLRURegionEntryOffHeapStringKey2 extends VMStatsLRURegionEntr
}
@Override
+
@Released
+
public void release() {
OffHeapRegionEntryHelper.releaseEntry(this);
}
@@ -166,7 +201,7 @@ public class VMStatsLRURegionEntryOffHeapStringKey2 extends VMStatsLRURegionEntr
/**
* @see HashEntry#getEntryHash()
*/
- public final int getEntryHash() {
+ public int getEntryHash() {
return this.hash;
}
@@ -177,117 +212,121 @@ public class VMStatsLRURegionEntryOffHeapStringKey2 extends VMStatsLRURegionEntr
/**
* @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();
@@ -297,7 +336,7 @@ public class VMStatsLRURegionEntryOffHeapStringKey2 extends VMStatsLRURegionEntr
}
@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);
@@ -307,6 +346,7 @@ public class VMStatsLRURegionEntryOffHeapStringKey2 extends VMStatsLRURegionEntr
private volatile long lastAccessed;
private volatile int hitCount;
private volatile int missCount;
+
private static final AtomicIntegerFieldUpdater<VMStatsLRURegionEntryOffHeapStringKey2> hitCountUpdater =
AtomicIntegerFieldUpdater.newUpdater(VMStatsLRURegionEntryOffHeapStringKey2.class,
"hitCount");
@@ -315,7 +355,7 @@ public class VMStatsLRURegionEntryOffHeapStringKey2 extends VMStatsLRURegionEntr
"missCount");
@Override
- public final long getLastAccessed() throws InternalStatisticsDisabledException {
+ public long getLastAccessed() throws InternalStatisticsDisabledException {
return this.lastAccessed;
}
@@ -324,12 +364,12 @@ public class VMStatsLRURegionEntryOffHeapStringKey2 extends VMStatsLRURegionEntr
}
@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;
}
@@ -342,14 +382,15 @@ public class VMStatsLRURegionEntryOffHeapStringKey2 extends VMStatsLRURegionEntr
}
@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;
@@ -361,8 +402,12 @@ public class VMStatsLRURegionEntryOffHeapStringKey2 extends VMStatsLRURegionEntr
return true;
}
+
+
// 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.
@@ -381,7 +426,7 @@ public class VMStatsLRURegionEntryOffHeapStringKey2 extends VMStatsLRURegionEntr
}
@Override
- public final Object getKey() {
+ public Object getKey() {
int keylen = getKeyLength();
char[] chars = new char[keylen];
long tmpBits1 = this.bits1;
@@ -411,6 +456,7 @@ public class VMStatsLRURegionEntryOffHeapStringKey2 extends VMStatsLRURegionEntr
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
@Override
public boolean isKeyEqual(Object k) {
if (k instanceof String) {
@@ -453,5 +499,7 @@ public class VMStatsLRURegionEntryOffHeapStringKey2 extends VMStatsLRURegionEntr
}
return false;
}
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
}
+