http://git-wip-us.apache.org/repos/asf/geode/blob/a4458531/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapObjectKey.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapObjectKey.java index 4be97cb..011bf26 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapObjectKey.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapObjectKey.java @@ -15,36 +15,48 @@ package org.apache.geode.internal.cache; // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + + + import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; + import java.util.concurrent.atomic.AtomicLongFieldUpdater; + import org.apache.geode.cache.EntryEvent; + import org.apache.geode.internal.cache.lru.EnableLRU; + import org.apache.geode.internal.cache.persistence.DiskRecoveryStore; + 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; 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 -// lru: LRU +// disk: 1 +// lru: 1 // stats: STATS -// versioned: VERSIONED -// offheap: OFFHEAP +// versioned: 1 +// offheap: 1 // One of the following key macros must be defined: -// key object: KEY_OBJECT +// key object: 1 // key int: KEY_INT // key long: KEY_LONG // key uuid: KEY_UUID // key string1: KEY_STRING1 // key string2: KEY_STRING2 + /** * Do not modify this class. It was generated. Instead modify LeafRegionEntry.cpp and then run * ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory). @@ -52,14 +64,32 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha public class VersionedThinDiskLRURegionEntryOffHeapObjectKey extends VersionedThinDiskLRURegionEntryOffHeap { public VersionedThinDiskLRURegionEntryOffHeapObjectKey(RegionEntryContext context, Object key, - @Retained Object value) { - super(context, (value instanceof RecoveredEntry ? null : value)); + + @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; @@ -68,6 +98,7 @@ public class VersionedThinDiskLRURegionEntryOffHeapObjectKey private static final AtomicLongFieldUpdater<VersionedThinDiskLRURegionEntryOffHeapObjectKey> lastModifiedUpdater = AtomicLongFieldUpdater.newUpdater(VersionedThinDiskLRURegionEntryOffHeapObjectKey.class, "lastModified"); + /** * All access done using ohAddrUpdater so it is used even though the compiler can not tell it is. */ @@ -99,13 +130,19 @@ public class VersionedThinDiskLRURegionEntryOffHeapObjectKey // 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); } @@ -121,7 +158,9 @@ public class VersionedThinDiskLRURegionEntryOffHeapObjectKey } @Override + @Released + public void release() { OffHeapRegionEntryHelper.releaseEntry(this); } @@ -145,7 +184,7 @@ public class VersionedThinDiskLRURegionEntryOffHeapObjectKey /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -156,19 +195,22 @@ public class VersionedThinDiskLRURegionEntryOffHeapObjectKey /** * @see HashEntry#getNextEntry() */ - public final HashEntry<Object, Object> getNextEntry() { + public HashEntry<Object, Object> getNextEntry() { return this.next; } /** * @see HashEntry#setNextEntry */ - public final void setNextEntry(final HashEntry<Object, Object> n) { + public void setNextEntry(final HashEntry<Object, Object> n) { this.next = n; } + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // disk code + protected void initialize(RegionEntryContext drs, Object value) { boolean isBackup; if (drs instanceof LocalRegion) { @@ -185,7 +227,7 @@ public class VersionedThinDiskLRURegionEntryOffHeapObjectKey } @Override - public final synchronized int updateAsyncEntrySize(EnableLRU capacityController) { + public synchronized int updateAsyncEntrySize(EnableLRU capacityController) { int oldSize = getEntrySize(); int newSize = capacityController.entrySize(getKeyForSizing(), null); setEntrySize(newSize); @@ -193,7 +235,9 @@ public class VersionedThinDiskLRURegionEntryOffHeapObjectKey return delta; } + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + private void diskInitialize(RegionEntryContext context, Object value) { DiskRecoveryStore drs = (DiskRecoveryStore) context; DiskStoreImpl ds = drs.getDiskStore(); @@ -218,7 +262,6 @@ public class VersionedThinDiskLRURegionEntryOffHeapObjectKey void setDiskId(RegionEntry old) { this.id = ((AbstractDiskRegionEntry) old).getDiskId(); } - // // inlining DiskId // // always have these fields // /** @@ -258,105 +301,110 @@ public class VersionedThinDiskLRURegionEntryOffHeapObjectKey // // persistent // /** unique entry identifier * */ // private long keyId; + + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // lru code @Override public void setDelayedDiskId(LocalRegion r) { + DiskStoreImpl ds = r.getDiskStore(); long maxOplogSize = ds.getMaxOplogSize(); this.id = DiskId.createDiskId(maxOplogSize, false /* over flow only */, ds.needsLinkedList()); + + + } - public final synchronized int updateEntrySize(EnableLRU capacityController) { + public synchronized int updateEntrySize(EnableLRU capacityController) { return updateEntrySize(capacityController, _getValue()); // OFHEAP: _getValue ok w/o incing // refcount because we are synced and // only getting the size } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp - public final synchronized int updateEntrySize(EnableLRU capacityController, Object value) { + + public synchronized int updateEntrySize(EnableLRU capacityController, Object value) { int oldSize = getEntrySize(); int newSize = capacityController.entrySize(getKeyForSizing(), value); setEntrySize(newSize); int delta = newSize - oldSize; - // if ( debug ) log( "updateEntrySize key=" + getKey() - // + (_getValue() == Token.INVALID ? " invalid" : - // (_getValue() == Token.LOCAL_INVALID ? "local_invalid" : - // (_getValue()==null ? " evicted" : " valid"))) - // + " oldSize=" + oldSize - // + " newSize=" + this.size ); return delta; } - public final boolean testRecentlyUsed() { + public boolean testRecentlyUsed() { return areAnyBitsSet(RECENTLY_USED); } @Override - public final void setRecentlyUsed() { + public void setRecentlyUsed() { setBits(RECENTLY_USED); } - public final void unsetRecentlyUsed() { + public void unsetRecentlyUsed() { clearBits(~RECENTLY_USED); } - public final boolean testEvicted() { + public boolean testEvicted() { return areAnyBitsSet(EVICTED); } - public final void setEvicted() { + public void setEvicted() { setBits(EVICTED); } - public final void unsetEvicted() { + public void unsetEvicted() { clearBits(~EVICTED); } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + private LRUClockNode nextLRU; private LRUClockNode prevLRU; private int size; - public final void setNextLRUNode(LRUClockNode next) { + public void setNextLRUNode(LRUClockNode next) { this.nextLRU = next; } - public final LRUClockNode nextLRUNode() { + public LRUClockNode nextLRUNode() { return this.nextLRU; } - public final void setPrevLRUNode(LRUClockNode prev) { + public void setPrevLRUNode(LRUClockNode prev) { this.prevLRU = prev; } - public final LRUClockNode prevLRUNode() { + public LRUClockNode prevLRUNode() { return this.prevLRU; } - public final int getEntrySize() { + public int getEntrySize() { return this.size; } - protected final void setEntrySize(int size) { + protected void setEntrySize(int size) { this.size = size; } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp - // @Override - // public StringBuilder appendFieldsToString(final StringBuilder sb) { - // StringBuilder result = super.appendFieldsToString(sb); - // result.append("; prev=").append(this.prevLRU==null?"null":"not null"); - // result.append("; next=").append(this.nextLRU==null?"null":"not null"); - // return result; - // } + @Override public Object getKeyForSizing() { + // default implementation. return getKey(); + + + } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // versioned code private VersionSource memberID; private short entryVersionLowBytes; @@ -373,6 +421,7 @@ public class VersionedThinDiskLRURegionEntryOffHeapObjectKey return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -390,6 +439,7 @@ public class VersionedThinDiskLRURegionEntryOffHeapObjectKey } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public void setVersions(VersionTag tag) { this.memberID = tag.getMemberID(); int eVersion = tag.getEntryVersion(); @@ -419,6 +469,7 @@ public class VersionedThinDiskLRURegionEntryOffHeapObjectKey } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public VersionTag asVersionTag() { VersionTag tag = VersionTag.create(memberID); tag.setEntryVersion(getEntryVersion()); @@ -451,13 +502,19 @@ public class VersionedThinDiskLRURegionEntryOffHeapObjectKey return this.regionVersionLowBytes; } + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // key code + private final Object key; @Override - public final Object getKey() { + public Object getKey() { return this.key; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp } +
http://git-wip-us.apache.org/repos/asf/geode/blob/a4458531/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapStringKey1.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapStringKey1.java index b4e861d..ffba17a 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapStringKey1.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapStringKey1.java @@ -15,36 +15,48 @@ package org.apache.geode.internal.cache; // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + + + import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; + import java.util.concurrent.atomic.AtomicLongFieldUpdater; + import org.apache.geode.cache.EntryEvent; + import org.apache.geode.internal.cache.lru.EnableLRU; + import org.apache.geode.internal.cache.persistence.DiskRecoveryStore; + 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; 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 -// lru: LRU +// disk: 1 +// lru: 1 // 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 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). @@ -52,10 +64,25 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha public class VersionedThinDiskLRURegionEntryOffHeapStringKey1 extends VersionedThinDiskLRURegionEntryOffHeap { public VersionedThinDiskLRURegionEntryOffHeapStringKey1(RegionEntryContext context, String key, - @Retained Object value, boolean byteEncode) { - super(context, (value instanceof RecoveredEntry ? null : value)); + + @Retained + + 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) { @@ -74,9 +101,11 @@ public class VersionedThinDiskLRURegionEntryOffHeapStringKey1 } 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; @@ -85,6 +114,7 @@ public class VersionedThinDiskLRURegionEntryOffHeapStringKey1 private static final AtomicLongFieldUpdater<VersionedThinDiskLRURegionEntryOffHeapStringKey1> lastModifiedUpdater = AtomicLongFieldUpdater.newUpdater(VersionedThinDiskLRURegionEntryOffHeapStringKey1.class, "lastModified"); + /** * All access done using ohAddrUpdater so it is used even though the compiler can not tell it is. */ @@ -116,13 +146,19 @@ public class VersionedThinDiskLRURegionEntryOffHeapStringKey1 // 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); } @@ -138,7 +174,9 @@ public class VersionedThinDiskLRURegionEntryOffHeapStringKey1 } @Override + @Released + public void release() { OffHeapRegionEntryHelper.releaseEntry(this); } @@ -162,7 +200,7 @@ public class VersionedThinDiskLRURegionEntryOffHeapStringKey1 /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -173,19 +211,22 @@ public class VersionedThinDiskLRURegionEntryOffHeapStringKey1 /** * @see HashEntry#getNextEntry() */ - public final HashEntry<Object, Object> getNextEntry() { + public HashEntry<Object, Object> getNextEntry() { return this.next; } /** * @see HashEntry#setNextEntry */ - public final void setNextEntry(final HashEntry<Object, Object> n) { + public void setNextEntry(final HashEntry<Object, Object> n) { this.next = n; } + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // disk code + protected void initialize(RegionEntryContext drs, Object value) { boolean isBackup; if (drs instanceof LocalRegion) { @@ -202,7 +243,7 @@ public class VersionedThinDiskLRURegionEntryOffHeapStringKey1 } @Override - public final synchronized int updateAsyncEntrySize(EnableLRU capacityController) { + public synchronized int updateAsyncEntrySize(EnableLRU capacityController) { int oldSize = getEntrySize(); int newSize = capacityController.entrySize(getKeyForSizing(), null); setEntrySize(newSize); @@ -210,7 +251,9 @@ public class VersionedThinDiskLRURegionEntryOffHeapStringKey1 return delta; } + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + private void diskInitialize(RegionEntryContext context, Object value) { DiskRecoveryStore drs = (DiskRecoveryStore) context; DiskStoreImpl ds = drs.getDiskStore(); @@ -235,7 +278,6 @@ public class VersionedThinDiskLRURegionEntryOffHeapStringKey1 void setDiskId(RegionEntry old) { this.id = ((AbstractDiskRegionEntry) old).getDiskId(); } - // // inlining DiskId // // always have these fields // /** @@ -275,105 +317,110 @@ public class VersionedThinDiskLRURegionEntryOffHeapStringKey1 // // persistent // /** unique entry identifier * */ // private long keyId; + + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // lru code @Override public void setDelayedDiskId(LocalRegion r) { + DiskStoreImpl ds = r.getDiskStore(); long maxOplogSize = ds.getMaxOplogSize(); this.id = DiskId.createDiskId(maxOplogSize, false /* over flow only */, ds.needsLinkedList()); + + + } - public final synchronized int updateEntrySize(EnableLRU capacityController) { + public synchronized int updateEntrySize(EnableLRU capacityController) { return updateEntrySize(capacityController, _getValue()); // OFHEAP: _getValue ok w/o incing // refcount because we are synced and // only getting the size } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp - public final synchronized int updateEntrySize(EnableLRU capacityController, Object value) { + + public synchronized int updateEntrySize(EnableLRU capacityController, Object value) { int oldSize = getEntrySize(); int newSize = capacityController.entrySize(getKeyForSizing(), value); setEntrySize(newSize); int delta = newSize - oldSize; - // if ( debug ) log( "updateEntrySize key=" + getKey() - // + (_getValue() == Token.INVALID ? " invalid" : - // (_getValue() == Token.LOCAL_INVALID ? "local_invalid" : - // (_getValue()==null ? " evicted" : " valid"))) - // + " oldSize=" + oldSize - // + " newSize=" + this.size ); return delta; } - public final boolean testRecentlyUsed() { + public boolean testRecentlyUsed() { return areAnyBitsSet(RECENTLY_USED); } @Override - public final void setRecentlyUsed() { + public void setRecentlyUsed() { setBits(RECENTLY_USED); } - public final void unsetRecentlyUsed() { + public void unsetRecentlyUsed() { clearBits(~RECENTLY_USED); } - public final boolean testEvicted() { + public boolean testEvicted() { return areAnyBitsSet(EVICTED); } - public final void setEvicted() { + public void setEvicted() { setBits(EVICTED); } - public final void unsetEvicted() { + public void unsetEvicted() { clearBits(~EVICTED); } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + private LRUClockNode nextLRU; private LRUClockNode prevLRU; private int size; - public final void setNextLRUNode(LRUClockNode next) { + public void setNextLRUNode(LRUClockNode next) { this.nextLRU = next; } - public final LRUClockNode nextLRUNode() { + public LRUClockNode nextLRUNode() { return this.nextLRU; } - public final void setPrevLRUNode(LRUClockNode prev) { + public void setPrevLRUNode(LRUClockNode prev) { this.prevLRU = prev; } - public final LRUClockNode prevLRUNode() { + public LRUClockNode prevLRUNode() { return this.prevLRU; } - public final int getEntrySize() { + public int getEntrySize() { return this.size; } - protected final void setEntrySize(int size) { + protected void setEntrySize(int size) { this.size = size; } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp - // @Override - // public StringBuilder appendFieldsToString(final StringBuilder sb) { - // StringBuilder result = super.appendFieldsToString(sb); - // result.append("; prev=").append(this.prevLRU==null?"null":"not null"); - // result.append("; next=").append(this.nextLRU==null?"null":"not null"); - // return result; - // } + @Override public Object getKeyForSizing() { + + + // inline keys always report null for sizing since the size comes from the entry size return null; + } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // versioned code private VersionSource memberID; private short entryVersionLowBytes; @@ -390,6 +437,7 @@ public class VersionedThinDiskLRURegionEntryOffHeapStringKey1 return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -407,6 +455,7 @@ public class VersionedThinDiskLRURegionEntryOffHeapStringKey1 } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public void setVersions(VersionTag tag) { this.memberID = tag.getMemberID(); int eVersion = tag.getEntryVersion(); @@ -436,6 +485,7 @@ public class VersionedThinDiskLRURegionEntryOffHeapStringKey1 } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public VersionTag asVersionTag() { VersionTag tag = VersionTag.create(memberID); tag.setEntryVersion(getEntryVersion()); @@ -468,8 +518,11 @@ public class VersionedThinDiskLRURegionEntryOffHeapStringKey1 return this.regionVersionLowBytes; } + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // key code + private final long bits1; private int getKeyLength() { @@ -483,7 +536,7 @@ public class VersionedThinDiskLRURegionEntryOffHeapStringKey1 } @Override - public final Object getKey() { + public Object getKey() { int keylen = getKeyLength(); char[] chars = new char[keylen]; long tmpBits1 = this.bits1; @@ -502,6 +555,7 @@ public class VersionedThinDiskLRURegionEntryOffHeapStringKey1 } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + @Override public boolean isKeyEqual(Object k) { if (k instanceof String) { @@ -531,5 +585,8 @@ public class VersionedThinDiskLRURegionEntryOffHeapStringKey1 } return false; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp } + http://git-wip-us.apache.org/repos/asf/geode/blob/a4458531/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapStringKey2.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapStringKey2.java index 1652cb3..85a66ae 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapStringKey2.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapStringKey2.java @@ -15,36 +15,48 @@ package org.apache.geode.internal.cache; // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + + + import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; + import java.util.concurrent.atomic.AtomicLongFieldUpdater; + import org.apache.geode.cache.EntryEvent; + import org.apache.geode.internal.cache.lru.EnableLRU; + import org.apache.geode.internal.cache.persistence.DiskRecoveryStore; + 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; 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 -// lru: LRU +// disk: 1 +// lru: 1 // 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 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). @@ -52,10 +64,25 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha public class VersionedThinDiskLRURegionEntryOffHeapStringKey2 extends VersionedThinDiskLRURegionEntryOffHeap { public VersionedThinDiskLRURegionEntryOffHeapStringKey2(RegionEntryContext context, String key, - @Retained Object value, boolean byteEncode) { - super(context, (value instanceof RecoveredEntry ? null : value)); + + @Retained + + 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; @@ -86,9 +113,11 @@ public class VersionedThinDiskLRURegionEntryOffHeapStringKey2 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; @@ -97,6 +126,7 @@ public class VersionedThinDiskLRURegionEntryOffHeapStringKey2 private static final AtomicLongFieldUpdater<VersionedThinDiskLRURegionEntryOffHeapStringKey2> lastModifiedUpdater = AtomicLongFieldUpdater.newUpdater(VersionedThinDiskLRURegionEntryOffHeapStringKey2.class, "lastModified"); + /** * All access done using ohAddrUpdater so it is used even though the compiler can not tell it is. */ @@ -128,13 +158,19 @@ public class VersionedThinDiskLRURegionEntryOffHeapStringKey2 // 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); } @@ -150,7 +186,9 @@ public class VersionedThinDiskLRURegionEntryOffHeapStringKey2 } @Override + @Released + public void release() { OffHeapRegionEntryHelper.releaseEntry(this); } @@ -174,7 +212,7 @@ public class VersionedThinDiskLRURegionEntryOffHeapStringKey2 /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -185,19 +223,22 @@ public class VersionedThinDiskLRURegionEntryOffHeapStringKey2 /** * @see HashEntry#getNextEntry() */ - public final HashEntry<Object, Object> getNextEntry() { + public HashEntry<Object, Object> getNextEntry() { return this.next; } /** * @see HashEntry#setNextEntry */ - public final void setNextEntry(final HashEntry<Object, Object> n) { + public void setNextEntry(final HashEntry<Object, Object> n) { this.next = n; } + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // disk code + protected void initialize(RegionEntryContext drs, Object value) { boolean isBackup; if (drs instanceof LocalRegion) { @@ -214,7 +255,7 @@ public class VersionedThinDiskLRURegionEntryOffHeapStringKey2 } @Override - public final synchronized int updateAsyncEntrySize(EnableLRU capacityController) { + public synchronized int updateAsyncEntrySize(EnableLRU capacityController) { int oldSize = getEntrySize(); int newSize = capacityController.entrySize(getKeyForSizing(), null); setEntrySize(newSize); @@ -222,7 +263,9 @@ public class VersionedThinDiskLRURegionEntryOffHeapStringKey2 return delta; } + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + private void diskInitialize(RegionEntryContext context, Object value) { DiskRecoveryStore drs = (DiskRecoveryStore) context; DiskStoreImpl ds = drs.getDiskStore(); @@ -247,7 +290,6 @@ public class VersionedThinDiskLRURegionEntryOffHeapStringKey2 void setDiskId(RegionEntry old) { this.id = ((AbstractDiskRegionEntry) old).getDiskId(); } - // // inlining DiskId // // always have these fields // /** @@ -287,105 +329,110 @@ public class VersionedThinDiskLRURegionEntryOffHeapStringKey2 // // persistent // /** unique entry identifier * */ // private long keyId; + + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // lru code @Override public void setDelayedDiskId(LocalRegion r) { + DiskStoreImpl ds = r.getDiskStore(); long maxOplogSize = ds.getMaxOplogSize(); this.id = DiskId.createDiskId(maxOplogSize, false /* over flow only */, ds.needsLinkedList()); + + + } - public final synchronized int updateEntrySize(EnableLRU capacityController) { + public synchronized int updateEntrySize(EnableLRU capacityController) { return updateEntrySize(capacityController, _getValue()); // OFHEAP: _getValue ok w/o incing // refcount because we are synced and // only getting the size } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp - public final synchronized int updateEntrySize(EnableLRU capacityController, Object value) { + + public synchronized int updateEntrySize(EnableLRU capacityController, Object value) { int oldSize = getEntrySize(); int newSize = capacityController.entrySize(getKeyForSizing(), value); setEntrySize(newSize); int delta = newSize - oldSize; - // if ( debug ) log( "updateEntrySize key=" + getKey() - // + (_getValue() == Token.INVALID ? " invalid" : - // (_getValue() == Token.LOCAL_INVALID ? "local_invalid" : - // (_getValue()==null ? " evicted" : " valid"))) - // + " oldSize=" + oldSize - // + " newSize=" + this.size ); return delta; } - public final boolean testRecentlyUsed() { + public boolean testRecentlyUsed() { return areAnyBitsSet(RECENTLY_USED); } @Override - public final void setRecentlyUsed() { + public void setRecentlyUsed() { setBits(RECENTLY_USED); } - public final void unsetRecentlyUsed() { + public void unsetRecentlyUsed() { clearBits(~RECENTLY_USED); } - public final boolean testEvicted() { + public boolean testEvicted() { return areAnyBitsSet(EVICTED); } - public final void setEvicted() { + public void setEvicted() { setBits(EVICTED); } - public final void unsetEvicted() { + public void unsetEvicted() { clearBits(~EVICTED); } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + private LRUClockNode nextLRU; private LRUClockNode prevLRU; private int size; - public final void setNextLRUNode(LRUClockNode next) { + public void setNextLRUNode(LRUClockNode next) { this.nextLRU = next; } - public final LRUClockNode nextLRUNode() { + public LRUClockNode nextLRUNode() { return this.nextLRU; } - public final void setPrevLRUNode(LRUClockNode prev) { + public void setPrevLRUNode(LRUClockNode prev) { this.prevLRU = prev; } - public final LRUClockNode prevLRUNode() { + public LRUClockNode prevLRUNode() { return this.prevLRU; } - public final int getEntrySize() { + public int getEntrySize() { return this.size; } - protected final void setEntrySize(int size) { + protected void setEntrySize(int size) { this.size = size; } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp - // @Override - // public StringBuilder appendFieldsToString(final StringBuilder sb) { - // StringBuilder result = super.appendFieldsToString(sb); - // result.append("; prev=").append(this.prevLRU==null?"null":"not null"); - // result.append("; next=").append(this.nextLRU==null?"null":"not null"); - // return result; - // } + @Override public Object getKeyForSizing() { + + + // inline keys always report null for sizing since the size comes from the entry size return null; + } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // versioned code private VersionSource memberID; private short entryVersionLowBytes; @@ -402,6 +449,7 @@ public class VersionedThinDiskLRURegionEntryOffHeapStringKey2 return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -419,6 +467,7 @@ public class VersionedThinDiskLRURegionEntryOffHeapStringKey2 } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public void setVersions(VersionTag tag) { this.memberID = tag.getMemberID(); int eVersion = tag.getEntryVersion(); @@ -448,6 +497,7 @@ public class VersionedThinDiskLRURegionEntryOffHeapStringKey2 } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public VersionTag asVersionTag() { VersionTag tag = VersionTag.create(memberID); tag.setEntryVersion(getEntryVersion()); @@ -480,8 +530,11 @@ public class VersionedThinDiskLRURegionEntryOffHeapStringKey2 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. @@ -500,7 +553,7 @@ public class VersionedThinDiskLRURegionEntryOffHeapStringKey2 } @Override - public final Object getKey() { + public Object getKey() { int keylen = getKeyLength(); char[] chars = new char[keylen]; long tmpBits1 = this.bits1; @@ -530,6 +583,7 @@ public class VersionedThinDiskLRURegionEntryOffHeapStringKey2 } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + @Override public boolean isKeyEqual(Object k) { if (k instanceof String) { @@ -572,5 +626,7 @@ public class VersionedThinDiskLRURegionEntryOffHeapStringKey2 } return false; } + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp } + http://git-wip-us.apache.org/repos/asf/geode/blob/a4458531/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapUUIDKey.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapUUIDKey.java index 1f28498..804623b 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapUUIDKey.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskLRURegionEntryOffHeapUUIDKey.java @@ -15,37 +15,50 @@ 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.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.persistence.DiskRecoveryStore; + 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; 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 -// lru: LRU +// disk: 1 +// lru: 1 // 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 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). @@ -53,15 +66,34 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha public class VersionedThinDiskLRURegionEntryOffHeapUUIDKey extends VersionedThinDiskLRURegionEntryOffHeap { public VersionedThinDiskLRURegionEntryOffHeapUUIDKey(RegionEntryContext context, UUID key, - @Retained Object value) { - super(context, (value instanceof RecoveredEntry ? null : value)); + + @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.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; @@ -70,6 +102,7 @@ public class VersionedThinDiskLRURegionEntryOffHeapUUIDKey private static final AtomicLongFieldUpdater<VersionedThinDiskLRURegionEntryOffHeapUUIDKey> lastModifiedUpdater = AtomicLongFieldUpdater.newUpdater(VersionedThinDiskLRURegionEntryOffHeapUUIDKey.class, "lastModified"); + /** * All access done using ohAddrUpdater so it is used even though the compiler can not tell it is. */ @@ -101,13 +134,19 @@ public class VersionedThinDiskLRURegionEntryOffHeapUUIDKey // 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); } @@ -123,7 +162,9 @@ public class VersionedThinDiskLRURegionEntryOffHeapUUIDKey } @Override + @Released + public void release() { OffHeapRegionEntryHelper.releaseEntry(this); } @@ -147,7 +188,7 @@ public class VersionedThinDiskLRURegionEntryOffHeapUUIDKey /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -158,19 +199,22 @@ public class VersionedThinDiskLRURegionEntryOffHeapUUIDKey /** * @see HashEntry#getNextEntry() */ - public final HashEntry<Object, Object> getNextEntry() { + public HashEntry<Object, Object> getNextEntry() { return this.next; } /** * @see HashEntry#setNextEntry */ - public final void setNextEntry(final HashEntry<Object, Object> n) { + public void setNextEntry(final HashEntry<Object, Object> n) { this.next = n; } + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // disk code + protected void initialize(RegionEntryContext drs, Object value) { boolean isBackup; if (drs instanceof LocalRegion) { @@ -187,7 +231,7 @@ public class VersionedThinDiskLRURegionEntryOffHeapUUIDKey } @Override - public final synchronized int updateAsyncEntrySize(EnableLRU capacityController) { + public synchronized int updateAsyncEntrySize(EnableLRU capacityController) { int oldSize = getEntrySize(); int newSize = capacityController.entrySize(getKeyForSizing(), null); setEntrySize(newSize); @@ -195,7 +239,9 @@ public class VersionedThinDiskLRURegionEntryOffHeapUUIDKey return delta; } + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + private void diskInitialize(RegionEntryContext context, Object value) { DiskRecoveryStore drs = (DiskRecoveryStore) context; DiskStoreImpl ds = drs.getDiskStore(); @@ -220,7 +266,6 @@ public class VersionedThinDiskLRURegionEntryOffHeapUUIDKey void setDiskId(RegionEntry old) { this.id = ((AbstractDiskRegionEntry) old).getDiskId(); } - // // inlining DiskId // // always have these fields // /** @@ -260,105 +305,110 @@ public class VersionedThinDiskLRURegionEntryOffHeapUUIDKey // // persistent // /** unique entry identifier * */ // private long keyId; + + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // lru code @Override public void setDelayedDiskId(LocalRegion r) { + DiskStoreImpl ds = r.getDiskStore(); long maxOplogSize = ds.getMaxOplogSize(); this.id = DiskId.createDiskId(maxOplogSize, false /* over flow only */, ds.needsLinkedList()); + + + } - public final synchronized int updateEntrySize(EnableLRU capacityController) { + public synchronized int updateEntrySize(EnableLRU capacityController) { return updateEntrySize(capacityController, _getValue()); // OFHEAP: _getValue ok w/o incing // refcount because we are synced and // only getting the size } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp - public final synchronized int updateEntrySize(EnableLRU capacityController, Object value) { + + public synchronized int updateEntrySize(EnableLRU capacityController, Object value) { int oldSize = getEntrySize(); int newSize = capacityController.entrySize(getKeyForSizing(), value); setEntrySize(newSize); int delta = newSize - oldSize; - // if ( debug ) log( "updateEntrySize key=" + getKey() - // + (_getValue() == Token.INVALID ? " invalid" : - // (_getValue() == Token.LOCAL_INVALID ? "local_invalid" : - // (_getValue()==null ? " evicted" : " valid"))) - // + " oldSize=" + oldSize - // + " newSize=" + this.size ); return delta; } - public final boolean testRecentlyUsed() { + public boolean testRecentlyUsed() { return areAnyBitsSet(RECENTLY_USED); } @Override - public final void setRecentlyUsed() { + public void setRecentlyUsed() { setBits(RECENTLY_USED); } - public final void unsetRecentlyUsed() { + public void unsetRecentlyUsed() { clearBits(~RECENTLY_USED); } - public final boolean testEvicted() { + public boolean testEvicted() { return areAnyBitsSet(EVICTED); } - public final void setEvicted() { + public void setEvicted() { setBits(EVICTED); } - public final void unsetEvicted() { + public void unsetEvicted() { clearBits(~EVICTED); } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + private LRUClockNode nextLRU; private LRUClockNode prevLRU; private int size; - public final void setNextLRUNode(LRUClockNode next) { + public void setNextLRUNode(LRUClockNode next) { this.nextLRU = next; } - public final LRUClockNode nextLRUNode() { + public LRUClockNode nextLRUNode() { return this.nextLRU; } - public final void setPrevLRUNode(LRUClockNode prev) { + public void setPrevLRUNode(LRUClockNode prev) { this.prevLRU = prev; } - public final LRUClockNode prevLRUNode() { + public LRUClockNode prevLRUNode() { return this.prevLRU; } - public final int getEntrySize() { + public int getEntrySize() { return this.size; } - protected final void setEntrySize(int size) { + protected void setEntrySize(int size) { this.size = size; } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp - // @Override - // public StringBuilder appendFieldsToString(final StringBuilder sb) { - // StringBuilder result = super.appendFieldsToString(sb); - // result.append("; prev=").append(this.prevLRU==null?"null":"not null"); - // result.append("; next=").append(this.nextLRU==null?"null":"not null"); - // return result; - // } + @Override public Object getKeyForSizing() { + + + // inline keys always report null for sizing since the size comes from the entry size return null; + } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // versioned code private VersionSource memberID; private short entryVersionLowBytes; @@ -375,6 +425,7 @@ public class VersionedThinDiskLRURegionEntryOffHeapUUIDKey return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -392,6 +443,7 @@ public class VersionedThinDiskLRURegionEntryOffHeapUUIDKey } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public void setVersions(VersionTag tag) { this.memberID = tag.getMemberID(); int eVersion = tag.getEntryVersion(); @@ -421,6 +473,7 @@ public class VersionedThinDiskLRURegionEntryOffHeapUUIDKey } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public VersionTag asVersionTag() { VersionTag tag = VersionTag.create(memberID); tag.setEntryVersion(getEntryVersion()); @@ -453,13 +506,16 @@ public class VersionedThinDiskLRURegionEntryOffHeapUUIDKey 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); } @@ -472,5 +528,8 @@ public class VersionedThinDiskLRURegionEntryOffHeapUUIDKey } return false; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp } + http://git-wip-us.apache.org/repos/asf/geode/blob/a4458531/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapIntKey.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapIntKey.java index 96e97f1..eefae22 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapIntKey.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapIntKey.java @@ -15,42 +15,71 @@ 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 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 VersionedThinDiskRegionEntryHeapIntKey extends VersionedThinDiskRegionEntryHeap { - public VersionedThinDiskRegionEntryHeapIntKey(RegionEntryContext context, int key, Object value) { - super(context, (value instanceof RecoveredEntry ? null : value)); + public VersionedThinDiskRegionEntryHeapIntKey(RegionEntryContext context, int key, + + + + Object value + + + + ) { + super(context, + + (value instanceof RecoveredEntry ? null : value) + + + + ); // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + initialize(context, value); + + + this.key = key; + } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // common code protected int hash; private HashEntry<Object, Object> next; @@ -59,10 +88,11 @@ public class VersionedThinDiskRegionEntryHeapIntKey extends VersionedThinDiskReg private static final AtomicLongFieldUpdater<VersionedThinDiskRegionEntryHeapIntKey> lastModifiedUpdater = AtomicLongFieldUpdater.newUpdater(VersionedThinDiskRegionEntryHeapIntKey.class, "lastModified"); + private volatile Object value; @Override - protected final Object getValueField() { + protected Object getValueField() { return this.value; } @@ -82,7 +112,7 @@ public class VersionedThinDiskRegionEntryHeapIntKey extends VersionedThinDiskReg /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -93,19 +123,22 @@ public class VersionedThinDiskRegionEntryHeapIntKey extends VersionedThinDiskReg /** * @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); } @@ -115,7 +148,9 @@ public class VersionedThinDiskRegionEntryHeapIntKey extends VersionedThinDiskReg 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; DiskStoreImpl ds = drs.getDiskStore(); @@ -140,7 +175,6 @@ public class VersionedThinDiskRegionEntryHeapIntKey extends VersionedThinDiskReg void setDiskId(RegionEntry old) { this.id = ((AbstractDiskRegionEntry) old).getDiskId(); } - // // inlining DiskId // // always have these fields // /** @@ -180,7 +214,11 @@ public class VersionedThinDiskRegionEntryHeapIntKey extends VersionedThinDiskReg // // 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; @@ -197,6 +235,7 @@ public class VersionedThinDiskRegionEntryHeapIntKey extends VersionedThinDiskReg return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -214,6 +253,7 @@ public class VersionedThinDiskRegionEntryHeapIntKey extends VersionedThinDiskReg } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public void setVersions(VersionTag tag) { this.memberID = tag.getMemberID(); int eVersion = tag.getEntryVersion(); @@ -243,6 +283,7 @@ public class VersionedThinDiskRegionEntryHeapIntKey extends VersionedThinDiskReg } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public VersionTag asVersionTag() { VersionTag tag = VersionTag.create(memberID); tag.setEntryVersion(getEntryVersion()); @@ -275,12 +316,17 @@ public class VersionedThinDiskRegionEntryHeapIntKey extends VersionedThinDiskReg return this.regionVersionLowBytes; } + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // key code + + + private final int key; @Override - public final Object getKey() { + public Object getKey() { return this.key; } @@ -291,5 +337,8 @@ public class VersionedThinDiskRegionEntryHeapIntKey extends VersionedThinDiskReg } return false; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp } + http://git-wip-us.apache.org/repos/asf/geode/blob/a4458531/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapLongKey.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapLongKey.java index 5d3199c..a52fc3c 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapLongKey.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapLongKey.java @@ -15,43 +15,71 @@ 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 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 VersionedThinDiskRegionEntryHeapLongKey extends VersionedThinDiskRegionEntryHeap { public VersionedThinDiskRegionEntryHeapLongKey(RegionEntryContext context, long key, - Object value) { - super(context, (value instanceof RecoveredEntry ? null : value)); + + + + Object value + + + + ) { + super(context, + + (value instanceof RecoveredEntry ? null : value) + + + + ); // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + initialize(context, value); + + + this.key = key; + } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // common code protected int hash; private HashEntry<Object, Object> next; @@ -60,10 +88,11 @@ public class VersionedThinDiskRegionEntryHeapLongKey extends VersionedThinDiskRe private static final AtomicLongFieldUpdater<VersionedThinDiskRegionEntryHeapLongKey> lastModifiedUpdater = AtomicLongFieldUpdater.newUpdater(VersionedThinDiskRegionEntryHeapLongKey.class, "lastModified"); + private volatile Object value; @Override - protected final Object getValueField() { + protected Object getValueField() { return this.value; } @@ -83,7 +112,7 @@ public class VersionedThinDiskRegionEntryHeapLongKey extends VersionedThinDiskRe /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -94,19 +123,22 @@ public class VersionedThinDiskRegionEntryHeapLongKey extends VersionedThinDiskRe /** * @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); } @@ -116,7 +148,9 @@ public class VersionedThinDiskRegionEntryHeapLongKey extends VersionedThinDiskRe 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; DiskStoreImpl ds = drs.getDiskStore(); @@ -141,7 +175,6 @@ public class VersionedThinDiskRegionEntryHeapLongKey extends VersionedThinDiskRe void setDiskId(RegionEntry old) { this.id = ((AbstractDiskRegionEntry) old).getDiskId(); } - // // inlining DiskId // // always have these fields // /** @@ -181,7 +214,11 @@ public class VersionedThinDiskRegionEntryHeapLongKey extends VersionedThinDiskRe // // 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; @@ -198,6 +235,7 @@ public class VersionedThinDiskRegionEntryHeapLongKey extends VersionedThinDiskRe return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -215,6 +253,7 @@ public class VersionedThinDiskRegionEntryHeapLongKey extends VersionedThinDiskRe } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public void setVersions(VersionTag tag) { this.memberID = tag.getMemberID(); int eVersion = tag.getEntryVersion(); @@ -244,6 +283,7 @@ public class VersionedThinDiskRegionEntryHeapLongKey extends VersionedThinDiskRe } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public VersionTag asVersionTag() { VersionTag tag = VersionTag.create(memberID); tag.setEntryVersion(getEntryVersion()); @@ -276,12 +316,15 @@ public class VersionedThinDiskRegionEntryHeapLongKey extends VersionedThinDiskRe return this.regionVersionLowBytes; } + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // key code + private final long key; @Override - public final Object getKey() { + public Object getKey() { return this.key; } @@ -292,5 +335,8 @@ public class VersionedThinDiskRegionEntryHeapLongKey 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/a4458531/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapObjectKey.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapObjectKey.java index 8eb828b..8c9706c 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapObjectKey.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryHeapObjectKey.java @@ -15,43 +15,70 @@ 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 object: 1 // key int: KEY_INT // key long: KEY_LONG // key uuid: KEY_UUID // key string1: KEY_STRING1 // key string2: KEY_STRING2 + /** * Do not modify this class. It was generated. Instead modify LeafRegionEntry.cpp and then run * ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory). */ public class VersionedThinDiskRegionEntryHeapObjectKey extends VersionedThinDiskRegionEntryHeap { public VersionedThinDiskRegionEntryHeapObjectKey(RegionEntryContext context, Object key, - Object value) { - super(context, (value instanceof RecoveredEntry ? null : value)); + + + + Object value + + + + ) { + super(context, + + (value instanceof RecoveredEntry ? null : value) + + + + ); // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + initialize(context, value); + + this.key = key; + } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // common code protected int hash; private HashEntry<Object, Object> next; @@ -60,10 +87,11 @@ public class VersionedThinDiskRegionEntryHeapObjectKey extends VersionedThinDisk private static final AtomicLongFieldUpdater<VersionedThinDiskRegionEntryHeapObjectKey> lastModifiedUpdater = AtomicLongFieldUpdater.newUpdater(VersionedThinDiskRegionEntryHeapObjectKey.class, "lastModified"); + private volatile Object value; @Override - protected final Object getValueField() { + protected Object getValueField() { return this.value; } @@ -83,7 +111,7 @@ public class VersionedThinDiskRegionEntryHeapObjectKey extends VersionedThinDisk /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -94,19 +122,22 @@ public class VersionedThinDiskRegionEntryHeapObjectKey extends VersionedThinDisk /** * @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); } @@ -116,7 +147,9 @@ public class VersionedThinDiskRegionEntryHeapObjectKey extends VersionedThinDisk 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; DiskStoreImpl ds = drs.getDiskStore(); @@ -141,7 +174,6 @@ public class VersionedThinDiskRegionEntryHeapObjectKey extends VersionedThinDisk void setDiskId(RegionEntry old) { this.id = ((AbstractDiskRegionEntry) old).getDiskId(); } - // // inlining DiskId // // always have these fields // /** @@ -181,7 +213,11 @@ public class VersionedThinDiskRegionEntryHeapObjectKey extends VersionedThinDisk // // 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; @@ -198,6 +234,7 @@ public class VersionedThinDiskRegionEntryHeapObjectKey extends VersionedThinDisk return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -215,6 +252,7 @@ public class VersionedThinDiskRegionEntryHeapObjectKey extends VersionedThinDisk } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public void setVersions(VersionTag tag) { this.memberID = tag.getMemberID(); int eVersion = tag.getEntryVersion(); @@ -244,6 +282,7 @@ public class VersionedThinDiskRegionEntryHeapObjectKey extends VersionedThinDisk } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public VersionTag asVersionTag() { VersionTag tag = VersionTag.create(memberID); tag.setEntryVersion(getEntryVersion()); @@ -276,13 +315,19 @@ public class VersionedThinDiskRegionEntryHeapObjectKey extends VersionedThinDisk return this.regionVersionLowBytes; } + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // key code + private final Object key; @Override - public final Object getKey() { + public Object getKey() { return this.key; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp } + http://git-wip-us.apache.org/repos/asf/geode/blob/a4458531/geode-core/src/main/java/org/apache/geode/internal/cache/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..9491844 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,39 +15,63 @@ 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)); + + + + 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) { @@ -66,9 +90,11 @@ public class VersionedThinDiskRegionEntryHeapStringKey1 extends VersionedThinDis } 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; @@ -77,10 +103,11 @@ public class VersionedThinDiskRegionEntryHeapStringKey1 extends VersionedThinDis 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; } @@ -100,7 +127,7 @@ public class VersionedThinDiskRegionEntryHeapStringKey1 extends VersionedThinDis /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -111,19 +138,22 @@ public class VersionedThinDiskRegionEntryHeapStringKey1 extends VersionedThinDis /** * @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); } @@ -133,7 +163,9 @@ public class VersionedThinDiskRegionEntryHeapStringKey1 extends VersionedThinDis 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; DiskStoreImpl ds = drs.getDiskStore(); @@ -158,7 +190,6 @@ public class VersionedThinDiskRegionEntryHeapStringKey1 extends VersionedThinDis void setDiskId(RegionEntry old) { this.id = ((AbstractDiskRegionEntry) old).getDiskId(); } - // // inlining DiskId // // always have these fields // /** @@ -198,7 +229,11 @@ public class VersionedThinDiskRegionEntryHeapStringKey1 extends VersionedThinDis // // 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; @@ -215,6 +250,7 @@ public class VersionedThinDiskRegionEntryHeapStringKey1 extends VersionedThinDis return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -232,6 +268,7 @@ public class VersionedThinDiskRegionEntryHeapStringKey1 extends VersionedThinDis } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public void setVersions(VersionTag tag) { this.memberID = tag.getMemberID(); int eVersion = tag.getEntryVersion(); @@ -261,6 +298,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()); @@ -293,8 +331,11 @@ public class VersionedThinDiskRegionEntryHeapStringKey1 extends VersionedThinDis return this.regionVersionLowBytes; } + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // key code + private final long bits1; private int getKeyLength() { @@ -308,7 +349,7 @@ public class VersionedThinDiskRegionEntryHeapStringKey1 extends VersionedThinDis } @Override - public final Object getKey() { + public Object getKey() { int keylen = getKeyLength(); char[] chars = new char[keylen]; long tmpBits1 = this.bits1; @@ -327,6 +368,7 @@ 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) { @@ -356,5 +398,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/a4458531/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..bb21686 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,29 @@ 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,17 +45,33 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha // key long: KEY_LONG // key uuid: KEY_UUID // key string1: KEY_STRING1 -// key string2: KEY_STRING2 +// key string2: 1 + /** * Do not modify this class. It was generated. Instead modify LeafRegionEntry.cpp and then run * ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory). */ public class VersionedThinDiskRegionEntryHeapStringKey2 extends VersionedThinDiskRegionEntryHeap { public VersionedThinDiskRegionEntryHeapStringKey2(RegionEntryContext context, String key, - Object value, boolean byteEncode) { - super(context, (value instanceof RecoveredEntry ? null : value)); + + + + Object value + + , boolean byteEncode + + ) { + super(context, + + (value instanceof RecoveredEntry ? null : value) + + + + ); // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + initialize(context, value); + // caller has already confirmed that key.length <= MAX_INLINE_STRING_KEY long tmpBits1 = 0L; long tmpBits2 = 0L; @@ -78,9 +102,11 @@ 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; @@ -89,10 +115,11 @@ public class VersionedThinDiskRegionEntryHeapStringKey2 extends VersionedThinDis 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; } @@ -112,7 +139,7 @@ public class VersionedThinDiskRegionEntryHeapStringKey2 extends VersionedThinDis /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -123,19 +150,22 @@ public class VersionedThinDiskRegionEntryHeapStringKey2 extends VersionedThinDis /** * @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); } @@ -145,7 +175,9 @@ public class VersionedThinDiskRegionEntryHeapStringKey2 extends VersionedThinDis 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; DiskStoreImpl ds = drs.getDiskStore(); @@ -170,7 +202,6 @@ public class VersionedThinDiskRegionEntryHeapStringKey2 extends VersionedThinDis void setDiskId(RegionEntry old) { this.id = ((AbstractDiskRegionEntry) old).getDiskId(); } - // // inlining DiskId // // always have these fields // /** @@ -210,7 +241,11 @@ public class VersionedThinDiskRegionEntryHeapStringKey2 extends VersionedThinDis // // 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; @@ -227,6 +262,7 @@ public class VersionedThinDiskRegionEntryHeapStringKey2 extends VersionedThinDis return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -244,6 +280,7 @@ public class VersionedThinDiskRegionEntryHeapStringKey2 extends VersionedThinDis } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public void setVersions(VersionTag tag) { this.memberID = tag.getMemberID(); int eVersion = tag.getEntryVersion(); @@ -273,6 +310,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()); @@ -305,8 +343,11 @@ public class VersionedThinDiskRegionEntryHeapStringKey2 extends VersionedThinDis 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. @@ -325,7 +366,7 @@ public class VersionedThinDiskRegionEntryHeapStringKey2 extends VersionedThinDis } @Override - public final Object getKey() { + public Object getKey() { int keylen = getKeyLength(); char[] chars = new char[keylen]; long tmpBits1 = this.bits1; @@ -355,6 +396,7 @@ 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) { @@ -397,5 +439,7 @@ public class VersionedThinDiskRegionEntryHeapStringKey2 extends VersionedThinDis } return false; } + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp } +
