You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by kl...@apache.org on 2017/05/16 02:20:24 UTC
[74/78] geode git commit: fixup
http://git-wip-us.apache.org/repos/asf/geode/blob/5adb681a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapUUIDKey.java
index 72caefb..19ad7fe 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryOffHeapUUIDKey.java
@@ -20,33 +20,19 @@ package org.apache.geode.internal.cache;
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.cache.persistence.DiskRecoveryStore;
-
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;
@@ -73,7 +59,7 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha
* ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory).
*/
public class VMStatsDiskLRURegionEntryOffHeapUUIDKey extends VMStatsDiskLRURegionEntryOffHeap {
- public VMStatsDiskLRURegionEntryOffHeapUUIDKey (RegionEntryContext context, UUID key,
+ public VMStatsDiskLRURegionEntryOffHeapUUIDKey(RegionEntryContext context, UUID key,
@Retained
@@ -81,60 +67,59 @@ public class VMStatsDiskLRURegionEntryOffHeapUUIDKey extends VMStatsDiskLRURegio
- ) {
- super(context,
+ ) {
+ super(context,
- (value instanceof RecoveredEntry ? null : value)
+ (value instanceof RecoveredEntry ? null : value)
- );
+ );
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
initialize(context, value);
-
-
-
-
-
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;
@SuppressWarnings("unused")
private volatile long lastModified;
- private static final AtomicLongFieldUpdater<VMStatsDiskLRURegionEntryOffHeapUUIDKey> lastModifiedUpdater
- = AtomicLongFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryOffHeapUUIDKey.class, "lastModified");
+ private static final AtomicLongFieldUpdater<VMStatsDiskLRURegionEntryOffHeapUUIDKey> lastModifiedUpdater =
+ AtomicLongFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryOffHeapUUIDKey.class,
+ "lastModified");
/**
* All access done using ohAddrUpdater so it is used even though the compiler can not tell it is.
*/
@SuppressWarnings("unused")
- @Retained @Released private volatile long ohAddress;
+ @Retained
+ @Released
+ private volatile long ohAddress;
/**
- * I needed to add this because I wanted clear to call setValue which normally can only be called while the re is synced.
- * But if I sync in that code it causes a lock ordering deadlock with the disk regions because they also get a rw lock in clear.
- * Some hardware platforms do not support CAS on a long. If gemfire is run on one of those the AtomicLongFieldUpdater does a sync
- * on the re and we will once again be deadlocked.
- * I don't know if we support any of the hardware platforms that do not have a 64bit CAS. If we do then we can expect deadlocks
- * on disk regions.
+ * I needed to add this because I wanted clear to call setValue which normally can only be called
+ * while the re is synced. But if I sync in that code it causes a lock ordering deadlock with the
+ * disk regions because they also get a rw lock in clear. Some hardware platforms do not support
+ * CAS on a long. If gemfire is run on one of those the AtomicLongFieldUpdater does a sync on the
+ * re and we will once again be deadlocked. I don't know if we support any of the hardware
+ * platforms that do not have a 64bit CAS. If we do then we can expect deadlocks on disk regions.
*/
- private final static AtomicLongFieldUpdater<VMStatsDiskLRURegionEntryOffHeapUUIDKey> ohAddrUpdater = AtomicLongFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryOffHeapUUIDKey.class, "ohAddress");
-
+ private final static AtomicLongFieldUpdater<VMStatsDiskLRURegionEntryOffHeapUUIDKey> ohAddrUpdater =
+ AtomicLongFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryOffHeapUUIDKey.class, "ohAddress");
+
@Override
public Token getValueAsToken() {
return OffHeapRegionEntryHelper.getValueAsToken(this);
}
-
+
@Override
protected Object getValueField() {
return OffHeapRegionEntryHelper._getValue(this);
@@ -150,6 +135,7 @@ public class VMStatsDiskLRURegionEntryOffHeapUUIDKey extends VMStatsDiskLRURegio
OffHeapRegionEntryHelper.setValue(this, v);
}
+
@Override
@Retained
@@ -167,7 +153,7 @@ public class VMStatsDiskLRURegionEntryOffHeapUUIDKey extends VMStatsDiskLRURegio
public boolean setAddress(long expectedAddr, long newAddr) {
return ohAddrUpdater.compareAndSet(this, expectedAddr, newAddr);
}
-
+
@Override
@Released
@@ -175,36 +161,41 @@ public class VMStatsDiskLRURegionEntryOffHeapUUIDKey extends VMStatsDiskLRURegio
public void release() {
OffHeapRegionEntryHelper.releaseEntry(this);
}
-
+
@Override
public void returnToPool() {
// Deadcoded for now; never was working
-// if (this instanceof VMThinRegionEntryLongKey) {
-// factory.returnToPool((VMThinRegionEntryLongKey)this);
-// }
+ // if (this instanceof VMThinRegionEntryLongKey) {
+ // factory.returnToPool((VMThinRegionEntryLongKey)this);
+ // }
}
protected long getLastModifiedField() {
return lastModifiedUpdater.get(this);
}
+
protected boolean compareAndSetLastModifiedField(long expectedValue, long newValue) {
return lastModifiedUpdater.compareAndSet(this, expectedValue, newValue);
}
+
/**
* @see HashEntry#getEntryHash()
*/
public int getEntryHash() {
return this.hash;
}
+
protected void setEntryHash(int v) {
this.hash = v;
}
+
/**
* @see HashEntry#getNextEntry()
*/
public HashEntry<Object, Object> getNextEntry() {
return this.next;
}
+
/**
* @see HashEntry#setNextEntry
*/
@@ -214,13 +205,13 @@ public class VMStatsDiskLRURegionEntryOffHeapUUIDKey extends VMStatsDiskLRURegio
// 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) {
- isBackup = ((LocalRegion)drs).getDiskRegion().isBackup();
+ isBackup = ((LocalRegion) drs).getDiskRegion().isBackup();
} else if (drs instanceof PlaceHolderDiskRegion) {
isBackup = true;
} else {
@@ -231,10 +222,11 @@ public class VMStatsDiskLRURegionEntryOffHeapUUIDKey extends VMStatsDiskLRURegio
diskInitialize(drs, value);
}
}
+
@Override
public synchronized int updateAsyncEntrySize(EnableLRU capacityController) {
int oldSize = getEntrySize();
- int newSize = capacityController.entrySize( getKeyForSizing(), null);
+ int newSize = capacityController.entrySize(getKeyForSizing(), null);
setEntrySize(newSize);
int delta = newSize - oldSize;
return delta;
@@ -242,12 +234,12 @@ public class VMStatsDiskLRURegionEntryOffHeapUUIDKey extends VMStatsDiskLRURegio
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
private void diskInitialize(RegionEntryContext context, Object value) {
- DiskRecoveryStore drs = (DiskRecoveryStore)context;
+ DiskRecoveryStore drs = (DiskRecoveryStore) context;
DiskStoreImpl ds = drs.getDiskStore();
long maxOplogSize = ds.getMaxOplogSize();
- //get appropriate instance of DiskId implementation based on maxOplogSize
+ // get appropriate instance of DiskId implementation based on maxOplogSize
this.id = DiskId.createDiskId(maxOplogSize, true/* is persistence */, ds.needsLinkedList());
Helper.initialize(this, drs, value);
}
@@ -257,58 +249,60 @@ public class VMStatsDiskLRURegionEntryOffHeapUUIDKey extends VMStatsDiskLRURegio
*
* @since GemFire 5.1
*/
- protected DiskId id;//= new DiskId();
+ protected DiskId id;// = new DiskId();
+
public DiskId getDiskId() {
return this.id;
}
+
@Override
void setDiskId(RegionEntry old) {
- this.id = ((AbstractDiskRegionEntry)old).getDiskId();
- }
-// // inlining DiskId
-// // always have these fields
-// /**
-// * id consists of
-// * most significant
-// * 1 byte = users bits
-// * 2-8 bytes = oplog id
-// * least significant.
-// *
-// * The highest bit in the oplog id part is set to 1 if the oplog id
-// * is negative.
-// * @todo this field could be an int for an overflow only region
-// */
-// private long id;
-// /**
-// * Length of the bytes on disk.
-// * This is always set. If the value is invalid then it will be set to 0.
-// * The most significant bit is used by overflow to mark it as needing to be written.
-// */
-// protected int valueLength = 0;
-// // have intOffset or longOffset
-// // intOffset
-// /**
-// * The position in the oplog (the oplog offset) where this entry's value is
-// * stored
-// */
-// private volatile int offsetInOplog;
-// // longOffset
-// /**
-// * The position in the oplog (the oplog offset) where this entry's value is
-// * stored
-// */
-// private volatile long offsetInOplog;
-// // have overflowOnly or persistence
-// // overflowOnly
-// // no fields
-// // persistent
-// /** unique entry identifier * */
-// private long keyId;
-
-
+ this.id = ((AbstractDiskRegionEntry) old).getDiskId();
+ }
+ // // inlining DiskId
+ // // always have these fields
+ // /**
+ // * id consists of
+ // * most significant
+ // * 1 byte = users bits
+ // * 2-8 bytes = oplog id
+ // * least significant.
+ // *
+ // * The highest bit in the oplog id part is set to 1 if the oplog id
+ // * is negative.
+ // * @todo this field could be an int for an overflow only region
+ // */
+ // private long id;
+ // /**
+ // * Length of the bytes on disk.
+ // * This is always set. If the value is invalid then it will be set to 0.
+ // * The most significant bit is used by overflow to mark it as needing to be written.
+ // */
+ // protected int valueLength = 0;
+ // // have intOffset or longOffset
+ // // intOffset
+ // /**
+ // * The position in the oplog (the oplog offset) where this entry's value is
+ // * stored
+ // */
+ // private volatile int offsetInOplog;
+ // // longOffset
+ // /**
+ // * The position in the oplog (the oplog offset) where this entry's value is
+ // * stored
+ // */
+ // private volatile long offsetInOplog;
+ // // have overflowOnly or persistence
+ // // overflowOnly
+ // // no fields
+ // // 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) {
@@ -320,36 +314,44 @@ public class VMStatsDiskLRURegionEntryOffHeapUUIDKey extends VMStatsDiskLRURegio
}
+
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
+ 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 synchronized int updateEntrySize(EnableLRU capacityController,
- Object value) {
+
+ public synchronized int updateEntrySize(EnableLRU capacityController, Object value) {
int oldSize = getEntrySize();
- int newSize = capacityController.entrySize( getKeyForSizing(), value);
+ int newSize = capacityController.entrySize(getKeyForSizing(), value);
setEntrySize(newSize);
int delta = newSize - oldSize;
return delta;
}
+
public boolean testRecentlyUsed() {
return areAnyBitsSet(RECENTLY_USED);
}
+
@Override
public void setRecentlyUsed() {
setBits(RECENTLY_USED);
}
+
public void unsetRecentlyUsed() {
clearBits(~RECENTLY_USED);
}
+
public boolean testEvicted() {
return areAnyBitsSet(EVICTED);
}
+
public void setEvicted() {
setBits(EVICTED);
}
+
public void unsetEvicted() {
clearBits(~EVICTED);
}
@@ -359,33 +361,38 @@ public class VMStatsDiskLRURegionEntryOffHeapUUIDKey extends VMStatsDiskLRURegio
private LRUClockNode nextLRU;
private LRUClockNode prevLRU;
private int size;
- public void setNextLRUNode( LRUClockNode next ) {
+
+ public void setNextLRUNode(LRUClockNode next) {
this.nextLRU = next;
}
+
public LRUClockNode nextLRUNode() {
return this.nextLRU;
}
- public void setPrevLRUNode( LRUClockNode prev ) {
+
+ public void setPrevLRUNode(LRUClockNode prev) {
this.prevLRU = prev;
}
+
public LRUClockNode prevLRUNode() {
return this.prevLRU;
}
+
public int getEntrySize() {
return this.size;
}
+
protected void setEntrySize(int size) {
this.size = size;
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
@Override
public Object getKeyForSizing() {
-
// inline keys always report null for sizing since the size comes from the entry size
return null;
@@ -394,7 +401,7 @@ public class VMStatsDiskLRURegionEntryOffHeapUUIDKey extends VMStatsDiskLRURegio
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// stats code
@Override
public void updateStatsForGet(boolean hit, long time) {
@@ -405,51 +412,61 @@ public class VMStatsDiskLRURegionEntryOffHeapUUIDKey extends VMStatsDiskLRURegio
incrementMissCount();
}
}
+
@Override
protected void setLastModifiedAndAccessedTimes(long lastModified, long lastAccessed) {
_setLastModified(lastModified);
- if (!DISABLE_ACCESS_TIME_UPDATE_ON_PUT) {
+ if (!DISABLE_ACCESS_TIME_UPDATE_ON_PUT) {
setLastAccessed(lastAccessed);
}
}
+
private volatile long lastAccessed;
private volatile int hitCount;
private volatile int missCount;
-
- private static final AtomicIntegerFieldUpdater<VMStatsDiskLRURegionEntryOffHeapUUIDKey> hitCountUpdater
- = AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryOffHeapUUIDKey.class, "hitCount");
- private static final AtomicIntegerFieldUpdater<VMStatsDiskLRURegionEntryOffHeapUUIDKey> missCountUpdater
- = AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryOffHeapUUIDKey.class, "missCount");
-
+
+ private static final AtomicIntegerFieldUpdater<VMStatsDiskLRURegionEntryOffHeapUUIDKey> hitCountUpdater =
+ AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryOffHeapUUIDKey.class,
+ "hitCount");
+ private static final AtomicIntegerFieldUpdater<VMStatsDiskLRURegionEntryOffHeapUUIDKey> missCountUpdater =
+ AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryOffHeapUUIDKey.class,
+ "missCount");
+
@Override
public long getLastAccessed() throws InternalStatisticsDisabledException {
return this.lastAccessed;
}
+
private void setLastAccessed(long lastAccessed) {
this.lastAccessed = lastAccessed;
}
+
@Override
public long getHitCount() throws InternalStatisticsDisabledException {
return this.hitCount & 0xFFFFFFFFL;
}
+
@Override
public long getMissCount() throws InternalStatisticsDisabledException {
return this.missCount & 0xFFFFFFFFL;
}
+
private void incrementHitCount() {
hitCountUpdater.incrementAndGet(this);
}
+
private void incrementMissCount() {
missCountUpdater.incrementAndGet(this);
}
+
@Override
public void resetCounts() throws InternalStatisticsDisabledException {
- hitCountUpdater.set(this,0);
- missCountUpdater.set(this,0);
+ hitCountUpdater.set(this, 0);
+ missCountUpdater.set(this, 0);
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
@Override
public void txDidDestroy(long currTime) {
setLastModified(currTime);
@@ -457,24 +474,26 @@ public class VMStatsDiskLRURegionEntryOffHeapUUIDKey extends VMStatsDiskLRURegio
this.hitCount = 0;
this.missCount = 0;
}
+
@Override
public boolean hasStats() {
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 Object getKey() {
return new UUID(this.keyMostSigBits, this.keyLeastSigBits);
}
+
@Override
public boolean isKeyEqual(Object k) {
if (k instanceof UUID) {
@@ -484,7 +503,7 @@ public class VMStatsDiskLRURegionEntryOffHeapUUIDKey extends VMStatsDiskLRURegio
}
return false;
}
-
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
}
http://git-wip-us.apache.org/repos/asf/geode/blob/5adb681a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapIntKey.java
index 1a50824..8cda823 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapIntKey.java
@@ -18,22 +18,14 @@ package org.apache.geode.internal.cache;
-
-
-
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.cache.persistence.DiskRecoveryStore;
-
import org.apache.geode.internal.InternalStatisticsDisabledException;
import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
@@ -57,7 +49,7 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha
* ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory).
*/
public class VMStatsDiskRegionEntryHeapIntKey extends VMStatsDiskRegionEntryHeap {
- public VMStatsDiskRegionEntryHeapIntKey (RegionEntryContext context, int key,
+ public VMStatsDiskRegionEntryHeapIntKey(RegionEntryContext context, int key,
@@ -65,40 +57,41 @@ public class VMStatsDiskRegionEntryHeapIntKey extends VMStatsDiskRegionEntryHeap
- ) {
- super(context,
+ ) {
+ super(context,
- (value instanceof RecoveredEntry ? null : value)
+ (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;
@SuppressWarnings("unused")
private volatile long lastModified;
- private static final AtomicLongFieldUpdater<VMStatsDiskRegionEntryHeapIntKey> lastModifiedUpdater
- = AtomicLongFieldUpdater.newUpdater(VMStatsDiskRegionEntryHeapIntKey.class, "lastModified");
+ private static final AtomicLongFieldUpdater<VMStatsDiskRegionEntryHeapIntKey> lastModifiedUpdater =
+ AtomicLongFieldUpdater.newUpdater(VMStatsDiskRegionEntryHeapIntKey.class, "lastModified");
private volatile Object value;
+
@Override
protected Object getValueField() {
return this.value;
}
+
@Override
protected void setValueField(Object v) {
this.value = v;
@@ -107,24 +100,29 @@ public class VMStatsDiskRegionEntryHeapIntKey extends VMStatsDiskRegionEntryHeap
protected long getLastModifiedField() {
return lastModifiedUpdater.get(this);
}
+
protected boolean compareAndSetLastModifiedField(long expectedValue, long newValue) {
return lastModifiedUpdater.compareAndSet(this, expectedValue, newValue);
}
+
/**
* @see HashEntry#getEntryHash()
*/
public int getEntryHash() {
return this.hash;
}
+
protected void setEntryHash(int v) {
this.hash = v;
}
+
/**
* @see HashEntry#getNextEntry()
*/
public HashEntry<Object, Object> getNextEntry() {
return this.next;
}
+
/**
* @see HashEntry#setNextEntry
*/
@@ -134,12 +132,13 @@ public class VMStatsDiskRegionEntryHeapIntKey extends VMStatsDiskRegionEntryHeap
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// disk code
protected void initialize(RegionEntryContext context, Object value) {
diskInitialize(context, value);
}
+
@Override
public int updateAsyncEntrySize(EnableLRU capacityController) {
throw new IllegalStateException("should never be called");
@@ -147,12 +146,12 @@ public class VMStatsDiskRegionEntryHeapIntKey extends VMStatsDiskRegionEntryHeap
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
private void diskInitialize(RegionEntryContext context, Object value) {
- DiskRecoveryStore drs = (DiskRecoveryStore)context;
+ DiskRecoveryStore drs = (DiskRecoveryStore) context;
DiskStoreImpl ds = drs.getDiskStore();
long maxOplogSize = ds.getMaxOplogSize();
- //get appropriate instance of DiskId implementation based on maxOplogSize
+ // get appropriate instance of DiskId implementation based on maxOplogSize
this.id = DiskId.createDiskId(maxOplogSize, true/* is persistence */, ds.needsLinkedList());
Helper.initialize(this, drs, value);
}
@@ -162,60 +161,60 @@ public class VMStatsDiskRegionEntryHeapIntKey extends VMStatsDiskRegionEntryHeap
*
* @since GemFire 5.1
*/
- protected DiskId id;//= new DiskId();
+ protected DiskId id;// = new DiskId();
+
public DiskId getDiskId() {
return this.id;
}
+
@Override
void setDiskId(RegionEntry old) {
- this.id = ((AbstractDiskRegionEntry)old).getDiskId();
+ this.id = ((AbstractDiskRegionEntry) old).getDiskId();
}
-// // inlining DiskId
-// // always have these fields
-// /**
-// * id consists of
-// * most significant
-// * 1 byte = users bits
-// * 2-8 bytes = oplog id
-// * least significant.
-// *
-// * The highest bit in the oplog id part is set to 1 if the oplog id
-// * is negative.
-// * @todo this field could be an int for an overflow only region
-// */
-// private long id;
-// /**
-// * Length of the bytes on disk.
-// * This is always set. If the value is invalid then it will be set to 0.
-// * The most significant bit is used by overflow to mark it as needing to be written.
-// */
-// protected int valueLength = 0;
-// // have intOffset or longOffset
-// // intOffset
-// /**
-// * The position in the oplog (the oplog offset) where this entry's value is
-// * stored
-// */
-// private volatile int offsetInOplog;
-// // longOffset
-// /**
-// * The position in the oplog (the oplog offset) where this entry's value is
-// * stored
-// */
-// private volatile long offsetInOplog;
-// // have overflowOnly or persistence
-// // overflowOnly
-// // no fields
-// // persistent
-// /** unique entry identifier * */
-// private long keyId;
-
-
+ // // inlining DiskId
+ // // always have these fields
+ // /**
+ // * id consists of
+ // * most significant
+ // * 1 byte = users bits
+ // * 2-8 bytes = oplog id
+ // * least significant.
+ // *
+ // * The highest bit in the oplog id part is set to 1 if the oplog id
+ // * is negative.
+ // * @todo this field could be an int for an overflow only region
+ // */
+ // private long id;
+ // /**
+ // * Length of the bytes on disk.
+ // * This is always set. If the value is invalid then it will be set to 0.
+ // * The most significant bit is used by overflow to mark it as needing to be written.
+ // */
+ // protected int valueLength = 0;
+ // // have intOffset or longOffset
+ // // intOffset
+ // /**
+ // * The position in the oplog (the oplog offset) where this entry's value is
+ // * stored
+ // */
+ // private volatile int offsetInOplog;
+ // // longOffset
+ // /**
+ // * The position in the oplog (the oplog offset) where this entry's value is
+ // * stored
+ // */
+ // private volatile long offsetInOplog;
+ // // have overflowOnly or persistence
+ // // overflowOnly
+ // // no fields
+ // // persistent
+ // /** unique entry identifier * */
+ // private long keyId;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// stats code
@Override
public void updateStatsForGet(boolean hit, long time) {
@@ -226,51 +225,59 @@ public class VMStatsDiskRegionEntryHeapIntKey extends VMStatsDiskRegionEntryHeap
incrementMissCount();
}
}
+
@Override
protected void setLastModifiedAndAccessedTimes(long lastModified, long lastAccessed) {
_setLastModified(lastModified);
- if (!DISABLE_ACCESS_TIME_UPDATE_ON_PUT) {
+ if (!DISABLE_ACCESS_TIME_UPDATE_ON_PUT) {
setLastAccessed(lastAccessed);
}
}
+
private volatile long lastAccessed;
private volatile int hitCount;
private volatile int missCount;
-
- private static final AtomicIntegerFieldUpdater<VMStatsDiskRegionEntryHeapIntKey> hitCountUpdater
- = AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskRegionEntryHeapIntKey.class, "hitCount");
- private static final AtomicIntegerFieldUpdater<VMStatsDiskRegionEntryHeapIntKey> missCountUpdater
- = AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskRegionEntryHeapIntKey.class, "missCount");
-
+
+ private static final AtomicIntegerFieldUpdater<VMStatsDiskRegionEntryHeapIntKey> hitCountUpdater =
+ AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskRegionEntryHeapIntKey.class, "hitCount");
+ private static final AtomicIntegerFieldUpdater<VMStatsDiskRegionEntryHeapIntKey> missCountUpdater =
+ AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskRegionEntryHeapIntKey.class, "missCount");
+
@Override
public long getLastAccessed() throws InternalStatisticsDisabledException {
return this.lastAccessed;
}
+
private void setLastAccessed(long lastAccessed) {
this.lastAccessed = lastAccessed;
}
+
@Override
public long getHitCount() throws InternalStatisticsDisabledException {
return this.hitCount & 0xFFFFFFFFL;
}
+
@Override
public long getMissCount() throws InternalStatisticsDisabledException {
return this.missCount & 0xFFFFFFFFL;
}
+
private void incrementHitCount() {
hitCountUpdater.incrementAndGet(this);
}
+
private void incrementMissCount() {
missCountUpdater.incrementAndGet(this);
}
+
@Override
public void resetCounts() throws InternalStatisticsDisabledException {
- hitCountUpdater.set(this,0);
- missCountUpdater.set(this,0);
+ hitCountUpdater.set(this, 0);
+ missCountUpdater.set(this, 0);
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
@Override
public void txDidDestroy(long currTime) {
setLastModified(currTime);
@@ -278,30 +285,27 @@ public class VMStatsDiskRegionEntryHeapIntKey extends VMStatsDiskRegionEntryHeap
this.hitCount = 0;
this.missCount = 0;
}
+
@Override
public boolean hasStats() {
return true;
}
-
-
-
- // DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
- // key code
-
-
+ // DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+ // key code
private final int key;
+
@Override
public Object getKey() {
return this.key;
}
+
@Override
public boolean isKeyEqual(Object k) {
if (k instanceof Integer) {
@@ -309,7 +313,7 @@ public class VMStatsDiskRegionEntryHeapIntKey extends VMStatsDiskRegionEntryHeap
}
return false;
}
-
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
}
http://git-wip-us.apache.org/repos/asf/geode/blob/5adb681a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapLongKey.java
index a14da39..88b6e29 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapLongKey.java
@@ -18,22 +18,14 @@ package org.apache.geode.internal.cache;
-
-
-
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.cache.persistence.DiskRecoveryStore;
-
import org.apache.geode.internal.InternalStatisticsDisabledException;
import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
@@ -57,7 +49,7 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha
* ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory).
*/
public class VMStatsDiskRegionEntryHeapLongKey extends VMStatsDiskRegionEntryHeap {
- public VMStatsDiskRegionEntryHeapLongKey (RegionEntryContext context, long key,
+ public VMStatsDiskRegionEntryHeapLongKey(RegionEntryContext context, long key,
@@ -65,42 +57,41 @@ public class VMStatsDiskRegionEntryHeapLongKey extends VMStatsDiskRegionEntryHea
- ) {
- super(context,
+ ) {
+ super(context,
- (value instanceof RecoveredEntry ? null : value)
+ (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;
@SuppressWarnings("unused")
private volatile long lastModified;
- private static final AtomicLongFieldUpdater<VMStatsDiskRegionEntryHeapLongKey> lastModifiedUpdater
- = AtomicLongFieldUpdater.newUpdater(VMStatsDiskRegionEntryHeapLongKey.class, "lastModified");
+ private static final AtomicLongFieldUpdater<VMStatsDiskRegionEntryHeapLongKey> lastModifiedUpdater =
+ AtomicLongFieldUpdater.newUpdater(VMStatsDiskRegionEntryHeapLongKey.class, "lastModified");
private volatile Object value;
+
@Override
protected Object getValueField() {
return this.value;
}
+
@Override
protected void setValueField(Object v) {
this.value = v;
@@ -109,24 +100,29 @@ public class VMStatsDiskRegionEntryHeapLongKey extends VMStatsDiskRegionEntryHea
protected long getLastModifiedField() {
return lastModifiedUpdater.get(this);
}
+
protected boolean compareAndSetLastModifiedField(long expectedValue, long newValue) {
return lastModifiedUpdater.compareAndSet(this, expectedValue, newValue);
}
+
/**
* @see HashEntry#getEntryHash()
*/
public int getEntryHash() {
return this.hash;
}
+
protected void setEntryHash(int v) {
this.hash = v;
}
+
/**
* @see HashEntry#getNextEntry()
*/
public HashEntry<Object, Object> getNextEntry() {
return this.next;
}
+
/**
* @see HashEntry#setNextEntry
*/
@@ -136,12 +132,13 @@ public class VMStatsDiskRegionEntryHeapLongKey extends VMStatsDiskRegionEntryHea
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// disk code
protected void initialize(RegionEntryContext context, Object value) {
diskInitialize(context, value);
}
+
@Override
public int updateAsyncEntrySize(EnableLRU capacityController) {
throw new IllegalStateException("should never be called");
@@ -149,12 +146,12 @@ public class VMStatsDiskRegionEntryHeapLongKey extends VMStatsDiskRegionEntryHea
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
private void diskInitialize(RegionEntryContext context, Object value) {
- DiskRecoveryStore drs = (DiskRecoveryStore)context;
+ DiskRecoveryStore drs = (DiskRecoveryStore) context;
DiskStoreImpl ds = drs.getDiskStore();
long maxOplogSize = ds.getMaxOplogSize();
- //get appropriate instance of DiskId implementation based on maxOplogSize
+ // get appropriate instance of DiskId implementation based on maxOplogSize
this.id = DiskId.createDiskId(maxOplogSize, true/* is persistence */, ds.needsLinkedList());
Helper.initialize(this, drs, value);
}
@@ -164,60 +161,60 @@ public class VMStatsDiskRegionEntryHeapLongKey extends VMStatsDiskRegionEntryHea
*
* @since GemFire 5.1
*/
- protected DiskId id;//= new DiskId();
+ protected DiskId id;// = new DiskId();
+
public DiskId getDiskId() {
return this.id;
}
+
@Override
void setDiskId(RegionEntry old) {
- this.id = ((AbstractDiskRegionEntry)old).getDiskId();
+ this.id = ((AbstractDiskRegionEntry) old).getDiskId();
}
-// // inlining DiskId
-// // always have these fields
-// /**
-// * id consists of
-// * most significant
-// * 1 byte = users bits
-// * 2-8 bytes = oplog id
-// * least significant.
-// *
-// * The highest bit in the oplog id part is set to 1 if the oplog id
-// * is negative.
-// * @todo this field could be an int for an overflow only region
-// */
-// private long id;
-// /**
-// * Length of the bytes on disk.
-// * This is always set. If the value is invalid then it will be set to 0.
-// * The most significant bit is used by overflow to mark it as needing to be written.
-// */
-// protected int valueLength = 0;
-// // have intOffset or longOffset
-// // intOffset
-// /**
-// * The position in the oplog (the oplog offset) where this entry's value is
-// * stored
-// */
-// private volatile int offsetInOplog;
-// // longOffset
-// /**
-// * The position in the oplog (the oplog offset) where this entry's value is
-// * stored
-// */
-// private volatile long offsetInOplog;
-// // have overflowOnly or persistence
-// // overflowOnly
-// // no fields
-// // persistent
-// /** unique entry identifier * */
-// private long keyId;
-
-
+ // // inlining DiskId
+ // // always have these fields
+ // /**
+ // * id consists of
+ // * most significant
+ // * 1 byte = users bits
+ // * 2-8 bytes = oplog id
+ // * least significant.
+ // *
+ // * The highest bit in the oplog id part is set to 1 if the oplog id
+ // * is negative.
+ // * @todo this field could be an int for an overflow only region
+ // */
+ // private long id;
+ // /**
+ // * Length of the bytes on disk.
+ // * This is always set. If the value is invalid then it will be set to 0.
+ // * The most significant bit is used by overflow to mark it as needing to be written.
+ // */
+ // protected int valueLength = 0;
+ // // have intOffset or longOffset
+ // // intOffset
+ // /**
+ // * The position in the oplog (the oplog offset) where this entry's value is
+ // * stored
+ // */
+ // private volatile int offsetInOplog;
+ // // longOffset
+ // /**
+ // * The position in the oplog (the oplog offset) where this entry's value is
+ // * stored
+ // */
+ // private volatile long offsetInOplog;
+ // // have overflowOnly or persistence
+ // // overflowOnly
+ // // no fields
+ // // persistent
+ // /** unique entry identifier * */
+ // private long keyId;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// stats code
@Override
public void updateStatsForGet(boolean hit, long time) {
@@ -228,51 +225,59 @@ public class VMStatsDiskRegionEntryHeapLongKey extends VMStatsDiskRegionEntryHea
incrementMissCount();
}
}
+
@Override
protected void setLastModifiedAndAccessedTimes(long lastModified, long lastAccessed) {
_setLastModified(lastModified);
- if (!DISABLE_ACCESS_TIME_UPDATE_ON_PUT) {
+ if (!DISABLE_ACCESS_TIME_UPDATE_ON_PUT) {
setLastAccessed(lastAccessed);
}
}
+
private volatile long lastAccessed;
private volatile int hitCount;
private volatile int missCount;
-
- private static final AtomicIntegerFieldUpdater<VMStatsDiskRegionEntryHeapLongKey> hitCountUpdater
- = AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskRegionEntryHeapLongKey.class, "hitCount");
- private static final AtomicIntegerFieldUpdater<VMStatsDiskRegionEntryHeapLongKey> missCountUpdater
- = AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskRegionEntryHeapLongKey.class, "missCount");
-
+
+ private static final AtomicIntegerFieldUpdater<VMStatsDiskRegionEntryHeapLongKey> hitCountUpdater =
+ AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskRegionEntryHeapLongKey.class, "hitCount");
+ private static final AtomicIntegerFieldUpdater<VMStatsDiskRegionEntryHeapLongKey> missCountUpdater =
+ AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskRegionEntryHeapLongKey.class, "missCount");
+
@Override
public long getLastAccessed() throws InternalStatisticsDisabledException {
return this.lastAccessed;
}
+
private void setLastAccessed(long lastAccessed) {
this.lastAccessed = lastAccessed;
}
+
@Override
public long getHitCount() throws InternalStatisticsDisabledException {
return this.hitCount & 0xFFFFFFFFL;
}
+
@Override
public long getMissCount() throws InternalStatisticsDisabledException {
return this.missCount & 0xFFFFFFFFL;
}
+
private void incrementHitCount() {
hitCountUpdater.incrementAndGet(this);
}
+
private void incrementMissCount() {
missCountUpdater.incrementAndGet(this);
}
+
@Override
public void resetCounts() throws InternalStatisticsDisabledException {
- hitCountUpdater.set(this,0);
- missCountUpdater.set(this,0);
+ hitCountUpdater.set(this, 0);
+ missCountUpdater.set(this, 0);
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
@Override
public void txDidDestroy(long currTime) {
setLastModified(currTime);
@@ -280,23 +285,25 @@ public class VMStatsDiskRegionEntryHeapLongKey extends VMStatsDiskRegionEntryHea
this.hitCount = 0;
this.missCount = 0;
}
+
@Override
public boolean hasStats() {
return true;
}
-
-
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// key code
private final long key;
+
@Override
public Object getKey() {
return this.key;
}
+
@Override
public boolean isKeyEqual(Object k) {
if (k instanceof Long) {
@@ -304,7 +311,7 @@ public class VMStatsDiskRegionEntryHeapLongKey extends VMStatsDiskRegionEntryHea
}
return false;
}
-
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
}
http://git-wip-us.apache.org/repos/asf/geode/blob/5adb681a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapObjectKey.java
index 4f8f71c..1d6a464 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapObjectKey.java
@@ -18,22 +18,14 @@ package org.apache.geode.internal.cache;
-
-
-
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.cache.persistence.DiskRecoveryStore;
-
import org.apache.geode.internal.InternalStatisticsDisabledException;
import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
@@ -57,7 +49,7 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha
* ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory).
*/
public class VMStatsDiskRegionEntryHeapObjectKey extends VMStatsDiskRegionEntryHeap {
- public VMStatsDiskRegionEntryHeapObjectKey (RegionEntryContext context, Object key,
+ public VMStatsDiskRegionEntryHeapObjectKey(RegionEntryContext context, Object key,
@@ -65,14 +57,14 @@ public class VMStatsDiskRegionEntryHeapObjectKey extends VMStatsDiskRegionEntryH
- ) {
- super(context,
+ ) {
+ super(context,
- (value instanceof RecoveredEntry ? null : value)
+ (value instanceof RecoveredEntry ? null : value)
- );
+ );
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
initialize(context, value);
@@ -83,20 +75,22 @@ public class VMStatsDiskRegionEntryHeapObjectKey extends VMStatsDiskRegionEntryH
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// common code
protected int hash;
private HashEntry<Object, Object> next;
@SuppressWarnings("unused")
private volatile long lastModified;
- private static final AtomicLongFieldUpdater<VMStatsDiskRegionEntryHeapObjectKey> lastModifiedUpdater
- = AtomicLongFieldUpdater.newUpdater(VMStatsDiskRegionEntryHeapObjectKey.class, "lastModified");
+ private static final AtomicLongFieldUpdater<VMStatsDiskRegionEntryHeapObjectKey> lastModifiedUpdater =
+ AtomicLongFieldUpdater.newUpdater(VMStatsDiskRegionEntryHeapObjectKey.class, "lastModified");
private volatile Object value;
+
@Override
protected Object getValueField() {
return this.value;
}
+
@Override
protected void setValueField(Object v) {
this.value = v;
@@ -105,24 +99,29 @@ public class VMStatsDiskRegionEntryHeapObjectKey extends VMStatsDiskRegionEntryH
protected long getLastModifiedField() {
return lastModifiedUpdater.get(this);
}
+
protected boolean compareAndSetLastModifiedField(long expectedValue, long newValue) {
return lastModifiedUpdater.compareAndSet(this, expectedValue, newValue);
}
+
/**
* @see HashEntry#getEntryHash()
*/
public int getEntryHash() {
return this.hash;
}
+
protected void setEntryHash(int v) {
this.hash = v;
}
+
/**
* @see HashEntry#getNextEntry()
*/
public HashEntry<Object, Object> getNextEntry() {
return this.next;
}
+
/**
* @see HashEntry#setNextEntry
*/
@@ -132,12 +131,13 @@ public class VMStatsDiskRegionEntryHeapObjectKey extends VMStatsDiskRegionEntryH
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// disk code
protected void initialize(RegionEntryContext context, Object value) {
diskInitialize(context, value);
}
+
@Override
public int updateAsyncEntrySize(EnableLRU capacityController) {
throw new IllegalStateException("should never be called");
@@ -145,12 +145,12 @@ public class VMStatsDiskRegionEntryHeapObjectKey extends VMStatsDiskRegionEntryH
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
private void diskInitialize(RegionEntryContext context, Object value) {
- DiskRecoveryStore drs = (DiskRecoveryStore)context;
+ DiskRecoveryStore drs = (DiskRecoveryStore) context;
DiskStoreImpl ds = drs.getDiskStore();
long maxOplogSize = ds.getMaxOplogSize();
- //get appropriate instance of DiskId implementation based on maxOplogSize
+ // get appropriate instance of DiskId implementation based on maxOplogSize
this.id = DiskId.createDiskId(maxOplogSize, true/* is persistence */, ds.needsLinkedList());
Helper.initialize(this, drs, value);
}
@@ -160,60 +160,60 @@ public class VMStatsDiskRegionEntryHeapObjectKey extends VMStatsDiskRegionEntryH
*
* @since GemFire 5.1
*/
- protected DiskId id;//= new DiskId();
+ protected DiskId id;// = new DiskId();
+
public DiskId getDiskId() {
return this.id;
}
+
@Override
void setDiskId(RegionEntry old) {
- this.id = ((AbstractDiskRegionEntry)old).getDiskId();
+ this.id = ((AbstractDiskRegionEntry) old).getDiskId();
}
-// // inlining DiskId
-// // always have these fields
-// /**
-// * id consists of
-// * most significant
-// * 1 byte = users bits
-// * 2-8 bytes = oplog id
-// * least significant.
-// *
-// * The highest bit in the oplog id part is set to 1 if the oplog id
-// * is negative.
-// * @todo this field could be an int for an overflow only region
-// */
-// private long id;
-// /**
-// * Length of the bytes on disk.
-// * This is always set. If the value is invalid then it will be set to 0.
-// * The most significant bit is used by overflow to mark it as needing to be written.
-// */
-// protected int valueLength = 0;
-// // have intOffset or longOffset
-// // intOffset
-// /**
-// * The position in the oplog (the oplog offset) where this entry's value is
-// * stored
-// */
-// private volatile int offsetInOplog;
-// // longOffset
-// /**
-// * The position in the oplog (the oplog offset) where this entry's value is
-// * stored
-// */
-// private volatile long offsetInOplog;
-// // have overflowOnly or persistence
-// // overflowOnly
-// // no fields
-// // persistent
-// /** unique entry identifier * */
-// private long keyId;
-
-
+ // // inlining DiskId
+ // // always have these fields
+ // /**
+ // * id consists of
+ // * most significant
+ // * 1 byte = users bits
+ // * 2-8 bytes = oplog id
+ // * least significant.
+ // *
+ // * The highest bit in the oplog id part is set to 1 if the oplog id
+ // * is negative.
+ // * @todo this field could be an int for an overflow only region
+ // */
+ // private long id;
+ // /**
+ // * Length of the bytes on disk.
+ // * This is always set. If the value is invalid then it will be set to 0.
+ // * The most significant bit is used by overflow to mark it as needing to be written.
+ // */
+ // protected int valueLength = 0;
+ // // have intOffset or longOffset
+ // // intOffset
+ // /**
+ // * The position in the oplog (the oplog offset) where this entry's value is
+ // * stored
+ // */
+ // private volatile int offsetInOplog;
+ // // longOffset
+ // /**
+ // * The position in the oplog (the oplog offset) where this entry's value is
+ // * stored
+ // */
+ // private volatile long offsetInOplog;
+ // // have overflowOnly or persistence
+ // // overflowOnly
+ // // no fields
+ // // persistent
+ // /** unique entry identifier * */
+ // private long keyId;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// stats code
@Override
public void updateStatsForGet(boolean hit, long time) {
@@ -224,51 +224,59 @@ public class VMStatsDiskRegionEntryHeapObjectKey extends VMStatsDiskRegionEntryH
incrementMissCount();
}
}
+
@Override
protected void setLastModifiedAndAccessedTimes(long lastModified, long lastAccessed) {
_setLastModified(lastModified);
- if (!DISABLE_ACCESS_TIME_UPDATE_ON_PUT) {
+ if (!DISABLE_ACCESS_TIME_UPDATE_ON_PUT) {
setLastAccessed(lastAccessed);
}
}
+
private volatile long lastAccessed;
private volatile int hitCount;
private volatile int missCount;
-
- private static final AtomicIntegerFieldUpdater<VMStatsDiskRegionEntryHeapObjectKey> hitCountUpdater
- = AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskRegionEntryHeapObjectKey.class, "hitCount");
- private static final AtomicIntegerFieldUpdater<VMStatsDiskRegionEntryHeapObjectKey> missCountUpdater
- = AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskRegionEntryHeapObjectKey.class, "missCount");
-
+
+ private static final AtomicIntegerFieldUpdater<VMStatsDiskRegionEntryHeapObjectKey> hitCountUpdater =
+ AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskRegionEntryHeapObjectKey.class, "hitCount");
+ private static final AtomicIntegerFieldUpdater<VMStatsDiskRegionEntryHeapObjectKey> missCountUpdater =
+ AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskRegionEntryHeapObjectKey.class, "missCount");
+
@Override
public long getLastAccessed() throws InternalStatisticsDisabledException {
return this.lastAccessed;
}
+
private void setLastAccessed(long lastAccessed) {
this.lastAccessed = lastAccessed;
}
+
@Override
public long getHitCount() throws InternalStatisticsDisabledException {
return this.hitCount & 0xFFFFFFFFL;
}
+
@Override
public long getMissCount() throws InternalStatisticsDisabledException {
return this.missCount & 0xFFFFFFFFL;
}
+
private void incrementHitCount() {
hitCountUpdater.incrementAndGet(this);
}
+
private void incrementMissCount() {
missCountUpdater.incrementAndGet(this);
}
+
@Override
public void resetCounts() throws InternalStatisticsDisabledException {
- hitCountUpdater.set(this,0);
- missCountUpdater.set(this,0);
+ hitCountUpdater.set(this, 0);
+ missCountUpdater.set(this, 0);
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
@Override
public void txDidDestroy(long currTime) {
setLastModified(currTime);
@@ -276,19 +284,20 @@ public class VMStatsDiskRegionEntryHeapObjectKey extends VMStatsDiskRegionEntryH
this.hitCount = 0;
this.missCount = 0;
}
+
@Override
public boolean hasStats() {
return true;
}
-
-
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// key code
private final Object key;
+
@Override
public Object getKey() {
return this.key;
http://git-wip-us.apache.org/repos/asf/geode/blob/5adb681a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapStringKey1.java
index 02eca82..52ab683 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapStringKey1.java
@@ -18,22 +18,14 @@ package org.apache.geode.internal.cache;
-
-
-
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.cache.persistence.DiskRecoveryStore;
-
import org.apache.geode.internal.InternalStatisticsDisabledException;
import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
@@ -57,7 +49,7 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha
* ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory).
*/
public class VMStatsDiskRegionEntryHeapStringKey1 extends VMStatsDiskRegionEntryHeap {
- public VMStatsDiskRegionEntryHeapStringKey1 (RegionEntryContext context, String key,
+ public VMStatsDiskRegionEntryHeapStringKey1(RegionEntryContext context, String key,
@@ -65,14 +57,14 @@ public class VMStatsDiskRegionEntryHeapStringKey1 extends VMStatsDiskRegionEntry
, boolean byteEncode
- ) {
- super(context,
+ ) {
+ super(context,
- (value instanceof RecoveredEntry ? null : value)
+ (value instanceof RecoveredEntry ? null : value)
- );
+ );
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
initialize(context, value);
@@ -80,14 +72,15 @@ public class VMStatsDiskRegionEntryHeapStringKey1 extends VMStatsDiskRegionEntry
// caller has already confirmed that key.length <= MAX_INLINE_STRING_KEY
long tmpBits1 = 0L;
if (byteEncode) {
- for (int i=key.length()-1; i >= 0; i--) {
- // Note: we know each byte is <= 0x7f so the "& 0xff" is not needed. But I added it in to keep findbugs happy.
- tmpBits1 |= (byte)key.charAt(i) & 0xff;
+ for (int i = key.length() - 1; i >= 0; i--) {
+ // Note: we know each byte is <= 0x7f so the "& 0xff" is not needed. But I added it in to
+ // keep findbugs happy.
+ tmpBits1 |= (byte) key.charAt(i) & 0xff;
tmpBits1 <<= 8;
}
- tmpBits1 |= 1<<6;
+ tmpBits1 |= 1 << 6;
} else {
- for (int i=key.length()-1; i >= 0; i--) {
+ for (int i = key.length() - 1; i >= 0; i--) {
tmpBits1 |= key.charAt(i);
tmpBits1 <<= 16;
}
@@ -98,20 +91,22 @@ public class VMStatsDiskRegionEntryHeapStringKey1 extends VMStatsDiskRegionEntry
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// common code
protected int hash;
private HashEntry<Object, Object> next;
@SuppressWarnings("unused")
private volatile long lastModified;
- private static final AtomicLongFieldUpdater<VMStatsDiskRegionEntryHeapStringKey1> lastModifiedUpdater
- = AtomicLongFieldUpdater.newUpdater(VMStatsDiskRegionEntryHeapStringKey1.class, "lastModified");
+ private static final AtomicLongFieldUpdater<VMStatsDiskRegionEntryHeapStringKey1> lastModifiedUpdater =
+ AtomicLongFieldUpdater.newUpdater(VMStatsDiskRegionEntryHeapStringKey1.class, "lastModified");
private volatile Object value;
+
@Override
protected Object getValueField() {
return this.value;
}
+
@Override
protected void setValueField(Object v) {
this.value = v;
@@ -120,24 +115,29 @@ public class VMStatsDiskRegionEntryHeapStringKey1 extends VMStatsDiskRegionEntry
protected long getLastModifiedField() {
return lastModifiedUpdater.get(this);
}
+
protected boolean compareAndSetLastModifiedField(long expectedValue, long newValue) {
return lastModifiedUpdater.compareAndSet(this, expectedValue, newValue);
}
+
/**
* @see HashEntry#getEntryHash()
*/
public int getEntryHash() {
return this.hash;
}
+
protected void setEntryHash(int v) {
this.hash = v;
}
+
/**
* @see HashEntry#getNextEntry()
*/
public HashEntry<Object, Object> getNextEntry() {
return this.next;
}
+
/**
* @see HashEntry#setNextEntry
*/
@@ -147,12 +147,13 @@ public class VMStatsDiskRegionEntryHeapStringKey1 extends VMStatsDiskRegionEntry
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// disk code
protected void initialize(RegionEntryContext context, Object value) {
diskInitialize(context, value);
}
+
@Override
public int updateAsyncEntrySize(EnableLRU capacityController) {
throw new IllegalStateException("should never be called");
@@ -160,12 +161,12 @@ public class VMStatsDiskRegionEntryHeapStringKey1 extends VMStatsDiskRegionEntry
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
private void diskInitialize(RegionEntryContext context, Object value) {
- DiskRecoveryStore drs = (DiskRecoveryStore)context;
+ DiskRecoveryStore drs = (DiskRecoveryStore) context;
DiskStoreImpl ds = drs.getDiskStore();
long maxOplogSize = ds.getMaxOplogSize();
- //get appropriate instance of DiskId implementation based on maxOplogSize
+ // get appropriate instance of DiskId implementation based on maxOplogSize
this.id = DiskId.createDiskId(maxOplogSize, true/* is persistence */, ds.needsLinkedList());
Helper.initialize(this, drs, value);
}
@@ -175,60 +176,60 @@ public class VMStatsDiskRegionEntryHeapStringKey1 extends VMStatsDiskRegionEntry
*
* @since GemFire 5.1
*/
- protected DiskId id;//= new DiskId();
+ protected DiskId id;// = new DiskId();
+
public DiskId getDiskId() {
return this.id;
}
+
@Override
void setDiskId(RegionEntry old) {
- this.id = ((AbstractDiskRegionEntry)old).getDiskId();
+ this.id = ((AbstractDiskRegionEntry) old).getDiskId();
}
-// // inlining DiskId
-// // always have these fields
-// /**
-// * id consists of
-// * most significant
-// * 1 byte = users bits
-// * 2-8 bytes = oplog id
-// * least significant.
-// *
-// * The highest bit in the oplog id part is set to 1 if the oplog id
-// * is negative.
-// * @todo this field could be an int for an overflow only region
-// */
-// private long id;
-// /**
-// * Length of the bytes on disk.
-// * This is always set. If the value is invalid then it will be set to 0.
-// * The most significant bit is used by overflow to mark it as needing to be written.
-// */
-// protected int valueLength = 0;
-// // have intOffset or longOffset
-// // intOffset
-// /**
-// * The position in the oplog (the oplog offset) where this entry's value is
-// * stored
-// */
-// private volatile int offsetInOplog;
-// // longOffset
-// /**
-// * The position in the oplog (the oplog offset) where this entry's value is
-// * stored
-// */
-// private volatile long offsetInOplog;
-// // have overflowOnly or persistence
-// // overflowOnly
-// // no fields
-// // persistent
-// /** unique entry identifier * */
-// private long keyId;
-
-
+ // // inlining DiskId
+ // // always have these fields
+ // /**
+ // * id consists of
+ // * most significant
+ // * 1 byte = users bits
+ // * 2-8 bytes = oplog id
+ // * least significant.
+ // *
+ // * The highest bit in the oplog id part is set to 1 if the oplog id
+ // * is negative.
+ // * @todo this field could be an int for an overflow only region
+ // */
+ // private long id;
+ // /**
+ // * Length of the bytes on disk.
+ // * This is always set. If the value is invalid then it will be set to 0.
+ // * The most significant bit is used by overflow to mark it as needing to be written.
+ // */
+ // protected int valueLength = 0;
+ // // have intOffset or longOffset
+ // // intOffset
+ // /**
+ // * The position in the oplog (the oplog offset) where this entry's value is
+ // * stored
+ // */
+ // private volatile int offsetInOplog;
+ // // longOffset
+ // /**
+ // * The position in the oplog (the oplog offset) where this entry's value is
+ // * stored
+ // */
+ // private volatile long offsetInOplog;
+ // // have overflowOnly or persistence
+ // // overflowOnly
+ // // no fields
+ // // persistent
+ // /** unique entry identifier * */
+ // private long keyId;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// stats code
@Override
public void updateStatsForGet(boolean hit, long time) {
@@ -239,51 +240,59 @@ public class VMStatsDiskRegionEntryHeapStringKey1 extends VMStatsDiskRegionEntry
incrementMissCount();
}
}
+
@Override
protected void setLastModifiedAndAccessedTimes(long lastModified, long lastAccessed) {
_setLastModified(lastModified);
- if (!DISABLE_ACCESS_TIME_UPDATE_ON_PUT) {
+ if (!DISABLE_ACCESS_TIME_UPDATE_ON_PUT) {
setLastAccessed(lastAccessed);
}
}
+
private volatile long lastAccessed;
private volatile int hitCount;
private volatile int missCount;
-
- private static final AtomicIntegerFieldUpdater<VMStatsDiskRegionEntryHeapStringKey1> hitCountUpdater
- = AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskRegionEntryHeapStringKey1.class, "hitCount");
- private static final AtomicIntegerFieldUpdater<VMStatsDiskRegionEntryHeapStringKey1> missCountUpdater
- = AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskRegionEntryHeapStringKey1.class, "missCount");
-
+
+ private static final AtomicIntegerFieldUpdater<VMStatsDiskRegionEntryHeapStringKey1> hitCountUpdater =
+ AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskRegionEntryHeapStringKey1.class, "hitCount");
+ private static final AtomicIntegerFieldUpdater<VMStatsDiskRegionEntryHeapStringKey1> missCountUpdater =
+ AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskRegionEntryHeapStringKey1.class, "missCount");
+
@Override
public long getLastAccessed() throws InternalStatisticsDisabledException {
return this.lastAccessed;
}
+
private void setLastAccessed(long lastAccessed) {
this.lastAccessed = lastAccessed;
}
+
@Override
public long getHitCount() throws InternalStatisticsDisabledException {
return this.hitCount & 0xFFFFFFFFL;
}
+
@Override
public long getMissCount() throws InternalStatisticsDisabledException {
return this.missCount & 0xFFFFFFFFL;
}
+
private void incrementHitCount() {
hitCountUpdater.incrementAndGet(this);
}
+
private void incrementMissCount() {
missCountUpdater.incrementAndGet(this);
}
+
@Override
public void resetCounts() throws InternalStatisticsDisabledException {
- hitCountUpdater.set(this,0);
- missCountUpdater.set(this,0);
+ hitCountUpdater.set(this, 0);
+ missCountUpdater.set(this, 0);
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
@Override
public void txDidDestroy(long currTime) {
setLastModified(currTime);
@@ -291,39 +300,42 @@ public class VMStatsDiskRegionEntryHeapStringKey1 extends VMStatsDiskRegionEntry
this.hitCount = 0;
this.missCount = 0;
}
+
@Override
public boolean hasStats() {
return true;
}
-
-
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// key code
private final long bits1;
+
private int getKeyLength() {
return (int) (this.bits1 & 0x003fL);
}
+
private int getEncoding() {
// 0 means encoded as char
// 1 means encoded as bytes that are all <= 0x7f;
return (int) (this.bits1 >> 6) & 0x03;
}
+
@Override
public Object getKey() {
int keylen = getKeyLength();
char[] chars = new char[keylen];
long tmpBits1 = this.bits1;
if (getEncoding() == 1) {
- for (int i=0; i < keylen; i++) {
+ for (int i = 0; i < keylen; i++) {
tmpBits1 >>= 8;
- chars[i] = (char) (tmpBits1 & 0x00ff);
+ chars[i] = (char) (tmpBits1 & 0x00ff);
}
} else {
- for (int i=0; i < keylen; i++) {
+ for (int i = 0; i < keylen; i++) {
tmpBits1 >>= 16;
chars[i] = (char) (tmpBits1 & 0x00FFff);
}
@@ -332,16 +344,16 @@ public class VMStatsDiskRegionEntryHeapStringKey1 extends VMStatsDiskRegionEntry
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
@Override
public boolean isKeyEqual(Object k) {
if (k instanceof String) {
- String str = (String)k;
+ String str = (String) k;
int keylen = getKeyLength();
if (str.length() == keylen) {
long tmpBits1 = this.bits1;
if (getEncoding() == 1) {
- for (int i=0; i < keylen; i++) {
+ for (int i = 0; i < keylen; i++) {
tmpBits1 >>= 8;
char c = (char) (tmpBits1 & 0x00ff);
if (str.charAt(i) != c) {
@@ -349,7 +361,7 @@ public class VMStatsDiskRegionEntryHeapStringKey1 extends VMStatsDiskRegionEntry
}
}
} else {
- for (int i=0; i < keylen; i++) {
+ for (int i = 0; i < keylen; i++) {
tmpBits1 >>= 16;
char c = (char) (tmpBits1 & 0x00FFff);
if (str.charAt(i) != c) {
@@ -362,7 +374,7 @@ public class VMStatsDiskRegionEntryHeapStringKey1 extends VMStatsDiskRegionEntry
}
return false;
}
-
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
}
http://git-wip-us.apache.org/repos/asf/geode/blob/5adb681a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapStringKey2.java
index 23d0cc6..2dc2ae6 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskRegionEntryHeapStringKey2.java
@@ -18,22 +18,14 @@ package org.apache.geode.internal.cache;
-
-
-
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.cache.persistence.DiskRecoveryStore;
-
import org.apache.geode.internal.InternalStatisticsDisabledException;
import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
@@ -57,7 +49,7 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha
* ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory).
*/
public class VMStatsDiskRegionEntryHeapStringKey2 extends VMStatsDiskRegionEntryHeap {
- public VMStatsDiskRegionEntryHeapStringKey2 (RegionEntryContext context, String key,
+ public VMStatsDiskRegionEntryHeapStringKey2(RegionEntryContext context, String key,
@@ -65,14 +57,14 @@ public class VMStatsDiskRegionEntryHeapStringKey2 extends VMStatsDiskRegionEntry
, boolean byteEncode
- ) {
- super(context,
+ ) {
+ super(context,
- (value instanceof RecoveredEntry ? null : value)
+ (value instanceof RecoveredEntry ? null : value)
- );
+ );
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
initialize(context, value);
@@ -81,19 +73,20 @@ public class VMStatsDiskRegionEntryHeapStringKey2 extends VMStatsDiskRegionEntry
long tmpBits1 = 0L;
long tmpBits2 = 0L;
if (byteEncode) {
- for (int i=key.length()-1; i >= 0; i--) {
- // Note: we know each byte is <= 0x7f so the "& 0xff" is not needed. But I added it in to keep findbugs happy.
+ for (int i = key.length() - 1; i >= 0; i--) {
+ // Note: we know each byte is <= 0x7f so the "& 0xff" is not needed. But I added it in to
+ // keep findbugs happy.
if (i < 7) {
- tmpBits1 |= (byte)key.charAt(i) & 0xff;
+ tmpBits1 |= (byte) key.charAt(i) & 0xff;
tmpBits1 <<= 8;
} else {
tmpBits2 <<= 8;
- tmpBits2 |= (byte)key.charAt(i) & 0xff;
+ tmpBits2 |= (byte) key.charAt(i) & 0xff;
}
}
- tmpBits1 |= 1<<6;
+ tmpBits1 |= 1 << 6;
} else {
- for (int i=key.length()-1; i >= 0; i--) {
+ for (int i = key.length() - 1; i >= 0; i--) {
if (i < 3) {
tmpBits1 |= key.charAt(i);
tmpBits1 <<= 16;
@@ -110,20 +103,22 @@ public class VMStatsDiskRegionEntryHeapStringKey2 extends VMStatsDiskRegionEntry
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// common code
protected int hash;
private HashEntry<Object, Object> next;
@SuppressWarnings("unused")
private volatile long lastModified;
- private static final AtomicLongFieldUpdater<VMStatsDiskRegionEntryHeapStringKey2> lastModifiedUpdater
- = AtomicLongFieldUpdater.newUpdater(VMStatsDiskRegionEntryHeapStringKey2.class, "lastModified");
+ private static final AtomicLongFieldUpdater<VMStatsDiskRegionEntryHeapStringKey2> lastModifiedUpdater =
+ AtomicLongFieldUpdater.newUpdater(VMStatsDiskRegionEntryHeapStringKey2.class, "lastModified");
private volatile Object value;
+
@Override
protected Object getValueField() {
return this.value;
}
+
@Override
protected void setValueField(Object v) {
this.value = v;
@@ -132,24 +127,29 @@ public class VMStatsDiskRegionEntryHeapStringKey2 extends VMStatsDiskRegionEntry
protected long getLastModifiedField() {
return lastModifiedUpdater.get(this);
}
+
protected boolean compareAndSetLastModifiedField(long expectedValue, long newValue) {
return lastModifiedUpdater.compareAndSet(this, expectedValue, newValue);
}
+
/**
* @see HashEntry#getEntryHash()
*/
public int getEntryHash() {
return this.hash;
}
+
protected void setEntryHash(int v) {
this.hash = v;
}
+
/**
* @see HashEntry#getNextEntry()
*/
public HashEntry<Object, Object> getNextEntry() {
return this.next;
}
+
/**
* @see HashEntry#setNextEntry
*/
@@ -159,12 +159,13 @@ public class VMStatsDiskRegionEntryHeapStringKey2 extends VMStatsDiskRegionEntry
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// disk code
protected void initialize(RegionEntryContext context, Object value) {
diskInitialize(context, value);
}
+
@Override
public int updateAsyncEntrySize(EnableLRU capacityController) {
throw new IllegalStateException("should never be called");
@@ -172,12 +173,12 @@ public class VMStatsDiskRegionEntryHeapStringKey2 extends VMStatsDiskRegionEntry
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
private void diskInitialize(RegionEntryContext context, Object value) {
- DiskRecoveryStore drs = (DiskRecoveryStore)context;
+ DiskRecoveryStore drs = (DiskRecoveryStore) context;
DiskStoreImpl ds = drs.getDiskStore();
long maxOplogSize = ds.getMaxOplogSize();
- //get appropriate instance of DiskId implementation based on maxOplogSize
+ // get appropriate instance of DiskId implementation based on maxOplogSize
this.id = DiskId.createDiskId(maxOplogSize, true/* is persistence */, ds.needsLinkedList());
Helper.initialize(this, drs, value);
}
@@ -187,60 +188,60 @@ public class VMStatsDiskRegionEntryHeapStringKey2 extends VMStatsDiskRegionEntry
*
* @since GemFire 5.1
*/
- protected DiskId id;//= new DiskId();
+ protected DiskId id;// = new DiskId();
+
public DiskId getDiskId() {
return this.id;
}
+
@Override
void setDiskId(RegionEntry old) {
- this.id = ((AbstractDiskRegionEntry)old).getDiskId();
+ this.id = ((AbstractDiskRegionEntry) old).getDiskId();
}
-// // inlining DiskId
-// // always have these fields
-// /**
-// * id consists of
-// * most significant
-// * 1 byte = users bits
-// * 2-8 bytes = oplog id
-// * least significant.
-// *
-// * The highest bit in the oplog id part is set to 1 if the oplog id
-// * is negative.
-// * @todo this field could be an int for an overflow only region
-// */
-// private long id;
-// /**
-// * Length of the bytes on disk.
-// * This is always set. If the value is invalid then it will be set to 0.
-// * The most significant bit is used by overflow to mark it as needing to be written.
-// */
-// protected int valueLength = 0;
-// // have intOffset or longOffset
-// // intOffset
-// /**
-// * The position in the oplog (the oplog offset) where this entry's value is
-// * stored
-// */
-// private volatile int offsetInOplog;
-// // longOffset
-// /**
-// * The position in the oplog (the oplog offset) where this entry's value is
-// * stored
-// */
-// private volatile long offsetInOplog;
-// // have overflowOnly or persistence
-// // overflowOnly
-// // no fields
-// // persistent
-// /** unique entry identifier * */
-// private long keyId;
-
-
+ // // inlining DiskId
+ // // always have these fields
+ // /**
+ // * id consists of
+ // * most significant
+ // * 1 byte = users bits
+ // * 2-8 bytes = oplog id
+ // * least significant.
+ // *
+ // * The highest bit in the oplog id part is set to 1 if the oplog id
+ // * is negative.
+ // * @todo this field could be an int for an overflow only region
+ // */
+ // private long id;
+ // /**
+ // * Length of the bytes on disk.
+ // * This is always set. If the value is invalid then it will be set to 0.
+ // * The most significant bit is used by overflow to mark it as needing to be written.
+ // */
+ // protected int valueLength = 0;
+ // // have intOffset or longOffset
+ // // intOffset
+ // /**
+ // * The position in the oplog (the oplog offset) where this entry's value is
+ // * stored
+ // */
+ // private volatile int offsetInOplog;
+ // // longOffset
+ // /**
+ // * The position in the oplog (the oplog offset) where this entry's value is
+ // * stored
+ // */
+ // private volatile long offsetInOplog;
+ // // have overflowOnly or persistence
+ // // overflowOnly
+ // // no fields
+ // // persistent
+ // /** unique entry identifier * */
+ // private long keyId;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// stats code
@Override
public void updateStatsForGet(boolean hit, long time) {
@@ -251,51 +252,59 @@ public class VMStatsDiskRegionEntryHeapStringKey2 extends VMStatsDiskRegionEntry
incrementMissCount();
}
}
+
@Override
protected void setLastModifiedAndAccessedTimes(long lastModified, long lastAccessed) {
_setLastModified(lastModified);
- if (!DISABLE_ACCESS_TIME_UPDATE_ON_PUT) {
+ if (!DISABLE_ACCESS_TIME_UPDATE_ON_PUT) {
setLastAccessed(lastAccessed);
}
}
+
private volatile long lastAccessed;
private volatile int hitCount;
private volatile int missCount;
-
- private static final AtomicIntegerFieldUpdater<VMStatsDiskRegionEntryHeapStringKey2> hitCountUpdater
- = AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskRegionEntryHeapStringKey2.class, "hitCount");
- private static final AtomicIntegerFieldUpdater<VMStatsDiskRegionEntryHeapStringKey2> missCountUpdater
- = AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskRegionEntryHeapStringKey2.class, "missCount");
-
+
+ private static final AtomicIntegerFieldUpdater<VMStatsDiskRegionEntryHeapStringKey2> hitCountUpdater =
+ AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskRegionEntryHeapStringKey2.class, "hitCount");
+ private static final AtomicIntegerFieldUpdater<VMStatsDiskRegionEntryHeapStringKey2> missCountUpdater =
+ AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskRegionEntryHeapStringKey2.class, "missCount");
+
@Override
public long getLastAccessed() throws InternalStatisticsDisabledException {
return this.lastAccessed;
}
+
private void setLastAccessed(long lastAccessed) {
this.lastAccessed = lastAccessed;
}
+
@Override
public long getHitCount() throws InternalStatisticsDisabledException {
return this.hitCount & 0xFFFFFFFFL;
}
+
@Override
public long getMissCount() throws InternalStatisticsDisabledException {
return this.missCount & 0xFFFFFFFFL;
}
+
private void incrementHitCount() {
hitCountUpdater.incrementAndGet(this);
}
+
private void incrementMissCount() {
missCountUpdater.incrementAndGet(this);
}
+
@Override
public void resetCounts() throws InternalStatisticsDisabledException {
- hitCountUpdater.set(this,0);
- missCountUpdater.set(this,0);
+ hitCountUpdater.set(this, 0);
+ missCountUpdater.set(this, 0);
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
@Override
public void txDidDestroy(long currTime) {
setLastModified(currTime);
@@ -303,16 +312,16 @@ public class VMStatsDiskRegionEntryHeapStringKey2 extends VMStatsDiskRegionEntry
this.hitCount = 0;
this.missCount = 0;
}
+
@Override
public boolean hasStats() {
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)
@@ -321,14 +330,17 @@ public class VMStatsDiskRegionEntryHeapStringKey2 extends VMStatsDiskRegionEntry
private final long bits1;
// bits2 encodes character data
private final long bits2;
+
private int getKeyLength() {
return (int) (this.bits1 & 0x003fL);
}
+
private int getEncoding() {
// 0 means encoded as char
// 1 means encoded as bytes that are all <= 0x7f;
return (int) (this.bits1 >> 6) & 0x03;
}
+
@Override
public Object getKey() {
int keylen = getKeyLength();
@@ -336,7 +348,7 @@ public class VMStatsDiskRegionEntryHeapStringKey2 extends VMStatsDiskRegionEntry
long tmpBits1 = this.bits1;
long tmpBits2 = this.bits2;
if (getEncoding() == 1) {
- for (int i=0; i < keylen; i++) {
+ for (int i = 0; i < keylen; i++) {
if (i < 7) {
tmpBits1 >>= 8;
chars[i] = (char) (tmpBits1 & 0x00ff);
@@ -346,10 +358,10 @@ public class VMStatsDiskRegionEntryHeapStringKey2 extends VMStatsDiskRegionEntry
}
}
} else {
- for (int i=0; i < keylen; i++) {
+ for (int i = 0; i < keylen; i++) {
if (i < 3) {
tmpBits1 >>= 16;
- chars[i] = (char) (tmpBits1 & 0x00FFff);
+ chars[i] = (char) (tmpBits1 & 0x00FFff);
} else {
chars[i] = (char) (tmpBits2 & 0x00FFff);
tmpBits2 >>= 16;
@@ -360,17 +372,17 @@ public class VMStatsDiskRegionEntryHeapStringKey2 extends VMStatsDiskRegionEntry
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
@Override
public boolean isKeyEqual(Object k) {
if (k instanceof String) {
- String str = (String)k;
+ String str = (String) k;
int keylen = getKeyLength();
if (str.length() == keylen) {
long tmpBits1 = this.bits1;
long tmpBits2 = this.bits2;
if (getEncoding() == 1) {
- for (int i=0; i < keylen; i++) {
+ for (int i = 0; i < keylen; i++) {
char c;
if (i < 7) {
tmpBits1 >>= 8;
@@ -384,7 +396,7 @@ public class VMStatsDiskRegionEntryHeapStringKey2 extends VMStatsDiskRegionEntry
}
}
} else {
- for (int i=0; i < keylen; i++) {
+ for (int i = 0; i < keylen; i++) {
char c;
if (i < 3) {
tmpBits1 >>= 16;