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 19:29:00 UTC
[28/33] geode git commit: GEODE-2929: remove superfluous uses of
final from internal classes
http://git-wip-us.apache.org/repos/asf/geode/blob/a4458531/geode-core/src/main/java/org/apache/geode/internal/cache/TXFarSideCMTracker.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/TXFarSideCMTracker.java b/geode-core/src/main/java/org/apache/geode/internal/cache/TXFarSideCMTracker.java
index a7d06be..b7ab7e8 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/TXFarSideCMTracker.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/TXFarSideCMTracker.java
@@ -83,7 +83,7 @@ public class TXFarSideCMTracker {
this.lastHistoryItem = 0;
}
- public final int getHistorySize() {
+ public int getHistorySize() {
return this.txHistory.length;
}
@@ -91,7 +91,7 @@ public class TXFarSideCMTracker {
* Answers fellow "Far Siders" question about an DACK transaction when the transaction originator
* died before it sent the CommitProcess message.
*/
- public final boolean commitProcessReceived(Object key, DM dm) {
+ public boolean commitProcessReceived(Object key, DM dm) {
// Assume that after the member has departed that we have all its pending
// transaction messages
if (key instanceof TXLockId) {
@@ -137,7 +137,7 @@ public class TXFarSideCMTracker {
* Answers new Grantor query regarding whether it can start handing out new locks. Waits until
* txInProgress is empty.
*/
- public final void waitForAllToProcess() throws InterruptedException {
+ public void waitForAllToProcess() throws InterruptedException {
if (Thread.interrupted())
throw new InterruptedException(); // wisest to do this before the synchronize below
// Assume that a thread interrupt is only sent in the
@@ -155,7 +155,7 @@ public class TXFarSideCMTracker {
* departed/ing Originator (this will most likely be called nearly the same time as
* commitProcessReceived
*/
- public final void waitToProcess(TXLockId lk, DM dm) {
+ public void waitToProcess(TXLockId lk, DM dm) {
waitForMemberToDepart(lk.getMemberId(), dm);
final TXCommitMessage mess;
synchronized (this.txInProgress) {
@@ -189,7 +189,7 @@ public class TXFarSideCMTracker {
/**
* Register a <code>MemberhipListener</code>, wait until the member is gone.
*/
- private final void waitForMemberToDepart(final InternalDistributedMember memberId, DM dm) {
+ private void waitForMemberToDepart(final InternalDistributedMember memberId, DM dm) {
if (!dm.getDistributionManagerIds().contains(memberId)) {
return;
}
@@ -239,7 +239,7 @@ public class TXFarSideCMTracker {
* Indicate that the transaction message has been processed and to place it in the transaction
* history
*/
- public final TXCommitMessage processed(TXCommitMessage processedMess) {
+ public TXCommitMessage processed(TXCommitMessage processedMess) {
final TXCommitMessage mess;
final Object key = processedMess.getTrackerKey();
synchronized (this.txInProgress) {
@@ -269,7 +269,7 @@ public class TXFarSideCMTracker {
* Indicate that this message is never going to be processed, typically used in the case where
* none of the FarSiders received the CommitProcessMessage
**/
- public final void removeMessage(TXCommitMessage deadMess) {
+ public void removeMessage(TXCommitMessage deadMess) {
synchronized (this.txInProgress) {
this.txInProgress.remove(deadMess.getTrackerKey());
// For any waitForAllToComplete
@@ -282,7 +282,7 @@ public class TXFarSideCMTracker {
/**
* Retrieve the commit message associated with the lock
*/
- public final TXCommitMessage get(Object key) {
+ public TXCommitMessage get(Object key) {
final TXCommitMessage mess;
synchronized (this.txInProgress) {
mess = (TXCommitMessage) this.txInProgress.get(key);
@@ -290,7 +290,7 @@ public class TXFarSideCMTracker {
return mess;
}
- public final TXCommitMessage waitForMessage(Object key, DM dm) {
+ public TXCommitMessage waitForMessage(Object key, DM dm) {
TXCommitMessage msg = null;
synchronized (this.txInProgress) {
msg = (TXCommitMessage) this.txInProgress.get(key);
@@ -310,7 +310,7 @@ public class TXFarSideCMTracker {
/**
* The transcation commit message has been received
*/
- public final void add(TXCommitMessage msg) {
+ public void add(TXCommitMessage msg) {
synchronized (this.txInProgress) {
final Object key = msg.getTrackerKey();
if (key == null) {
http://git-wip-us.apache.org/repos/asf/geode/blob/a4458531/geode-core/src/main/java/org/apache/geode/internal/cache/TXId.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/TXId.java b/geode-core/src/main/java/org/apache/geode/internal/cache/TXId.java
index db74765..32fe284 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/TXId.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/TXId.java
@@ -34,7 +34,7 @@ import org.apache.geode.distributed.internal.membership.*;
* @see TXManagerImpl#begin
* @see org.apache.geode.cache.CacheTransactionManager#getTransactionId
*/
-public final class TXId extends ExternalizableDSFID implements TransactionId {
+public class TXId extends ExternalizableDSFID implements TransactionId {
/** The domain of a transaction, currently the VM's unique identifier */
private InternalDistributedMember memberId;
/** Per unique identifier within the transactions memberId */
http://git-wip-us.apache.org/repos/asf/geode/blob/a4458531/geode-core/src/main/java/org/apache/geode/internal/cache/TXRemoteCommitMessage.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/TXRemoteCommitMessage.java b/geode-core/src/main/java/org/apache/geode/internal/cache/TXRemoteCommitMessage.java
index 6a1eeed..c229997 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/TXRemoteCommitMessage.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/TXRemoteCommitMessage.java
@@ -127,7 +127,7 @@ public class TXRemoteCommitMessage extends TXMessage {
*
* @since GemFire 6.5
*/
- public static final class TXRemoteCommitReplyMessage extends ReplyMessage {
+ public static class TXRemoteCommitReplyMessage extends ReplyMessage {
private transient TXCommitMessage commitMessage;
http://git-wip-us.apache.org/repos/asf/geode/blob/a4458531/geode-core/src/main/java/org/apache/geode/internal/cache/TXReservationMgr.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/TXReservationMgr.java b/geode-core/src/main/java/org/apache/geode/internal/cache/TXReservationMgr.java
index e1a2ece..261f90c 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/TXReservationMgr.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/TXReservationMgr.java
@@ -107,7 +107,7 @@ public class TXReservationMgr {
}
}
- private final Object getRegionObject(TXRegionLockRequestImpl lr) {
+ private Object getRegionObject(TXRegionLockRequestImpl lr) {
if (local) {
return lr.getLocalRegion();
} else {
http://git-wip-us.apache.org/repos/asf/geode/blob/a4458531/geode-core/src/main/java/org/apache/geode/internal/cache/TXState.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/TXState.java b/geode-core/src/main/java/org/apache/geode/internal/cache/TXState.java
index 0a9d80e..6a6e9ad 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/TXState.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/TXState.java
@@ -1220,7 +1220,7 @@ public class TXState implements TXStateInterface {
* @param ifNew only write the entry if it currently does not exist
* @param expectedOldValue the required old value or null
*/
- final TXEntryState txWriteEntry(LocalRegion region, EntryEventImpl event, boolean ifNew,
+ TXEntryState txWriteEntry(LocalRegion region, EntryEventImpl event, boolean ifNew,
boolean requireOldValue, Object expectedOldValue) throws EntryNotFoundException {
boolean createIfAbsent = true;
if (event.getOperation() == Operation.REPLACE) {
http://git-wip-us.apache.org/repos/asf/geode/blob/a4458531/geode-core/src/main/java/org/apache/geode/internal/cache/TXStateProxyImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/TXStateProxyImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/TXStateProxyImpl.java
index 22b95f3..6b6b712 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/TXStateProxyImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/TXStateProxyImpl.java
@@ -86,15 +86,15 @@ public class TXStateProxyImpl implements TXStateProxy {
return this.lock;
}
- final boolean isJTA() {
+ boolean isJTA() {
return isJTA;
}
- final public TXId getTxId() {
+ public TXId getTxId() {
return txId;
}
- public final TXManagerImpl getTxMgr() {
+ public TXManagerImpl getTxMgr() {
return txMgr;
}
http://git-wip-us.apache.org/repos/asf/geode/blob/a4458531/geode-core/src/main/java/org/apache/geode/internal/cache/Token.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/Token.java b/geode-core/src/main/java/org/apache/geode/internal/cache/Token.java
index 54f57da..f2809a6 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/Token.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/Token.java
@@ -88,23 +88,23 @@ public abstract class Token {
/**
* Returns true if o is INVALID, LOCAL_INVALID, DESTROYED, or REMOVED.
*/
- public static final boolean isInvalidOrRemoved(Object o) {
+ public static boolean isInvalidOrRemoved(Object o) {
return isInvalid(o) || isRemoved(o);
}
- public static final boolean isInvalid(Object o) {
+ public static boolean isInvalid(Object o) {
return o == INVALID || o == LOCAL_INVALID;
}
- public static final boolean isRemoved(Object o) {
+ public static boolean isRemoved(Object o) {
return o == DESTROYED || o == REMOVED_PHASE1 || o == REMOVED_PHASE2 || o == TOMBSTONE;
}
- public static final boolean isRemovedFromDisk(Object o) {
+ public static boolean isRemovedFromDisk(Object o) {
return o == DESTROYED || o == REMOVED_PHASE1 || o == REMOVED_PHASE2;
}
- public static final boolean isDestroyed(Object o) {
+ public static boolean isDestroyed(Object o) {
return o == DESTROYED;
}
@@ -303,7 +303,7 @@ public abstract class Token {
}
/** Token used in StreamingOperation, StreamingPartitionOperation */
- public static final class EndOfStream extends Token implements DataSerializableFixedID {
+ public static class EndOfStream extends Token implements DataSerializableFixedID {
public EndOfStream() {}
@Override
http://git-wip-us.apache.org/repos/asf/geode/blob/a4458531/geode-core/src/main/java/org/apache/geode/internal/cache/UnsharedImageState.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/UnsharedImageState.java b/geode-core/src/main/java/org/apache/geode/internal/cache/UnsharedImageState.java
index 78a4c99..8b4c380 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/UnsharedImageState.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/UnsharedImageState.java
@@ -256,7 +256,7 @@ public class UnsharedImageState implements ImageState {
}
/** tracks RVV versions applied to the region during GII */
- private static final class VersionTagEntryImpl implements ImageState.VersionTagEntry {
+ private static class VersionTagEntryImpl implements ImageState.VersionTagEntry {
Object key;
VersionSource member;
long regionVersion;
http://git-wip-us.apache.org/repos/asf/geode/blob/a4458531/geode-core/src/main/java/org/apache/geode/internal/cache/UpdateAttributesProcessor.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/UpdateAttributesProcessor.java b/geode-core/src/main/java/org/apache/geode/internal/cache/UpdateAttributesProcessor.java
index 53c3832..5718001 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/UpdateAttributesProcessor.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/UpdateAttributesProcessor.java
@@ -258,7 +258,7 @@ public class UpdateAttributesProcessor {
}
- public static final class UpdateAttributesMessage extends HighPriorityDistributionMessage
+ public static class UpdateAttributesMessage extends HighPriorityDistributionMessage
implements MessageWithReply {
protected String adviseePath;
@@ -376,7 +376,7 @@ public class UpdateAttributesProcessor {
}
- public final static class ProfileReplyMessage extends ReplyMessage {
+ public static class ProfileReplyMessage extends ReplyMessage {
Profile profile;
public static void send(InternalDistributedMember recipient, int processorId,
http://git-wip-us.apache.org/repos/asf/geode/blob/a4458531/geode-core/src/main/java/org/apache/geode/internal/cache/UpdateOperation.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/UpdateOperation.java b/geode-core/src/main/java/org/apache/geode/internal/cache/UpdateOperation.java
index 1afae86..2ba9517 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/UpdateOperation.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/UpdateOperation.java
@@ -496,13 +496,13 @@ public class UpdateOperation extends AbstractUpdateOperation {
}
}
- public static final class UpdateWithContextMessage extends UpdateMessage {
+ public static class UpdateWithContextMessage extends UpdateMessage {
protected transient ClientProxyMembershipID clientID;
@Override
@Retained
- final public EntryEventImpl createEntryEvent(DistributedRegion rgn) {
+ public EntryEventImpl createEntryEvent(DistributedRegion rgn) {
// Object oldValue = null;
final Object argNewValue = null;
// boolean localLoad = false, netLoad = false, netSearch = false,
http://git-wip-us.apache.org/repos/asf/geode/blob/a4458531/geode-core/src/main/java/org/apache/geode/internal/cache/VMCachedDeserializable.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMCachedDeserializable.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMCachedDeserializable.java
index a2894e3..c559b5d 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMCachedDeserializable.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMCachedDeserializable.java
@@ -34,7 +34,7 @@ import org.apache.geode.pdx.PdxInstance;
* then on keep a reference to the deserialized form. So it "prefers deserialization".
*
*/
-public final class VMCachedDeserializable implements CachedDeserializable, DataSerializableFixedID {
+public class VMCachedDeserializable implements CachedDeserializable, DataSerializableFixedID {
/** The cached value */
private volatile Object value;
http://git-wip-us.apache.org/repos/asf/geode/blob/a4458531/geode-core/src/main/java/org/apache/geode/internal/cache/VMLRURegionMap.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMLRURegionMap.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMLRURegionMap.java
index 93dfa82..3a32efd 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMLRURegionMap.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMLRURegionMap.java
@@ -26,7 +26,7 @@ import org.apache.geode.internal.cache.lru.*;
*
*
*/
-final class VMLRURegionMap extends AbstractLRURegionMap {
+class VMLRURegionMap extends AbstractLRURegionMap {
VMLRURegionMap(Object owner, Attributes attr, InternalRegionArguments internalRegionArgs) {
super(internalRegionArgs);
@@ -42,22 +42,22 @@ final class VMLRURegionMap extends AbstractLRURegionMap {
private NewLRUClockHand lruList;
@Override
- protected final void _setCCHelper(EnableLRU ccHelper) {
+ protected void _setCCHelper(EnableLRU ccHelper) {
this.ccHelper = ccHelper;
}
@Override
- protected final EnableLRU _getCCHelper() {
+ protected EnableLRU _getCCHelper() {
return this.ccHelper;
}
@Override
- protected final void _setLruList(NewLRUClockHand lruList) {
+ protected void _setLruList(NewLRUClockHand lruList) {
this.lruList = lruList;
}
@Override
- public final NewLRUClockHand _getLruList() {
+ public NewLRUClockHand _getLruList() {
return this.lruList;
}
}
http://git-wip-us.apache.org/repos/asf/geode/blob/a4458531/geode-core/src/main/java/org/apache/geode/internal/cache/VMRegionMap.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMRegionMap.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMRegionMap.java
index c1cfb14..989a112 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMRegionMap.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMRegionMap.java
@@ -22,7 +22,7 @@ package org.apache.geode.internal.cache;
*
*
*/
-final class VMRegionMap extends AbstractRegionMap {
+class VMRegionMap extends AbstractRegionMap {
VMRegionMap(Object owner, Attributes attr, InternalRegionArguments internalRegionArgs) {
super(internalRegionArgs);
http://git-wip-us.apache.org/repos/asf/geode/blob/a4458531/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 e2043f2..c14438d 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,41 +15,71 @@
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;
@@ -57,10 +87,11 @@ public class VMStatsDiskLRURegionEntryHeapIntKey extends VMStatsDiskLRURegionEnt
private volatile long lastModified;
private static final AtomicLongFieldUpdater<VMStatsDiskLRURegionEntryHeapIntKey> lastModifiedUpdater =
AtomicLongFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryHeapIntKey.class, "lastModified");
+
private volatile Object value;
@Override
- protected final Object getValueField() {
+ protected Object getValueField() {
return this.value;
}
@@ -80,7 +111,7 @@ public class VMStatsDiskLRURegionEntryHeapIntKey extends VMStatsDiskLRURegionEnt
/**
* @see HashEntry#getEntryHash()
*/
- public final int getEntryHash() {
+ public int getEntryHash() {
return this.hash;
}
@@ -91,19 +122,22 @@ public class VMStatsDiskLRURegionEntryHeapIntKey extends VMStatsDiskLRURegionEnt
/**
* @see HashEntry#getNextEntry()
*/
- public final HashEntry<Object, Object> getNextEntry() {
+ public HashEntry<Object, Object> getNextEntry() {
return this.next;
}
/**
* @see HashEntry#setNextEntry
*/
- public final void setNextEntry(final HashEntry<Object, Object> n) {
+ public void setNextEntry(final HashEntry<Object, Object> n) {
this.next = n;
}
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// disk code
+
protected void initialize(RegionEntryContext drs, Object value) {
boolean isBackup;
if (drs instanceof LocalRegion) {
@@ -120,7 +154,7 @@ public class VMStatsDiskLRURegionEntryHeapIntKey extends VMStatsDiskLRURegionEnt
}
@Override
- public final synchronized int updateAsyncEntrySize(EnableLRU capacityController) {
+ public synchronized int updateAsyncEntrySize(EnableLRU capacityController) {
int oldSize = getEntrySize();
int newSize = capacityController.entrySize(getKeyForSizing(), null);
setEntrySize(newSize);
@@ -128,7 +162,9 @@ public class VMStatsDiskLRURegionEntryHeapIntKey extends VMStatsDiskLRURegionEnt
return delta;
}
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
private void diskInitialize(RegionEntryContext context, Object value) {
DiskRecoveryStore drs = (DiskRecoveryStore) context;
DiskStoreImpl ds = drs.getDiskStore();
@@ -153,7 +189,6 @@ public class VMStatsDiskLRURegionEntryHeapIntKey extends VMStatsDiskLRURegionEnt
void setDiskId(RegionEntry old) {
this.id = ((AbstractDiskRegionEntry) old).getDiskId();
}
-
// // inlining DiskId
// // always have these fields
// /**
@@ -193,108 +228,113 @@ public class VMStatsDiskLRURegionEntryHeapIntKey extends VMStatsDiskLRURegionEnt
// // persistent
// /** unique entry identifier * */
// private long keyId;
+
+
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// lru code
@Override
public void setDelayedDiskId(LocalRegion r) {
+
DiskStoreImpl ds = r.getDiskStore();
long maxOplogSize = ds.getMaxOplogSize();
this.id = DiskId.createDiskId(maxOplogSize, false /* over flow only */, ds.needsLinkedList());
+
+
+
}
- public final synchronized int updateEntrySize(EnableLRU capacityController) {
+ public synchronized int updateEntrySize(EnableLRU capacityController) {
return updateEntrySize(capacityController, _getValue()); // OFHEAP: _getValue ok w/o incing
// refcount because we are synced and
// only getting the size
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
- public final synchronized int updateEntrySize(EnableLRU capacityController, Object value) {
+
+ public synchronized int updateEntrySize(EnableLRU capacityController, Object value) {
int oldSize = getEntrySize();
int newSize = capacityController.entrySize(getKeyForSizing(), value);
setEntrySize(newSize);
int delta = newSize - oldSize;
- // if ( debug ) log( "updateEntrySize key=" + getKey()
- // + (_getValue() == Token.INVALID ? " invalid" :
- // (_getValue() == Token.LOCAL_INVALID ? "local_invalid" :
- // (_getValue()==null ? " evicted" : " valid")))
- // + " oldSize=" + oldSize
- // + " newSize=" + this.size );
return delta;
}
- public final boolean testRecentlyUsed() {
+ public boolean testRecentlyUsed() {
return areAnyBitsSet(RECENTLY_USED);
}
@Override
- public final void setRecentlyUsed() {
+ public void setRecentlyUsed() {
setBits(RECENTLY_USED);
}
- public final void unsetRecentlyUsed() {
+ public void unsetRecentlyUsed() {
clearBits(~RECENTLY_USED);
}
- public final boolean testEvicted() {
+ public boolean testEvicted() {
return areAnyBitsSet(EVICTED);
}
- public final void setEvicted() {
+ public void setEvicted() {
setBits(EVICTED);
}
- public final void unsetEvicted() {
+ public void unsetEvicted() {
clearBits(~EVICTED);
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
private LRUClockNode nextLRU;
private LRUClockNode prevLRU;
private int size;
- public final void setNextLRUNode(LRUClockNode next) {
+ public void setNextLRUNode(LRUClockNode next) {
this.nextLRU = next;
}
- public final LRUClockNode nextLRUNode() {
+ public LRUClockNode nextLRUNode() {
return this.nextLRU;
}
- public final void setPrevLRUNode(LRUClockNode prev) {
+ public void setPrevLRUNode(LRUClockNode prev) {
this.prevLRU = prev;
}
- public final LRUClockNode prevLRUNode() {
+ public LRUClockNode prevLRUNode() {
return this.prevLRU;
}
- public final int getEntrySize() {
+ public int getEntrySize() {
return this.size;
}
- protected final void setEntrySize(int size) {
+ protected void setEntrySize(int size) {
this.size = size;
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
- // @Override
- // public StringBuilder appendFieldsToString(final StringBuilder sb) {
- // StringBuilder result = super.appendFieldsToString(sb);
- // result.append("; prev=").append(this.prevLRU==null?"null":"not null");
- // result.append("; next=").append(this.nextLRU==null?"null":"not null");
- // return result;
- // }
+
@Override
public Object getKeyForSizing() {
+
+
+
// inline keys always report null for sizing since the size comes from the entry size
return null;
+
}
+
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// stats code
@Override
- public final void updateStatsForGet(boolean hit, long time) {
+ public void updateStatsForGet(boolean hit, long time) {
setLastAccessed(time);
if (hit) {
incrementHitCount();
@@ -304,7 +344,7 @@ public class VMStatsDiskLRURegionEntryHeapIntKey extends VMStatsDiskLRURegionEnt
}
@Override
- protected final void setLastModifiedAndAccessedTimes(long lastModified, long lastAccessed) {
+ protected void setLastModifiedAndAccessedTimes(long lastModified, long lastAccessed) {
_setLastModified(lastModified);
if (!DISABLE_ACCESS_TIME_UPDATE_ON_PUT) {
setLastAccessed(lastAccessed);
@@ -314,13 +354,14 @@ public class VMStatsDiskLRURegionEntryHeapIntKey extends VMStatsDiskLRURegionEnt
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");
@Override
- public final long getLastAccessed() throws InternalStatisticsDisabledException {
+ public long getLastAccessed() throws InternalStatisticsDisabledException {
return this.lastAccessed;
}
@@ -329,12 +370,12 @@ public class VMStatsDiskLRURegionEntryHeapIntKey extends VMStatsDiskLRURegionEnt
}
@Override
- public final long getHitCount() throws InternalStatisticsDisabledException {
+ public long getHitCount() throws InternalStatisticsDisabledException {
return this.hitCount & 0xFFFFFFFFL;
}
@Override
- public final long getMissCount() throws InternalStatisticsDisabledException {
+ public long getMissCount() throws InternalStatisticsDisabledException {
return this.missCount & 0xFFFFFFFFL;
}
@@ -347,14 +388,15 @@ public class VMStatsDiskLRURegionEntryHeapIntKey extends VMStatsDiskLRURegionEnt
}
@Override
- public final void resetCounts() throws InternalStatisticsDisabledException {
+ public void resetCounts() throws InternalStatisticsDisabledException {
hitCountUpdater.set(this, 0);
missCountUpdater.set(this, 0);
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
@Override
- public final void txDidDestroy(long currTime) {
+ public void txDidDestroy(long currTime) {
setLastModified(currTime);
setLastAccessed(currTime);
this.hitCount = 0;
@@ -366,12 +408,18 @@ public class VMStatsDiskLRURegionEntryHeapIntKey extends VMStatsDiskLRURegionEnt
return true;
}
+
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// key code
+
+
+
private final int key;
@Override
- public final Object getKey() {
+ public Object getKey() {
return this.key;
}
@@ -382,5 +430,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/a4458531/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 d65ea70..a41f02b 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,41 +15,71 @@
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;
@@ -57,10 +87,11 @@ public class VMStatsDiskLRURegionEntryHeapLongKey extends VMStatsDiskLRURegionEn
private volatile long lastModified;
private static final AtomicLongFieldUpdater<VMStatsDiskLRURegionEntryHeapLongKey> lastModifiedUpdater =
AtomicLongFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryHeapLongKey.class, "lastModified");
+
private volatile Object value;
@Override
- protected final Object getValueField() {
+ protected Object getValueField() {
return this.value;
}
@@ -80,7 +111,7 @@ public class VMStatsDiskLRURegionEntryHeapLongKey extends VMStatsDiskLRURegionEn
/**
* @see HashEntry#getEntryHash()
*/
- public final int getEntryHash() {
+ public int getEntryHash() {
return this.hash;
}
@@ -91,19 +122,22 @@ public class VMStatsDiskLRURegionEntryHeapLongKey extends VMStatsDiskLRURegionEn
/**
* @see HashEntry#getNextEntry()
*/
- public final HashEntry<Object, Object> getNextEntry() {
+ public HashEntry<Object, Object> getNextEntry() {
return this.next;
}
/**
* @see HashEntry#setNextEntry
*/
- public final void setNextEntry(final HashEntry<Object, Object> n) {
+ public void setNextEntry(final HashEntry<Object, Object> n) {
this.next = n;
}
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// disk code
+
protected void initialize(RegionEntryContext drs, Object value) {
boolean isBackup;
if (drs instanceof LocalRegion) {
@@ -120,7 +154,7 @@ public class VMStatsDiskLRURegionEntryHeapLongKey extends VMStatsDiskLRURegionEn
}
@Override
- public final synchronized int updateAsyncEntrySize(EnableLRU capacityController) {
+ public synchronized int updateAsyncEntrySize(EnableLRU capacityController) {
int oldSize = getEntrySize();
int newSize = capacityController.entrySize(getKeyForSizing(), null);
setEntrySize(newSize);
@@ -128,7 +162,9 @@ public class VMStatsDiskLRURegionEntryHeapLongKey extends VMStatsDiskLRURegionEn
return delta;
}
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
private void diskInitialize(RegionEntryContext context, Object value) {
DiskRecoveryStore drs = (DiskRecoveryStore) context;
DiskStoreImpl ds = drs.getDiskStore();
@@ -153,7 +189,6 @@ public class VMStatsDiskLRURegionEntryHeapLongKey extends VMStatsDiskLRURegionEn
void setDiskId(RegionEntry old) {
this.id = ((AbstractDiskRegionEntry) old).getDiskId();
}
-
// // inlining DiskId
// // always have these fields
// /**
@@ -193,108 +228,113 @@ public class VMStatsDiskLRURegionEntryHeapLongKey extends VMStatsDiskLRURegionEn
// // persistent
// /** unique entry identifier * */
// private long keyId;
+
+
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// lru code
@Override
public void setDelayedDiskId(LocalRegion r) {
+
DiskStoreImpl ds = r.getDiskStore();
long maxOplogSize = ds.getMaxOplogSize();
this.id = DiskId.createDiskId(maxOplogSize, false /* over flow only */, ds.needsLinkedList());
+
+
+
}
- public final synchronized int updateEntrySize(EnableLRU capacityController) {
+ public synchronized int updateEntrySize(EnableLRU capacityController) {
return updateEntrySize(capacityController, _getValue()); // OFHEAP: _getValue ok w/o incing
// refcount because we are synced and
// only getting the size
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
- public final synchronized int updateEntrySize(EnableLRU capacityController, Object value) {
+
+ public synchronized int updateEntrySize(EnableLRU capacityController, Object value) {
int oldSize = getEntrySize();
int newSize = capacityController.entrySize(getKeyForSizing(), value);
setEntrySize(newSize);
int delta = newSize - oldSize;
- // if ( debug ) log( "updateEntrySize key=" + getKey()
- // + (_getValue() == Token.INVALID ? " invalid" :
- // (_getValue() == Token.LOCAL_INVALID ? "local_invalid" :
- // (_getValue()==null ? " evicted" : " valid")))
- // + " oldSize=" + oldSize
- // + " newSize=" + this.size );
return delta;
}
- public final boolean testRecentlyUsed() {
+ public boolean testRecentlyUsed() {
return areAnyBitsSet(RECENTLY_USED);
}
@Override
- public final void setRecentlyUsed() {
+ public void setRecentlyUsed() {
setBits(RECENTLY_USED);
}
- public final void unsetRecentlyUsed() {
+ public void unsetRecentlyUsed() {
clearBits(~RECENTLY_USED);
}
- public final boolean testEvicted() {
+ public boolean testEvicted() {
return areAnyBitsSet(EVICTED);
}
- public final void setEvicted() {
+ public void setEvicted() {
setBits(EVICTED);
}
- public final void unsetEvicted() {
+ public void unsetEvicted() {
clearBits(~EVICTED);
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
private LRUClockNode nextLRU;
private LRUClockNode prevLRU;
private int size;
- public final void setNextLRUNode(LRUClockNode next) {
+ public void setNextLRUNode(LRUClockNode next) {
this.nextLRU = next;
}
- public final LRUClockNode nextLRUNode() {
+ public LRUClockNode nextLRUNode() {
return this.nextLRU;
}
- public final void setPrevLRUNode(LRUClockNode prev) {
+ public void setPrevLRUNode(LRUClockNode prev) {
this.prevLRU = prev;
}
- public final LRUClockNode prevLRUNode() {
+ public LRUClockNode prevLRUNode() {
return this.prevLRU;
}
- public final int getEntrySize() {
+ public int getEntrySize() {
return this.size;
}
- protected final void setEntrySize(int size) {
+ protected void setEntrySize(int size) {
this.size = size;
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
- // @Override
- // public StringBuilder appendFieldsToString(final StringBuilder sb) {
- // StringBuilder result = super.appendFieldsToString(sb);
- // result.append("; prev=").append(this.prevLRU==null?"null":"not null");
- // result.append("; next=").append(this.nextLRU==null?"null":"not null");
- // return result;
- // }
+
@Override
public Object getKeyForSizing() {
+
+
+
// inline keys always report null for sizing since the size comes from the entry size
return null;
+
}
+
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// stats code
@Override
- public final void updateStatsForGet(boolean hit, long time) {
+ public void updateStatsForGet(boolean hit, long time) {
setLastAccessed(time);
if (hit) {
incrementHitCount();
@@ -304,7 +344,7 @@ public class VMStatsDiskLRURegionEntryHeapLongKey extends VMStatsDiskLRURegionEn
}
@Override
- protected final void setLastModifiedAndAccessedTimes(long lastModified, long lastAccessed) {
+ protected void setLastModifiedAndAccessedTimes(long lastModified, long lastAccessed) {
_setLastModified(lastModified);
if (!DISABLE_ACCESS_TIME_UPDATE_ON_PUT) {
setLastAccessed(lastAccessed);
@@ -314,13 +354,14 @@ public class VMStatsDiskLRURegionEntryHeapLongKey extends VMStatsDiskLRURegionEn
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");
@Override
- public final long getLastAccessed() throws InternalStatisticsDisabledException {
+ public long getLastAccessed() throws InternalStatisticsDisabledException {
return this.lastAccessed;
}
@@ -329,12 +370,12 @@ public class VMStatsDiskLRURegionEntryHeapLongKey extends VMStatsDiskLRURegionEn
}
@Override
- public final long getHitCount() throws InternalStatisticsDisabledException {
+ public long getHitCount() throws InternalStatisticsDisabledException {
return this.hitCount & 0xFFFFFFFFL;
}
@Override
- public final long getMissCount() throws InternalStatisticsDisabledException {
+ public long getMissCount() throws InternalStatisticsDisabledException {
return this.missCount & 0xFFFFFFFFL;
}
@@ -347,14 +388,15 @@ public class VMStatsDiskLRURegionEntryHeapLongKey extends VMStatsDiskLRURegionEn
}
@Override
- public final void resetCounts() throws InternalStatisticsDisabledException {
+ public void resetCounts() throws InternalStatisticsDisabledException {
hitCountUpdater.set(this, 0);
missCountUpdater.set(this, 0);
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
@Override
- public final void txDidDestroy(long currTime) {
+ public void txDidDestroy(long currTime) {
setLastModified(currTime);
setLastAccessed(currTime);
this.hitCount = 0;
@@ -366,12 +408,16 @@ public class VMStatsDiskLRURegionEntryHeapLongKey extends VMStatsDiskLRURegionEn
return true;
}
+
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// key code
+
private final long key;
@Override
- public final Object getKey() {
+ public Object getKey() {
return this.key;
}
@@ -382,5 +428,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/a4458531/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 cbfa0f8..0c6c3de 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,42 +15,70 @@
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));
+
+
+
+ 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;
@@ -59,10 +87,11 @@ public class VMStatsDiskLRURegionEntryHeapObjectKey extends VMStatsDiskLRURegion
private static final AtomicLongFieldUpdater<VMStatsDiskLRURegionEntryHeapObjectKey> lastModifiedUpdater =
AtomicLongFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryHeapObjectKey.class,
"lastModified");
+
private volatile Object value;
@Override
- protected final Object getValueField() {
+ protected Object getValueField() {
return this.value;
}
@@ -82,7 +111,7 @@ public class VMStatsDiskLRURegionEntryHeapObjectKey extends VMStatsDiskLRURegion
/**
* @see HashEntry#getEntryHash()
*/
- public final int getEntryHash() {
+ public int getEntryHash() {
return this.hash;
}
@@ -93,19 +122,22 @@ public class VMStatsDiskLRURegionEntryHeapObjectKey extends VMStatsDiskLRURegion
/**
* @see HashEntry#getNextEntry()
*/
- public final HashEntry<Object, Object> getNextEntry() {
+ public HashEntry<Object, Object> getNextEntry() {
return this.next;
}
/**
* @see HashEntry#setNextEntry
*/
- public final void setNextEntry(final HashEntry<Object, Object> n) {
+ public void setNextEntry(final HashEntry<Object, Object> n) {
this.next = n;
}
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// disk code
+
protected void initialize(RegionEntryContext drs, Object value) {
boolean isBackup;
if (drs instanceof LocalRegion) {
@@ -122,7 +154,7 @@ public class VMStatsDiskLRURegionEntryHeapObjectKey extends VMStatsDiskLRURegion
}
@Override
- public final synchronized int updateAsyncEntrySize(EnableLRU capacityController) {
+ public synchronized int updateAsyncEntrySize(EnableLRU capacityController) {
int oldSize = getEntrySize();
int newSize = capacityController.entrySize(getKeyForSizing(), null);
setEntrySize(newSize);
@@ -130,7 +162,9 @@ public class VMStatsDiskLRURegionEntryHeapObjectKey extends VMStatsDiskLRURegion
return delta;
}
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
private void diskInitialize(RegionEntryContext context, Object value) {
DiskRecoveryStore drs = (DiskRecoveryStore) context;
DiskStoreImpl ds = drs.getDiskStore();
@@ -155,7 +189,6 @@ public class VMStatsDiskLRURegionEntryHeapObjectKey extends VMStatsDiskLRURegion
void setDiskId(RegionEntry old) {
this.id = ((AbstractDiskRegionEntry) old).getDiskId();
}
-
// // inlining DiskId
// // always have these fields
// /**
@@ -195,108 +228,113 @@ public class VMStatsDiskLRURegionEntryHeapObjectKey extends VMStatsDiskLRURegion
// // persistent
// /** unique entry identifier * */
// private long keyId;
+
+
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// lru code
@Override
public void setDelayedDiskId(LocalRegion r) {
+
DiskStoreImpl ds = r.getDiskStore();
long maxOplogSize = ds.getMaxOplogSize();
this.id = DiskId.createDiskId(maxOplogSize, false /* over flow only */, ds.needsLinkedList());
+
+
+
}
- public final synchronized int updateEntrySize(EnableLRU capacityController) {
+ public synchronized int updateEntrySize(EnableLRU capacityController) {
return updateEntrySize(capacityController, _getValue()); // OFHEAP: _getValue ok w/o incing
// refcount because we are synced and
// only getting the size
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
- public final synchronized int updateEntrySize(EnableLRU capacityController, Object value) {
+
+ public synchronized int updateEntrySize(EnableLRU capacityController, Object value) {
int oldSize = getEntrySize();
int newSize = capacityController.entrySize(getKeyForSizing(), value);
setEntrySize(newSize);
int delta = newSize - oldSize;
- // if ( debug ) log( "updateEntrySize key=" + getKey()
- // + (_getValue() == Token.INVALID ? " invalid" :
- // (_getValue() == Token.LOCAL_INVALID ? "local_invalid" :
- // (_getValue()==null ? " evicted" : " valid")))
- // + " oldSize=" + oldSize
- // + " newSize=" + this.size );
return delta;
}
- public final boolean testRecentlyUsed() {
+ public boolean testRecentlyUsed() {
return areAnyBitsSet(RECENTLY_USED);
}
@Override
- public final void setRecentlyUsed() {
+ public void setRecentlyUsed() {
setBits(RECENTLY_USED);
}
- public final void unsetRecentlyUsed() {
+ public void unsetRecentlyUsed() {
clearBits(~RECENTLY_USED);
}
- public final boolean testEvicted() {
+ public boolean testEvicted() {
return areAnyBitsSet(EVICTED);
}
- public final void setEvicted() {
+ public void setEvicted() {
setBits(EVICTED);
}
- public final void unsetEvicted() {
+ public void unsetEvicted() {
clearBits(~EVICTED);
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
private LRUClockNode nextLRU;
private LRUClockNode prevLRU;
private int size;
- public final void setNextLRUNode(LRUClockNode next) {
+ public void setNextLRUNode(LRUClockNode next) {
this.nextLRU = next;
}
- public final LRUClockNode nextLRUNode() {
+ public LRUClockNode nextLRUNode() {
return this.nextLRU;
}
- public final void setPrevLRUNode(LRUClockNode prev) {
+ public void setPrevLRUNode(LRUClockNode prev) {
this.prevLRU = prev;
}
- public final LRUClockNode prevLRUNode() {
+ public LRUClockNode prevLRUNode() {
return this.prevLRU;
}
- public final int getEntrySize() {
+ public int getEntrySize() {
return this.size;
}
- protected final void setEntrySize(int size) {
+ protected void setEntrySize(int size) {
this.size = size;
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
- // @Override
- // public StringBuilder appendFieldsToString(final StringBuilder sb) {
- // StringBuilder result = super.appendFieldsToString(sb);
- // result.append("; prev=").append(this.prevLRU==null?"null":"not null");
- // result.append("; next=").append(this.nextLRU==null?"null":"not null");
- // return result;
- // }
+
@Override
public Object getKeyForSizing() {
+
// default implementation.
return getKey();
+
+
+
}
+
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// stats code
@Override
- public final void updateStatsForGet(boolean hit, long time) {
+ public void updateStatsForGet(boolean hit, long time) {
setLastAccessed(time);
if (hit) {
incrementHitCount();
@@ -306,7 +344,7 @@ public class VMStatsDiskLRURegionEntryHeapObjectKey extends VMStatsDiskLRURegion
}
@Override
- protected final void setLastModifiedAndAccessedTimes(long lastModified, long lastAccessed) {
+ protected void setLastModifiedAndAccessedTimes(long lastModified, long lastAccessed) {
_setLastModified(lastModified);
if (!DISABLE_ACCESS_TIME_UPDATE_ON_PUT) {
setLastAccessed(lastAccessed);
@@ -316,6 +354,7 @@ public class VMStatsDiskLRURegionEntryHeapObjectKey extends VMStatsDiskLRURegion
private volatile long lastAccessed;
private volatile int hitCount;
private volatile int missCount;
+
private static final AtomicIntegerFieldUpdater<VMStatsDiskLRURegionEntryHeapObjectKey> hitCountUpdater =
AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryHeapObjectKey.class,
"hitCount");
@@ -324,7 +363,7 @@ public class VMStatsDiskLRURegionEntryHeapObjectKey extends VMStatsDiskLRURegion
"missCount");
@Override
- public final long getLastAccessed() throws InternalStatisticsDisabledException {
+ public long getLastAccessed() throws InternalStatisticsDisabledException {
return this.lastAccessed;
}
@@ -333,12 +372,12 @@ public class VMStatsDiskLRURegionEntryHeapObjectKey extends VMStatsDiskLRURegion
}
@Override
- public final long getHitCount() throws InternalStatisticsDisabledException {
+ public long getHitCount() throws InternalStatisticsDisabledException {
return this.hitCount & 0xFFFFFFFFL;
}
@Override
- public final long getMissCount() throws InternalStatisticsDisabledException {
+ public long getMissCount() throws InternalStatisticsDisabledException {
return this.missCount & 0xFFFFFFFFL;
}
@@ -351,14 +390,15 @@ public class VMStatsDiskLRURegionEntryHeapObjectKey extends VMStatsDiskLRURegion
}
@Override
- public final void resetCounts() throws InternalStatisticsDisabledException {
+ public void resetCounts() throws InternalStatisticsDisabledException {
hitCountUpdater.set(this, 0);
missCountUpdater.set(this, 0);
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
@Override
- public final void txDidDestroy(long currTime) {
+ public void txDidDestroy(long currTime) {
setLastModified(currTime);
setLastAccessed(currTime);
this.hitCount = 0;
@@ -370,13 +410,20 @@ public class VMStatsDiskLRURegionEntryHeapObjectKey extends VMStatsDiskLRURegion
return true;
}
+
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// key code
+
private final Object key;
@Override
- public final Object getKey() {
+ public Object getKey() {
return this.key;
}
+
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
}
+
http://git-wip-us.apache.org/repos/asf/geode/blob/a4458531/geode-core/src/main/java/org/apache/geode/internal/cache/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 1428eb1..fe5fad6 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,19 +15,28 @@
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:
@@ -35,18 +44,34 @@ 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));
+
+
+
+ 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) {
@@ -65,9 +90,11 @@ public class VMStatsDiskLRURegionEntryHeapStringKey1 extends VMStatsDiskLRURegio
}
tmpBits1 |= key.length();
this.bits1 = tmpBits1;
+
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// common code
protected int hash;
private HashEntry<Object, Object> next;
@@ -76,10 +103,11 @@ public class VMStatsDiskLRURegionEntryHeapStringKey1 extends VMStatsDiskLRURegio
private static final AtomicLongFieldUpdater<VMStatsDiskLRURegionEntryHeapStringKey1> lastModifiedUpdater =
AtomicLongFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryHeapStringKey1.class,
"lastModified");
+
private volatile Object value;
@Override
- protected final Object getValueField() {
+ protected Object getValueField() {
return this.value;
}
@@ -99,7 +127,7 @@ public class VMStatsDiskLRURegionEntryHeapStringKey1 extends VMStatsDiskLRURegio
/**
* @see HashEntry#getEntryHash()
*/
- public final int getEntryHash() {
+ public int getEntryHash() {
return this.hash;
}
@@ -110,19 +138,22 @@ public class VMStatsDiskLRURegionEntryHeapStringKey1 extends VMStatsDiskLRURegio
/**
* @see HashEntry#getNextEntry()
*/
- public final HashEntry<Object, Object> getNextEntry() {
+ public HashEntry<Object, Object> getNextEntry() {
return this.next;
}
/**
* @see HashEntry#setNextEntry
*/
- public final void setNextEntry(final HashEntry<Object, Object> n) {
+ public void setNextEntry(final HashEntry<Object, Object> n) {
this.next = n;
}
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// disk code
+
protected void initialize(RegionEntryContext drs, Object value) {
boolean isBackup;
if (drs instanceof LocalRegion) {
@@ -139,7 +170,7 @@ public class VMStatsDiskLRURegionEntryHeapStringKey1 extends VMStatsDiskLRURegio
}
@Override
- public final synchronized int updateAsyncEntrySize(EnableLRU capacityController) {
+ public synchronized int updateAsyncEntrySize(EnableLRU capacityController) {
int oldSize = getEntrySize();
int newSize = capacityController.entrySize(getKeyForSizing(), null);
setEntrySize(newSize);
@@ -147,7 +178,9 @@ public class VMStatsDiskLRURegionEntryHeapStringKey1 extends VMStatsDiskLRURegio
return delta;
}
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
private void diskInitialize(RegionEntryContext context, Object value) {
DiskRecoveryStore drs = (DiskRecoveryStore) context;
DiskStoreImpl ds = drs.getDiskStore();
@@ -172,7 +205,6 @@ public class VMStatsDiskLRURegionEntryHeapStringKey1 extends VMStatsDiskLRURegio
void setDiskId(RegionEntry old) {
this.id = ((AbstractDiskRegionEntry) old).getDiskId();
}
-
// // inlining DiskId
// // always have these fields
// /**
@@ -212,108 +244,113 @@ public class VMStatsDiskLRURegionEntryHeapStringKey1 extends VMStatsDiskLRURegio
// // persistent
// /** unique entry identifier * */
// private long keyId;
+
+
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// lru code
@Override
public void setDelayedDiskId(LocalRegion r) {
+
DiskStoreImpl ds = r.getDiskStore();
long maxOplogSize = ds.getMaxOplogSize();
this.id = DiskId.createDiskId(maxOplogSize, false /* over flow only */, ds.needsLinkedList());
+
+
+
}
- public final synchronized int updateEntrySize(EnableLRU capacityController) {
+ public synchronized int updateEntrySize(EnableLRU capacityController) {
return updateEntrySize(capacityController, _getValue()); // OFHEAP: _getValue ok w/o incing
// refcount because we are synced and
// only getting the size
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
- public final synchronized int updateEntrySize(EnableLRU capacityController, Object value) {
+
+ public synchronized int updateEntrySize(EnableLRU capacityController, Object value) {
int oldSize = getEntrySize();
int newSize = capacityController.entrySize(getKeyForSizing(), value);
setEntrySize(newSize);
int delta = newSize - oldSize;
- // if ( debug ) log( "updateEntrySize key=" + getKey()
- // + (_getValue() == Token.INVALID ? " invalid" :
- // (_getValue() == Token.LOCAL_INVALID ? "local_invalid" :
- // (_getValue()==null ? " evicted" : " valid")))
- // + " oldSize=" + oldSize
- // + " newSize=" + this.size );
return delta;
}
- public final boolean testRecentlyUsed() {
+ public boolean testRecentlyUsed() {
return areAnyBitsSet(RECENTLY_USED);
}
@Override
- public final void setRecentlyUsed() {
+ public void setRecentlyUsed() {
setBits(RECENTLY_USED);
}
- public final void unsetRecentlyUsed() {
+ public void unsetRecentlyUsed() {
clearBits(~RECENTLY_USED);
}
- public final boolean testEvicted() {
+ public boolean testEvicted() {
return areAnyBitsSet(EVICTED);
}
- public final void setEvicted() {
+ public void setEvicted() {
setBits(EVICTED);
}
- public final void unsetEvicted() {
+ public void unsetEvicted() {
clearBits(~EVICTED);
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
private LRUClockNode nextLRU;
private LRUClockNode prevLRU;
private int size;
- public final void setNextLRUNode(LRUClockNode next) {
+ public void setNextLRUNode(LRUClockNode next) {
this.nextLRU = next;
}
- public final LRUClockNode nextLRUNode() {
+ public LRUClockNode nextLRUNode() {
return this.nextLRU;
}
- public final void setPrevLRUNode(LRUClockNode prev) {
+ public void setPrevLRUNode(LRUClockNode prev) {
this.prevLRU = prev;
}
- public final LRUClockNode prevLRUNode() {
+ public LRUClockNode prevLRUNode() {
return this.prevLRU;
}
- public final int getEntrySize() {
+ public int getEntrySize() {
return this.size;
}
- protected final void setEntrySize(int size) {
+ protected void setEntrySize(int size) {
this.size = size;
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
- // @Override
- // public StringBuilder appendFieldsToString(final StringBuilder sb) {
- // StringBuilder result = super.appendFieldsToString(sb);
- // result.append("; prev=").append(this.prevLRU==null?"null":"not null");
- // result.append("; next=").append(this.nextLRU==null?"null":"not null");
- // return result;
- // }
+
@Override
public Object getKeyForSizing() {
+
+
+
// inline keys always report null for sizing since the size comes from the entry size
return null;
+
}
+
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// stats code
@Override
- public final void updateStatsForGet(boolean hit, long time) {
+ public void updateStatsForGet(boolean hit, long time) {
setLastAccessed(time);
if (hit) {
incrementHitCount();
@@ -323,7 +360,7 @@ public class VMStatsDiskLRURegionEntryHeapStringKey1 extends VMStatsDiskLRURegio
}
@Override
- protected final void setLastModifiedAndAccessedTimes(long lastModified, long lastAccessed) {
+ protected void setLastModifiedAndAccessedTimes(long lastModified, long lastAccessed) {
_setLastModified(lastModified);
if (!DISABLE_ACCESS_TIME_UPDATE_ON_PUT) {
setLastAccessed(lastAccessed);
@@ -333,6 +370,7 @@ public class VMStatsDiskLRURegionEntryHeapStringKey1 extends VMStatsDiskLRURegio
private volatile long lastAccessed;
private volatile int hitCount;
private volatile int missCount;
+
private static final AtomicIntegerFieldUpdater<VMStatsDiskLRURegionEntryHeapStringKey1> hitCountUpdater =
AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryHeapStringKey1.class,
"hitCount");
@@ -341,7 +379,7 @@ public class VMStatsDiskLRURegionEntryHeapStringKey1 extends VMStatsDiskLRURegio
"missCount");
@Override
- public final long getLastAccessed() throws InternalStatisticsDisabledException {
+ public long getLastAccessed() throws InternalStatisticsDisabledException {
return this.lastAccessed;
}
@@ -350,12 +388,12 @@ public class VMStatsDiskLRURegionEntryHeapStringKey1 extends VMStatsDiskLRURegio
}
@Override
- public final long getHitCount() throws InternalStatisticsDisabledException {
+ public long getHitCount() throws InternalStatisticsDisabledException {
return this.hitCount & 0xFFFFFFFFL;
}
@Override
- public final long getMissCount() throws InternalStatisticsDisabledException {
+ public long getMissCount() throws InternalStatisticsDisabledException {
return this.missCount & 0xFFFFFFFFL;
}
@@ -368,14 +406,15 @@ public class VMStatsDiskLRURegionEntryHeapStringKey1 extends VMStatsDiskLRURegio
}
@Override
- public final void resetCounts() throws InternalStatisticsDisabledException {
+ public void resetCounts() throws InternalStatisticsDisabledException {
hitCountUpdater.set(this, 0);
missCountUpdater.set(this, 0);
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
@Override
- public final void txDidDestroy(long currTime) {
+ public void txDidDestroy(long currTime) {
setLastModified(currTime);
setLastAccessed(currTime);
this.hitCount = 0;
@@ -387,8 +426,12 @@ public class VMStatsDiskLRURegionEntryHeapStringKey1 extends VMStatsDiskLRURegio
return true;
}
+
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// key code
+
private final long bits1;
private int getKeyLength() {
@@ -402,7 +445,7 @@ public class VMStatsDiskLRURegionEntryHeapStringKey1 extends VMStatsDiskLRURegio
}
@Override
- public final Object getKey() {
+ public Object getKey() {
int keylen = getKeyLength();
char[] chars = new char[keylen];
long tmpBits1 = this.bits1;
@@ -421,6 +464,7 @@ 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) {
@@ -450,5 +494,8 @@ public class VMStatsDiskLRURegionEntryHeapStringKey1 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/a4458531/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapStringKey2.java
index 7a11c77..929e14e 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VMStatsDiskLRURegionEntryHeapStringKey2.java
@@ -15,19 +15,28 @@
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:
@@ -36,17 +45,33 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha
// key long: KEY_LONG
// key uuid: KEY_UUID
// key string1: KEY_STRING1
-// key string2: KEY_STRING2
+// key string2: 1
+
/**
* Do not modify this class. It was generated. Instead modify LeafRegionEntry.cpp and then run
* ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory).
*/
public class VMStatsDiskLRURegionEntryHeapStringKey2 extends VMStatsDiskLRURegionEntryHeap {
public VMStatsDiskLRURegionEntryHeapStringKey2(RegionEntryContext context, String key,
- Object value, boolean byteEncode) {
- super(context, (value instanceof RecoveredEntry ? null : value));
+
+
+
+ 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;
long tmpBits2 = 0L;
@@ -77,9 +102,11 @@ public class VMStatsDiskLRURegionEntryHeapStringKey2 extends VMStatsDiskLRURegio
tmpBits1 |= key.length();
this.bits1 = tmpBits1;
this.bits2 = tmpBits2;
+
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// common code
protected int hash;
private HashEntry<Object, Object> next;
@@ -88,10 +115,11 @@ public class VMStatsDiskLRURegionEntryHeapStringKey2 extends VMStatsDiskLRURegio
private static final AtomicLongFieldUpdater<VMStatsDiskLRURegionEntryHeapStringKey2> lastModifiedUpdater =
AtomicLongFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryHeapStringKey2.class,
"lastModified");
+
private volatile Object value;
@Override
- protected final Object getValueField() {
+ protected Object getValueField() {
return this.value;
}
@@ -111,7 +139,7 @@ public class VMStatsDiskLRURegionEntryHeapStringKey2 extends VMStatsDiskLRURegio
/**
* @see HashEntry#getEntryHash()
*/
- public final int getEntryHash() {
+ public int getEntryHash() {
return this.hash;
}
@@ -122,19 +150,22 @@ public class VMStatsDiskLRURegionEntryHeapStringKey2 extends VMStatsDiskLRURegio
/**
* @see HashEntry#getNextEntry()
*/
- public final HashEntry<Object, Object> getNextEntry() {
+ public HashEntry<Object, Object> getNextEntry() {
return this.next;
}
/**
* @see HashEntry#setNextEntry
*/
- public final void setNextEntry(final HashEntry<Object, Object> n) {
+ public void setNextEntry(final HashEntry<Object, Object> n) {
this.next = n;
}
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// disk code
+
protected void initialize(RegionEntryContext drs, Object value) {
boolean isBackup;
if (drs instanceof LocalRegion) {
@@ -151,7 +182,7 @@ public class VMStatsDiskLRURegionEntryHeapStringKey2 extends VMStatsDiskLRURegio
}
@Override
- public final synchronized int updateAsyncEntrySize(EnableLRU capacityController) {
+ public synchronized int updateAsyncEntrySize(EnableLRU capacityController) {
int oldSize = getEntrySize();
int newSize = capacityController.entrySize(getKeyForSizing(), null);
setEntrySize(newSize);
@@ -159,7 +190,9 @@ public class VMStatsDiskLRURegionEntryHeapStringKey2 extends VMStatsDiskLRURegio
return delta;
}
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
private void diskInitialize(RegionEntryContext context, Object value) {
DiskRecoveryStore drs = (DiskRecoveryStore) context;
DiskStoreImpl ds = drs.getDiskStore();
@@ -184,7 +217,6 @@ public class VMStatsDiskLRURegionEntryHeapStringKey2 extends VMStatsDiskLRURegio
void setDiskId(RegionEntry old) {
this.id = ((AbstractDiskRegionEntry) old).getDiskId();
}
-
// // inlining DiskId
// // always have these fields
// /**
@@ -224,108 +256,113 @@ public class VMStatsDiskLRURegionEntryHeapStringKey2 extends VMStatsDiskLRURegio
// // persistent
// /** unique entry identifier * */
// private long keyId;
+
+
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// lru code
@Override
public void setDelayedDiskId(LocalRegion r) {
+
DiskStoreImpl ds = r.getDiskStore();
long maxOplogSize = ds.getMaxOplogSize();
this.id = DiskId.createDiskId(maxOplogSize, false /* over flow only */, ds.needsLinkedList());
+
+
+
}
- public final synchronized int updateEntrySize(EnableLRU capacityController) {
+ public synchronized int updateEntrySize(EnableLRU capacityController) {
return updateEntrySize(capacityController, _getValue()); // OFHEAP: _getValue ok w/o incing
// refcount because we are synced and
// only getting the size
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
- public final synchronized int updateEntrySize(EnableLRU capacityController, Object value) {
+
+ public synchronized int updateEntrySize(EnableLRU capacityController, Object value) {
int oldSize = getEntrySize();
int newSize = capacityController.entrySize(getKeyForSizing(), value);
setEntrySize(newSize);
int delta = newSize - oldSize;
- // if ( debug ) log( "updateEntrySize key=" + getKey()
- // + (_getValue() == Token.INVALID ? " invalid" :
- // (_getValue() == Token.LOCAL_INVALID ? "local_invalid" :
- // (_getValue()==null ? " evicted" : " valid")))
- // + " oldSize=" + oldSize
- // + " newSize=" + this.size );
return delta;
}
- public final boolean testRecentlyUsed() {
+ public boolean testRecentlyUsed() {
return areAnyBitsSet(RECENTLY_USED);
}
@Override
- public final void setRecentlyUsed() {
+ public void setRecentlyUsed() {
setBits(RECENTLY_USED);
}
- public final void unsetRecentlyUsed() {
+ public void unsetRecentlyUsed() {
clearBits(~RECENTLY_USED);
}
- public final boolean testEvicted() {
+ public boolean testEvicted() {
return areAnyBitsSet(EVICTED);
}
- public final void setEvicted() {
+ public void setEvicted() {
setBits(EVICTED);
}
- public final void unsetEvicted() {
+ public void unsetEvicted() {
clearBits(~EVICTED);
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
private LRUClockNode nextLRU;
private LRUClockNode prevLRU;
private int size;
- public final void setNextLRUNode(LRUClockNode next) {
+ public void setNextLRUNode(LRUClockNode next) {
this.nextLRU = next;
}
- public final LRUClockNode nextLRUNode() {
+ public LRUClockNode nextLRUNode() {
return this.nextLRU;
}
- public final void setPrevLRUNode(LRUClockNode prev) {
+ public void setPrevLRUNode(LRUClockNode prev) {
this.prevLRU = prev;
}
- public final LRUClockNode prevLRUNode() {
+ public LRUClockNode prevLRUNode() {
return this.prevLRU;
}
- public final int getEntrySize() {
+ public int getEntrySize() {
return this.size;
}
- protected final void setEntrySize(int size) {
+ protected void setEntrySize(int size) {
this.size = size;
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
- // @Override
- // public StringBuilder appendFieldsToString(final StringBuilder sb) {
- // StringBuilder result = super.appendFieldsToString(sb);
- // result.append("; prev=").append(this.prevLRU==null?"null":"not null");
- // result.append("; next=").append(this.nextLRU==null?"null":"not null");
- // return result;
- // }
+
@Override
public Object getKeyForSizing() {
+
+
+
// inline keys always report null for sizing since the size comes from the entry size
return null;
+
}
+
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// stats code
@Override
- public final void updateStatsForGet(boolean hit, long time) {
+ public void updateStatsForGet(boolean hit, long time) {
setLastAccessed(time);
if (hit) {
incrementHitCount();
@@ -335,7 +372,7 @@ public class VMStatsDiskLRURegionEntryHeapStringKey2 extends VMStatsDiskLRURegio
}
@Override
- protected final void setLastModifiedAndAccessedTimes(long lastModified, long lastAccessed) {
+ protected void setLastModifiedAndAccessedTimes(long lastModified, long lastAccessed) {
_setLastModified(lastModified);
if (!DISABLE_ACCESS_TIME_UPDATE_ON_PUT) {
setLastAccessed(lastAccessed);
@@ -345,6 +382,7 @@ public class VMStatsDiskLRURegionEntryHeapStringKey2 extends VMStatsDiskLRURegio
private volatile long lastAccessed;
private volatile int hitCount;
private volatile int missCount;
+
private static final AtomicIntegerFieldUpdater<VMStatsDiskLRURegionEntryHeapStringKey2> hitCountUpdater =
AtomicIntegerFieldUpdater.newUpdater(VMStatsDiskLRURegionEntryHeapStringKey2.class,
"hitCount");
@@ -353,7 +391,7 @@ public class VMStatsDiskLRURegionEntryHeapStringKey2 extends VMStatsDiskLRURegio
"missCount");
@Override
- public final long getLastAccessed() throws InternalStatisticsDisabledException {
+ public long getLastAccessed() throws InternalStatisticsDisabledException {
return this.lastAccessed;
}
@@ -362,12 +400,12 @@ public class VMStatsDiskLRURegionEntryHeapStringKey2 extends VMStatsDiskLRURegio
}
@Override
- public final long getHitCount() throws InternalStatisticsDisabledException {
+ public long getHitCount() throws InternalStatisticsDisabledException {
return this.hitCount & 0xFFFFFFFFL;
}
@Override
- public final long getMissCount() throws InternalStatisticsDisabledException {
+ public long getMissCount() throws InternalStatisticsDisabledException {
return this.missCount & 0xFFFFFFFFL;
}
@@ -380,14 +418,15 @@ public class VMStatsDiskLRURegionEntryHeapStringKey2 extends VMStatsDiskLRURegio
}
@Override
- public final void resetCounts() throws InternalStatisticsDisabledException {
+ public void resetCounts() throws InternalStatisticsDisabledException {
hitCountUpdater.set(this, 0);
missCountUpdater.set(this, 0);
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
@Override
- public final void txDidDestroy(long currTime) {
+ public void txDidDestroy(long currTime) {
setLastModified(currTime);
setLastAccessed(currTime);
this.hitCount = 0;
@@ -399,8 +438,12 @@ public class VMStatsDiskLRURegionEntryHeapStringKey2 extends VMStatsDiskLRURegio
return true;
}
+
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// key code
+
// strlen is encoded in lowest 6 bits (max strlen is 63)
// character encoding info is in bits 7 and 8
// The other bits are used to encoded character data.
@@ -419,7 +462,7 @@ public class VMStatsDiskLRURegionEntryHeapStringKey2 extends VMStatsDiskLRURegio
}
@Override
- public final Object getKey() {
+ public Object getKey() {
int keylen = getKeyLength();
char[] chars = new char[keylen];
long tmpBits1 = this.bits1;
@@ -449,6 +492,7 @@ public class VMStatsDiskLRURegionEntryHeapStringKey2 extends VMStatsDiskLRURegio
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
@Override
public boolean isKeyEqual(Object k) {
if (k instanceof String) {
@@ -491,5 +535,7 @@ public class VMStatsDiskLRURegionEntryHeapStringKey2 extends VMStatsDiskLRURegio
}
return false;
}
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
}
+