You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by kl...@apache.org on 2017/05/16 02:19:56 UTC
[46/78] geode git commit: fixup
http://git-wip-us.apache.org/repos/asf/geode/blob/5adb681a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapStringKey2.java
index c166c71..bc533ad 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapStringKey2.java
@@ -18,35 +18,22 @@ package org.apache.geode.internal.cache;
-
-
-
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.cache.EntryEvent;
-
import org.apache.geode.internal.cache.lru.EnableLRU;
-
-
-
-
-
-
-
import org.apache.geode.internal.cache.lru.LRUClockNode;
import org.apache.geode.internal.cache.lru.NewLRUClockHand;
-
import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
import org.apache.geode.internal.cache.versions.VersionSource;
import org.apache.geode.internal.cache.versions.VersionStamp;
import org.apache.geode.internal.cache.versions.VersionTag;
-
import org.apache.geode.internal.offheap.OffHeapRegionEntryHelper;
import org.apache.geode.internal.offheap.annotations.Released;
import org.apache.geode.internal.offheap.annotations.Retained;
@@ -72,8 +59,9 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha
* 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 VersionedThinLRURegionEntryOffHeapStringKey2 extends VersionedThinLRURegionEntryOffHeap {
- public VersionedThinLRURegionEntryOffHeapStringKey2 (RegionEntryContext context, String key,
+public class VersionedThinLRURegionEntryOffHeapStringKey2
+ extends VersionedThinLRURegionEntryOffHeap {
+ public VersionedThinLRURegionEntryOffHeapStringKey2(RegionEntryContext context, String key,
@Retained
@@ -81,33 +69,34 @@ public class VersionedThinLRURegionEntryOffHeapStringKey2 extends VersionedThinL
, boolean byteEncode
- ) {
- super(context,
+ ) {
+ super(context,
- value
+ value
- );
+ );
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
// caller has already confirmed that key.length <= MAX_INLINE_STRING_KEY
long tmpBits1 = 0L;
long tmpBits2 = 0L;
if (byteEncode) {
- for (int i=key.length()-1; i >= 0; i--) {
- // Note: we know each byte is <= 0x7f so the "& 0xff" is not needed. But I added it in to keep findbugs happy.
+ for (int i = key.length() - 1; i >= 0; i--) {
+ // Note: we know each byte is <= 0x7f so the "& 0xff" is not needed. But I added it in to
+ // keep findbugs happy.
if (i < 7) {
- tmpBits1 |= (byte)key.charAt(i) & 0xff;
+ tmpBits1 |= (byte) key.charAt(i) & 0xff;
tmpBits1 <<= 8;
} else {
tmpBits2 <<= 8;
- tmpBits2 |= (byte)key.charAt(i) & 0xff;
+ tmpBits2 |= (byte) key.charAt(i) & 0xff;
}
}
- tmpBits1 |= 1<<6;
+ tmpBits1 |= 1 << 6;
} else {
- for (int i=key.length()-1; i >= 0; i--) {
+ for (int i = key.length() - 1; i >= 0; i--) {
if (i < 3) {
tmpBits1 |= key.charAt(i);
tmpBits1 <<= 16;
@@ -124,35 +113,40 @@ public class VersionedThinLRURegionEntryOffHeapStringKey2 extends VersionedThinL
}
// 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<VersionedThinLRURegionEntryOffHeapStringKey2> lastModifiedUpdater
- = AtomicLongFieldUpdater.newUpdater(VersionedThinLRURegionEntryOffHeapStringKey2.class, "lastModified");
+ private static final AtomicLongFieldUpdater<VersionedThinLRURegionEntryOffHeapStringKey2> lastModifiedUpdater =
+ AtomicLongFieldUpdater.newUpdater(VersionedThinLRURegionEntryOffHeapStringKey2.class,
+ "lastModified");
/**
* All access done using ohAddrUpdater so it is used even though the compiler can not tell it is.
*/
@SuppressWarnings("unused")
- @Retained @Released private volatile long ohAddress;
+ @Retained
+ @Released
+ private volatile long ohAddress;
/**
- * I needed to add this because I wanted clear to call setValue which normally can only be called while the re is synced.
- * But if I sync in that code it causes a lock ordering deadlock with the disk regions because they also get a rw lock in clear.
- * Some hardware platforms do not support CAS on a long. If gemfire is run on one of those the AtomicLongFieldUpdater does a sync
- * on the re and we will once again be deadlocked.
- * I don't know if we support any of the hardware platforms that do not have a 64bit CAS. If we do then we can expect deadlocks
- * on disk regions.
+ * I needed to add this because I wanted clear to call setValue which normally can only be called
+ * while the re is synced. But if I sync in that code it causes a lock ordering deadlock with the
+ * disk regions because they also get a rw lock in clear. Some hardware platforms do not support
+ * CAS on a long. If gemfire is run on one of those the AtomicLongFieldUpdater does a sync on the
+ * re and we will once again be deadlocked. I don't know if we support any of the hardware
+ * platforms that do not have a 64bit CAS. If we do then we can expect deadlocks on disk regions.
*/
- private final static AtomicLongFieldUpdater<VersionedThinLRURegionEntryOffHeapStringKey2> ohAddrUpdater = AtomicLongFieldUpdater.newUpdater(VersionedThinLRURegionEntryOffHeapStringKey2.class, "ohAddress");
-
+ private final static AtomicLongFieldUpdater<VersionedThinLRURegionEntryOffHeapStringKey2> ohAddrUpdater =
+ AtomicLongFieldUpdater.newUpdater(VersionedThinLRURegionEntryOffHeapStringKey2.class,
+ "ohAddress");
+
@Override
public Token getValueAsToken() {
return OffHeapRegionEntryHelper.getValueAsToken(this);
}
-
+
@Override
protected Object getValueField() {
return OffHeapRegionEntryHelper._getValue(this);
@@ -168,6 +162,7 @@ public class VersionedThinLRURegionEntryOffHeapStringKey2 extends VersionedThinL
OffHeapRegionEntryHelper.setValue(this, v);
}
+
@Override
@Retained
@@ -185,7 +180,7 @@ public class VersionedThinLRURegionEntryOffHeapStringKey2 extends VersionedThinL
public boolean setAddress(long expectedAddr, long newAddr) {
return ohAddrUpdater.compareAndSet(this, expectedAddr, newAddr);
}
-
+
@Override
@Released
@@ -193,36 +188,41 @@ public class VersionedThinLRURegionEntryOffHeapStringKey2 extends VersionedThinL
public void release() {
OffHeapRegionEntryHelper.releaseEntry(this);
}
-
+
@Override
public void returnToPool() {
// Deadcoded for now; never was working
-// if (this instanceof VMThinRegionEntryLongKey) {
-// factory.returnToPool((VMThinRegionEntryLongKey)this);
-// }
+ // if (this instanceof VMThinRegionEntryLongKey) {
+ // factory.returnToPool((VMThinRegionEntryLongKey)this);
+ // }
}
protected long getLastModifiedField() {
return lastModifiedUpdater.get(this);
}
+
protected boolean compareAndSetLastModifiedField(long expectedValue, long newValue) {
return lastModifiedUpdater.compareAndSet(this, expectedValue, newValue);
}
+
/**
* @see HashEntry#getEntryHash()
*/
public int getEntryHash() {
return this.hash;
}
+
protected void setEntryHash(int v) {
this.hash = v;
}
+
/**
* @see HashEntry#getNextEntry()
*/
public HashEntry<Object, Object> getNextEntry() {
return this.next;
}
+
/**
* @see HashEntry#setNextEntry
*/
@@ -230,51 +230,57 @@ public class VersionedThinLRURegionEntryOffHeapStringKey2 extends VersionedThinL
this.next = n;
}
-
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// lru code
@Override
public void setDelayedDiskId(LocalRegion r) {
-
-
- // nothing needed for LRUs with no disk
+ // nothing needed for LRUs with no disk
}
+
public synchronized int updateEntrySize(EnableLRU capacityController) {
- return updateEntrySize(capacityController, _getValue()); // OFHEAP: _getValue ok w/o incing refcount because we are synced and only getting the size
+ return updateEntrySize(capacityController, _getValue()); // OFHEAP: _getValue ok w/o incing
+ // refcount because we are synced and
+ // only getting the size
}
-
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
- public synchronized int updateEntrySize(EnableLRU capacityController,
- Object value) {
+
+ public synchronized int updateEntrySize(EnableLRU capacityController, Object value) {
int oldSize = getEntrySize();
- int newSize = capacityController.entrySize( getKeyForSizing(), value);
+ int newSize = capacityController.entrySize(getKeyForSizing(), value);
setEntrySize(newSize);
int delta = newSize - oldSize;
return delta;
}
+
public boolean testRecentlyUsed() {
return areAnyBitsSet(RECENTLY_USED);
}
+
@Override
public void setRecentlyUsed() {
setBits(RECENTLY_USED);
}
+
public void unsetRecentlyUsed() {
clearBits(~RECENTLY_USED);
}
+
public boolean testEvicted() {
return areAnyBitsSet(EVICTED);
}
+
public void setEvicted() {
setBits(EVICTED);
}
+
public void unsetEvicted() {
clearBits(~EVICTED);
}
@@ -284,33 +290,38 @@ public class VersionedThinLRURegionEntryOffHeapStringKey2 extends VersionedThinL
private LRUClockNode nextLRU;
private LRUClockNode prevLRU;
private int size;
- public void setNextLRUNode( LRUClockNode next ) {
+
+ public void setNextLRUNode(LRUClockNode next) {
this.nextLRU = next;
}
+
public LRUClockNode nextLRUNode() {
return this.nextLRU;
}
- public void setPrevLRUNode( LRUClockNode prev ) {
+
+ public void setPrevLRUNode(LRUClockNode prev) {
this.prevLRU = prev;
}
+
public LRUClockNode prevLRUNode() {
return this.prevLRU;
}
+
public int getEntrySize() {
return this.size;
}
+
protected void setEntrySize(int size) {
this.size = size;
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
@Override
public Object getKeyForSizing() {
-
// inline keys always report null for sizing since the size comes from the entry size
return null;
@@ -318,10 +329,8 @@ public class VersionedThinLRURegionEntryOffHeapStringKey2 extends VersionedThinL
-
-
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// versioned code
private VersionSource memberID;
private short entryVersionLowBytes;
@@ -333,16 +342,16 @@ public class VersionedThinLRURegionEntryOffHeapStringKey2 extends VersionedThinL
public int getEntryVersion() {
return ((entryVersionHighByte << 16) & 0xFF0000) | (entryVersionLowBytes & 0xFFFF);
}
-
+
public long getRegionVersion() {
- return (((long)regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL);
+ return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL);
}
-
-
+
+
public long getVersionTimeStamp() {
return getLastModified();
}
-
+
public void setVersionTimeStamp(long time) {
setLastModified(time);
}
@@ -350,17 +359,18 @@ public class VersionedThinLRURegionEntryOffHeapStringKey2 extends VersionedThinL
public VersionSource getMemberID() {
return this.memberID;
}
+
public int getDistributedSystemId() {
return this.distributedSystemId;
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
public void setVersions(VersionTag tag) {
this.memberID = tag.getMemberID();
int eVersion = tag.getEntryVersion();
- this.entryVersionLowBytes = (short)(eVersion & 0xffff);
- this.entryVersionHighByte = (byte)((eVersion & 0xff0000) >> 16);
+ this.entryVersionLowBytes = (short) (eVersion & 0xffff);
+ this.entryVersionHighByte = (byte) ((eVersion & 0xff0000) >> 16);
this.regionVersionHighBytes = tag.getRegionVersionHighBytes();
this.regionVersionLowBytes = tag.getRegionVersionLowBytes();
if (!(tag.isGatewayTag()) && this.distributedSystemId == tag.getDistributedSystemId()) {
@@ -372,11 +382,11 @@ public class VersionedThinLRURegionEntryOffHeapStringKey2 extends VersionedThinL
} else {
setVersionTimeStamp(tag.getVersionTimeStamp());
}
- this.distributedSystemId = (byte)(tag.getDistributedSystemId() & 0xff);
+ this.distributedSystemId = (byte) (tag.getDistributedSystemId() & 0xff);
}
public void setMemberID(VersionSource memberID) {
- this.memberID = memberID;
+ this.memberID = memberID;
}
@Override
@@ -385,7 +395,7 @@ public class VersionedThinLRURegionEntryOffHeapStringKey2 extends VersionedThinL
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
public VersionTag asVersionTag() {
VersionTag tag = VersionTag.create(memberID);
tag.setEntryVersion(getEntryVersion());
@@ -395,9 +405,9 @@ public class VersionedThinLRURegionEntryOffHeapStringKey2 extends VersionedThinL
return tag;
}
- public void processVersionTag(LocalRegion r, VersionTag tag,
- boolean isTombstoneFromGII, boolean hasDelta,
- VersionSource thisVM, InternalDistributedMember sender, boolean checkForConflicts) {
+ public void processVersionTag(LocalRegion r, VersionTag tag, boolean isTombstoneFromGII,
+ boolean hasDelta, VersionSource thisVM, InternalDistributedMember sender,
+ boolean checkForConflicts) {
basicProcessVersionTag(r, tag, isTombstoneFromGII, hasDelta, thisVM, sender, checkForConflicts);
}
@@ -412,15 +422,15 @@ public class VersionedThinLRURegionEntryOffHeapStringKey2 extends VersionedThinL
public short getRegionVersionHighBytes() {
return this.regionVersionHighBytes;
}
-
+
/** get rvv internal low bytes. Used by region entries for transferring to storage */
public int getRegionVersionLowBytes() {
return this.regionVersionLowBytes;
}
-
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// key code
// strlen is encoded in lowest 6 bits (max strlen is 63)
@@ -429,14 +439,17 @@ public class VersionedThinLRURegionEntryOffHeapStringKey2 extends VersionedThinL
private final long bits1;
// bits2 encodes character data
private final long bits2;
+
private int getKeyLength() {
return (int) (this.bits1 & 0x003fL);
}
+
private int getEncoding() {
// 0 means encoded as char
// 1 means encoded as bytes that are all <= 0x7f;
return (int) (this.bits1 >> 6) & 0x03;
}
+
@Override
public Object getKey() {
int keylen = getKeyLength();
@@ -444,7 +457,7 @@ public class VersionedThinLRURegionEntryOffHeapStringKey2 extends VersionedThinL
long tmpBits1 = this.bits1;
long tmpBits2 = this.bits2;
if (getEncoding() == 1) {
- for (int i=0; i < keylen; i++) {
+ for (int i = 0; i < keylen; i++) {
if (i < 7) {
tmpBits1 >>= 8;
chars[i] = (char) (tmpBits1 & 0x00ff);
@@ -454,10 +467,10 @@ public class VersionedThinLRURegionEntryOffHeapStringKey2 extends VersionedThinL
}
}
} else {
- for (int i=0; i < keylen; i++) {
+ for (int i = 0; i < keylen; i++) {
if (i < 3) {
tmpBits1 >>= 16;
- chars[i] = (char) (tmpBits1 & 0x00FFff);
+ chars[i] = (char) (tmpBits1 & 0x00FFff);
} else {
chars[i] = (char) (tmpBits2 & 0x00FFff);
tmpBits2 >>= 16;
@@ -468,17 +481,17 @@ public class VersionedThinLRURegionEntryOffHeapStringKey2 extends VersionedThinL
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
@Override
public boolean isKeyEqual(Object k) {
if (k instanceof String) {
- String str = (String)k;
+ String str = (String) k;
int keylen = getKeyLength();
if (str.length() == keylen) {
long tmpBits1 = this.bits1;
long tmpBits2 = this.bits2;
if (getEncoding() == 1) {
- for (int i=0; i < keylen; i++) {
+ for (int i = 0; i < keylen; i++) {
char c;
if (i < 7) {
tmpBits1 >>= 8;
@@ -492,7 +505,7 @@ public class VersionedThinLRURegionEntryOffHeapStringKey2 extends VersionedThinL
}
}
} else {
- for (int i=0; i < keylen; i++) {
+ for (int i = 0; i < keylen; i++) {
char c;
if (i < 3) {
tmpBits1 >>= 16;
http://git-wip-us.apache.org/repos/asf/geode/blob/5adb681a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapUUIDKey.java
index a8f0c3f..60ac459 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryOffHeapUUIDKey.java
@@ -20,33 +20,22 @@ package org.apache.geode.internal.cache;
import java.util.UUID;
-
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.cache.EntryEvent;
-
import org.apache.geode.internal.cache.lru.EnableLRU;
-
-
-
-
-
-
-
import org.apache.geode.internal.cache.lru.LRUClockNode;
import org.apache.geode.internal.cache.lru.NewLRUClockHand;
-
import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
import org.apache.geode.internal.cache.versions.VersionSource;
import org.apache.geode.internal.cache.versions.VersionStamp;
import org.apache.geode.internal.cache.versions.VersionTag;
-
import org.apache.geode.internal.offheap.OffHeapRegionEntryHelper;
import org.apache.geode.internal.offheap.annotations.Released;
import org.apache.geode.internal.offheap.annotations.Retained;
@@ -73,7 +62,7 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha
* ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory).
*/
public class VersionedThinLRURegionEntryOffHeapUUIDKey extends VersionedThinLRURegionEntryOffHeap {
- public VersionedThinLRURegionEntryOffHeapUUIDKey (RegionEntryContext context, UUID key,
+ public VersionedThinLRURegionEntryOffHeapUUIDKey(RegionEntryContext context, UUID key,
@Retained
@@ -81,14 +70,14 @@ public class VersionedThinLRURegionEntryOffHeapUUIDKey extends VersionedThinLRUR
- ) {
- super(context,
+ ) {
+ super(context,
- value
+ value
- );
+ );
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
this.keyMostSigBits = key.getMostSignificantBits();
@@ -97,35 +86,40 @@ public class VersionedThinLRURegionEntryOffHeapUUIDKey extends VersionedThinLRUR
}
// 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<VersionedThinLRURegionEntryOffHeapUUIDKey> lastModifiedUpdater
- = AtomicLongFieldUpdater.newUpdater(VersionedThinLRURegionEntryOffHeapUUIDKey.class, "lastModified");
+ private static final AtomicLongFieldUpdater<VersionedThinLRURegionEntryOffHeapUUIDKey> lastModifiedUpdater =
+ AtomicLongFieldUpdater.newUpdater(VersionedThinLRURegionEntryOffHeapUUIDKey.class,
+ "lastModified");
/**
* All access done using ohAddrUpdater so it is used even though the compiler can not tell it is.
*/
@SuppressWarnings("unused")
- @Retained @Released private volatile long ohAddress;
+ @Retained
+ @Released
+ private volatile long ohAddress;
/**
- * I needed to add this because I wanted clear to call setValue which normally can only be called while the re is synced.
- * But if I sync in that code it causes a lock ordering deadlock with the disk regions because they also get a rw lock in clear.
- * Some hardware platforms do not support CAS on a long. If gemfire is run on one of those the AtomicLongFieldUpdater does a sync
- * on the re and we will once again be deadlocked.
- * I don't know if we support any of the hardware platforms that do not have a 64bit CAS. If we do then we can expect deadlocks
- * on disk regions.
+ * I needed to add this because I wanted clear to call setValue which normally can only be called
+ * while the re is synced. But if I sync in that code it causes a lock ordering deadlock with the
+ * disk regions because they also get a rw lock in clear. Some hardware platforms do not support
+ * CAS on a long. If gemfire is run on one of those the AtomicLongFieldUpdater does a sync on the
+ * re and we will once again be deadlocked. I don't know if we support any of the hardware
+ * platforms that do not have a 64bit CAS. If we do then we can expect deadlocks on disk regions.
*/
- private final static AtomicLongFieldUpdater<VersionedThinLRURegionEntryOffHeapUUIDKey> ohAddrUpdater = AtomicLongFieldUpdater.newUpdater(VersionedThinLRURegionEntryOffHeapUUIDKey.class, "ohAddress");
-
+ private final static AtomicLongFieldUpdater<VersionedThinLRURegionEntryOffHeapUUIDKey> ohAddrUpdater =
+ AtomicLongFieldUpdater.newUpdater(VersionedThinLRURegionEntryOffHeapUUIDKey.class,
+ "ohAddress");
+
@Override
public Token getValueAsToken() {
return OffHeapRegionEntryHelper.getValueAsToken(this);
}
-
+
@Override
protected Object getValueField() {
return OffHeapRegionEntryHelper._getValue(this);
@@ -141,6 +135,7 @@ public class VersionedThinLRURegionEntryOffHeapUUIDKey extends VersionedThinLRUR
OffHeapRegionEntryHelper.setValue(this, v);
}
+
@Override
@Retained
@@ -158,7 +153,7 @@ public class VersionedThinLRURegionEntryOffHeapUUIDKey extends VersionedThinLRUR
public boolean setAddress(long expectedAddr, long newAddr) {
return ohAddrUpdater.compareAndSet(this, expectedAddr, newAddr);
}
-
+
@Override
@Released
@@ -166,36 +161,41 @@ public class VersionedThinLRURegionEntryOffHeapUUIDKey extends VersionedThinLRUR
public void release() {
OffHeapRegionEntryHelper.releaseEntry(this);
}
-
+
@Override
public void returnToPool() {
// Deadcoded for now; never was working
-// if (this instanceof VMThinRegionEntryLongKey) {
-// factory.returnToPool((VMThinRegionEntryLongKey)this);
-// }
+ // if (this instanceof VMThinRegionEntryLongKey) {
+ // factory.returnToPool((VMThinRegionEntryLongKey)this);
+ // }
}
protected long getLastModifiedField() {
return lastModifiedUpdater.get(this);
}
+
protected boolean compareAndSetLastModifiedField(long expectedValue, long newValue) {
return lastModifiedUpdater.compareAndSet(this, expectedValue, newValue);
}
+
/**
* @see HashEntry#getEntryHash()
*/
public int getEntryHash() {
return this.hash;
}
+
protected void setEntryHash(int v) {
this.hash = v;
}
+
/**
* @see HashEntry#getNextEntry()
*/
public HashEntry<Object, Object> getNextEntry() {
return this.next;
}
+
/**
* @see HashEntry#setNextEntry
*/
@@ -203,51 +203,57 @@ public class VersionedThinLRURegionEntryOffHeapUUIDKey extends VersionedThinLRUR
this.next = n;
}
-
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// lru code
@Override
public void setDelayedDiskId(LocalRegion r) {
-
-
- // nothing needed for LRUs with no disk
+ // nothing needed for LRUs with no disk
}
+
public synchronized int updateEntrySize(EnableLRU capacityController) {
- return updateEntrySize(capacityController, _getValue()); // OFHEAP: _getValue ok w/o incing refcount because we are synced and only getting the size
+ return updateEntrySize(capacityController, _getValue()); // OFHEAP: _getValue ok w/o incing
+ // refcount because we are synced and
+ // only getting the size
}
-
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
- public synchronized int updateEntrySize(EnableLRU capacityController,
- Object value) {
+
+ public synchronized int updateEntrySize(EnableLRU capacityController, Object value) {
int oldSize = getEntrySize();
- int newSize = capacityController.entrySize( getKeyForSizing(), value);
+ int newSize = capacityController.entrySize(getKeyForSizing(), value);
setEntrySize(newSize);
int delta = newSize - oldSize;
return delta;
}
+
public boolean testRecentlyUsed() {
return areAnyBitsSet(RECENTLY_USED);
}
+
@Override
public void setRecentlyUsed() {
setBits(RECENTLY_USED);
}
+
public void unsetRecentlyUsed() {
clearBits(~RECENTLY_USED);
}
+
public boolean testEvicted() {
return areAnyBitsSet(EVICTED);
}
+
public void setEvicted() {
setBits(EVICTED);
}
+
public void unsetEvicted() {
clearBits(~EVICTED);
}
@@ -257,33 +263,38 @@ public class VersionedThinLRURegionEntryOffHeapUUIDKey extends VersionedThinLRUR
private LRUClockNode nextLRU;
private LRUClockNode prevLRU;
private int size;
- public void setNextLRUNode( LRUClockNode next ) {
+
+ public void setNextLRUNode(LRUClockNode next) {
this.nextLRU = next;
}
+
public LRUClockNode nextLRUNode() {
return this.nextLRU;
}
- public void setPrevLRUNode( LRUClockNode prev ) {
+
+ public void setPrevLRUNode(LRUClockNode prev) {
this.prevLRU = prev;
}
+
public LRUClockNode prevLRUNode() {
return this.prevLRU;
}
+
public int getEntrySize() {
return this.size;
}
+
protected void setEntrySize(int size) {
this.size = size;
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
@Override
public Object getKeyForSizing() {
-
// inline keys always report null for sizing since the size comes from the entry size
return null;
@@ -291,10 +302,8 @@ public class VersionedThinLRURegionEntryOffHeapUUIDKey extends VersionedThinLRUR
-
-
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// versioned code
private VersionSource memberID;
private short entryVersionLowBytes;
@@ -306,16 +315,16 @@ public class VersionedThinLRURegionEntryOffHeapUUIDKey extends VersionedThinLRUR
public int getEntryVersion() {
return ((entryVersionHighByte << 16) & 0xFF0000) | (entryVersionLowBytes & 0xFFFF);
}
-
+
public long getRegionVersion() {
- return (((long)regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL);
+ return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL);
}
-
-
+
+
public long getVersionTimeStamp() {
return getLastModified();
}
-
+
public void setVersionTimeStamp(long time) {
setLastModified(time);
}
@@ -323,17 +332,18 @@ public class VersionedThinLRURegionEntryOffHeapUUIDKey extends VersionedThinLRUR
public VersionSource getMemberID() {
return this.memberID;
}
+
public int getDistributedSystemId() {
return this.distributedSystemId;
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
public void setVersions(VersionTag tag) {
this.memberID = tag.getMemberID();
int eVersion = tag.getEntryVersion();
- this.entryVersionLowBytes = (short)(eVersion & 0xffff);
- this.entryVersionHighByte = (byte)((eVersion & 0xff0000) >> 16);
+ this.entryVersionLowBytes = (short) (eVersion & 0xffff);
+ this.entryVersionHighByte = (byte) ((eVersion & 0xff0000) >> 16);
this.regionVersionHighBytes = tag.getRegionVersionHighBytes();
this.regionVersionLowBytes = tag.getRegionVersionLowBytes();
if (!(tag.isGatewayTag()) && this.distributedSystemId == tag.getDistributedSystemId()) {
@@ -345,11 +355,11 @@ public class VersionedThinLRURegionEntryOffHeapUUIDKey extends VersionedThinLRUR
} else {
setVersionTimeStamp(tag.getVersionTimeStamp());
}
- this.distributedSystemId = (byte)(tag.getDistributedSystemId() & 0xff);
+ this.distributedSystemId = (byte) (tag.getDistributedSystemId() & 0xff);
}
public void setMemberID(VersionSource memberID) {
- this.memberID = memberID;
+ this.memberID = memberID;
}
@Override
@@ -358,7 +368,7 @@ public class VersionedThinLRURegionEntryOffHeapUUIDKey extends VersionedThinLRUR
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
public VersionTag asVersionTag() {
VersionTag tag = VersionTag.create(memberID);
tag.setEntryVersion(getEntryVersion());
@@ -368,9 +378,9 @@ public class VersionedThinLRURegionEntryOffHeapUUIDKey extends VersionedThinLRUR
return tag;
}
- public void processVersionTag(LocalRegion r, VersionTag tag,
- boolean isTombstoneFromGII, boolean hasDelta,
- VersionSource thisVM, InternalDistributedMember sender, boolean checkForConflicts) {
+ public void processVersionTag(LocalRegion r, VersionTag tag, boolean isTombstoneFromGII,
+ boolean hasDelta, VersionSource thisVM, InternalDistributedMember sender,
+ boolean checkForConflicts) {
basicProcessVersionTag(r, tag, isTombstoneFromGII, hasDelta, thisVM, sender, checkForConflicts);
}
@@ -385,23 +395,25 @@ public class VersionedThinLRURegionEntryOffHeapUUIDKey extends VersionedThinLRUR
public short getRegionVersionHighBytes() {
return this.regionVersionHighBytes;
}
-
+
/** get rvv internal low bytes. Used by region entries for transferring to storage */
public int getRegionVersionLowBytes() {
return this.regionVersionLowBytes;
}
-
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// key code
private final long keyMostSigBits;
private final long keyLeastSigBits;
+
@Override
public Object getKey() {
return new UUID(this.keyMostSigBits, this.keyLeastSigBits);
}
+
@Override
public boolean isKeyEqual(Object k) {
if (k instanceof UUID) {
@@ -411,7 +423,7 @@ public class VersionedThinLRURegionEntryOffHeapUUIDKey extends VersionedThinLRUR
}
return false;
}
-
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
}
http://git-wip-us.apache.org/repos/asf/geode/blob/5adb681a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapIntKey.java
index d8ddae0..51347e0 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapIntKey.java
@@ -18,11 +18,6 @@ package org.apache.geode.internal.cache;
-
-
-
-
-
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.cache.EntryEvent;
@@ -32,12 +27,6 @@ import org.apache.geode.internal.cache.versions.VersionSource;
import org.apache.geode.internal.cache.versions.VersionStamp;
import org.apache.geode.internal.cache.versions.VersionTag;
-
-
-
-
-
-
import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
// macros whose definition changes this class:
@@ -59,7 +48,7 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha
* ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory).
*/
public class VersionedThinRegionEntryHeapIntKey extends VersionedThinRegionEntryHeap {
- public VersionedThinRegionEntryHeapIntKey (RegionEntryContext context, int key,
+ public VersionedThinRegionEntryHeapIntKey(RegionEntryContext context, int key,
@@ -67,40 +56,39 @@ public class VersionedThinRegionEntryHeapIntKey extends VersionedThinRegionEntry
- ) {
- super(context,
+ ) {
+ super(context,
- value
+ value
- );
+ );
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
-
-
this.key = key;
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// common code
protected int hash;
private HashEntry<Object, Object> next;
@SuppressWarnings("unused")
private volatile long lastModified;
- private static final AtomicLongFieldUpdater<VersionedThinRegionEntryHeapIntKey> lastModifiedUpdater
- = AtomicLongFieldUpdater.newUpdater(VersionedThinRegionEntryHeapIntKey.class, "lastModified");
+ private static final AtomicLongFieldUpdater<VersionedThinRegionEntryHeapIntKey> lastModifiedUpdater =
+ AtomicLongFieldUpdater.newUpdater(VersionedThinRegionEntryHeapIntKey.class, "lastModified");
private volatile Object value;
+
@Override
protected Object getValueField() {
return this.value;
}
+
@Override
protected void setValueField(Object v) {
this.value = v;
@@ -109,24 +97,29 @@ public class VersionedThinRegionEntryHeapIntKey extends VersionedThinRegionEntry
protected long getLastModifiedField() {
return lastModifiedUpdater.get(this);
}
+
protected boolean compareAndSetLastModifiedField(long expectedValue, long newValue) {
return lastModifiedUpdater.compareAndSet(this, expectedValue, newValue);
}
+
/**
* @see HashEntry#getEntryHash()
*/
public int getEntryHash() {
return this.hash;
}
+
protected void setEntryHash(int v) {
this.hash = v;
}
+
/**
* @see HashEntry#getNextEntry()
*/
public HashEntry<Object, Object> getNextEntry() {
return this.next;
}
+
/**
* @see HashEntry#setNextEntry
*/
@@ -134,14 +127,10 @@ public class VersionedThinRegionEntryHeapIntKey extends VersionedThinRegionEntry
this.next = n;
}
-
-
-
-
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// versioned code
private VersionSource memberID;
private short entryVersionLowBytes;
@@ -153,16 +142,16 @@ public class VersionedThinRegionEntryHeapIntKey extends VersionedThinRegionEntry
public int getEntryVersion() {
return ((entryVersionHighByte << 16) & 0xFF0000) | (entryVersionLowBytes & 0xFFFF);
}
-
+
public long getRegionVersion() {
- return (((long)regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL);
+ return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL);
}
-
-
+
+
public long getVersionTimeStamp() {
return getLastModified();
}
-
+
public void setVersionTimeStamp(long time) {
setLastModified(time);
}
@@ -170,17 +159,18 @@ public class VersionedThinRegionEntryHeapIntKey extends VersionedThinRegionEntry
public VersionSource getMemberID() {
return this.memberID;
}
+
public int getDistributedSystemId() {
return this.distributedSystemId;
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
public void setVersions(VersionTag tag) {
this.memberID = tag.getMemberID();
int eVersion = tag.getEntryVersion();
- this.entryVersionLowBytes = (short)(eVersion & 0xffff);
- this.entryVersionHighByte = (byte)((eVersion & 0xff0000) >> 16);
+ this.entryVersionLowBytes = (short) (eVersion & 0xffff);
+ this.entryVersionHighByte = (byte) ((eVersion & 0xff0000) >> 16);
this.regionVersionHighBytes = tag.getRegionVersionHighBytes();
this.regionVersionLowBytes = tag.getRegionVersionLowBytes();
if (!(tag.isGatewayTag()) && this.distributedSystemId == tag.getDistributedSystemId()) {
@@ -192,11 +182,11 @@ public class VersionedThinRegionEntryHeapIntKey extends VersionedThinRegionEntry
} else {
setVersionTimeStamp(tag.getVersionTimeStamp());
}
- this.distributedSystemId = (byte)(tag.getDistributedSystemId() & 0xff);
+ this.distributedSystemId = (byte) (tag.getDistributedSystemId() & 0xff);
}
public void setMemberID(VersionSource memberID) {
- this.memberID = memberID;
+ this.memberID = memberID;
}
@Override
@@ -205,7 +195,7 @@ public class VersionedThinRegionEntryHeapIntKey extends VersionedThinRegionEntry
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
public VersionTag asVersionTag() {
VersionTag tag = VersionTag.create(memberID);
tag.setEntryVersion(getEntryVersion());
@@ -215,9 +205,9 @@ public class VersionedThinRegionEntryHeapIntKey extends VersionedThinRegionEntry
return tag;
}
- public void processVersionTag(LocalRegion r, VersionTag tag,
- boolean isTombstoneFromGII, boolean hasDelta,
- VersionSource thisVM, InternalDistributedMember sender, boolean checkForConflicts) {
+ public void processVersionTag(LocalRegion r, VersionTag tag, boolean isTombstoneFromGII,
+ boolean hasDelta, VersionSource thisVM, InternalDistributedMember sender,
+ boolean checkForConflicts) {
basicProcessVersionTag(r, tag, isTombstoneFromGII, hasDelta, thisVM, sender, checkForConflicts);
}
@@ -232,29 +222,26 @@ public class VersionedThinRegionEntryHeapIntKey extends VersionedThinRegionEntry
public short getRegionVersionHighBytes() {
return this.regionVersionHighBytes;
}
-
+
/** get rvv internal low bytes. Used by region entries for transferring to storage */
public int getRegionVersionLowBytes() {
return this.regionVersionLowBytes;
}
-
- // DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
- // key code
-
-
-
+ // DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+ // key code
private final int key;
+
@Override
public Object getKey() {
return this.key;
}
+
@Override
public boolean isKeyEqual(Object k) {
if (k instanceof Integer) {
@@ -262,7 +249,7 @@ public class VersionedThinRegionEntryHeapIntKey extends VersionedThinRegionEntry
}
return false;
}
-
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
}
http://git-wip-us.apache.org/repos/asf/geode/blob/5adb681a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapLongKey.java
index bae7e51..0269e67 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapLongKey.java
@@ -18,11 +18,6 @@ package org.apache.geode.internal.cache;
-
-
-
-
-
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.cache.EntryEvent;
@@ -32,12 +27,6 @@ import org.apache.geode.internal.cache.versions.VersionSource;
import org.apache.geode.internal.cache.versions.VersionStamp;
import org.apache.geode.internal.cache.versions.VersionTag;
-
-
-
-
-
-
import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
// macros whose definition changes this class:
@@ -59,7 +48,7 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha
* ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory).
*/
public class VersionedThinRegionEntryHeapLongKey extends VersionedThinRegionEntryHeap {
- public VersionedThinRegionEntryHeapLongKey (RegionEntryContext context, long key,
+ public VersionedThinRegionEntryHeapLongKey(RegionEntryContext context, long key,
@@ -67,42 +56,39 @@ public class VersionedThinRegionEntryHeapLongKey extends VersionedThinRegionEntr
- ) {
- super(context,
+ ) {
+ super(context,
- value
+ value
- );
+ );
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
-
-
-
-
this.key = key;
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// common code
protected int hash;
private HashEntry<Object, Object> next;
@SuppressWarnings("unused")
private volatile long lastModified;
- private static final AtomicLongFieldUpdater<VersionedThinRegionEntryHeapLongKey> lastModifiedUpdater
- = AtomicLongFieldUpdater.newUpdater(VersionedThinRegionEntryHeapLongKey.class, "lastModified");
+ private static final AtomicLongFieldUpdater<VersionedThinRegionEntryHeapLongKey> lastModifiedUpdater =
+ AtomicLongFieldUpdater.newUpdater(VersionedThinRegionEntryHeapLongKey.class, "lastModified");
private volatile Object value;
+
@Override
protected Object getValueField() {
return this.value;
}
+
@Override
protected void setValueField(Object v) {
this.value = v;
@@ -111,24 +97,29 @@ public class VersionedThinRegionEntryHeapLongKey extends VersionedThinRegionEntr
protected long getLastModifiedField() {
return lastModifiedUpdater.get(this);
}
+
protected boolean compareAndSetLastModifiedField(long expectedValue, long newValue) {
return lastModifiedUpdater.compareAndSet(this, expectedValue, newValue);
}
+
/**
* @see HashEntry#getEntryHash()
*/
public int getEntryHash() {
return this.hash;
}
+
protected void setEntryHash(int v) {
this.hash = v;
}
+
/**
* @see HashEntry#getNextEntry()
*/
public HashEntry<Object, Object> getNextEntry() {
return this.next;
}
+
/**
* @see HashEntry#setNextEntry
*/
@@ -136,14 +127,10 @@ public class VersionedThinRegionEntryHeapLongKey extends VersionedThinRegionEntr
this.next = n;
}
-
-
-
-
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// versioned code
private VersionSource memberID;
private short entryVersionLowBytes;
@@ -155,16 +142,16 @@ public class VersionedThinRegionEntryHeapLongKey extends VersionedThinRegionEntr
public int getEntryVersion() {
return ((entryVersionHighByte << 16) & 0xFF0000) | (entryVersionLowBytes & 0xFFFF);
}
-
+
public long getRegionVersion() {
- return (((long)regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL);
+ return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL);
}
-
-
+
+
public long getVersionTimeStamp() {
return getLastModified();
}
-
+
public void setVersionTimeStamp(long time) {
setLastModified(time);
}
@@ -172,17 +159,18 @@ public class VersionedThinRegionEntryHeapLongKey extends VersionedThinRegionEntr
public VersionSource getMemberID() {
return this.memberID;
}
+
public int getDistributedSystemId() {
return this.distributedSystemId;
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
public void setVersions(VersionTag tag) {
this.memberID = tag.getMemberID();
int eVersion = tag.getEntryVersion();
- this.entryVersionLowBytes = (short)(eVersion & 0xffff);
- this.entryVersionHighByte = (byte)((eVersion & 0xff0000) >> 16);
+ this.entryVersionLowBytes = (short) (eVersion & 0xffff);
+ this.entryVersionHighByte = (byte) ((eVersion & 0xff0000) >> 16);
this.regionVersionHighBytes = tag.getRegionVersionHighBytes();
this.regionVersionLowBytes = tag.getRegionVersionLowBytes();
if (!(tag.isGatewayTag()) && this.distributedSystemId == tag.getDistributedSystemId()) {
@@ -194,11 +182,11 @@ public class VersionedThinRegionEntryHeapLongKey extends VersionedThinRegionEntr
} else {
setVersionTimeStamp(tag.getVersionTimeStamp());
}
- this.distributedSystemId = (byte)(tag.getDistributedSystemId() & 0xff);
+ this.distributedSystemId = (byte) (tag.getDistributedSystemId() & 0xff);
}
public void setMemberID(VersionSource memberID) {
- this.memberID = memberID;
+ this.memberID = memberID;
}
@Override
@@ -207,7 +195,7 @@ public class VersionedThinRegionEntryHeapLongKey extends VersionedThinRegionEntr
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
public VersionTag asVersionTag() {
VersionTag tag = VersionTag.create(memberID);
tag.setEntryVersion(getEntryVersion());
@@ -217,9 +205,9 @@ public class VersionedThinRegionEntryHeapLongKey extends VersionedThinRegionEntr
return tag;
}
- public void processVersionTag(LocalRegion r, VersionTag tag,
- boolean isTombstoneFromGII, boolean hasDelta,
- VersionSource thisVM, InternalDistributedMember sender, boolean checkForConflicts) {
+ public void processVersionTag(LocalRegion r, VersionTag tag, boolean isTombstoneFromGII,
+ boolean hasDelta, VersionSource thisVM, InternalDistributedMember sender,
+ boolean checkForConflicts) {
basicProcessVersionTag(r, tag, isTombstoneFromGII, hasDelta, thisVM, sender, checkForConflicts);
}
@@ -234,22 +222,24 @@ public class VersionedThinRegionEntryHeapLongKey extends VersionedThinRegionEntr
public short getRegionVersionHighBytes() {
return this.regionVersionHighBytes;
}
-
+
/** get rvv internal low bytes. Used by region entries for transferring to storage */
public int getRegionVersionLowBytes() {
return this.regionVersionLowBytes;
}
-
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// key code
private final long key;
+
@Override
public Object getKey() {
return this.key;
}
+
@Override
public boolean isKeyEqual(Object k) {
if (k instanceof Long) {
@@ -257,7 +247,7 @@ public class VersionedThinRegionEntryHeapLongKey extends VersionedThinRegionEntr
}
return false;
}
-
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
}
http://git-wip-us.apache.org/repos/asf/geode/blob/5adb681a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapObjectKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapObjectKey.java
index 46f0c29..f4bfa8c 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapObjectKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapObjectKey.java
@@ -18,11 +18,6 @@ package org.apache.geode.internal.cache;
-
-
-
-
-
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.cache.EntryEvent;
@@ -32,12 +27,6 @@ import org.apache.geode.internal.cache.versions.VersionSource;
import org.apache.geode.internal.cache.versions.VersionStamp;
import org.apache.geode.internal.cache.versions.VersionTag;
-
-
-
-
-
-
import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
// macros whose definition changes this class:
@@ -59,7 +48,7 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha
* ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory).
*/
public class VersionedThinRegionEntryHeapObjectKey extends VersionedThinRegionEntryHeap {
- public VersionedThinRegionEntryHeapObjectKey (RegionEntryContext context, Object key,
+ public VersionedThinRegionEntryHeapObjectKey(RegionEntryContext context, Object key,
@@ -67,38 +56,40 @@ public class VersionedThinRegionEntryHeapObjectKey extends VersionedThinRegionEn
- ) {
- super(context,
+ ) {
+ super(context,
- value
+ value
- );
+ );
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
this.key = key;
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// common code
protected int hash;
private HashEntry<Object, Object> next;
@SuppressWarnings("unused")
private volatile long lastModified;
- private static final AtomicLongFieldUpdater<VersionedThinRegionEntryHeapObjectKey> lastModifiedUpdater
- = AtomicLongFieldUpdater.newUpdater(VersionedThinRegionEntryHeapObjectKey.class, "lastModified");
+ private static final AtomicLongFieldUpdater<VersionedThinRegionEntryHeapObjectKey> lastModifiedUpdater =
+ AtomicLongFieldUpdater.newUpdater(VersionedThinRegionEntryHeapObjectKey.class,
+ "lastModified");
private volatile Object value;
+
@Override
protected Object getValueField() {
return this.value;
}
+
@Override
protected void setValueField(Object v) {
this.value = v;
@@ -107,24 +98,29 @@ public class VersionedThinRegionEntryHeapObjectKey extends VersionedThinRegionEn
protected long getLastModifiedField() {
return lastModifiedUpdater.get(this);
}
+
protected boolean compareAndSetLastModifiedField(long expectedValue, long newValue) {
return lastModifiedUpdater.compareAndSet(this, expectedValue, newValue);
}
+
/**
* @see HashEntry#getEntryHash()
*/
public int getEntryHash() {
return this.hash;
}
+
protected void setEntryHash(int v) {
this.hash = v;
}
+
/**
* @see HashEntry#getNextEntry()
*/
public HashEntry<Object, Object> getNextEntry() {
return this.next;
}
+
/**
* @see HashEntry#setNextEntry
*/
@@ -132,14 +128,10 @@ public class VersionedThinRegionEntryHeapObjectKey extends VersionedThinRegionEn
this.next = n;
}
-
-
-
-
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// versioned code
private VersionSource memberID;
private short entryVersionLowBytes;
@@ -151,16 +143,16 @@ public class VersionedThinRegionEntryHeapObjectKey extends VersionedThinRegionEn
public int getEntryVersion() {
return ((entryVersionHighByte << 16) & 0xFF0000) | (entryVersionLowBytes & 0xFFFF);
}
-
+
public long getRegionVersion() {
- return (((long)regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL);
+ return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL);
}
-
-
+
+
public long getVersionTimeStamp() {
return getLastModified();
}
-
+
public void setVersionTimeStamp(long time) {
setLastModified(time);
}
@@ -168,17 +160,18 @@ public class VersionedThinRegionEntryHeapObjectKey extends VersionedThinRegionEn
public VersionSource getMemberID() {
return this.memberID;
}
+
public int getDistributedSystemId() {
return this.distributedSystemId;
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
public void setVersions(VersionTag tag) {
this.memberID = tag.getMemberID();
int eVersion = tag.getEntryVersion();
- this.entryVersionLowBytes = (short)(eVersion & 0xffff);
- this.entryVersionHighByte = (byte)((eVersion & 0xff0000) >> 16);
+ this.entryVersionLowBytes = (short) (eVersion & 0xffff);
+ this.entryVersionHighByte = (byte) ((eVersion & 0xff0000) >> 16);
this.regionVersionHighBytes = tag.getRegionVersionHighBytes();
this.regionVersionLowBytes = tag.getRegionVersionLowBytes();
if (!(tag.isGatewayTag()) && this.distributedSystemId == tag.getDistributedSystemId()) {
@@ -190,11 +183,11 @@ public class VersionedThinRegionEntryHeapObjectKey extends VersionedThinRegionEn
} else {
setVersionTimeStamp(tag.getVersionTimeStamp());
}
- this.distributedSystemId = (byte)(tag.getDistributedSystemId() & 0xff);
+ this.distributedSystemId = (byte) (tag.getDistributedSystemId() & 0xff);
}
public void setMemberID(VersionSource memberID) {
- this.memberID = memberID;
+ this.memberID = memberID;
}
@Override
@@ -203,7 +196,7 @@ public class VersionedThinRegionEntryHeapObjectKey extends VersionedThinRegionEn
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
public VersionTag asVersionTag() {
VersionTag tag = VersionTag.create(memberID);
tag.setEntryVersion(getEntryVersion());
@@ -213,9 +206,9 @@ public class VersionedThinRegionEntryHeapObjectKey extends VersionedThinRegionEn
return tag;
}
- public void processVersionTag(LocalRegion r, VersionTag tag,
- boolean isTombstoneFromGII, boolean hasDelta,
- VersionSource thisVM, InternalDistributedMember sender, boolean checkForConflicts) {
+ public void processVersionTag(LocalRegion r, VersionTag tag, boolean isTombstoneFromGII,
+ boolean hasDelta, VersionSource thisVM, InternalDistributedMember sender,
+ boolean checkForConflicts) {
basicProcessVersionTag(r, tag, isTombstoneFromGII, hasDelta, thisVM, sender, checkForConflicts);
}
@@ -230,18 +223,19 @@ public class VersionedThinRegionEntryHeapObjectKey extends VersionedThinRegionEn
public short getRegionVersionHighBytes() {
return this.regionVersionHighBytes;
}
-
+
/** get rvv internal low bytes. Used by region entries for transferring to storage */
public int getRegionVersionLowBytes() {
return this.regionVersionLowBytes;
}
-
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// key code
private final Object key;
+
@Override
public Object getKey() {
return this.key;
http://git-wip-us.apache.org/repos/asf/geode/blob/5adb681a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapStringKey1.java
index 4f48d7d..0ad5265 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapStringKey1.java
@@ -18,11 +18,6 @@ package org.apache.geode.internal.cache;
-
-
-
-
-
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.cache.EntryEvent;
@@ -32,12 +27,6 @@ import org.apache.geode.internal.cache.versions.VersionSource;
import org.apache.geode.internal.cache.versions.VersionStamp;
import org.apache.geode.internal.cache.versions.VersionTag;
-
-
-
-
-
-
import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
// macros whose definition changes this class:
@@ -59,7 +48,7 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha
* ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory).
*/
public class VersionedThinRegionEntryHeapStringKey1 extends VersionedThinRegionEntryHeap {
- public VersionedThinRegionEntryHeapStringKey1 (RegionEntryContext context, String key,
+ public VersionedThinRegionEntryHeapStringKey1(RegionEntryContext context, String key,
@@ -67,27 +56,28 @@ public class VersionedThinRegionEntryHeapStringKey1 extends VersionedThinRegionE
, boolean byteEncode
- ) {
- super(context,
+ ) {
+ super(context,
- value
+ value
- );
+ );
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
// caller has already confirmed that key.length <= MAX_INLINE_STRING_KEY
long tmpBits1 = 0L;
if (byteEncode) {
- for (int i=key.length()-1; i >= 0; i--) {
- // Note: we know each byte is <= 0x7f so the "& 0xff" is not needed. But I added it in to keep findbugs happy.
- tmpBits1 |= (byte)key.charAt(i) & 0xff;
+ for (int i = key.length() - 1; i >= 0; i--) {
+ // Note: we know each byte is <= 0x7f so the "& 0xff" is not needed. But I added it in to
+ // keep findbugs happy.
+ tmpBits1 |= (byte) key.charAt(i) & 0xff;
tmpBits1 <<= 8;
}
- tmpBits1 |= 1<<6;
+ tmpBits1 |= 1 << 6;
} else {
- for (int i=key.length()-1; i >= 0; i--) {
+ for (int i = key.length() - 1; i >= 0; i--) {
tmpBits1 |= key.charAt(i);
tmpBits1 <<= 16;
}
@@ -98,20 +88,23 @@ public class VersionedThinRegionEntryHeapStringKey1 extends VersionedThinRegionE
}
// 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<VersionedThinRegionEntryHeapStringKey1> lastModifiedUpdater
- = AtomicLongFieldUpdater.newUpdater(VersionedThinRegionEntryHeapStringKey1.class, "lastModified");
+ private static final AtomicLongFieldUpdater<VersionedThinRegionEntryHeapStringKey1> lastModifiedUpdater =
+ AtomicLongFieldUpdater.newUpdater(VersionedThinRegionEntryHeapStringKey1.class,
+ "lastModified");
private volatile Object value;
+
@Override
protected Object getValueField() {
return this.value;
}
+
@Override
protected void setValueField(Object v) {
this.value = v;
@@ -120,24 +113,29 @@ public class VersionedThinRegionEntryHeapStringKey1 extends VersionedThinRegionE
protected long getLastModifiedField() {
return lastModifiedUpdater.get(this);
}
+
protected boolean compareAndSetLastModifiedField(long expectedValue, long newValue) {
return lastModifiedUpdater.compareAndSet(this, expectedValue, newValue);
}
+
/**
* @see HashEntry#getEntryHash()
*/
public int getEntryHash() {
return this.hash;
}
+
protected void setEntryHash(int v) {
this.hash = v;
}
+
/**
* @see HashEntry#getNextEntry()
*/
public HashEntry<Object, Object> getNextEntry() {
return this.next;
}
+
/**
* @see HashEntry#setNextEntry
*/
@@ -145,14 +143,10 @@ public class VersionedThinRegionEntryHeapStringKey1 extends VersionedThinRegionE
this.next = n;
}
-
-
-
-
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// versioned code
private VersionSource memberID;
private short entryVersionLowBytes;
@@ -164,16 +158,16 @@ public class VersionedThinRegionEntryHeapStringKey1 extends VersionedThinRegionE
public int getEntryVersion() {
return ((entryVersionHighByte << 16) & 0xFF0000) | (entryVersionLowBytes & 0xFFFF);
}
-
+
public long getRegionVersion() {
- return (((long)regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL);
+ return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL);
}
-
-
+
+
public long getVersionTimeStamp() {
return getLastModified();
}
-
+
public void setVersionTimeStamp(long time) {
setLastModified(time);
}
@@ -181,17 +175,18 @@ public class VersionedThinRegionEntryHeapStringKey1 extends VersionedThinRegionE
public VersionSource getMemberID() {
return this.memberID;
}
+
public int getDistributedSystemId() {
return this.distributedSystemId;
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
public void setVersions(VersionTag tag) {
this.memberID = tag.getMemberID();
int eVersion = tag.getEntryVersion();
- this.entryVersionLowBytes = (short)(eVersion & 0xffff);
- this.entryVersionHighByte = (byte)((eVersion & 0xff0000) >> 16);
+ this.entryVersionLowBytes = (short) (eVersion & 0xffff);
+ this.entryVersionHighByte = (byte) ((eVersion & 0xff0000) >> 16);
this.regionVersionHighBytes = tag.getRegionVersionHighBytes();
this.regionVersionLowBytes = tag.getRegionVersionLowBytes();
if (!(tag.isGatewayTag()) && this.distributedSystemId == tag.getDistributedSystemId()) {
@@ -203,11 +198,11 @@ public class VersionedThinRegionEntryHeapStringKey1 extends VersionedThinRegionE
} else {
setVersionTimeStamp(tag.getVersionTimeStamp());
}
- this.distributedSystemId = (byte)(tag.getDistributedSystemId() & 0xff);
+ this.distributedSystemId = (byte) (tag.getDistributedSystemId() & 0xff);
}
public void setMemberID(VersionSource memberID) {
- this.memberID = memberID;
+ this.memberID = memberID;
}
@Override
@@ -216,7 +211,7 @@ public class VersionedThinRegionEntryHeapStringKey1 extends VersionedThinRegionE
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
public VersionTag asVersionTag() {
VersionTag tag = VersionTag.create(memberID);
tag.setEntryVersion(getEntryVersion());
@@ -226,9 +221,9 @@ public class VersionedThinRegionEntryHeapStringKey1 extends VersionedThinRegionE
return tag;
}
- public void processVersionTag(LocalRegion r, VersionTag tag,
- boolean isTombstoneFromGII, boolean hasDelta,
- VersionSource thisVM, InternalDistributedMember sender, boolean checkForConflicts) {
+ public void processVersionTag(LocalRegion r, VersionTag tag, boolean isTombstoneFromGII,
+ boolean hasDelta, VersionSource thisVM, InternalDistributedMember sender,
+ boolean checkForConflicts) {
basicProcessVersionTag(r, tag, isTombstoneFromGII, hasDelta, thisVM, sender, checkForConflicts);
}
@@ -243,38 +238,41 @@ public class VersionedThinRegionEntryHeapStringKey1 extends VersionedThinRegionE
public short getRegionVersionHighBytes() {
return this.regionVersionHighBytes;
}
-
+
/** get rvv internal low bytes. Used by region entries for transferring to storage */
public int getRegionVersionLowBytes() {
return this.regionVersionLowBytes;
}
-
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// key code
private final long bits1;
+
private int getKeyLength() {
return (int) (this.bits1 & 0x003fL);
}
+
private int getEncoding() {
// 0 means encoded as char
// 1 means encoded as bytes that are all <= 0x7f;
return (int) (this.bits1 >> 6) & 0x03;
}
+
@Override
public Object getKey() {
int keylen = getKeyLength();
char[] chars = new char[keylen];
long tmpBits1 = this.bits1;
if (getEncoding() == 1) {
- for (int i=0; i < keylen; i++) {
+ for (int i = 0; i < keylen; i++) {
tmpBits1 >>= 8;
- chars[i] = (char) (tmpBits1 & 0x00ff);
+ chars[i] = (char) (tmpBits1 & 0x00ff);
}
} else {
- for (int i=0; i < keylen; i++) {
+ for (int i = 0; i < keylen; i++) {
tmpBits1 >>= 16;
chars[i] = (char) (tmpBits1 & 0x00FFff);
}
@@ -283,16 +281,16 @@ public class VersionedThinRegionEntryHeapStringKey1 extends VersionedThinRegionE
}
// 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) {
@@ -300,7 +298,7 @@ public class VersionedThinRegionEntryHeapStringKey1 extends VersionedThinRegionE
}
}
} 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) {
@@ -313,7 +311,7 @@ public class VersionedThinRegionEntryHeapStringKey1 extends VersionedThinRegionE
}
return false;
}
-
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
}
http://git-wip-us.apache.org/repos/asf/geode/blob/5adb681a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapStringKey2.java
index f69d4d7..2d8817b 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapStringKey2.java
@@ -18,11 +18,6 @@ package org.apache.geode.internal.cache;
-
-
-
-
-
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.cache.EntryEvent;
@@ -32,12 +27,6 @@ import org.apache.geode.internal.cache.versions.VersionSource;
import org.apache.geode.internal.cache.versions.VersionStamp;
import org.apache.geode.internal.cache.versions.VersionTag;
-
-
-
-
-
-
import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
// macros whose definition changes this class:
@@ -59,7 +48,7 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha
* ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory).
*/
public class VersionedThinRegionEntryHeapStringKey2 extends VersionedThinRegionEntryHeap {
- public VersionedThinRegionEntryHeapStringKey2 (RegionEntryContext context, String key,
+ public VersionedThinRegionEntryHeapStringKey2(RegionEntryContext context, String key,
@@ -67,33 +56,34 @@ public class VersionedThinRegionEntryHeapStringKey2 extends VersionedThinRegionE
, boolean byteEncode
- ) {
- super(context,
+ ) {
+ super(context,
- value
+ value
- );
+ );
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
// caller has already confirmed that key.length <= MAX_INLINE_STRING_KEY
long tmpBits1 = 0L;
long tmpBits2 = 0L;
if (byteEncode) {
- for (int i=key.length()-1; i >= 0; i--) {
- // Note: we know each byte is <= 0x7f so the "& 0xff" is not needed. But I added it in to keep findbugs happy.
+ for (int i = key.length() - 1; i >= 0; i--) {
+ // Note: we know each byte is <= 0x7f so the "& 0xff" is not needed. But I added it in to
+ // keep findbugs happy.
if (i < 7) {
- tmpBits1 |= (byte)key.charAt(i) & 0xff;
+ tmpBits1 |= (byte) key.charAt(i) & 0xff;
tmpBits1 <<= 8;
} else {
tmpBits2 <<= 8;
- tmpBits2 |= (byte)key.charAt(i) & 0xff;
+ tmpBits2 |= (byte) key.charAt(i) & 0xff;
}
}
- tmpBits1 |= 1<<6;
+ tmpBits1 |= 1 << 6;
} else {
- for (int i=key.length()-1; i >= 0; i--) {
+ for (int i = key.length() - 1; i >= 0; i--) {
if (i < 3) {
tmpBits1 |= key.charAt(i);
tmpBits1 <<= 16;
@@ -110,20 +100,23 @@ public class VersionedThinRegionEntryHeapStringKey2 extends VersionedThinRegionE
}
// 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<VersionedThinRegionEntryHeapStringKey2> lastModifiedUpdater
- = AtomicLongFieldUpdater.newUpdater(VersionedThinRegionEntryHeapStringKey2.class, "lastModified");
+ private static final AtomicLongFieldUpdater<VersionedThinRegionEntryHeapStringKey2> lastModifiedUpdater =
+ AtomicLongFieldUpdater.newUpdater(VersionedThinRegionEntryHeapStringKey2.class,
+ "lastModified");
private volatile Object value;
+
@Override
protected Object getValueField() {
return this.value;
}
+
@Override
protected void setValueField(Object v) {
this.value = v;
@@ -132,24 +125,29 @@ public class VersionedThinRegionEntryHeapStringKey2 extends VersionedThinRegionE
protected long getLastModifiedField() {
return lastModifiedUpdater.get(this);
}
+
protected boolean compareAndSetLastModifiedField(long expectedValue, long newValue) {
return lastModifiedUpdater.compareAndSet(this, expectedValue, newValue);
}
+
/**
* @see HashEntry#getEntryHash()
*/
public int getEntryHash() {
return this.hash;
}
+
protected void setEntryHash(int v) {
this.hash = v;
}
+
/**
* @see HashEntry#getNextEntry()
*/
public HashEntry<Object, Object> getNextEntry() {
return this.next;
}
+
/**
* @see HashEntry#setNextEntry
*/
@@ -157,14 +155,10 @@ public class VersionedThinRegionEntryHeapStringKey2 extends VersionedThinRegionE
this.next = n;
}
-
-
-
-
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// versioned code
private VersionSource memberID;
private short entryVersionLowBytes;
@@ -176,16 +170,16 @@ public class VersionedThinRegionEntryHeapStringKey2 extends VersionedThinRegionE
public int getEntryVersion() {
return ((entryVersionHighByte << 16) & 0xFF0000) | (entryVersionLowBytes & 0xFFFF);
}
-
+
public long getRegionVersion() {
- return (((long)regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL);
+ return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL);
}
-
-
+
+
public long getVersionTimeStamp() {
return getLastModified();
}
-
+
public void setVersionTimeStamp(long time) {
setLastModified(time);
}
@@ -193,17 +187,18 @@ public class VersionedThinRegionEntryHeapStringKey2 extends VersionedThinRegionE
public VersionSource getMemberID() {
return this.memberID;
}
+
public int getDistributedSystemId() {
return this.distributedSystemId;
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
public void setVersions(VersionTag tag) {
this.memberID = tag.getMemberID();
int eVersion = tag.getEntryVersion();
- this.entryVersionLowBytes = (short)(eVersion & 0xffff);
- this.entryVersionHighByte = (byte)((eVersion & 0xff0000) >> 16);
+ this.entryVersionLowBytes = (short) (eVersion & 0xffff);
+ this.entryVersionHighByte = (byte) ((eVersion & 0xff0000) >> 16);
this.regionVersionHighBytes = tag.getRegionVersionHighBytes();
this.regionVersionLowBytes = tag.getRegionVersionLowBytes();
if (!(tag.isGatewayTag()) && this.distributedSystemId == tag.getDistributedSystemId()) {
@@ -215,11 +210,11 @@ public class VersionedThinRegionEntryHeapStringKey2 extends VersionedThinRegionE
} else {
setVersionTimeStamp(tag.getVersionTimeStamp());
}
- this.distributedSystemId = (byte)(tag.getDistributedSystemId() & 0xff);
+ this.distributedSystemId = (byte) (tag.getDistributedSystemId() & 0xff);
}
public void setMemberID(VersionSource memberID) {
- this.memberID = memberID;
+ this.memberID = memberID;
}
@Override
@@ -228,7 +223,7 @@ public class VersionedThinRegionEntryHeapStringKey2 extends VersionedThinRegionE
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
public VersionTag asVersionTag() {
VersionTag tag = VersionTag.create(memberID);
tag.setEntryVersion(getEntryVersion());
@@ -238,9 +233,9 @@ public class VersionedThinRegionEntryHeapStringKey2 extends VersionedThinRegionE
return tag;
}
- public void processVersionTag(LocalRegion r, VersionTag tag,
- boolean isTombstoneFromGII, boolean hasDelta,
- VersionSource thisVM, InternalDistributedMember sender, boolean checkForConflicts) {
+ public void processVersionTag(LocalRegion r, VersionTag tag, boolean isTombstoneFromGII,
+ boolean hasDelta, VersionSource thisVM, InternalDistributedMember sender,
+ boolean checkForConflicts) {
basicProcessVersionTag(r, tag, isTombstoneFromGII, hasDelta, thisVM, sender, checkForConflicts);
}
@@ -255,15 +250,15 @@ public class VersionedThinRegionEntryHeapStringKey2 extends VersionedThinRegionE
public short getRegionVersionHighBytes() {
return this.regionVersionHighBytes;
}
-
+
/** get rvv internal low bytes. Used by region entries for transferring to storage */
public int getRegionVersionLowBytes() {
return this.regionVersionLowBytes;
}
-
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// key code
// strlen is encoded in lowest 6 bits (max strlen is 63)
@@ -272,14 +267,17 @@ public class VersionedThinRegionEntryHeapStringKey2 extends VersionedThinRegionE
private final long bits1;
// bits2 encodes character data
private final long bits2;
+
private int getKeyLength() {
return (int) (this.bits1 & 0x003fL);
}
+
private int getEncoding() {
// 0 means encoded as char
// 1 means encoded as bytes that are all <= 0x7f;
return (int) (this.bits1 >> 6) & 0x03;
}
+
@Override
public Object getKey() {
int keylen = getKeyLength();
@@ -287,7 +285,7 @@ public class VersionedThinRegionEntryHeapStringKey2 extends VersionedThinRegionE
long tmpBits1 = this.bits1;
long tmpBits2 = this.bits2;
if (getEncoding() == 1) {
- for (int i=0; i < keylen; i++) {
+ for (int i = 0; i < keylen; i++) {
if (i < 7) {
tmpBits1 >>= 8;
chars[i] = (char) (tmpBits1 & 0x00ff);
@@ -297,10 +295,10 @@ public class VersionedThinRegionEntryHeapStringKey2 extends VersionedThinRegionE
}
}
} else {
- for (int i=0; i < keylen; i++) {
+ for (int i = 0; i < keylen; i++) {
if (i < 3) {
tmpBits1 >>= 16;
- chars[i] = (char) (tmpBits1 & 0x00FFff);
+ chars[i] = (char) (tmpBits1 & 0x00FFff);
} else {
chars[i] = (char) (tmpBits2 & 0x00FFff);
tmpBits2 >>= 16;
@@ -311,17 +309,17 @@ public class VersionedThinRegionEntryHeapStringKey2 extends VersionedThinRegionE
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
@Override
public boolean isKeyEqual(Object k) {
if (k instanceof String) {
- String str = (String)k;
+ String str = (String) k;
int keylen = getKeyLength();
if (str.length() == keylen) {
long tmpBits1 = this.bits1;
long tmpBits2 = this.bits2;
if (getEncoding() == 1) {
- for (int i=0; i < keylen; i++) {
+ for (int i = 0; i < keylen; i++) {
char c;
if (i < 7) {
tmpBits1 >>= 8;
@@ -335,7 +333,7 @@ public class VersionedThinRegionEntryHeapStringKey2 extends VersionedThinRegionE
}
}
} else {
- for (int i=0; i < keylen; i++) {
+ for (int i = 0; i < keylen; i++) {
char c;
if (i < 3) {
tmpBits1 >>= 16;
http://git-wip-us.apache.org/repos/asf/geode/blob/5adb681a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapUUIDKey.java
index eccb338..49abbfd 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinRegionEntryHeapUUIDKey.java
@@ -20,9 +20,6 @@ package org.apache.geode.internal.cache;
import java.util.UUID;
-
-
-
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.apache.geode.cache.EntryEvent;
@@ -32,12 +29,6 @@ import org.apache.geode.internal.cache.versions.VersionSource;
import org.apache.geode.internal.cache.versions.VersionStamp;
import org.apache.geode.internal.cache.versions.VersionTag;
-
-
-
-
-
-
import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
// macros whose definition changes this class:
@@ -59,7 +50,7 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha
* ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory).
*/
public class VersionedThinRegionEntryHeapUUIDKey extends VersionedThinRegionEntryHeap {
- public VersionedThinRegionEntryHeapUUIDKey (RegionEntryContext context, UUID key,
+ public VersionedThinRegionEntryHeapUUIDKey(RegionEntryContext context, UUID key,
@@ -67,14 +58,14 @@ public class VersionedThinRegionEntryHeapUUIDKey extends VersionedThinRegionEntr
- ) {
- super(context,
+ ) {
+ super(context,
- value
+ value
- );
+ );
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
this.keyMostSigBits = key.getMostSignificantBits();
@@ -83,20 +74,22 @@ public class VersionedThinRegionEntryHeapUUIDKey extends VersionedThinRegionEntr
}
// 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<VersionedThinRegionEntryHeapUUIDKey> lastModifiedUpdater
- = AtomicLongFieldUpdater.newUpdater(VersionedThinRegionEntryHeapUUIDKey.class, "lastModified");
+ private static final AtomicLongFieldUpdater<VersionedThinRegionEntryHeapUUIDKey> lastModifiedUpdater =
+ AtomicLongFieldUpdater.newUpdater(VersionedThinRegionEntryHeapUUIDKey.class, "lastModified");
private volatile Object value;
+
@Override
protected Object getValueField() {
return this.value;
}
+
@Override
protected void setValueField(Object v) {
this.value = v;
@@ -105,24 +98,29 @@ public class VersionedThinRegionEntryHeapUUIDKey extends VersionedThinRegionEntr
protected long getLastModifiedField() {
return lastModifiedUpdater.get(this);
}
+
protected boolean compareAndSetLastModifiedField(long expectedValue, long newValue) {
return lastModifiedUpdater.compareAndSet(this, expectedValue, newValue);
}
+
/**
* @see HashEntry#getEntryHash()
*/
public int getEntryHash() {
return this.hash;
}
+
protected void setEntryHash(int v) {
this.hash = v;
}
+
/**
* @see HashEntry#getNextEntry()
*/
public HashEntry<Object, Object> getNextEntry() {
return this.next;
}
+
/**
* @see HashEntry#setNextEntry
*/
@@ -130,14 +128,10 @@ public class VersionedThinRegionEntryHeapUUIDKey extends VersionedThinRegionEntr
this.next = n;
}
-
-
-
-
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// versioned code
private VersionSource memberID;
private short entryVersionLowBytes;
@@ -149,16 +143,16 @@ public class VersionedThinRegionEntryHeapUUIDKey extends VersionedThinRegionEntr
public int getEntryVersion() {
return ((entryVersionHighByte << 16) & 0xFF0000) | (entryVersionLowBytes & 0xFFFF);
}
-
+
public long getRegionVersion() {
- return (((long)regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL);
+ return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL);
}
-
-
+
+
public long getVersionTimeStamp() {
return getLastModified();
}
-
+
public void setVersionTimeStamp(long time) {
setLastModified(time);
}
@@ -166,17 +160,18 @@ public class VersionedThinRegionEntryHeapUUIDKey extends VersionedThinRegionEntr
public VersionSource getMemberID() {
return this.memberID;
}
+
public int getDistributedSystemId() {
return this.distributedSystemId;
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
public void setVersions(VersionTag tag) {
this.memberID = tag.getMemberID();
int eVersion = tag.getEntryVersion();
- this.entryVersionLowBytes = (short)(eVersion & 0xffff);
- this.entryVersionHighByte = (byte)((eVersion & 0xff0000) >> 16);
+ this.entryVersionLowBytes = (short) (eVersion & 0xffff);
+ this.entryVersionHighByte = (byte) ((eVersion & 0xff0000) >> 16);
this.regionVersionHighBytes = tag.getRegionVersionHighBytes();
this.regionVersionLowBytes = tag.getRegionVersionLowBytes();
if (!(tag.isGatewayTag()) && this.distributedSystemId == tag.getDistributedSystemId()) {
@@ -188,11 +183,11 @@ public class VersionedThinRegionEntryHeapUUIDKey extends VersionedThinRegionEntr
} else {
setVersionTimeStamp(tag.getVersionTimeStamp());
}
- this.distributedSystemId = (byte)(tag.getDistributedSystemId() & 0xff);
+ this.distributedSystemId = (byte) (tag.getDistributedSystemId() & 0xff);
}
public void setMemberID(VersionSource memberID) {
- this.memberID = memberID;
+ this.memberID = memberID;
}
@Override
@@ -201,7 +196,7 @@ public class VersionedThinRegionEntryHeapUUIDKey extends VersionedThinRegionEntr
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
public VersionTag asVersionTag() {
VersionTag tag = VersionTag.create(memberID);
tag.setEntryVersion(getEntryVersion());
@@ -211,9 +206,9 @@ public class VersionedThinRegionEntryHeapUUIDKey extends VersionedThinRegionEntr
return tag;
}
- public void processVersionTag(LocalRegion r, VersionTag tag,
- boolean isTombstoneFromGII, boolean hasDelta,
- VersionSource thisVM, InternalDistributedMember sender, boolean checkForConflicts) {
+ public void processVersionTag(LocalRegion r, VersionTag tag, boolean isTombstoneFromGII,
+ boolean hasDelta, VersionSource thisVM, InternalDistributedMember sender,
+ boolean checkForConflicts) {
basicProcessVersionTag(r, tag, isTombstoneFromGII, hasDelta, thisVM, sender, checkForConflicts);
}
@@ -228,23 +223,25 @@ public class VersionedThinRegionEntryHeapUUIDKey extends VersionedThinRegionEntr
public short getRegionVersionHighBytes() {
return this.regionVersionHighBytes;
}
-
+
/** get rvv internal low bytes. Used by region entries for transferring to storage */
public int getRegionVersionLowBytes() {
return this.regionVersionLowBytes;
}
-
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
-
+
// key code
private final long keyMostSigBits;
private final long keyLeastSigBits;
+
@Override
public Object getKey() {
return new UUID(this.keyMostSigBits, this.keyLeastSigBits);
}
+
@Override
public boolean isKeyEqual(Object k) {
if (k instanceof UUID) {
@@ -254,7 +251,7 @@ public class VersionedThinRegionEntryHeapUUIDKey extends VersionedThinRegionEntr
}
return false;
}
-
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
}