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/01 22:57:46 UTC
[23/51] [partial] geode git commit: GEODE-2632: change dependencies
on GemFireCacheImpl to InternalCache
http://git-wip-us.apache.org/repos/asf/geode/blob/d4f23332/geode-core/src/main/java/org/apache/geode/internal/cache/TXSynchronizationRunnable.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/TXSynchronizationRunnable.java b/geode-core/src/main/java/org/apache/geode/internal/cache/TXSynchronizationRunnable.java
index cebf3e6..35b0e75 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/TXSynchronizationRunnable.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/TXSynchronizationRunnable.java
@@ -16,7 +16,6 @@ package org.apache.geode.internal.cache;
import org.apache.logging.log4j.Logger;
-import org.apache.geode.distributed.internal.InternalDistributedSystem;
import org.apache.geode.internal.logging.LogService;
/**
@@ -26,7 +25,6 @@ import org.apache.geode.internal.logging.LogService;
* behavior.
*
* @since GemFire 6.6
- *
*/
public class TXSynchronizationRunnable implements Runnable {
private static final Logger logger = LogService.getLogger();
@@ -55,7 +53,7 @@ public class TXSynchronizationRunnable implements Runnable {
}
this.firstRunnableCompleted = true;
this.firstRunnable = null;
- this.firstRunnableSync.notify();
+ this.firstRunnableSync.notifyAll();
}
}
synchronized (this.secondRunnableSync) {
@@ -68,11 +66,11 @@ public class TXSynchronizationRunnable implements Runnable {
logger.trace("waiting for afterCompletion notification");
}
this.secondRunnableSync.wait(1000);
- } catch (InterruptedException e) {
+ } catch (InterruptedException ignore) {
// eat the interrupt and check for exit conditions
}
if (this.secondRunnable == null) {
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
+ InternalCache cache = GemFireCacheImpl.getInstance();
if (cache == null || cache.getCancelCriterion().isCancelInProgress()) {
return;
}
@@ -91,7 +89,7 @@ public class TXSynchronizationRunnable implements Runnable {
}
this.secondRunnableCompleted = true;
this.secondRunnable = null;
- this.secondRunnableSync.notify();
+ this.secondRunnableSync.notifyAll();
}
}
}
@@ -104,12 +102,12 @@ public class TXSynchronizationRunnable implements Runnable {
while (!this.firstRunnableCompleted) {
try {
this.firstRunnableSync.wait(1000);
- } catch (InterruptedException e) {
+ } catch (InterruptedException ignore) {
// eat the interrupt and check for exit conditions
}
// we really need the Cache Server's cancel criterion here, not the cache's
// but who knows how to get it?
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
+ InternalCache cache = GemFireCacheImpl.getInstance();
if (cache == null) {
return;
}
@@ -121,22 +119,20 @@ public class TXSynchronizationRunnable implements Runnable {
/**
* run the afterCompletion portion of synchronization. This method schedules execution of the
* given runnable and then waits for it to finish running
- *
- * @param r
*/
public void runSecondRunnable(Runnable r) {
synchronized (this.secondRunnableSync) {
this.secondRunnable = r;
- this.secondRunnableSync.notify();
+ this.secondRunnableSync.notifyAll();
while (!this.secondRunnableCompleted && !this.abort) {
try {
this.secondRunnableSync.wait(1000);
- } catch (InterruptedException e) {
+ } catch (InterruptedException ignore) {
// eat the interrupt and check for exit conditions
}
// we really need the Cache Server's cancel criterion here, not the cache's
// but who knows how to get it?
- GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
+ InternalCache cache = GemFireCacheImpl.getInstance();
if (cache == null) {
return;
}
http://git-wip-us.apache.org/repos/asf/geode/blob/d4f23332/geode-core/src/main/java/org/apache/geode/internal/cache/TombstoneService.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/TombstoneService.java b/geode-core/src/main/java/org/apache/geode/internal/cache/TombstoneService.java
index 0df27c8..bf5b97c 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/TombstoneService.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/TombstoneService.java
@@ -14,6 +14,24 @@
*/
package org.apache.geode.internal.cache;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Queue;
+import java.util.Set;
+import java.util.concurrent.ConcurrentLinkedQueue;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.function.Predicate;
+
+import org.apache.logging.log4j.Logger;
+
import org.apache.geode.CancelCriterion;
import org.apache.geode.CancelException;
import org.apache.geode.SystemFailure;
@@ -30,15 +48,6 @@ import org.apache.geode.internal.logging.log4j.LocalizedMessage;
import org.apache.geode.internal.logging.log4j.LogMarker;
import org.apache.geode.internal.size.ReflectionSingleObjectSizer;
import org.apache.geode.internal.util.concurrent.StoppableReentrantLock;
-import org.apache.logging.log4j.Logger;
-
-import java.util.*;
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicLong;
-import java.util.function.Predicate;
/**
* Tombstones are region entries that have been destroyed but are held for future concurrency
@@ -46,7 +55,6 @@ import java.util.function.Predicate;
* possibility of concurrent modification conflicts.
* <p>
* The cache holds a tombstone service that is responsible for tracking and timing out tombstones.
- *
*/
public class TombstoneService {
private static final Logger logger = LogService.getLogger();
@@ -61,7 +69,7 @@ public class TombstoneService {
* The default is 600,000 milliseconds (10 minutes).
*/
public static long REPLICATE_TOMBSTONE_TIMEOUT =
- Long.getLong(DistributionConfig.GEMFIRE_PREFIX + "tombstone-timeout", 600000L).longValue();
+ Long.getLong(DistributionConfig.GEMFIRE_PREFIX + "tombstone-timeout", 600000L);
/**
* The default tombstone expiration period in millis for non-replicate/partition regions. This
@@ -111,13 +119,11 @@ public class TombstoneService {
private final ReplicateTombstoneSweeper replicatedTombstoneSweeper;
private final NonReplicateTombstoneSweeper nonReplicatedTombstoneSweeper;
- public static TombstoneService initialize(GemFireCacheImpl cache) {
- TombstoneService instance = new TombstoneService(cache);
- // cache.getResourceManager().addResourceListener(instance); experimental
- return instance;
+ public static TombstoneService initialize(InternalCache cache) {
+ return new TombstoneService(cache);
}
- private TombstoneService(GemFireCacheImpl cache) {
+ private TombstoneService(InternalCache cache) {
this.replicatedTombstoneSweeper =
new ReplicateTombstoneSweeper(cache, cache.getCachePerfStats(), cache.getCancelCriterion(),
cache.getDistributionManager().getWaitingThreadPool());
@@ -165,11 +171,8 @@ public class TombstoneService {
}
}
-
/**
* remove all tombstones for the given region. Do this when the region is cleared or destroyed.
- *
- * @param r
*/
public void unscheduleTombstones(LocalRegion r) {
getSweeper(r).unscheduleTombstones(r);
@@ -225,7 +228,7 @@ public class TombstoneService {
destroyingMember = myId;
}
Long maxReclaimedRV = regionGCVersions.get(destroyingMember);
- if (maxReclaimedRV != null && t.getRegionVersion() <= maxReclaimedRV.longValue()) {
+ if (maxReclaimedRV != null && t.getRegionVersion() <= maxReclaimedRV) {
removals.add(t);
return true;
}
@@ -303,7 +306,6 @@ public class TombstoneService {
/**
* For test purposes only, force the expiration of a number of tombstones for replicated regions.
*
- * @throws InterruptedException
* @return true if the expiration occurred
*/
public boolean forceBatchExpirationForTests(int count) throws InterruptedException {
@@ -847,7 +849,7 @@ public class TombstoneService {
}
try {
this.sweeperThread.join(100);
- } catch (InterruptedException e) {
+ } catch (InterruptedException ignore) {
Thread.currentThread().interrupt();
}
}
@@ -892,7 +894,7 @@ public class TombstoneService {
checkOldestUnexpired(now);
purgeObsoleteTombstones(now);
doSleep();
- } catch (CancelException e) {
+ } catch (CancelException ignore) {
break;
} catch (VirtualMachineError err) { // GemStoneAddition
SystemFailure.initiateFailure(err);
@@ -926,7 +928,7 @@ public class TombstoneService {
}
try {
this.wait(sleepTime);
- } catch (InterruptedException e) {
+ } catch (InterruptedException ignore) {
}
}
}
@@ -945,7 +947,6 @@ public class TombstoneService {
return;
}
lastPurgeTimestamp = now;
- long start = now;
// see if any have been superseded
boolean removedObsoleteTombstone = removeIf(tombstone -> {
if (tombstone.region.getRegionMap().isTombstoneNotNeeded(tombstone.entry,
@@ -960,7 +961,7 @@ public class TombstoneService {
if (removedObsoleteTombstone) {
sleepTime = 0;
} else {
- long elapsed = getNow() - start;
+ long elapsed = getNow() - now;
sleepTime -= elapsed;
if (sleepTime <= 0) {
minimumPurgeTime = elapsed;
@@ -991,7 +992,7 @@ public class TombstoneService {
try {
tombstones.remove();
expireTombstone(oldest);
- } catch (CancelException e) {
+ } catch (CancelException ignore) {
// nothing needed
} catch (Exception e) {
logger.warn(
http://git-wip-us.apache.org/repos/asf/geode/blob/d4f23332/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapIntKey.java
index 016392d..cd7f8bf 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapIntKey.java
@@ -15,85 +15,120 @@
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.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.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
// macros whose definition changes this class:
-// disk: DISK
-// lru: LRU
-// stats: STATS
+// disk: 1
+// 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 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 VMStatsDiskLRURegionEntryHeapIntKey extends VMStatsDiskLRURegionEntryHeap {
- public VMStatsDiskLRURegionEntryHeapIntKey(RegionEntryContext context, int key, Object value) {
- super(context, (value instanceof RecoveredEntry ? null : value));
+ public VMStatsDiskLRURegionEntryHeapIntKey (RegionEntryContext context, int key,
+
+
+
+ Object value
+
+
+
+ ) {
+ super(context,
+
+ (value instanceof RecoveredEntry ? null : value)
+
+
+
+ );
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
initialize(context, value);
+
+
+
+
this.key = key;
+
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// common code
protected int hash;
private HashEntry<Object, Object> next;
@SuppressWarnings("unused")
private volatile long lastModified;
- private static final AtomicLongFieldUpdater<VMStatsDiskLRURegionEntryHeapIntKey> lastModifiedUpdater =
- AtomicLongFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryHeapIntKey.class, "lastModified");
- private volatile Object value;
+ private static final AtomicLongFieldUpdater<VMStatsDiskLRURegionEntryHeapIntKey> lastModifiedUpdater
+ = AtomicLongFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryHeapIntKey.class, "lastModified");
+ private volatile Object value;
@Override
protected final Object getValueField() {
return this.value;
}
-
@Override
protected void setValueField(Object v) {
this.value = v;
}
- protected long getlastModifiedField() {
+ protected long getLastModifiedField() {
return lastModifiedUpdater.get(this);
}
-
protected boolean compareAndSetLastModifiedField(long expectedValue, long newValue) {
return lastModifiedUpdater.compareAndSet(this, expectedValue, newValue);
}
-
/**
* @see HashEntry#getEntryHash()
*/
public final int getEntryHash() {
return this.hash;
}
-
protected void setEntryHash(int v) {
this.hash = v;
}
-
/**
* @see HashEntry#getNextEntry()
*/
public final HashEntry<Object, Object> getNextEntry() {
return this.next;
}
-
/**
* @see HashEntry#setNextEntry
*/
@@ -101,12 +136,15 @@ public class VMStatsDiskLRURegionEntryHeapIntKey extends VMStatsDiskLRURegionEnt
this.next = n;
}
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// disk code
+
protected void initialize(RegionEntryContext drs, Object value) {
boolean isBackup;
if (drs instanceof LocalRegion) {
- isBackup = ((LocalRegion) drs).getDiskRegion().isBackup();
+ isBackup = ((LocalRegion)drs).getDiskRegion().isBackup();
} else if (drs instanceof PlaceHolderDiskRegion) {
isBackup = true;
} else {
@@ -117,22 +155,23 @@ public class VMStatsDiskLRURegionEntryHeapIntKey extends VMStatsDiskLRURegionEnt
diskInitialize(drs, value);
}
}
-
@Override
public final 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;
}
+
// 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);
}
@@ -142,158 +181,162 @@ public class VMStatsDiskLRURegionEntryHeapIntKey extends VMStatsDiskLRURegionEnt
*
* @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) {
+
DiskStoreImpl ds = r.getDiskStore();
long maxOplogSize = ds.getMaxOplogSize();
this.id = DiskId.createDiskId(maxOplogSize, false /* over flow only */, ds.needsLinkedList());
- }
+
+
+ }
public final synchronized int updateEntrySize(EnableLRU capacityController) {
- 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 final synchronized int updateEntrySize(EnableLRU capacityController, Object value) {
+
+ public final 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;
- // 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 );
+ // 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() {
return areAnyBitsSet(RECENTLY_USED);
}
-
@Override
public final void setRecentlyUsed() {
setBits(RECENTLY_USED);
}
-
public final void unsetRecentlyUsed() {
clearBits(~RECENTLY_USED);
}
-
public final boolean testEvicted() {
return areAnyBitsSet(EVICTED);
}
-
public final void setEvicted() {
setBits(EVICTED);
}
-
public final 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 final void setNextLRUNode( LRUClockNode next ) {
this.nextLRU = next;
}
-
public final LRUClockNode nextLRUNode() {
return this.nextLRU;
}
-
- public final void setPrevLRUNode(LRUClockNode prev) {
+ public final void setPrevLRUNode( LRUClockNode prev ) {
this.prevLRU = prev;
}
-
public final LRUClockNode prevLRUNode() {
return this.prevLRU;
}
-
public final int getEntrySize() {
return this.size;
}
-
protected final 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 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 final void updateStatsForGet(boolean hit, long time)
+ {
setLastAccessed(time);
if (hit) {
incrementHitCount();
@@ -301,57 +344,51 @@ public class VMStatsDiskLRURegionEntryHeapIntKey extends VMStatsDiskLRURegionEnt
incrementMissCount();
}
}
-
@Override
protected final 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<VMStatsDiskLRURegionEntryHeapIntKey> hitCountUpdater =
- AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryHeapIntKey.class, "hitCount");
- private static final AtomicIntegerFieldUpdater<VMStatsDiskLRURegionEntryHeapIntKey> missCountUpdater =
- AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryHeapIntKey.class, "missCount");
-
+
+ private static final AtomicIntegerFieldUpdater<VMStatsDiskLRURegionEntryHeapIntKey> hitCountUpdater
+ = AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryHeapIntKey.class, "hitCount");
+ private static final AtomicIntegerFieldUpdater<VMStatsDiskLRURegionEntryHeapIntKey> missCountUpdater
+ = AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryHeapIntKey.class, "missCount");
+
@Override
public final long getLastAccessed() throws InternalStatisticsDisabledException {
return this.lastAccessed;
}
-
private void setLastAccessed(long lastAccessed) {
this.lastAccessed = lastAccessed;
}
-
@Override
public final long getHitCount() throws InternalStatisticsDisabledException {
return this.hitCount & 0xFFFFFFFFL;
}
-
@Override
public final long getMissCount() throws InternalStatisticsDisabledException {
return this.missCount & 0xFFFFFFFFL;
}
-
private void incrementHitCount() {
hitCountUpdater.incrementAndGet(this);
}
-
private void incrementMissCount() {
missCountUpdater.incrementAndGet(this);
}
-
@Override
public final 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 final void txDidDestroy(long currTime) {
setLastModified(currTime);
@@ -359,21 +396,30 @@ public class VMStatsDiskLRURegionEntryHeapIntKey extends VMStatsDiskLRURegionEnt
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 int key;
+
+
+
+
+
+
+
+ private final int key;
@Override
public final Object getKey() {
return this.key;
}
-
@Override
public boolean isKeyEqual(Object k) {
if (k instanceof Integer) {
@@ -381,5 +427,8 @@ public class VMStatsDiskLRURegionEntryHeapIntKey extends VMStatsDiskLRURegionEnt
}
return false;
}
+
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
}
+
http://git-wip-us.apache.org/repos/asf/geode/blob/d4f23332/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapLongKey.java
index 4e6f8fa..ce3ac88 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapLongKey.java
@@ -15,85 +15,122 @@
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.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.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
// macros whose definition changes this class:
-// disk: DISK
-// lru: LRU
-// stats: STATS
+// disk: 1
+// 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 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 VMStatsDiskLRURegionEntryHeapLongKey extends VMStatsDiskLRURegionEntryHeap {
- public VMStatsDiskLRURegionEntryHeapLongKey(RegionEntryContext context, long key, Object value) {
- super(context, (value instanceof RecoveredEntry ? null : value));
+ public VMStatsDiskLRURegionEntryHeapLongKey (RegionEntryContext context, long key,
+
+
+
+ Object value
+
+
+
+ ) {
+ super(context,
+
+ (value instanceof RecoveredEntry ? null : value)
+
+
+
+ );
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
initialize(context, value);
+
+
+
+
+
+
this.key = key;
+
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// common code
protected int hash;
private HashEntry<Object, Object> next;
@SuppressWarnings("unused")
private volatile long lastModified;
- private static final AtomicLongFieldUpdater<VMStatsDiskLRURegionEntryHeapLongKey> lastModifiedUpdater =
- AtomicLongFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryHeapLongKey.class, "lastModified");
- private volatile Object value;
+ private static final AtomicLongFieldUpdater<VMStatsDiskLRURegionEntryHeapLongKey> lastModifiedUpdater
+ = AtomicLongFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryHeapLongKey.class, "lastModified");
+ private volatile Object value;
@Override
protected final Object getValueField() {
return this.value;
}
-
@Override
protected void setValueField(Object v) {
this.value = v;
}
- protected long getlastModifiedField() {
+ protected long getLastModifiedField() {
return lastModifiedUpdater.get(this);
}
-
protected boolean compareAndSetLastModifiedField(long expectedValue, long newValue) {
return lastModifiedUpdater.compareAndSet(this, expectedValue, newValue);
}
-
/**
* @see HashEntry#getEntryHash()
*/
public final int getEntryHash() {
return this.hash;
}
-
protected void setEntryHash(int v) {
this.hash = v;
}
-
/**
* @see HashEntry#getNextEntry()
*/
public final HashEntry<Object, Object> getNextEntry() {
return this.next;
}
-
/**
* @see HashEntry#setNextEntry
*/
@@ -101,12 +138,15 @@ public class VMStatsDiskLRURegionEntryHeapLongKey extends VMStatsDiskLRURegionEn
this.next = n;
}
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// disk code
+
protected void initialize(RegionEntryContext drs, Object value) {
boolean isBackup;
if (drs instanceof LocalRegion) {
- isBackup = ((LocalRegion) drs).getDiskRegion().isBackup();
+ isBackup = ((LocalRegion)drs).getDiskRegion().isBackup();
} else if (drs instanceof PlaceHolderDiskRegion) {
isBackup = true;
} else {
@@ -117,22 +157,23 @@ public class VMStatsDiskLRURegionEntryHeapLongKey extends VMStatsDiskLRURegionEn
diskInitialize(drs, value);
}
}
-
@Override
public final 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;
}
+
// 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);
}
@@ -142,158 +183,162 @@ public class VMStatsDiskLRURegionEntryHeapLongKey extends VMStatsDiskLRURegionEn
*
* @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) {
+
DiskStoreImpl ds = r.getDiskStore();
long maxOplogSize = ds.getMaxOplogSize();
this.id = DiskId.createDiskId(maxOplogSize, false /* over flow only */, ds.needsLinkedList());
- }
+
+
+ }
public final synchronized int updateEntrySize(EnableLRU capacityController) {
- 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 final synchronized int updateEntrySize(EnableLRU capacityController, Object value) {
+
+ public final 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;
- // 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 );
+ // 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() {
return areAnyBitsSet(RECENTLY_USED);
}
-
@Override
public final void setRecentlyUsed() {
setBits(RECENTLY_USED);
}
-
public final void unsetRecentlyUsed() {
clearBits(~RECENTLY_USED);
}
-
public final boolean testEvicted() {
return areAnyBitsSet(EVICTED);
}
-
public final void setEvicted() {
setBits(EVICTED);
}
-
public final 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 final void setNextLRUNode( LRUClockNode next ) {
this.nextLRU = next;
}
-
public final LRUClockNode nextLRUNode() {
return this.nextLRU;
}
-
- public final void setPrevLRUNode(LRUClockNode prev) {
+ public final void setPrevLRUNode( LRUClockNode prev ) {
this.prevLRU = prev;
}
-
public final LRUClockNode prevLRUNode() {
return this.prevLRU;
}
-
public final int getEntrySize() {
return this.size;
}
-
protected final 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 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 final void updateStatsForGet(boolean hit, long time)
+ {
setLastAccessed(time);
if (hit) {
incrementHitCount();
@@ -301,57 +346,51 @@ public class VMStatsDiskLRURegionEntryHeapLongKey extends VMStatsDiskLRURegionEn
incrementMissCount();
}
}
-
@Override
protected final 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<VMStatsDiskLRURegionEntryHeapLongKey> hitCountUpdater =
- AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryHeapLongKey.class, "hitCount");
- private static final AtomicIntegerFieldUpdater<VMStatsDiskLRURegionEntryHeapLongKey> missCountUpdater =
- AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryHeapLongKey.class, "missCount");
-
+
+ private static final AtomicIntegerFieldUpdater<VMStatsDiskLRURegionEntryHeapLongKey> hitCountUpdater
+ = AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryHeapLongKey.class, "hitCount");
+ private static final AtomicIntegerFieldUpdater<VMStatsDiskLRURegionEntryHeapLongKey> missCountUpdater
+ = AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryHeapLongKey.class, "missCount");
+
@Override
public final long getLastAccessed() throws InternalStatisticsDisabledException {
return this.lastAccessed;
}
-
private void setLastAccessed(long lastAccessed) {
this.lastAccessed = lastAccessed;
}
-
@Override
public final long getHitCount() throws InternalStatisticsDisabledException {
return this.hitCount & 0xFFFFFFFFL;
}
-
@Override
public final long getMissCount() throws InternalStatisticsDisabledException {
return this.missCount & 0xFFFFFFFFL;
}
-
private void incrementHitCount() {
hitCountUpdater.incrementAndGet(this);
}
-
private void incrementMissCount() {
missCountUpdater.incrementAndGet(this);
}
-
@Override
public final 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 final void txDidDestroy(long currTime) {
setLastModified(currTime);
@@ -359,21 +398,23 @@ public class VMStatsDiskLRURegionEntryHeapLongKey extends VMStatsDiskLRURegionEn
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;
+ private final long key;
@Override
public final Object getKey() {
return this.key;
}
-
@Override
public boolean isKeyEqual(Object k) {
if (k instanceof Long) {
@@ -381,5 +422,8 @@ public class VMStatsDiskLRURegionEntryHeapLongKey extends VMStatsDiskLRURegionEn
}
return false;
}
+
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
}
+
http://git-wip-us.apache.org/repos/asf/geode/blob/d4f23332/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapObjectKey.java
index 5fb7e66..de8959b 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapObjectKey.java
@@ -15,87 +15,118 @@
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.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.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
// macros whose definition changes this class:
-// disk: DISK
-// lru: LRU
-// stats: STATS
+// disk: 1
+// lru: 1
+// stats: 1
// versioned: VERSIONED
// offheap: OFFHEAP
// One of the following key macros must be defined:
-// key object: KEY_OBJECT
+// key object: 1
// key int: KEY_INT
// key long: KEY_LONG
// key uuid: KEY_UUID
// key string1: KEY_STRING1
// key string2: KEY_STRING2
+
/**
* Do not modify this class. It was generated. Instead modify LeafRegionEntry.cpp and then run
* ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory).
*/
public class VMStatsDiskLRURegionEntryHeapObjectKey extends VMStatsDiskLRURegionEntryHeap {
- public VMStatsDiskLRURegionEntryHeapObjectKey(RegionEntryContext context, Object key,
- Object value) {
- super(context, (value instanceof RecoveredEntry ? null : value));
+ public VMStatsDiskLRURegionEntryHeapObjectKey (RegionEntryContext context, Object key,
+
+
+
+ Object value
+
+
+
+ ) {
+ super(context,
+
+ (value instanceof RecoveredEntry ? null : value)
+
+
+
+ );
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
initialize(context, value);
+
+
this.key = key;
+
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// common code
protected int hash;
private HashEntry<Object, Object> next;
@SuppressWarnings("unused")
private volatile long lastModified;
- private static final AtomicLongFieldUpdater<VMStatsDiskLRURegionEntryHeapObjectKey> lastModifiedUpdater =
- AtomicLongFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryHeapObjectKey.class,
- "lastModified");
- private volatile Object value;
+ private static final AtomicLongFieldUpdater<VMStatsDiskLRURegionEntryHeapObjectKey> lastModifiedUpdater
+ = AtomicLongFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryHeapObjectKey.class, "lastModified");
+ private volatile Object value;
@Override
protected final Object getValueField() {
return this.value;
}
-
@Override
protected void setValueField(Object v) {
this.value = v;
}
- protected long getlastModifiedField() {
+ protected long getLastModifiedField() {
return lastModifiedUpdater.get(this);
}
-
protected boolean compareAndSetLastModifiedField(long expectedValue, long newValue) {
return lastModifiedUpdater.compareAndSet(this, expectedValue, newValue);
}
-
/**
* @see HashEntry#getEntryHash()
*/
public final int getEntryHash() {
return this.hash;
}
-
protected void setEntryHash(int v) {
this.hash = v;
}
-
/**
* @see HashEntry#getNextEntry()
*/
public final HashEntry<Object, Object> getNextEntry() {
return this.next;
}
-
/**
* @see HashEntry#setNextEntry
*/
@@ -103,12 +134,15 @@ public class VMStatsDiskLRURegionEntryHeapObjectKey extends VMStatsDiskLRURegion
this.next = n;
}
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// disk code
+
protected void initialize(RegionEntryContext drs, Object value) {
boolean isBackup;
if (drs instanceof LocalRegion) {
- isBackup = ((LocalRegion) drs).getDiskRegion().isBackup();
+ isBackup = ((LocalRegion)drs).getDiskRegion().isBackup();
} else if (drs instanceof PlaceHolderDiskRegion) {
isBackup = true;
} else {
@@ -119,22 +153,23 @@ public class VMStatsDiskLRURegionEntryHeapObjectKey extends VMStatsDiskLRURegion
diskInitialize(drs, value);
}
}
-
@Override
public final 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;
}
+
// 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);
}
@@ -144,158 +179,162 @@ public class VMStatsDiskLRURegionEntryHeapObjectKey extends VMStatsDiskLRURegion
*
* @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) {
+
DiskStoreImpl ds = r.getDiskStore();
long maxOplogSize = ds.getMaxOplogSize();
this.id = DiskId.createDiskId(maxOplogSize, false /* over flow only */, ds.needsLinkedList());
- }
+
+
+ }
public final synchronized int updateEntrySize(EnableLRU capacityController) {
- 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 final synchronized int updateEntrySize(EnableLRU capacityController, Object value) {
+
+ public final 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;
- // 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 );
+ // 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() {
return areAnyBitsSet(RECENTLY_USED);
}
-
@Override
public final void setRecentlyUsed() {
setBits(RECENTLY_USED);
}
-
public final void unsetRecentlyUsed() {
clearBits(~RECENTLY_USED);
}
-
public final boolean testEvicted() {
return areAnyBitsSet(EVICTED);
}
-
public final void setEvicted() {
setBits(EVICTED);
}
-
public final 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 final void setNextLRUNode( LRUClockNode next ) {
this.nextLRU = next;
}
-
public final LRUClockNode nextLRUNode() {
return this.nextLRU;
}
-
- public final void setPrevLRUNode(LRUClockNode prev) {
+ public final void setPrevLRUNode( LRUClockNode prev ) {
this.prevLRU = prev;
}
-
public final LRUClockNode prevLRUNode() {
return this.prevLRU;
}
-
public final int getEntrySize() {
return this.size;
}
-
protected final 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 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 final void updateStatsForGet(boolean hit, long time)
+ {
setLastAccessed(time);
if (hit) {
incrementHitCount();
@@ -303,59 +342,51 @@ public class VMStatsDiskLRURegionEntryHeapObjectKey extends VMStatsDiskLRURegion
incrementMissCount();
}
}
-
@Override
protected final 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<VMStatsDiskLRURegionEntryHeapObjectKey> hitCountUpdater =
- AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryHeapObjectKey.class,
- "hitCount");
- private static final AtomicIntegerFieldUpdater<VMStatsDiskLRURegionEntryHeapObjectKey> missCountUpdater =
- AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryHeapObjectKey.class,
- "missCount");
-
+
+ private static final AtomicIntegerFieldUpdater<VMStatsDiskLRURegionEntryHeapObjectKey> hitCountUpdater
+ = AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryHeapObjectKey.class, "hitCount");
+ private static final AtomicIntegerFieldUpdater<VMStatsDiskLRURegionEntryHeapObjectKey> missCountUpdater
+ = AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryHeapObjectKey.class, "missCount");
+
@Override
public final long getLastAccessed() throws InternalStatisticsDisabledException {
return this.lastAccessed;
}
-
private void setLastAccessed(long lastAccessed) {
this.lastAccessed = lastAccessed;
}
-
@Override
public final long getHitCount() throws InternalStatisticsDisabledException {
return this.hitCount & 0xFFFFFFFFL;
}
-
@Override
public final long getMissCount() throws InternalStatisticsDisabledException {
return this.missCount & 0xFFFFFFFFL;
}
-
private void incrementHitCount() {
hitCountUpdater.incrementAndGet(this);
}
-
private void incrementMissCount() {
missCountUpdater.incrementAndGet(this);
}
-
@Override
public final 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 final void txDidDestroy(long currTime) {
setLastModified(currTime);
@@ -363,19 +394,25 @@ public class VMStatsDiskLRURegionEntryHeapObjectKey extends VMStatsDiskLRURegion
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;
+ private final Object key;
@Override
public final 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/d4f23332/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapStringKey1.java
index dafc106..120fca4 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapStringKey1.java
@@ -15,18 +15,37 @@
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.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.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
// macros whose definition changes this class:
-// disk: DISK
-// lru: LRU
-// stats: STATS
+// disk: 1
+// lru: 1
+// stats: 1
// versioned: VERSIONED
// offheap: OFFHEAP
// One of the following key macros must be defined:
@@ -34,85 +53,95 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha
// 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 VMStatsDiskLRURegionEntryHeapStringKey1 extends VMStatsDiskLRURegionEntryHeap {
- public VMStatsDiskLRURegionEntryHeapStringKey1(RegionEntryContext context, String key,
- Object value, boolean byteEncode) {
- super(context, (value instanceof RecoveredEntry ? null : value));
+ public VMStatsDiskLRURegionEntryHeapStringKey1 (RegionEntryContext context, String key,
+
+
+
+ Object value
+
+ , boolean byteEncode
+
+ ) {
+ super(context,
+
+ (value instanceof RecoveredEntry ? null : value)
+
+
+
+ );
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
initialize(context, value);
+
// 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;
}
}
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;
@SuppressWarnings("unused")
private volatile long lastModified;
- private static final AtomicLongFieldUpdater<VMStatsDiskLRURegionEntryHeapStringKey1> lastModifiedUpdater =
- AtomicLongFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryHeapStringKey1.class,
- "lastModified");
- private volatile Object value;
+ private static final AtomicLongFieldUpdater<VMStatsDiskLRURegionEntryHeapStringKey1> lastModifiedUpdater
+ = AtomicLongFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryHeapStringKey1.class, "lastModified");
+ private volatile Object value;
@Override
protected final Object getValueField() {
return this.value;
}
-
@Override
protected void setValueField(Object v) {
this.value = v;
}
- protected long getlastModifiedField() {
+ protected long getLastModifiedField() {
return lastModifiedUpdater.get(this);
}
-
protected boolean compareAndSetLastModifiedField(long expectedValue, long newValue) {
return lastModifiedUpdater.compareAndSet(this, expectedValue, newValue);
}
-
/**
* @see HashEntry#getEntryHash()
*/
public final int getEntryHash() {
return this.hash;
}
-
protected void setEntryHash(int v) {
this.hash = v;
}
-
/**
* @see HashEntry#getNextEntry()
*/
public final HashEntry<Object, Object> getNextEntry() {
return this.next;
}
-
/**
* @see HashEntry#setNextEntry
*/
@@ -120,12 +149,15 @@ public class VMStatsDiskLRURegionEntryHeapStringKey1 extends VMStatsDiskLRURegio
this.next = n;
}
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// disk code
+
protected void initialize(RegionEntryContext drs, Object value) {
boolean isBackup;
if (drs instanceof LocalRegion) {
- isBackup = ((LocalRegion) drs).getDiskRegion().isBackup();
+ isBackup = ((LocalRegion)drs).getDiskRegion().isBackup();
} else if (drs instanceof PlaceHolderDiskRegion) {
isBackup = true;
} else {
@@ -136,22 +168,23 @@ public class VMStatsDiskLRURegionEntryHeapStringKey1 extends VMStatsDiskLRURegio
diskInitialize(drs, value);
}
}
-
@Override
public final 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;
}
+
// 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);
}
@@ -161,158 +194,162 @@ public class VMStatsDiskLRURegionEntryHeapStringKey1 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) {
+
DiskStoreImpl ds = r.getDiskStore();
long maxOplogSize = ds.getMaxOplogSize();
this.id = DiskId.createDiskId(maxOplogSize, false /* over flow only */, ds.needsLinkedList());
- }
+
+
+ }
public final synchronized int updateEntrySize(EnableLRU capacityController) {
- 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 final synchronized int updateEntrySize(EnableLRU capacityController, Object value) {
+
+ public final 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;
- // 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 );
+ // 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() {
return areAnyBitsSet(RECENTLY_USED);
}
-
@Override
public final void setRecentlyUsed() {
setBits(RECENTLY_USED);
}
-
public final void unsetRecentlyUsed() {
clearBits(~RECENTLY_USED);
}
-
public final boolean testEvicted() {
return areAnyBitsSet(EVICTED);
}
-
public final void setEvicted() {
setBits(EVICTED);
}
-
public final 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 final void setNextLRUNode( LRUClockNode next ) {
this.nextLRU = next;
}
-
public final LRUClockNode nextLRUNode() {
return this.nextLRU;
}
-
- public final void setPrevLRUNode(LRUClockNode prev) {
+ public final void setPrevLRUNode( LRUClockNode prev ) {
this.prevLRU = prev;
}
-
public final LRUClockNode prevLRUNode() {
return this.prevLRU;
}
-
public final int getEntrySize() {
return this.size;
}
-
protected final 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 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 final void updateStatsForGet(boolean hit, long time)
+ {
setLastAccessed(time);
if (hit) {
incrementHitCount();
@@ -320,59 +357,51 @@ public class VMStatsDiskLRURegionEntryHeapStringKey1 extends VMStatsDiskLRURegio
incrementMissCount();
}
}
-
@Override
protected final 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<VMStatsDiskLRURegionEntryHeapStringKey1> hitCountUpdater =
- AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryHeapStringKey1.class,
- "hitCount");
- private static final AtomicIntegerFieldUpdater<VMStatsDiskLRURegionEntryHeapStringKey1> missCountUpdater =
- AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryHeapStringKey1.class,
- "missCount");
-
+
+ private static final AtomicIntegerFieldUpdater<VMStatsDiskLRURegionEntryHeapStringKey1> hitCountUpdater
+ = AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryHeapStringKey1.class, "hitCount");
+ private static final AtomicIntegerFieldUpdater<VMStatsDiskLRURegionEntryHeapStringKey1> missCountUpdater
+ = AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryHeapStringKey1.class, "missCount");
+
@Override
public final long getLastAccessed() throws InternalStatisticsDisabledException {
return this.lastAccessed;
}
-
private void setLastAccessed(long lastAccessed) {
this.lastAccessed = lastAccessed;
}
-
@Override
public final long getHitCount() throws InternalStatisticsDisabledException {
return this.hitCount & 0xFFFFFFFFL;
}
-
@Override
public final long getMissCount() throws InternalStatisticsDisabledException {
return this.missCount & 0xFFFFFFFFL;
}
-
private void incrementHitCount() {
hitCountUpdater.incrementAndGet(this);
}
-
private void incrementMissCount() {
missCountUpdater.incrementAndGet(this);
}
-
@Override
public final 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 final void txDidDestroy(long currTime) {
setLastModified(currTime);
@@ -380,38 +409,39 @@ public class VMStatsDiskLRURegionEntryHeapStringKey1 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 bits1;
+ 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 final 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);
}
@@ -420,15 +450,16 @@ public class VMStatsDiskLRURegionEntryHeapStringKey1 extends VMStatsDiskLRURegio
}
// 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) {
@@ -436,7 +467,7 @@ public class VMStatsDiskLRURegionEntryHeapStringKey1 extends VMStatsDiskLRURegio
}
}
} 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) {
@@ -449,5 +480,8 @@ public class VMStatsDiskLRURegionEntryHeapStringKey1 extends VMStatsDiskLRURegio
}
return false;
}
+
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
}
+