Return-Path: X-Original-To: apmail-geode-commits-archive@minotaur.apache.org Delivered-To: apmail-geode-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CA3FE18F92 for ; Thu, 28 Apr 2016 23:09:47 +0000 (UTC) Received: (qmail 10884 invoked by uid 500); 28 Apr 2016 23:09:47 -0000 Delivered-To: apmail-geode-commits-archive@geode.apache.org Received: (qmail 10847 invoked by uid 500); 28 Apr 2016 23:09:47 -0000 Mailing-List: contact commits-help@geode.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.incubator.apache.org Delivered-To: mailing list commits@geode.incubator.apache.org Received: (qmail 10834 invoked by uid 99); 28 Apr 2016 23:09:47 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Apr 2016 23:09:47 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 4DDAEC0257 for ; Thu, 28 Apr 2016 23:09:47 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -3.221 X-Spam-Level: X-Spam-Status: No, score=-3.221 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id sJjQ2MAOtI9D for ; Thu, 28 Apr 2016 23:09:45 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id 139F75FCDA for ; Thu, 28 Apr 2016 23:09:41 +0000 (UTC) Received: (qmail 9070 invoked by uid 99); 28 Apr 2016 23:09:40 -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; Thu, 28 Apr 2016 23:09:40 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 98DF5DFFB9; Thu, 28 Apr 2016 23:09:40 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: klund@apache.org To: commits@geode.incubator.apache.org Date: Thu, 28 Apr 2016 23:09:56 -0000 Message-Id: <17a162f20d5241f4b088369feec92a55@git.apache.org> In-Reply-To: <82e5948c82d540f8bec515c234fa1706@git.apache.org> References: <82e5948c82d540f8bec515c234fa1706@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [17/50] [abbrv] incubator-geode git commit: GEODE-1304: remove TODO OFFHEAP comments http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/44f403d9/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java index b4efd21..b0b1a32 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java @@ -826,7 +826,6 @@ public class ParallelGatewaySenderQueue implements RegionQueue { // this.bucketToTempQueueMap.put(bucketId, tempQueue); // } tempQueue.add(value); - // TODO OFFHEAP is value refCount ok here? // For debugging purpose. if (isDebugEnabled) { logger.debug("The value {} is enqueued to the tempQueue for the BucketRegionQueue.", value); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/44f403d9/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/AbstractStoredObject.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/AbstractStoredObject.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/AbstractStoredObject.java index 22e2d55..7e6ac93 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/AbstractStoredObject.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/AbstractStoredObject.java @@ -116,7 +116,6 @@ public abstract class AbstractStoredObject implements StoredObject { if (!isSerialized()) { return false; } - // TODO OFFHEAP: what if the data is compressed? byte dsCode = this.readDataByte(0); return dsCode == DSCODE.PDX || dsCode == DSCODE.PDX_ENUM || dsCode == DSCODE.PDX_INLINE_ENUM; } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/44f403d9/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/FreeListManager.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/FreeListManager.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/FreeListManager.java index 6de7be9..c5e17e8 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/FreeListManager.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/FreeListManager.java @@ -304,13 +304,6 @@ public class FreeListManager { /** * Defragments memory and returns true if enough memory to allocate chunkSize * is freed. Otherwise returns false; - * TODO OFFHEAP: what should be done about contiguous chunks that end up being bigger than 2G? - * Currently if we are given slabs bigger than 2G or that just happen to be contiguous and add - * up to 2G then the FreeListManager may unify them together into a single Chunk and our 32-bit chunkSize - * field will overflow. This code needs to detect this and just create a chunk of 2G and then start - * a new one. - * Or to prevent it from happening we could just check the incoming slabs and throw away a few bytes - * to keep them from being contiguous. */ boolean defragment(int chunkSize) { final long startDefragmentationTime = this.ma.getStats().startDefragmentation(); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/44f403d9/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/OffHeapStoredObject.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/OffHeapStoredObject.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/OffHeapStoredObject.java index 9861a54..c2066b4 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/OffHeapStoredObject.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/OffHeapStoredObject.java @@ -165,7 +165,6 @@ import com.gemstone.gemfire.internal.offheap.annotations.Unretained; // Hopefully the jvm is smart enough to use our stack for this short lived array. final byte[] dataCache1 = new byte[1024]; final byte[] dataCache2 = new byte[dataCache1.length]; - // TODO OFFHEAP: no need to copy to heap. Just get the address of each and compare each byte. No need to call incReads when reading from address. int i; // inc it twice since we are reading two different objects MemoryAllocatorImpl.getAllocator().getStats().incReads(); @@ -202,7 +201,6 @@ import com.gemstone.gemfire.internal.offheap.annotations.Unretained; } // We want to be able to do this operation without copying any of the data into the heap. // Hopefully the jvm is smart enough to use our stack for this short lived array. - // TODO OFFHEAP: no need to copy to heap. Just get the address of each and compare each byte. No need to call incReads when reading from address. final byte[] dataCache = new byte[1024]; int idx=0; int i; @@ -421,7 +419,6 @@ import com.gemstone.gemfire.internal.offheap.annotations.Unretained; } protected byte[] getRawBytes() { byte[] result = getCompressedBytes(); - // TODO OFFHEAP: change the following to assert !isCompressed(); if (isCompressed()) { throw new UnsupportedOperationException(); } @@ -441,10 +438,7 @@ import com.gemstone.gemfire.internal.offheap.annotations.Unretained; @Override public Object getDeserializedValue(Region r, RegionEntry re) { if (isSerialized()) { - // TODO OFFHEAP: debug deserializeChunk return EntryEventImpl.deserialize(getRawBytes()); - //assert !isCompressed(); - //return EntryEventImpl.deserializeChunk(this); } else { return getRawBytes(); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/44f403d9/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/TinyStoredObject.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/TinyStoredObject.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/TinyStoredObject.java index e8878fa..aee1b15 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/TinyStoredObject.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/TinyStoredObject.java @@ -160,7 +160,6 @@ public class TinyStoredObject extends AbstractStoredObject { @Override public byte readDataByte(int offset) { - // TODO OFFHEAP: what if the data is compressed? return getRawBytes()[offset]; } @@ -181,7 +180,6 @@ public class TinyStoredObject extends AbstractStoredObject { @Override public void readDataBytes(int offset, byte[] bytes, int bytesOffset, int size) { - // TODO OFFHEAP: what if the data is compressed? byte[] src = getRawBytes(); int dstIdx = bytesOffset; for (int i = offset; i < offset+size; i++) { @@ -206,13 +204,11 @@ public class TinyStoredObject extends AbstractStoredObject { @Override public boolean checkDataEquals(StoredObject so) { - // TODO OFFHEAP: what if the data is compressed? return equals(so); } @Override public boolean checkDataEquals(byte[] serializedObj) { - // TODO OFFHEAP: what if the data is compressed? byte[] myBytes = getSerializedValue(); return Arrays.equals(myBytes, serializedObj); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/44f403d9/geode-core/src/main/java/com/gemstone/gemfire/internal/tcp/MsgStreamer.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/tcp/MsgStreamer.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/tcp/MsgStreamer.java index 9fb2eb8..d3941bc 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/tcp/MsgStreamer.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/tcp/MsgStreamer.java @@ -64,12 +64,6 @@ public class MsgStreamer extends OutputStream implements * Any exceptions that happen during sends */ private ConnectExceptions ce; - // TODO OFFHEAP: instead of MsgStreamer extending OutputStream - // we could have it extends HeapDataOutputStream. - // HDOS can now be given a direct ByteBuffer and told - // to not copy large byte sequences it is given. - // Also be it being a HDOS we can take advantage of code - // that is already optimized to pass Chunk direct ByteBuffers. /** * The byte buffer we used for preparing a chunk of the message. * Currently this buffer is obtained from the connection. @@ -408,10 +402,6 @@ public class MsgStreamer extends OutputStream implements return; } int len = bb.remaining(); - // TODO OFFHEAP: if len > remainingSpace and isOverflowMode() then - // (and the overflow HDOS has doNotCopy set?) it is probably better to not copy part of - // bb to this.buffer and then add the remainder of it to the HDOS. Instead - // we can just add the whole bb to the HDOS. while (len > 0) { int remainingSpace = this.buffer.capacity() - this.buffer.position(); if (remainingSpace == 0) { @@ -938,7 +928,6 @@ public class MsgStreamer extends OutputStream implements * will all fit into our current buffer. */ public final void writeAsSerializedByteArray(Object v) throws IOException { - // TODO OFFHEAP: update this class to take into account the "noCopy" mode added to HDOS and that we might be adding direct ByteBuffers to this. if (v instanceof HeapDataOutputStream) { HeapDataOutputStream other = (HeapDataOutputStream)v; InternalDataSerializer.writeArrayLength(other.size(), this); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/44f403d9/geode-core/src/main/java/com/gemstone/gemfire/pdx/internal/PdxReaderImpl.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/pdx/internal/PdxReaderImpl.java b/geode-core/src/main/java/com/gemstone/gemfire/pdx/internal/PdxReaderImpl.java index f4b133c..6771117 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/pdx/internal/PdxReaderImpl.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/pdx/internal/PdxReaderImpl.java @@ -889,9 +889,6 @@ public class PdxReaderImpl implements InternalPdxReader, java.io.Serializable { bytes = buffer.array(); } else{ - // TODO OFFHEAP: this is going to break once we have a ByteSource that is offheap. - // Should we just copy the offheap ByteSource to a heap byte[] here or change - // PdxString to work with a ByteSource? throw new IllegalStateException(); } int offset = getPositionForField(ft) + buffer.arrayOffset(); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/44f403d9/geode-core/src/test/java/com/gemstone/gemfire/cache/operations/internal/GetOperationContextImplJUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/operations/internal/GetOperationContextImplJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/operations/internal/GetOperationContextImplJUnitTest.java index 8efec6e..00aa506 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache/operations/internal/GetOperationContextImplJUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/operations/internal/GetOperationContextImplJUnitTest.java @@ -287,5 +287,4 @@ public class GetOperationContextImplJUnitTest { } } } - // @TODO OFFHEAP: add coverage of "release" and the gettors methods with StoreObject and off-heap Chunk values } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/44f403d9/geode-cq/src/main/java/com/gemstone/gemfire/cache/query/internal/cq/CqServiceImpl.java ---------------------------------------------------------------------- diff --git a/geode-cq/src/main/java/com/gemstone/gemfire/cache/query/internal/cq/CqServiceImpl.java b/geode-cq/src/main/java/com/gemstone/gemfire/cache/query/internal/cq/CqServiceImpl.java index 05e062c..9188e56 100644 --- a/geode-cq/src/main/java/com/gemstone/gemfire/cache/query/internal/cq/CqServiceImpl.java +++ b/geode-cq/src/main/java/com/gemstone/gemfire/cache/query/internal/cq/CqServiceImpl.java @@ -1398,7 +1398,7 @@ public final class CqServiceImpl implements CqService { // Get new value. If its not retrieved. if (cqUnfilteredEventsSet_newValue.isEmpty() && (event.getOperation().isCreate() || event.getOperation().isUpdate())) { - Object newValue = entryEvent.getNewValue(); // TODO OFFHEAP: optimize by not copying the value on to the heap + Object newValue = entryEvent.getNewValue(); if (newValue != null) { //We have a new value to run the query on cqUnfilteredEventsSet_newValue.add(newValue);