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:16 UTC
[06/78] geode git commit: GEODE-2929: Remove superfluous final from
internal methods
http://git-wip-us.apache.org/repos/asf/geode/blob/30f455bb/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapStringKey1.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapStringKey1.java
index d4f5563..2e0f7ec 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapStringKey1.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapStringKey1.java
@@ -15,75 +15,111 @@
package org.apache.geode.internal.cache;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
+
+
+
+
+
+
+
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.persistence.DiskRecoveryStore;
+
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.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
// macros whose definition changes this class:
-// disk: DISK
+// disk: 1
// lru: LRU
// stats: STATS
-// versioned: VERSIONED
+// versioned: 1
// offheap: OFFHEAP
// One of the following key macros must be defined:
// key object: KEY_OBJECT
// key int: KEY_INT
// key long: KEY_LONG
// key uuid: KEY_UUID
-// key 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 VersionedThinDiskRegionEntryHeapStringKey1 extends VersionedThinDiskRegionEntryHeap {
- public VersionedThinDiskRegionEntryHeapStringKey1(RegionEntryContext context, String key,
- Object value, boolean byteEncode) {
- super(context, (value instanceof RecoveredEntry ? null : value));
+ public VersionedThinDiskRegionEntryHeapStringKey1 (RegionEntryContext context, String key,
+
+
+
+ Object value
+
+ , boolean byteEncode
+
+ ) {
+ super(context,
+
+ (value instanceof RecoveredEntry ? null : value)
+
+
+
+ );
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
initialize(context, value);
+
// caller has already confirmed that key.length <= MAX_INLINE_STRING_KEY
long tmpBits1 = 0L;
if (byteEncode) {
- for (int i = key.length() - 1; i >= 0; i--) {
- // Note: we know each byte is <= 0x7f so the "& 0xff" is not needed. But I added it in to
- // keep findbugs happy.
- tmpBits1 |= (byte) key.charAt(i) & 0xff;
+ for (int i=key.length()-1; i >= 0; i--) {
+ // Note: we know each byte is <= 0x7f so the "& 0xff" is not needed. But I added it in to keep findbugs happy.
+ tmpBits1 |= (byte)key.charAt(i) & 0xff;
tmpBits1 <<= 8;
}
- tmpBits1 |= 1 << 6;
+ tmpBits1 |= 1<<6;
} else {
- for (int i = key.length() - 1; i >= 0; i--) {
+ for (int i=key.length()-1; i >= 0; i--) {
tmpBits1 |= key.charAt(i);
tmpBits1 <<= 16;
}
}
tmpBits1 |= key.length();
this.bits1 = tmpBits1;
+
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// common code
protected int hash;
private HashEntry<Object, Object> next;
@SuppressWarnings("unused")
private volatile long lastModified;
- private static final AtomicLongFieldUpdater<VersionedThinDiskRegionEntryHeapStringKey1> lastModifiedUpdater =
- AtomicLongFieldUpdater.newUpdater(VersionedThinDiskRegionEntryHeapStringKey1.class,
- "lastModified");
- private volatile Object value;
+ private static final AtomicLongFieldUpdater<VersionedThinDiskRegionEntryHeapStringKey1> lastModifiedUpdater
+ = AtomicLongFieldUpdater.newUpdater(VersionedThinDiskRegionEntryHeapStringKey1.class, "lastModified");
+ private volatile Object value;
@Override
- protected final Object getValueField() {
+ protected Object getValueField() {
return this.value;
}
-
@Override
protected void setValueField(Object v) {
this.value = v;
@@ -92,53 +128,52 @@ public class VersionedThinDiskRegionEntryHeapStringKey1 extends VersionedThinDis
protected long getLastModifiedField() {
return lastModifiedUpdater.get(this);
}
-
protected boolean compareAndSetLastModifiedField(long expectedValue, long newValue) {
return lastModifiedUpdater.compareAndSet(this, expectedValue, newValue);
}
-
/**
* @see HashEntry#getEntryHash()
*/
- public final int getEntryHash() {
+ public int getEntryHash() {
return this.hash;
}
-
protected void setEntryHash(int v) {
this.hash = v;
}
-
/**
* @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 context, Object value) {
diskInitialize(context, value);
}
-
@Override
public int updateAsyncEntrySize(EnableLRU capacityController) {
throw new IllegalStateException("should never be called");
}
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
private void diskInitialize(RegionEntryContext context, Object value) {
- DiskRecoveryStore drs = (DiskRecoveryStore) context;
+ DiskRecoveryStore drs = (DiskRecoveryStore)context;
DiskStoreImpl ds = drs.getDiskStore();
long maxOplogSize = ds.getMaxOplogSize();
- // get appropriate instance of DiskId implementation based on maxOplogSize
+ //get appropriate instance of DiskId implementation based on maxOplogSize
this.id = DiskId.createDiskId(maxOplogSize, true/* is persistence */, ds.needsLinkedList());
Helper.initialize(this, drs, value);
}
@@ -148,57 +183,62 @@ public class VersionedThinDiskRegionEntryHeapStringKey1 extends VersionedThinDis
*
* @since GemFire 5.1
*/
- protected DiskId id;// = new DiskId();
-
+ protected DiskId id;//= new DiskId();
public DiskId getDiskId() {
return this.id;
}
-
@Override
void setDiskId(RegionEntry old) {
- this.id = ((AbstractDiskRegionEntry) old).getDiskId();
- }
-
- // // inlining DiskId
- // // always have these fields
- // /**
- // * id consists of
- // * most significant
- // * 1 byte = users bits
- // * 2-8 bytes = oplog id
- // * least significant.
- // *
- // * The highest bit in the oplog id part is set to 1 if the oplog id
- // * is negative.
- // * @todo this field could be an int for an overflow only region
- // */
- // private long id;
- // /**
- // * Length of the bytes on disk.
- // * This is always set. If the value is invalid then it will be set to 0.
- // * The most significant bit is used by overflow to mark it as needing to be written.
- // */
- // protected int valueLength = 0;
- // // have intOffset or longOffset
- // // intOffset
- // /**
- // * The position in the oplog (the oplog offset) where this entry's value is
- // * stored
- // */
- // private volatile int offsetInOplog;
- // // longOffset
- // /**
- // * The position in the oplog (the oplog offset) where this entry's value is
- // * stored
- // */
- // private volatile long offsetInOplog;
- // // have overflowOnly or persistence
- // // overflowOnly
- // // no fields
- // // persistent
- // /** unique entry identifier * */
- // private long keyId;
+ this.id = ((AbstractDiskRegionEntry)old).getDiskId();
+ }
+// // inlining DiskId
+// // always have these fields
+// /**
+// * id consists of
+// * most significant
+// * 1 byte = users bits
+// * 2-8 bytes = oplog id
+// * least significant.
+// *
+// * The highest bit in the oplog id part is set to 1 if the oplog id
+// * is negative.
+// * @todo this field could be an int for an overflow only region
+// */
+// private long id;
+// /**
+// * Length of the bytes on disk.
+// * This is always set. If the value is invalid then it will be set to 0.
+// * The most significant bit is used by overflow to mark it as needing to be written.
+// */
+// protected int valueLength = 0;
+// // have intOffset or longOffset
+// // intOffset
+// /**
+// * The position in the oplog (the oplog offset) where this entry's value is
+// * stored
+// */
+// private volatile int offsetInOplog;
+// // longOffset
+// /**
+// * The position in the oplog (the oplog offset) where this entry's value is
+// * stored
+// */
+// private volatile long offsetInOplog;
+// // have overflowOnly or persistence
+// // overflowOnly
+// // no fields
+// // persistent
+// /** unique entry identifier * */
+// private long keyId;
+
+
+
+
+
+
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// versioned code
private VersionSource memberID;
private short entryVersionLowBytes;
@@ -210,15 +250,16 @@ public class VersionedThinDiskRegionEntryHeapStringKey1 extends VersionedThinDis
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);
}
@@ -226,17 +267,17 @@ public class VersionedThinDiskRegionEntryHeapStringKey1 extends VersionedThinDis
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()) {
@@ -248,11 +289,11 @@ public class VersionedThinDiskRegionEntryHeapStringKey1 extends VersionedThinDis
} 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
@@ -261,6 +302,7 @@ public class VersionedThinDiskRegionEntryHeapStringKey1 extends VersionedThinDis
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
public VersionTag asVersionTag() {
VersionTag tag = VersionTag.create(memberID);
tag.setEntryVersion(getEntryVersion());
@@ -270,9 +312,9 @@ public class VersionedThinDiskRegionEntryHeapStringKey1 extends VersionedThinDis
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);
}
@@ -287,38 +329,38 @@ public class VersionedThinDiskRegionEntryHeapStringKey1 extends VersionedThinDis
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 final long bits1;
private int getKeyLength() {
return (int) (this.bits1 & 0x003fL);
}
-
private int getEncoding() {
// 0 means encoded as char
// 1 means encoded as bytes that are all <= 0x7f;
return (int) (this.bits1 >> 6) & 0x03;
}
-
@Override
- public final Object getKey() {
+ 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);
}
@@ -327,15 +369,16 @@ public class VersionedThinDiskRegionEntryHeapStringKey1 extends VersionedThinDis
}
// 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) {
@@ -343,7 +386,7 @@ public class VersionedThinDiskRegionEntryHeapStringKey1 extends VersionedThinDis
}
}
} 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) {
@@ -356,5 +399,8 @@ public class VersionedThinDiskRegionEntryHeapStringKey1 extends VersionedThinDis
}
return false;
}
+
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
}
+
http://git-wip-us.apache.org/repos/asf/geode/blob/30f455bb/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapStringKey2.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapStringKey2.java
index 8f0dc99..af00416 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapStringKey2.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapStringKey2.java
@@ -15,21 +15,42 @@
package org.apache.geode.internal.cache;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
+
+
+
+
+
+
+
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.persistence.DiskRecoveryStore;
+
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.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
// macros whose definition changes this class:
-// disk: DISK
+// disk: 1
// lru: LRU
// stats: STATS
-// versioned: VERSIONED
+// versioned: 1
// offheap: OFFHEAP
// One of the following key macros must be defined:
// key object: KEY_OBJECT
@@ -37,35 +58,50 @@ 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 VersionedThinDiskRegionEntryHeapStringKey2 extends VersionedThinDiskRegionEntryHeap {
- public VersionedThinDiskRegionEntryHeapStringKey2(RegionEntryContext context, String key,
- Object value, boolean byteEncode) {
- super(context, (value instanceof RecoveredEntry ? null : value));
+ public VersionedThinDiskRegionEntryHeapStringKey2 (RegionEntryContext context, String key,
+
+
+
+ Object value
+
+ , boolean byteEncode
+
+ ) {
+ super(context,
+
+ (value instanceof RecoveredEntry ? null : value)
+
+
+
+ );
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
initialize(context, value);
+
// caller has already confirmed that key.length <= MAX_INLINE_STRING_KEY
long tmpBits1 = 0L;
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;
@@ -78,24 +114,24 @@ public class VersionedThinDiskRegionEntryHeapStringKey2 extends VersionedThinDis
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;
@SuppressWarnings("unused")
private volatile long lastModified;
- private static final AtomicLongFieldUpdater<VersionedThinDiskRegionEntryHeapStringKey2> lastModifiedUpdater =
- AtomicLongFieldUpdater.newUpdater(VersionedThinDiskRegionEntryHeapStringKey2.class,
- "lastModified");
- private volatile Object value;
+ private static final AtomicLongFieldUpdater<VersionedThinDiskRegionEntryHeapStringKey2> lastModifiedUpdater
+ = AtomicLongFieldUpdater.newUpdater(VersionedThinDiskRegionEntryHeapStringKey2.class, "lastModified");
+ private volatile Object value;
@Override
- protected final Object getValueField() {
+ protected Object getValueField() {
return this.value;
}
-
@Override
protected void setValueField(Object v) {
this.value = v;
@@ -104,53 +140,52 @@ public class VersionedThinDiskRegionEntryHeapStringKey2 extends VersionedThinDis
protected long getLastModifiedField() {
return lastModifiedUpdater.get(this);
}
-
protected boolean compareAndSetLastModifiedField(long expectedValue, long newValue) {
return lastModifiedUpdater.compareAndSet(this, expectedValue, newValue);
}
-
/**
* @see HashEntry#getEntryHash()
*/
- public final int getEntryHash() {
+ public int getEntryHash() {
return this.hash;
}
-
protected void setEntryHash(int v) {
this.hash = v;
}
-
/**
* @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 context, Object value) {
diskInitialize(context, value);
}
-
@Override
public int updateAsyncEntrySize(EnableLRU capacityController) {
throw new IllegalStateException("should never be called");
}
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
private void diskInitialize(RegionEntryContext context, Object value) {
- DiskRecoveryStore drs = (DiskRecoveryStore) context;
+ DiskRecoveryStore drs = (DiskRecoveryStore)context;
DiskStoreImpl ds = drs.getDiskStore();
long maxOplogSize = ds.getMaxOplogSize();
- // get appropriate instance of DiskId implementation based on maxOplogSize
+ //get appropriate instance of DiskId implementation based on maxOplogSize
this.id = DiskId.createDiskId(maxOplogSize, true/* is persistence */, ds.needsLinkedList());
Helper.initialize(this, drs, value);
}
@@ -160,57 +195,62 @@ public class VersionedThinDiskRegionEntryHeapStringKey2 extends VersionedThinDis
*
* @since GemFire 5.1
*/
- protected DiskId id;// = new DiskId();
-
+ protected DiskId id;//= new DiskId();
public DiskId getDiskId() {
return this.id;
}
-
@Override
void setDiskId(RegionEntry old) {
- this.id = ((AbstractDiskRegionEntry) old).getDiskId();
- }
-
- // // inlining DiskId
- // // always have these fields
- // /**
- // * id consists of
- // * most significant
- // * 1 byte = users bits
- // * 2-8 bytes = oplog id
- // * least significant.
- // *
- // * The highest bit in the oplog id part is set to 1 if the oplog id
- // * is negative.
- // * @todo this field could be an int for an overflow only region
- // */
- // private long id;
- // /**
- // * Length of the bytes on disk.
- // * This is always set. If the value is invalid then it will be set to 0.
- // * The most significant bit is used by overflow to mark it as needing to be written.
- // */
- // protected int valueLength = 0;
- // // have intOffset or longOffset
- // // intOffset
- // /**
- // * The position in the oplog (the oplog offset) where this entry's value is
- // * stored
- // */
- // private volatile int offsetInOplog;
- // // longOffset
- // /**
- // * The position in the oplog (the oplog offset) where this entry's value is
- // * stored
- // */
- // private volatile long offsetInOplog;
- // // have overflowOnly or persistence
- // // overflowOnly
- // // no fields
- // // persistent
- // /** unique entry identifier * */
- // private long keyId;
+ this.id = ((AbstractDiskRegionEntry)old).getDiskId();
+ }
+// // inlining DiskId
+// // always have these fields
+// /**
+// * id consists of
+// * most significant
+// * 1 byte = users bits
+// * 2-8 bytes = oplog id
+// * least significant.
+// *
+// * The highest bit in the oplog id part is set to 1 if the oplog id
+// * is negative.
+// * @todo this field could be an int for an overflow only region
+// */
+// private long id;
+// /**
+// * Length of the bytes on disk.
+// * This is always set. If the value is invalid then it will be set to 0.
+// * The most significant bit is used by overflow to mark it as needing to be written.
+// */
+// protected int valueLength = 0;
+// // have intOffset or longOffset
+// // intOffset
+// /**
+// * The position in the oplog (the oplog offset) where this entry's value is
+// * stored
+// */
+// private volatile int offsetInOplog;
+// // longOffset
+// /**
+// * The position in the oplog (the oplog offset) where this entry's value is
+// * stored
+// */
+// private volatile long offsetInOplog;
+// // have overflowOnly or persistence
+// // overflowOnly
+// // no fields
+// // persistent
+// /** unique entry identifier * */
+// private long keyId;
+
+
+
+
+
+
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// versioned code
private VersionSource memberID;
private short entryVersionLowBytes;
@@ -222,15 +262,16 @@ public class VersionedThinDiskRegionEntryHeapStringKey2 extends VersionedThinDis
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);
}
@@ -238,17 +279,17 @@ public class VersionedThinDiskRegionEntryHeapStringKey2 extends VersionedThinDis
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()) {
@@ -260,11 +301,11 @@ public class VersionedThinDiskRegionEntryHeapStringKey2 extends VersionedThinDis
} 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
@@ -273,6 +314,7 @@ public class VersionedThinDiskRegionEntryHeapStringKey2 extends VersionedThinDis
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
public VersionTag asVersionTag() {
VersionTag tag = VersionTag.create(memberID);
tag.setEntryVersion(getEntryVersion());
@@ -282,9 +324,9 @@ public class VersionedThinDiskRegionEntryHeapStringKey2 extends VersionedThinDis
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);
}
@@ -299,39 +341,39 @@ public class VersionedThinDiskRegionEntryHeapStringKey2 extends VersionedThinDis
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)
// character encoding info is in bits 7 and 8
// The other bits are used to encoded character data.
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 final Object getKey() {
+ public Object getKey() {
int keylen = getKeyLength();
char[] chars = new char[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++) {
if (i < 7) {
tmpBits1 >>= 8;
chars[i] = (char) (tmpBits1 & 0x00ff);
@@ -341,10 +383,10 @@ public class VersionedThinDiskRegionEntryHeapStringKey2 extends VersionedThinDis
}
}
} 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;
@@ -355,16 +397,17 @@ public class VersionedThinDiskRegionEntryHeapStringKey2 extends VersionedThinDis
}
// 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;
@@ -378,7 +421,7 @@ public class VersionedThinDiskRegionEntryHeapStringKey2 extends VersionedThinDis
}
}
} else {
- for (int i = 0; i < keylen; i++) {
+ for (int i=0; i < keylen; i++) {
char c;
if (i < 3) {
tmpBits1 >>= 16;
@@ -397,5 +440,7 @@ public class VersionedThinDiskRegionEntryHeapStringKey2 extends VersionedThinDis
}
return false;
}
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
}
+
http://git-wip-us.apache.org/repos/asf/geode/blob/30f455bb/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapUUIDKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapUUIDKey.java
index 7ab81f8..ff8a624 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapUUIDKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapUUIDKey.java
@@ -15,60 +15,103 @@
package org.apache.geode.internal.cache;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
+
+
import java.util.UUID;
+
+
+
+
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
+
import org.apache.geode.cache.EntryEvent;
+
+
import org.apache.geode.internal.cache.lru.EnableLRU;
+
+
import org.apache.geode.internal.cache.persistence.DiskRecoveryStore;
+
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.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
// macros whose definition changes this class:
-// disk: DISK
+// disk: 1
// lru: LRU
// stats: STATS
-// versioned: VERSIONED
+// versioned: 1
// offheap: OFFHEAP
// One of the following key macros must be defined:
// key object: KEY_OBJECT
// key int: KEY_INT
// key long: KEY_LONG
-// key uuid: KEY_UUID
+// key uuid: 1
// key string1: KEY_STRING1
// key string2: KEY_STRING2
+
/**
* Do not modify this class. It was generated. Instead modify LeafRegionEntry.cpp and then run
* ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory).
*/
public class VersionedThinDiskRegionEntryHeapUUIDKey extends VersionedThinDiskRegionEntryHeap {
- public VersionedThinDiskRegionEntryHeapUUIDKey(RegionEntryContext context, UUID key,
- Object value) {
- super(context, (value instanceof RecoveredEntry ? null : value));
+ public VersionedThinDiskRegionEntryHeapUUIDKey (RegionEntryContext context, UUID 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.keyMostSigBits = key.getMostSignificantBits();
this.keyLeastSigBits = key.getLeastSignificantBits();
+
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// common code
protected int hash;
private HashEntry<Object, Object> next;
@SuppressWarnings("unused")
private volatile long lastModified;
- private static final AtomicLongFieldUpdater<VersionedThinDiskRegionEntryHeapUUIDKey> lastModifiedUpdater =
- AtomicLongFieldUpdater.newUpdater(VersionedThinDiskRegionEntryHeapUUIDKey.class,
- "lastModified");
- private volatile Object value;
+ private static final AtomicLongFieldUpdater<VersionedThinDiskRegionEntryHeapUUIDKey> lastModifiedUpdater
+ = AtomicLongFieldUpdater.newUpdater(VersionedThinDiskRegionEntryHeapUUIDKey.class, "lastModified");
+ private volatile Object value;
@Override
- protected final Object getValueField() {
+ protected Object getValueField() {
return this.value;
}
-
@Override
protected void setValueField(Object v) {
this.value = v;
@@ -77,53 +120,52 @@ public class VersionedThinDiskRegionEntryHeapUUIDKey extends VersionedThinDiskRe
protected long getLastModifiedField() {
return lastModifiedUpdater.get(this);
}
-
protected boolean compareAndSetLastModifiedField(long expectedValue, long newValue) {
return lastModifiedUpdater.compareAndSet(this, expectedValue, newValue);
}
-
/**
* @see HashEntry#getEntryHash()
*/
- public final int getEntryHash() {
+ public int getEntryHash() {
return this.hash;
}
-
protected void setEntryHash(int v) {
this.hash = v;
}
-
/**
* @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 context, Object value) {
diskInitialize(context, value);
}
-
@Override
public int updateAsyncEntrySize(EnableLRU capacityController) {
throw new IllegalStateException("should never be called");
}
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
private void diskInitialize(RegionEntryContext context, Object value) {
- DiskRecoveryStore drs = (DiskRecoveryStore) context;
+ DiskRecoveryStore drs = (DiskRecoveryStore)context;
DiskStoreImpl ds = drs.getDiskStore();
long maxOplogSize = ds.getMaxOplogSize();
- // get appropriate instance of DiskId implementation based on maxOplogSize
+ //get appropriate instance of DiskId implementation based on maxOplogSize
this.id = DiskId.createDiskId(maxOplogSize, true/* is persistence */, ds.needsLinkedList());
Helper.initialize(this, drs, value);
}
@@ -133,57 +175,62 @@ public class VersionedThinDiskRegionEntryHeapUUIDKey extends VersionedThinDiskRe
*
* @since GemFire 5.1
*/
- protected DiskId id;// = new DiskId();
-
+ protected DiskId id;//= new DiskId();
public DiskId getDiskId() {
return this.id;
}
-
@Override
void setDiskId(RegionEntry old) {
- this.id = ((AbstractDiskRegionEntry) old).getDiskId();
+ this.id = ((AbstractDiskRegionEntry)old).getDiskId();
}
+// // inlining DiskId
+// // always have these fields
+// /**
+// * id consists of
+// * most significant
+// * 1 byte = users bits
+// * 2-8 bytes = oplog id
+// * least significant.
+// *
+// * The highest bit in the oplog id part is set to 1 if the oplog id
+// * is negative.
+// * @todo this field could be an int for an overflow only region
+// */
+// private long id;
+// /**
+// * Length of the bytes on disk.
+// * This is always set. If the value is invalid then it will be set to 0.
+// * The most significant bit is used by overflow to mark it as needing to be written.
+// */
+// protected int valueLength = 0;
+// // have intOffset or longOffset
+// // intOffset
+// /**
+// * The position in the oplog (the oplog offset) where this entry's value is
+// * stored
+// */
+// private volatile int offsetInOplog;
+// // longOffset
+// /**
+// * The position in the oplog (the oplog offset) where this entry's value is
+// * stored
+// */
+// private volatile long offsetInOplog;
+// // have overflowOnly or persistence
+// // overflowOnly
+// // no fields
+// // persistent
+// /** unique entry identifier * */
+// private long keyId;
+
+
+
+
+
+
- // // inlining DiskId
- // // always have these fields
- // /**
- // * id consists of
- // * most significant
- // * 1 byte = users bits
- // * 2-8 bytes = oplog id
- // * least significant.
- // *
- // * The highest bit in the oplog id part is set to 1 if the oplog id
- // * is negative.
- // * @todo this field could be an int for an overflow only region
- // */
- // private long id;
- // /**
- // * Length of the bytes on disk.
- // * This is always set. If the value is invalid then it will be set to 0.
- // * The most significant bit is used by overflow to mark it as needing to be written.
- // */
- // protected int valueLength = 0;
- // // have intOffset or longOffset
- // // intOffset
- // /**
- // * The position in the oplog (the oplog offset) where this entry's value is
- // * stored
- // */
- // private volatile int offsetInOplog;
- // // longOffset
- // /**
- // * The position in the oplog (the oplog offset) where this entry's value is
- // * stored
- // */
- // private volatile long offsetInOplog;
- // // have overflowOnly or persistence
- // // overflowOnly
- // // no fields
- // // persistent
- // /** unique entry identifier * */
- // private long keyId;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// versioned code
private VersionSource memberID;
private short entryVersionLowBytes;
@@ -195,15 +242,16 @@ public class VersionedThinDiskRegionEntryHeapUUIDKey extends VersionedThinDiskRe
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);
}
@@ -211,17 +259,17 @@ public class VersionedThinDiskRegionEntryHeapUUIDKey extends VersionedThinDiskRe
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()) {
@@ -233,11 +281,11 @@ public class VersionedThinDiskRegionEntryHeapUUIDKey extends VersionedThinDiskRe
} 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
@@ -246,6 +294,7 @@ public class VersionedThinDiskRegionEntryHeapUUIDKey extends VersionedThinDiskRe
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
public VersionTag asVersionTag() {
VersionTag tag = VersionTag.create(memberID);
tag.setEntryVersion(getEntryVersion());
@@ -255,9 +304,9 @@ public class VersionedThinDiskRegionEntryHeapUUIDKey extends VersionedThinDiskRe
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);
}
@@ -272,22 +321,23 @@ public class VersionedThinDiskRegionEntryHeapUUIDKey extends VersionedThinDiskRe
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 final Object getKey() {
+ public Object getKey() {
return new UUID(this.keyMostSigBits, this.keyLeastSigBits);
}
-
@Override
public boolean isKeyEqual(Object k) {
if (k instanceof UUID) {
@@ -297,5 +347,8 @@ public class VersionedThinDiskRegionEntryHeapUUIDKey extends VersionedThinDiskRe
}
return false;
}
+
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
}
+
http://git-wip-us.apache.org/repos/asf/geode/blob/30f455bb/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapIntKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapIntKey.java
index 1d0bdc9..b7eaccc 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapIntKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapIntKey.java
@@ -15,79 +15,113 @@
package org.apache.geode.internal.cache;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
+
+
+
+
+
+
+
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.persistence.DiskRecoveryStore;
+
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;
import org.apache.geode.internal.offheap.annotations.Unretained;
+
import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
// macros whose definition changes this class:
-// disk: DISK
+// disk: 1
// lru: LRU
// stats: STATS
-// versioned: VERSIONED
-// offheap: OFFHEAP
+// versioned: 1
+// offheap: 1
// One of the following key macros must be defined:
// key object: KEY_OBJECT
-// key int: KEY_INT
+// key int: 1
// key long: KEY_LONG
// key uuid: KEY_UUID
// key string1: KEY_STRING1
// key string2: KEY_STRING2
+
/**
* Do not modify this class. It was generated. Instead modify LeafRegionEntry.cpp and then run
* ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory).
*/
public class VersionedThinDiskRegionEntryOffHeapIntKey extends VersionedThinDiskRegionEntryOffHeap {
- public VersionedThinDiskRegionEntryOffHeapIntKey(RegionEntryContext context, int key,
- @Retained Object value) {
- super(context, (value instanceof RecoveredEntry ? null : value));
+ public VersionedThinDiskRegionEntryOffHeapIntKey (RegionEntryContext context, int key,
+
+ @Retained
+
+ Object value
+
+
+
+ ) {
+ super(context,
+
+ (value instanceof RecoveredEntry ? null : value)
+
+
+
+ );
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
initialize(context, value);
+
+
+
+
this.key = key;
+
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// common code
protected int hash;
private HashEntry<Object, Object> next;
@SuppressWarnings("unused")
private volatile long lastModified;
- private static final AtomicLongFieldUpdater<VersionedThinDiskRegionEntryOffHeapIntKey> lastModifiedUpdater =
- AtomicLongFieldUpdater.newUpdater(VersionedThinDiskRegionEntryOffHeapIntKey.class,
- "lastModified");
+ private static final AtomicLongFieldUpdater<VersionedThinDiskRegionEntryOffHeapIntKey> lastModifiedUpdater
+ = AtomicLongFieldUpdater.newUpdater(VersionedThinDiskRegionEntryOffHeapIntKey.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<VersionedThinDiskRegionEntryOffHeapIntKey> ohAddrUpdater =
- AtomicLongFieldUpdater.newUpdater(VersionedThinDiskRegionEntryOffHeapIntKey.class,
- "ohAddress");
-
+ private final static AtomicLongFieldUpdater<VersionedThinDiskRegionEntryOffHeapIntKey> ohAddrUpdater = AtomicLongFieldUpdater.newUpdater(VersionedThinDiskRegionEntryOffHeapIntKey.class, "ohAddress");
+
@Override
public Token getValueAsToken() {
return OffHeapRegionEntryHelper.getValueAsToken(this);
}
-
+
@Override
protected Object getValueField() {
return OffHeapRegionEntryHelper._getValue(this);
@@ -95,13 +129,18 @@ public class VersionedThinDiskRegionEntryOffHeapIntKey extends VersionedThinDisk
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
@Override
+
@Unretained
protected void setValueField(@Unretained Object v) {
+
+
+
OffHeapRegionEntryHelper.setValue(this, v);
}
-
@Override
+
@Retained
+
public Object _getValueRetain(RegionEntryContext context, boolean decompress) {
return OffHeapRegionEntryHelper._getValueRetain(this, decompress, context);
}
@@ -115,71 +154,72 @@ public class VersionedThinDiskRegionEntryOffHeapIntKey extends VersionedThinDisk
public boolean setAddress(long expectedAddr, long newAddr) {
return ohAddrUpdater.compareAndSet(this, expectedAddr, newAddr);
}
-
+
@Override
+
@Released
+
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 final int getEntryHash() {
+ public int getEntryHash() {
return this.hash;
}
-
protected void setEntryHash(int v) {
this.hash = v;
}
-
/**
* @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 context, Object value) {
diskInitialize(context, value);
}
-
@Override
public int updateAsyncEntrySize(EnableLRU capacityController) {
throw new IllegalStateException("should never be called");
}
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
private void diskInitialize(RegionEntryContext context, Object value) {
- DiskRecoveryStore drs = (DiskRecoveryStore) context;
+ DiskRecoveryStore drs = (DiskRecoveryStore)context;
DiskStoreImpl ds = drs.getDiskStore();
long maxOplogSize = ds.getMaxOplogSize();
- // get appropriate instance of DiskId implementation based on maxOplogSize
+ //get appropriate instance of DiskId implementation based on maxOplogSize
this.id = DiskId.createDiskId(maxOplogSize, true/* is persistence */, ds.needsLinkedList());
Helper.initialize(this, drs, value);
}
@@ -189,57 +229,62 @@ public class VersionedThinDiskRegionEntryOffHeapIntKey extends VersionedThinDisk
*
* @since GemFire 5.1
*/
- protected DiskId id;// = new DiskId();
-
+ protected DiskId id;//= new DiskId();
public DiskId getDiskId() {
return this.id;
}
-
@Override
void setDiskId(RegionEntry old) {
- this.id = ((AbstractDiskRegionEntry) old).getDiskId();
- }
-
- // // inlining DiskId
- // // always have these fields
- // /**
- // * id consists of
- // * most significant
- // * 1 byte = users bits
- // * 2-8 bytes = oplog id
- // * least significant.
- // *
- // * The highest bit in the oplog id part is set to 1 if the oplog id
- // * is negative.
- // * @todo this field could be an int for an overflow only region
- // */
- // private long id;
- // /**
- // * Length of the bytes on disk.
- // * This is always set. If the value is invalid then it will be set to 0.
- // * The most significant bit is used by overflow to mark it as needing to be written.
- // */
- // protected int valueLength = 0;
- // // have intOffset or longOffset
- // // intOffset
- // /**
- // * The position in the oplog (the oplog offset) where this entry's value is
- // * stored
- // */
- // private volatile int offsetInOplog;
- // // longOffset
- // /**
- // * The position in the oplog (the oplog offset) where this entry's value is
- // * stored
- // */
- // private volatile long offsetInOplog;
- // // have overflowOnly or persistence
- // // overflowOnly
- // // no fields
- // // persistent
- // /** unique entry identifier * */
- // private long keyId;
+ this.id = ((AbstractDiskRegionEntry)old).getDiskId();
+ }
+// // inlining DiskId
+// // always have these fields
+// /**
+// * id consists of
+// * most significant
+// * 1 byte = users bits
+// * 2-8 bytes = oplog id
+// * least significant.
+// *
+// * The highest bit in the oplog id part is set to 1 if the oplog id
+// * is negative.
+// * @todo this field could be an int for an overflow only region
+// */
+// private long id;
+// /**
+// * Length of the bytes on disk.
+// * This is always set. If the value is invalid then it will be set to 0.
+// * The most significant bit is used by overflow to mark it as needing to be written.
+// */
+// protected int valueLength = 0;
+// // have intOffset or longOffset
+// // intOffset
+// /**
+// * The position in the oplog (the oplog offset) where this entry's value is
+// * stored
+// */
+// private volatile int offsetInOplog;
+// // longOffset
+// /**
+// * The position in the oplog (the oplog offset) where this entry's value is
+// * stored
+// */
+// private volatile long offsetInOplog;
+// // have overflowOnly or persistence
+// // overflowOnly
+// // no fields
+// // persistent
+// /** unique entry identifier * */
+// private long keyId;
+
+
+
+
+
+
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// versioned code
private VersionSource memberID;
private short entryVersionLowBytes;
@@ -251,15 +296,16 @@ public class VersionedThinDiskRegionEntryOffHeapIntKey extends VersionedThinDisk
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);
}
@@ -267,17 +313,17 @@ public class VersionedThinDiskRegionEntryOffHeapIntKey extends VersionedThinDisk
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()) {
@@ -289,11 +335,11 @@ public class VersionedThinDiskRegionEntryOffHeapIntKey extends VersionedThinDisk
} 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
@@ -302,6 +348,7 @@ public class VersionedThinDiskRegionEntryOffHeapIntKey extends VersionedThinDisk
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
public VersionTag asVersionTag() {
VersionTag tag = VersionTag.create(memberID);
tag.setEntryVersion(getEntryVersion());
@@ -311,9 +358,9 @@ public class VersionedThinDiskRegionEntryOffHeapIntKey extends VersionedThinDisk
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);
}
@@ -328,21 +375,29 @@ public class VersionedThinDiskRegionEntryOffHeapIntKey extends VersionedThinDisk
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 int key;
+
+
+
+
+
+
+
+ private final int key;
@Override
- public final Object getKey() {
+ public Object getKey() {
return this.key;
}
-
@Override
public boolean isKeyEqual(Object k) {
if (k instanceof Integer) {
@@ -350,5 +405,8 @@ public class VersionedThinDiskRegionEntryOffHeapIntKey extends VersionedThinDisk
}
return false;
}
+
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
}
+
http://git-wip-us.apache.org/repos/asf/geode/blob/30f455bb/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapLongKey.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapLongKey.java
index 324134a..b1c31ed 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapLongKey.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapLongKey.java
@@ -15,80 +15,115 @@
package org.apache.geode.internal.cache;
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
+
+
+
+
+
+
+
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.persistence.DiskRecoveryStore;
+
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;
import org.apache.geode.internal.offheap.annotations.Unretained;
+
import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
// macros whose definition changes this class:
-// disk: DISK
+// disk: 1
// lru: LRU
// stats: STATS
-// versioned: VERSIONED
-// offheap: OFFHEAP
+// versioned: 1
+// offheap: 1
// One of the following key macros must be defined:
// key object: KEY_OBJECT
// key int: KEY_INT
-// key long: KEY_LONG
+// key long: 1
// key uuid: KEY_UUID
// key string1: KEY_STRING1
// key string2: KEY_STRING2
+
/**
* Do not modify this class. It was generated. Instead modify LeafRegionEntry.cpp and then run
* ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory).
*/
-public class VersionedThinDiskRegionEntryOffHeapLongKey
- extends VersionedThinDiskRegionEntryOffHeap {
- public VersionedThinDiskRegionEntryOffHeapLongKey(RegionEntryContext context, long key,
- @Retained Object value) {
- super(context, (value instanceof RecoveredEntry ? null : value));
+public class VersionedThinDiskRegionEntryOffHeapLongKey extends VersionedThinDiskRegionEntryOffHeap {
+ public VersionedThinDiskRegionEntryOffHeapLongKey (RegionEntryContext context, long key,
+
+ @Retained
+
+ Object value
+
+
+
+ ) {
+ super(context,
+
+ (value instanceof RecoveredEntry ? null : value)
+
+
+
+ );
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
initialize(context, value);
+
+
+
+
+
+
this.key = key;
+
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// common code
protected int hash;
private HashEntry<Object, Object> next;
@SuppressWarnings("unused")
private volatile long lastModified;
- private static final AtomicLongFieldUpdater<VersionedThinDiskRegionEntryOffHeapLongKey> lastModifiedUpdater =
- AtomicLongFieldUpdater.newUpdater(VersionedThinDiskRegionEntryOffHeapLongKey.class,
- "lastModified");
+ private static final AtomicLongFieldUpdater<VersionedThinDiskRegionEntryOffHeapLongKey> lastModifiedUpdater
+ = AtomicLongFieldUpdater.newUpdater(VersionedThinDiskRegionEntryOffHeapLongKey.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<VersionedThinDiskRegionEntryOffHeapLongKey> ohAddrUpdater =
- AtomicLongFieldUpdater.newUpdater(VersionedThinDiskRegionEntryOffHeapLongKey.class,
- "ohAddress");
-
+ private final static AtomicLongFieldUpdater<VersionedThinDiskRegionEntryOffHeapLongKey> ohAddrUpdater = AtomicLongFieldUpdater.newUpdater(VersionedThinDiskRegionEntryOffHeapLongKey.class, "ohAddress");
+
@Override
public Token getValueAsToken() {
return OffHeapRegionEntryHelper.getValueAsToken(this);
}
-
+
@Override
protected Object getValueField() {
return OffHeapRegionEntryHelper._getValue(this);
@@ -96,13 +131,18 @@ public class VersionedThinDiskRegionEntryOffHeapLongKey
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
@Override
+
@Unretained
protected void setValueField(@Unretained Object v) {
+
+
+
OffHeapRegionEntryHelper.setValue(this, v);
}
-
@Override
+
@Retained
+
public Object _getValueRetain(RegionEntryContext context, boolean decompress) {
return OffHeapRegionEntryHelper._getValueRetain(this, decompress, context);
}
@@ -116,71 +156,72 @@ public class VersionedThinDiskRegionEntryOffHeapLongKey
public boolean setAddress(long expectedAddr, long newAddr) {
return ohAddrUpdater.compareAndSet(this, expectedAddr, newAddr);
}
-
+
@Override
+
@Released
+
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 final int getEntryHash() {
+ public int getEntryHash() {
return this.hash;
}
-
protected void setEntryHash(int v) {
this.hash = v;
}
-
/**
* @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 context, Object value) {
diskInitialize(context, value);
}
-
@Override
public int updateAsyncEntrySize(EnableLRU capacityController) {
throw new IllegalStateException("should never be called");
}
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
private void diskInitialize(RegionEntryContext context, Object value) {
- DiskRecoveryStore drs = (DiskRecoveryStore) context;
+ DiskRecoveryStore drs = (DiskRecoveryStore)context;
DiskStoreImpl ds = drs.getDiskStore();
long maxOplogSize = ds.getMaxOplogSize();
- // get appropriate instance of DiskId implementation based on maxOplogSize
+ //get appropriate instance of DiskId implementation based on maxOplogSize
this.id = DiskId.createDiskId(maxOplogSize, true/* is persistence */, ds.needsLinkedList());
Helper.initialize(this, drs, value);
}
@@ -190,57 +231,62 @@ public class VersionedThinDiskRegionEntryOffHeapLongKey
*
* @since GemFire 5.1
*/
- protected DiskId id;// = new DiskId();
-
+ protected DiskId id;//= new DiskId();
public DiskId getDiskId() {
return this.id;
}
-
@Override
void setDiskId(RegionEntry old) {
- this.id = ((AbstractDiskRegionEntry) old).getDiskId();
- }
-
- // // inlining DiskId
- // // always have these fields
- // /**
- // * id consists of
- // * most significant
- // * 1 byte = users bits
- // * 2-8 bytes = oplog id
- // * least significant.
- // *
- // * The highest bit in the oplog id part is set to 1 if the oplog id
- // * is negative.
- // * @todo this field could be an int for an overflow only region
- // */
- // private long id;
- // /**
- // * Length of the bytes on disk.
- // * This is always set. If the value is invalid then it will be set to 0.
- // * The most significant bit is used by overflow to mark it as needing to be written.
- // */
- // protected int valueLength = 0;
- // // have intOffset or longOffset
- // // intOffset
- // /**
- // * The position in the oplog (the oplog offset) where this entry's value is
- // * stored
- // */
- // private volatile int offsetInOplog;
- // // longOffset
- // /**
- // * The position in the oplog (the oplog offset) where this entry's value is
- // * stored
- // */
- // private volatile long offsetInOplog;
- // // have overflowOnly or persistence
- // // overflowOnly
- // // no fields
- // // persistent
- // /** unique entry identifier * */
- // private long keyId;
+ this.id = ((AbstractDiskRegionEntry)old).getDiskId();
+ }
+// // inlining DiskId
+// // always have these fields
+// /**
+// * id consists of
+// * most significant
+// * 1 byte = users bits
+// * 2-8 bytes = oplog id
+// * least significant.
+// *
+// * The highest bit in the oplog id part is set to 1 if the oplog id
+// * is negative.
+// * @todo this field could be an int for an overflow only region
+// */
+// private long id;
+// /**
+// * Length of the bytes on disk.
+// * This is always set. If the value is invalid then it will be set to 0.
+// * The most significant bit is used by overflow to mark it as needing to be written.
+// */
+// protected int valueLength = 0;
+// // have intOffset or longOffset
+// // intOffset
+// /**
+// * The position in the oplog (the oplog offset) where this entry's value is
+// * stored
+// */
+// private volatile int offsetInOplog;
+// // longOffset
+// /**
+// * The position in the oplog (the oplog offset) where this entry's value is
+// * stored
+// */
+// private volatile long offsetInOplog;
+// // have overflowOnly or persistence
+// // overflowOnly
+// // no fields
+// // persistent
+// /** unique entry identifier * */
+// private long keyId;
+
+
+
+
+
+
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
// versioned code
private VersionSource memberID;
private short entryVersionLowBytes;
@@ -252,15 +298,16 @@ public class VersionedThinDiskRegionEntryOffHeapLongKey
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);
}
@@ -268,17 +315,17 @@ public class VersionedThinDiskRegionEntryOffHeapLongKey
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()) {
@@ -290,11 +337,11 @@ public class VersionedThinDiskRegionEntryOffHeapLongKey
} 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
@@ -303,6 +350,7 @@ public class VersionedThinDiskRegionEntryOffHeapLongKey
}
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
+
public VersionTag asVersionTag() {
VersionTag tag = VersionTag.create(memberID);
tag.setEntryVersion(getEntryVersion());
@@ -312,9 +360,9 @@ public class VersionedThinDiskRegionEntryOffHeapLongKey
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);
}
@@ -329,21 +377,22 @@ public class VersionedThinDiskRegionEntryOffHeapLongKey
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;
+ private final long key;
@Override
- public final Object getKey() {
+ public Object getKey() {
return this.key;
}
-
@Override
public boolean isKeyEqual(Object k) {
if (k instanceof Long) {
@@ -351,5 +400,8 @@ public class VersionedThinDiskRegionEntryOffHeapLongKey
}
return false;
}
+
+
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
}
+