Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1B28A200C86 for ; Tue, 16 May 2017 21:28:41 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 19BA9160BD5; Tue, 16 May 2017 19:28:41 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 954D0160BD6 for ; Tue, 16 May 2017 21:28:35 +0200 (CEST) Received: (qmail 91907 invoked by uid 500); 16 May 2017 19:28:34 -0000 Mailing-List: contact commits-help@geode.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.apache.org Delivered-To: mailing list commits@geode.apache.org Received: (qmail 91283 invoked by uid 99); 16 May 2017 19:28:34 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 May 2017 19:28:34 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E1262E9637; Tue, 16 May 2017 19:28:33 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: klund@apache.org To: commits@geode.apache.org Date: Tue, 16 May 2017 19:28:41 -0000 Message-Id: <78707596d4a24c8cb0a898986d699b6c@git.apache.org> In-Reply-To: <4252f6b822c6451a8f6ff5183c485dec@git.apache.org> References: <4252f6b822c6451a8f6ff5183c485dec@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [09/33] geode git commit: GEODE-2929: remove superfluous uses of final from internal classes archived-at: Tue, 16 May 2017 19:28:41 -0000 http://git-wip-us.apache.org/repos/asf/geode/blob/a4458531/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..bf9380c 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,45 +15,74 @@ 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)); + + + + 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 next; @@ -62,10 +91,11 @@ public class VersionedThinDiskRegionEntryHeapUUIDKey extends VersionedThinDiskRe private static final AtomicLongFieldUpdater lastModifiedUpdater = AtomicLongFieldUpdater.newUpdater(VersionedThinDiskRegionEntryHeapUUIDKey.class, "lastModified"); + private volatile Object value; @Override - protected final Object getValueField() { + protected Object getValueField() { return this.value; } @@ -85,7 +115,7 @@ public class VersionedThinDiskRegionEntryHeapUUIDKey extends VersionedThinDiskRe /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -96,19 +126,22 @@ public class VersionedThinDiskRegionEntryHeapUUIDKey extends VersionedThinDiskRe /** * @see HashEntry#getNextEntry() */ - public final HashEntry getNextEntry() { + public HashEntry getNextEntry() { return this.next; } /** * @see HashEntry#setNextEntry */ - public final void setNextEntry(final HashEntry n) { + public void setNextEntry(final HashEntry 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); } @@ -118,7 +151,9 @@ public class VersionedThinDiskRegionEntryHeapUUIDKey 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(); @@ -143,7 +178,6 @@ public class VersionedThinDiskRegionEntryHeapUUIDKey extends VersionedThinDiskRe void setDiskId(RegionEntry old) { this.id = ((AbstractDiskRegionEntry) old).getDiskId(); } - // // inlining DiskId // // always have these fields // /** @@ -183,7 +217,11 @@ public class VersionedThinDiskRegionEntryHeapUUIDKey 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; @@ -200,6 +238,7 @@ public class VersionedThinDiskRegionEntryHeapUUIDKey extends VersionedThinDiskRe return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -217,6 +256,7 @@ public class VersionedThinDiskRegionEntryHeapUUIDKey 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(); @@ -246,6 +286,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()); @@ -278,13 +319,16 @@ public class VersionedThinDiskRegionEntryHeapUUIDKey extends VersionedThinDiskRe 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); } @@ -297,5 +341,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/a4458531/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..cdfd226 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,47 +15,76 @@ 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)); + + @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 next; @@ -64,6 +93,7 @@ public class VersionedThinDiskRegionEntryOffHeapIntKey extends VersionedThinDisk private static final AtomicLongFieldUpdater lastModifiedUpdater = AtomicLongFieldUpdater.newUpdater(VersionedThinDiskRegionEntryOffHeapIntKey.class, "lastModified"); + /** * All access done using ohAddrUpdater so it is used even though the compiler can not tell it is. */ @@ -95,13 +125,19 @@ 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); } @@ -117,7 +153,9 @@ public class VersionedThinDiskRegionEntryOffHeapIntKey extends VersionedThinDisk } @Override + @Released + public void release() { OffHeapRegionEntryHelper.releaseEntry(this); } @@ -141,7 +179,7 @@ public class VersionedThinDiskRegionEntryOffHeapIntKey extends VersionedThinDisk /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -152,19 +190,22 @@ public class VersionedThinDiskRegionEntryOffHeapIntKey extends VersionedThinDisk /** * @see HashEntry#getNextEntry() */ - public final HashEntry getNextEntry() { + public HashEntry getNextEntry() { return this.next; } /** * @see HashEntry#setNextEntry */ - public final void setNextEntry(final HashEntry n) { + public void setNextEntry(final HashEntry 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); } @@ -174,7 +215,9 @@ public class VersionedThinDiskRegionEntryOffHeapIntKey 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(); @@ -199,7 +242,6 @@ public class VersionedThinDiskRegionEntryOffHeapIntKey extends VersionedThinDisk void setDiskId(RegionEntry old) { this.id = ((AbstractDiskRegionEntry) old).getDiskId(); } - // // inlining DiskId // // always have these fields // /** @@ -239,7 +281,11 @@ public class VersionedThinDiskRegionEntryOffHeapIntKey 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; @@ -256,6 +302,7 @@ public class VersionedThinDiskRegionEntryOffHeapIntKey extends VersionedThinDisk return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -273,6 +320,7 @@ public class VersionedThinDiskRegionEntryOffHeapIntKey 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(); @@ -302,6 +350,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()); @@ -334,12 +383,17 @@ public class VersionedThinDiskRegionEntryOffHeapIntKey extends VersionedThinDisk 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; } @@ -350,5 +404,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/a4458531/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..7ef2d5f 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,33 +15,43 @@ 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). @@ -49,14 +59,33 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha public class VersionedThinDiskRegionEntryOffHeapLongKey extends VersionedThinDiskRegionEntryOffHeap { public VersionedThinDiskRegionEntryOffHeapLongKey(RegionEntryContext context, long 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 next; @@ -65,6 +94,7 @@ public class VersionedThinDiskRegionEntryOffHeapLongKey private static final AtomicLongFieldUpdater lastModifiedUpdater = AtomicLongFieldUpdater.newUpdater(VersionedThinDiskRegionEntryOffHeapLongKey.class, "lastModified"); + /** * All access done using ohAddrUpdater so it is used even though the compiler can not tell it is. */ @@ -96,13 +126,19 @@ 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); } @@ -118,7 +154,9 @@ public class VersionedThinDiskRegionEntryOffHeapLongKey } @Override + @Released + public void release() { OffHeapRegionEntryHelper.releaseEntry(this); } @@ -142,7 +180,7 @@ public class VersionedThinDiskRegionEntryOffHeapLongKey /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -153,19 +191,22 @@ public class VersionedThinDiskRegionEntryOffHeapLongKey /** * @see HashEntry#getNextEntry() */ - public final HashEntry getNextEntry() { + public HashEntry getNextEntry() { return this.next; } /** * @see HashEntry#setNextEntry */ - public final void setNextEntry(final HashEntry n) { + public void setNextEntry(final HashEntry 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); } @@ -175,7 +216,9 @@ public class VersionedThinDiskRegionEntryOffHeapLongKey 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(); @@ -200,7 +243,6 @@ public class VersionedThinDiskRegionEntryOffHeapLongKey void setDiskId(RegionEntry old) { this.id = ((AbstractDiskRegionEntry) old).getDiskId(); } - // // inlining DiskId // // always have these fields // /** @@ -240,7 +282,11 @@ public class VersionedThinDiskRegionEntryOffHeapLongKey // // 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; @@ -257,6 +303,7 @@ public class VersionedThinDiskRegionEntryOffHeapLongKey return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -274,6 +321,7 @@ public class VersionedThinDiskRegionEntryOffHeapLongKey } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public void setVersions(VersionTag tag) { this.memberID = tag.getMemberID(); int eVersion = tag.getEntryVersion(); @@ -303,6 +351,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()); @@ -335,12 +384,15 @@ public class VersionedThinDiskRegionEntryOffHeapLongKey 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; } @@ -351,5 +403,8 @@ public class VersionedThinDiskRegionEntryOffHeapLongKey } 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/VersionedThinDiskRegionEntryOffHeapObjectKey.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapObjectKey.java index 77048f7..9f0055e 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapObjectKey.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapObjectKey.java @@ -15,33 +15,43 @@ 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 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). @@ -49,14 +59,32 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha public class VersionedThinDiskRegionEntryOffHeapObjectKey extends VersionedThinDiskRegionEntryOffHeap { public VersionedThinDiskRegionEntryOffHeapObjectKey(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 next; @@ -65,6 +93,7 @@ public class VersionedThinDiskRegionEntryOffHeapObjectKey private static final AtomicLongFieldUpdater lastModifiedUpdater = AtomicLongFieldUpdater.newUpdater(VersionedThinDiskRegionEntryOffHeapObjectKey.class, "lastModified"); + /** * All access done using ohAddrUpdater so it is used even though the compiler can not tell it is. */ @@ -96,13 +125,19 @@ public class VersionedThinDiskRegionEntryOffHeapObjectKey // 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); } @@ -118,7 +153,9 @@ public class VersionedThinDiskRegionEntryOffHeapObjectKey } @Override + @Released + public void release() { OffHeapRegionEntryHelper.releaseEntry(this); } @@ -142,7 +179,7 @@ public class VersionedThinDiskRegionEntryOffHeapObjectKey /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -153,19 +190,22 @@ public class VersionedThinDiskRegionEntryOffHeapObjectKey /** * @see HashEntry#getNextEntry() */ - public final HashEntry getNextEntry() { + public HashEntry getNextEntry() { return this.next; } /** * @see HashEntry#setNextEntry */ - public final void setNextEntry(final HashEntry n) { + public void setNextEntry(final HashEntry 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); } @@ -175,7 +215,9 @@ public class VersionedThinDiskRegionEntryOffHeapObjectKey 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(); @@ -200,7 +242,6 @@ public class VersionedThinDiskRegionEntryOffHeapObjectKey void setDiskId(RegionEntry old) { this.id = ((AbstractDiskRegionEntry) old).getDiskId(); } - // // inlining DiskId // // always have these fields // /** @@ -240,7 +281,11 @@ public class VersionedThinDiskRegionEntryOffHeapObjectKey // // 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; @@ -257,6 +302,7 @@ public class VersionedThinDiskRegionEntryOffHeapObjectKey return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -274,6 +320,7 @@ public class VersionedThinDiskRegionEntryOffHeapObjectKey } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public void setVersions(VersionTag tag) { this.memberID = tag.getMemberID(); int eVersion = tag.getEntryVersion(); @@ -303,6 +350,7 @@ public class VersionedThinDiskRegionEntryOffHeapObjectKey } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public VersionTag asVersionTag() { VersionTag tag = VersionTag.create(memberID); tag.setEntryVersion(getEntryVersion()); @@ -335,13 +383,19 @@ public class VersionedThinDiskRegionEntryOffHeapObjectKey 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/VersionedThinDiskRegionEntryOffHeapStringKey1.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapStringKey1.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapStringKey1.java index c2b9845..34b5e68 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapStringKey1.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapStringKey1.java @@ -15,33 +15,43 @@ 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 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). @@ -49,10 +59,25 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha public class VersionedThinDiskRegionEntryOffHeapStringKey1 extends VersionedThinDiskRegionEntryOffHeap { public VersionedThinDiskRegionEntryOffHeapStringKey1(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) { @@ -71,9 +96,11 @@ public class VersionedThinDiskRegionEntryOffHeapStringKey1 } tmpBits1 |= key.length(); this.bits1 = tmpBits1; + } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // common code protected int hash; private HashEntry next; @@ -82,6 +109,7 @@ public class VersionedThinDiskRegionEntryOffHeapStringKey1 private static final AtomicLongFieldUpdater lastModifiedUpdater = AtomicLongFieldUpdater.newUpdater(VersionedThinDiskRegionEntryOffHeapStringKey1.class, "lastModified"); + /** * All access done using ohAddrUpdater so it is used even though the compiler can not tell it is. */ @@ -113,13 +141,19 @@ public class VersionedThinDiskRegionEntryOffHeapStringKey1 // 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); } @@ -135,7 +169,9 @@ public class VersionedThinDiskRegionEntryOffHeapStringKey1 } @Override + @Released + public void release() { OffHeapRegionEntryHelper.releaseEntry(this); } @@ -159,7 +195,7 @@ public class VersionedThinDiskRegionEntryOffHeapStringKey1 /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -170,19 +206,22 @@ public class VersionedThinDiskRegionEntryOffHeapStringKey1 /** * @see HashEntry#getNextEntry() */ - public final HashEntry getNextEntry() { + public HashEntry getNextEntry() { return this.next; } /** * @see HashEntry#setNextEntry */ - public final void setNextEntry(final HashEntry n) { + public void setNextEntry(final HashEntry 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); } @@ -192,7 +231,9 @@ public class VersionedThinDiskRegionEntryOffHeapStringKey1 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(); @@ -217,7 +258,6 @@ public class VersionedThinDiskRegionEntryOffHeapStringKey1 void setDiskId(RegionEntry old) { this.id = ((AbstractDiskRegionEntry) old).getDiskId(); } - // // inlining DiskId // // always have these fields // /** @@ -257,7 +297,11 @@ public class VersionedThinDiskRegionEntryOffHeapStringKey1 // // 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; @@ -274,6 +318,7 @@ public class VersionedThinDiskRegionEntryOffHeapStringKey1 return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -291,6 +336,7 @@ public class VersionedThinDiskRegionEntryOffHeapStringKey1 } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public void setVersions(VersionTag tag) { this.memberID = tag.getMemberID(); int eVersion = tag.getEntryVersion(); @@ -320,6 +366,7 @@ public class VersionedThinDiskRegionEntryOffHeapStringKey1 } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public VersionTag asVersionTag() { VersionTag tag = VersionTag.create(memberID); tag.setEntryVersion(getEntryVersion()); @@ -352,8 +399,11 @@ public class VersionedThinDiskRegionEntryOffHeapStringKey1 return this.regionVersionLowBytes; } + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // key code + private final long bits1; private int getKeyLength() { @@ -367,7 +417,7 @@ public class VersionedThinDiskRegionEntryOffHeapStringKey1 } @Override - public final Object getKey() { + public Object getKey() { int keylen = getKeyLength(); char[] chars = new char[keylen]; long tmpBits1 = this.bits1; @@ -386,6 +436,7 @@ public class VersionedThinDiskRegionEntryOffHeapStringKey1 } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + @Override public boolean isKeyEqual(Object k) { if (k instanceof String) { @@ -415,5 +466,8 @@ public class VersionedThinDiskRegionEntryOffHeapStringKey1 } 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/VersionedThinDiskRegionEntryOffHeapStringKey2.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapStringKey2.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapStringKey2.java index 0e3a75c..1fd7871 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapStringKey2.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapStringKey2.java @@ -15,33 +15,43 @@ 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 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). @@ -49,10 +59,25 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha public class VersionedThinDiskRegionEntryOffHeapStringKey2 extends VersionedThinDiskRegionEntryOffHeap { public VersionedThinDiskRegionEntryOffHeapStringKey2(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; @@ -83,9 +108,11 @@ public class VersionedThinDiskRegionEntryOffHeapStringKey2 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 next; @@ -94,6 +121,7 @@ public class VersionedThinDiskRegionEntryOffHeapStringKey2 private static final AtomicLongFieldUpdater lastModifiedUpdater = AtomicLongFieldUpdater.newUpdater(VersionedThinDiskRegionEntryOffHeapStringKey2.class, "lastModified"); + /** * All access done using ohAddrUpdater so it is used even though the compiler can not tell it is. */ @@ -125,13 +153,19 @@ public class VersionedThinDiskRegionEntryOffHeapStringKey2 // 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); } @@ -147,7 +181,9 @@ public class VersionedThinDiskRegionEntryOffHeapStringKey2 } @Override + @Released + public void release() { OffHeapRegionEntryHelper.releaseEntry(this); } @@ -171,7 +207,7 @@ public class VersionedThinDiskRegionEntryOffHeapStringKey2 /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -182,19 +218,22 @@ public class VersionedThinDiskRegionEntryOffHeapStringKey2 /** * @see HashEntry#getNextEntry() */ - public final HashEntry getNextEntry() { + public HashEntry getNextEntry() { return this.next; } /** * @see HashEntry#setNextEntry */ - public final void setNextEntry(final HashEntry n) { + public void setNextEntry(final HashEntry 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); } @@ -204,7 +243,9 @@ public class VersionedThinDiskRegionEntryOffHeapStringKey2 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(); @@ -229,7 +270,6 @@ public class VersionedThinDiskRegionEntryOffHeapStringKey2 void setDiskId(RegionEntry old) { this.id = ((AbstractDiskRegionEntry) old).getDiskId(); } - // // inlining DiskId // // always have these fields // /** @@ -269,7 +309,11 @@ public class VersionedThinDiskRegionEntryOffHeapStringKey2 // // 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; @@ -286,6 +330,7 @@ public class VersionedThinDiskRegionEntryOffHeapStringKey2 return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -303,6 +348,7 @@ public class VersionedThinDiskRegionEntryOffHeapStringKey2 } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public void setVersions(VersionTag tag) { this.memberID = tag.getMemberID(); int eVersion = tag.getEntryVersion(); @@ -332,6 +378,7 @@ public class VersionedThinDiskRegionEntryOffHeapStringKey2 } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public VersionTag asVersionTag() { VersionTag tag = VersionTag.create(memberID); tag.setEntryVersion(getEntryVersion()); @@ -364,8 +411,11 @@ public class VersionedThinDiskRegionEntryOffHeapStringKey2 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. @@ -384,7 +434,7 @@ public class VersionedThinDiskRegionEntryOffHeapStringKey2 } @Override - public final Object getKey() { + public Object getKey() { int keylen = getKeyLength(); char[] chars = new char[keylen]; long tmpBits1 = this.bits1; @@ -414,6 +464,7 @@ public class VersionedThinDiskRegionEntryOffHeapStringKey2 } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + @Override public boolean isKeyEqual(Object k) { if (k instanceof String) { @@ -456,5 +507,7 @@ public class VersionedThinDiskRegionEntryOffHeapStringKey2 } 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/VersionedThinDiskRegionEntryOffHeapUUIDKey.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapUUIDKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapUUIDKey.java index 751e8dd..59ab436 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapUUIDKey.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinDiskRegionEntryOffHeapUUIDKey.java @@ -15,34 +15,45 @@ 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.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 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). @@ -50,15 +61,34 @@ import org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.Ha public class VersionedThinDiskRegionEntryOffHeapUUIDKey extends VersionedThinDiskRegionEntryOffHeap { public VersionedThinDiskRegionEntryOffHeapUUIDKey(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 next; @@ -67,6 +97,7 @@ public class VersionedThinDiskRegionEntryOffHeapUUIDKey private static final AtomicLongFieldUpdater lastModifiedUpdater = AtomicLongFieldUpdater.newUpdater(VersionedThinDiskRegionEntryOffHeapUUIDKey.class, "lastModified"); + /** * All access done using ohAddrUpdater so it is used even though the compiler can not tell it is. */ @@ -98,13 +129,19 @@ public class VersionedThinDiskRegionEntryOffHeapUUIDKey // 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); } @@ -120,7 +157,9 @@ public class VersionedThinDiskRegionEntryOffHeapUUIDKey } @Override + @Released + public void release() { OffHeapRegionEntryHelper.releaseEntry(this); } @@ -144,7 +183,7 @@ public class VersionedThinDiskRegionEntryOffHeapUUIDKey /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -155,19 +194,22 @@ public class VersionedThinDiskRegionEntryOffHeapUUIDKey /** * @see HashEntry#getNextEntry() */ - public final HashEntry getNextEntry() { + public HashEntry getNextEntry() { return this.next; } /** * @see HashEntry#setNextEntry */ - public final void setNextEntry(final HashEntry n) { + public void setNextEntry(final HashEntry 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); } @@ -177,7 +219,9 @@ public class VersionedThinDiskRegionEntryOffHeapUUIDKey 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(); @@ -202,7 +246,6 @@ public class VersionedThinDiskRegionEntryOffHeapUUIDKey void setDiskId(RegionEntry old) { this.id = ((AbstractDiskRegionEntry) old).getDiskId(); } - // // inlining DiskId // // always have these fields // /** @@ -242,7 +285,11 @@ public class VersionedThinDiskRegionEntryOffHeapUUIDKey // // 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; @@ -259,6 +306,7 @@ public class VersionedThinDiskRegionEntryOffHeapUUIDKey return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -276,6 +324,7 @@ public class VersionedThinDiskRegionEntryOffHeapUUIDKey } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public void setVersions(VersionTag tag) { this.memberID = tag.getMemberID(); int eVersion = tag.getEntryVersion(); @@ -305,6 +354,7 @@ public class VersionedThinDiskRegionEntryOffHeapUUIDKey } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public VersionTag asVersionTag() { VersionTag tag = VersionTag.create(memberID); tag.setEntryVersion(getEntryVersion()); @@ -337,13 +387,16 @@ public class VersionedThinDiskRegionEntryOffHeapUUIDKey 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); } @@ -356,5 +409,8 @@ public class VersionedThinDiskRegionEntryOffHeapUUIDKey } 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/VersionedThinLRURegionEntryHeapIntKey.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapIntKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapIntKey.java index 8d4d2b0..79520c1 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapIntKey.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapIntKey.java @@ -15,43 +15,72 @@ 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.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.util.concurrent.CustomEntryConcurrentHashMap.HashEntry; // macros whose definition changes this class: // disk: DISK -// lru: LRU +// lru: 1 // 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 VersionedThinLRURegionEntryHeapIntKey extends VersionedThinLRURegionEntryHeap { - public VersionedThinLRURegionEntryHeapIntKey(RegionEntryContext context, int key, Object value) { - super(context, value); + public VersionedThinLRURegionEntryHeapIntKey(RegionEntryContext context, int key, + + + + Object value + + + + ) { + super(context, + + + + value + + ); // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + + + this.key = key; + } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // common code protected int hash; private HashEntry next; @@ -60,10 +89,11 @@ public class VersionedThinLRURegionEntryHeapIntKey extends VersionedThinLRURegio private static final AtomicLongFieldUpdater lastModifiedUpdater = AtomicLongFieldUpdater.newUpdater(VersionedThinLRURegionEntryHeapIntKey.class, "lastModified"); + private volatile Object value; @Override - protected final Object getValueField() { + protected Object getValueField() { return this.value; } @@ -83,7 +113,7 @@ public class VersionedThinLRURegionEntryHeapIntKey extends VersionedThinLRURegio /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -94,114 +124,118 @@ public class VersionedThinLRURegionEntryHeapIntKey extends VersionedThinLRURegio /** * @see HashEntry#getNextEntry() */ - public final HashEntry getNextEntry() { + public HashEntry getNextEntry() { return this.next; } /** * @see HashEntry#setNextEntry */ - public final void setNextEntry(final HashEntry n) { + public void setNextEntry(final HashEntry n) { this.next = n; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // lru code @Override public void setDelayedDiskId(LocalRegion r) { + + + // nothing needed for LRUs with no disk + } - 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; @@ -218,6 +252,7 @@ public class VersionedThinLRURegionEntryHeapIntKey extends VersionedThinLRURegio return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -235,6 +270,7 @@ public class VersionedThinLRURegionEntryHeapIntKey extends VersionedThinLRURegio } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public void setVersions(VersionTag tag) { this.memberID = tag.getMemberID(); int eVersion = tag.getEntryVersion(); @@ -264,6 +300,7 @@ public class VersionedThinLRURegionEntryHeapIntKey extends VersionedThinLRURegio } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public VersionTag asVersionTag() { VersionTag tag = VersionTag.create(memberID); tag.setEntryVersion(getEntryVersion()); @@ -296,12 +333,17 @@ public class VersionedThinLRURegionEntryHeapIntKey extends VersionedThinLRURegio 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; } @@ -312,5 +354,8 @@ public class VersionedThinLRURegionEntryHeapIntKey extends VersionedThinLRURegio } 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/VersionedThinLRURegionEntryHeapLongKey.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapLongKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapLongKey.java index b552bf9..3f8145e 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapLongKey.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapLongKey.java @@ -15,44 +15,72 @@ 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.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.util.concurrent.CustomEntryConcurrentHashMap.HashEntry; // macros whose definition changes this class: // disk: DISK -// lru: LRU +// lru: 1 // 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 VersionedThinLRURegionEntryHeapLongKey extends VersionedThinLRURegionEntryHeap { public VersionedThinLRURegionEntryHeapLongKey(RegionEntryContext context, long key, - Object value) { - super(context, value); + + + + Object value + + + + ) { + super(context, + + + + value + + ); // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + + + this.key = key; + } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // common code protected int hash; private HashEntry next; @@ -61,10 +89,11 @@ public class VersionedThinLRURegionEntryHeapLongKey extends VersionedThinLRURegi private static final AtomicLongFieldUpdater lastModifiedUpdater = AtomicLongFieldUpdater.newUpdater(VersionedThinLRURegionEntryHeapLongKey.class, "lastModified"); + private volatile Object value; @Override - protected final Object getValueField() { + protected Object getValueField() { return this.value; } @@ -84,7 +113,7 @@ public class VersionedThinLRURegionEntryHeapLongKey extends VersionedThinLRURegi /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -95,114 +124,118 @@ public class VersionedThinLRURegionEntryHeapLongKey extends VersionedThinLRURegi /** * @see HashEntry#getNextEntry() */ - public final HashEntry getNextEntry() { + public HashEntry getNextEntry() { return this.next; } /** * @see HashEntry#setNextEntry */ - public final void setNextEntry(final HashEntry n) { + public void setNextEntry(final HashEntry n) { this.next = n; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // lru code @Override public void setDelayedDiskId(LocalRegion r) { + + + // nothing needed for LRUs with no disk + } - 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; @@ -219,6 +252,7 @@ public class VersionedThinLRURegionEntryHeapLongKey extends VersionedThinLRURegi return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -236,6 +270,7 @@ public class VersionedThinLRURegionEntryHeapLongKey extends VersionedThinLRURegi } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public void setVersions(VersionTag tag) { this.memberID = tag.getMemberID(); int eVersion = tag.getEntryVersion(); @@ -265,6 +300,7 @@ public class VersionedThinLRURegionEntryHeapLongKey extends VersionedThinLRURegi } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public VersionTag asVersionTag() { VersionTag tag = VersionTag.create(memberID); tag.setEntryVersion(getEntryVersion()); @@ -297,12 +333,15 @@ public class VersionedThinLRURegionEntryHeapLongKey extends VersionedThinLRURegi 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; } @@ -313,5 +352,8 @@ public class VersionedThinLRURegionEntryHeapLongKey extends VersionedThinLRURegi } 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/VersionedThinLRURegionEntryHeapObjectKey.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapObjectKey.java b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapObjectKey.java index 316418c..e30c9c4 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapObjectKey.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/VersionedThinLRURegionEntryHeapObjectKey.java @@ -15,44 +15,72 @@ 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.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.util.concurrent.CustomEntryConcurrentHashMap.HashEntry; // macros whose definition changes this class: // disk: DISK -// lru: LRU +// lru: 1 // 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 VersionedThinLRURegionEntryHeapObjectKey extends VersionedThinLRURegionEntryHeap { public VersionedThinLRURegionEntryHeapObjectKey(RegionEntryContext context, Object key, - Object value) { - super(context, value); + + + + Object value + + + + ) { + super(context, + + + + value + + ); // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + + + this.key = key; + } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // common code protected int hash; private HashEntry next; @@ -61,10 +89,11 @@ public class VersionedThinLRURegionEntryHeapObjectKey extends VersionedThinLRURe private static final AtomicLongFieldUpdater lastModifiedUpdater = AtomicLongFieldUpdater.newUpdater(VersionedThinLRURegionEntryHeapObjectKey.class, "lastModified"); + private volatile Object value; @Override - protected final Object getValueField() { + protected Object getValueField() { return this.value; } @@ -84,7 +113,7 @@ public class VersionedThinLRURegionEntryHeapObjectKey extends VersionedThinLRURe /** * @see HashEntry#getEntryHash() */ - public final int getEntryHash() { + public int getEntryHash() { return this.hash; } @@ -95,114 +124,118 @@ public class VersionedThinLRURegionEntryHeapObjectKey extends VersionedThinLRURe /** * @see HashEntry#getNextEntry() */ - public final HashEntry getNextEntry() { + public HashEntry getNextEntry() { return this.next; } /** * @see HashEntry#setNextEntry */ - public final void setNextEntry(final HashEntry n) { + public void setNextEntry(final HashEntry n) { this.next = n; } + + // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + // lru code @Override public void setDelayedDiskId(LocalRegion r) { + + + // nothing needed for LRUs with no disk + } - 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; @@ -219,6 +252,7 @@ public class VersionedThinLRURegionEntryHeapObjectKey extends VersionedThinLRURe return (((long) regionVersionHighBytes) << 32) | (regionVersionLowBytes & 0x00000000FFFFFFFFL); } + public long getVersionTimeStamp() { return getLastModified(); } @@ -236,6 +270,7 @@ public class VersionedThinLRURegionEntryHeapObjectKey extends VersionedThinLRURe } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public void setVersions(VersionTag tag) { this.memberID = tag.getMemberID(); int eVersion = tag.getEntryVersion(); @@ -265,6 +300,7 @@ public class VersionedThinLRURegionEntryHeapObjectKey extends VersionedThinLRURe } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp + public VersionTag asVersionTag() { VersionTag tag = VersionTag.create(memberID); tag.setEntryVersion(getEntryVersion()); @@ -297,13 +333,19 @@ public class VersionedThinLRURegionEntryHeapObjectKey extends VersionedThinLRURe 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 } +