[jira] [Commented] (GEODE-1296) OffHeapStoredObject.getRawBytes should assert that it is not called on compressed data
[ https://issues.apache.org/jira/browse/GEODE-1296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15302372#comment-15302372 ] ASF subversion and git services commented on GEODE-1296: Commit 6c626b7ebc134d85160ff2d253ed12762fe49728 in incubator-geode's branch refs/heads/feature/GEODE-1452 from [~khowe] [ https://git-wip-us.apache.org/repos/asf?p=incubator-geode.git;h=6c626b7 ] GEODE-1296: change conditional in getRawBytes to assert > OffHeapStoredObject.getRawBytes should assert that it is not called on > compressed data > -- > > Key: GEODE-1296 > URL: https://issues.apache.org/jira/browse/GEODE-1296 > Project: Geode > Issue Type: Bug > Components: offheap >Reporter: Darrel Schneider >Assignee: Kenneth Howe > Fix For: 1.0.0-incubating.M3 > > > The current code does this: > if (isCompressed()) { > throw new UnsupportedOperationException(); > } > It would be more clear if it just did this: > assert !isCompressed(); -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (GEODE-1296) OffHeapStoredObject.getRawBytes should assert that it is not called on compressed data
[ https://issues.apache.org/jira/browse/GEODE-1296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15301008#comment-15301008 ] ASF subversion and git services commented on GEODE-1296: Commit 6c626b7ebc134d85160ff2d253ed12762fe49728 in incubator-geode's branch refs/heads/feature/GEODE-835 from [~khowe] [ https://git-wip-us.apache.org/repos/asf?p=incubator-geode.git;h=6c626b7 ] GEODE-1296: change conditional in getRawBytes to assert > OffHeapStoredObject.getRawBytes should assert that it is not called on > compressed data > -- > > Key: GEODE-1296 > URL: https://issues.apache.org/jira/browse/GEODE-1296 > Project: Geode > Issue Type: Bug > Components: offheap >Reporter: Darrel Schneider >Assignee: Kenneth Howe > Fix For: 1.0.0-incubating.M3 > > > The current code does this: > if (isCompressed()) { > throw new UnsupportedOperationException(); > } > It would be more clear if it just did this: > assert !isCompressed(); -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (GEODE-1296) OffHeapStoredObject.getRawBytes should assert that it is not called on compressed data
[ https://issues.apache.org/jira/browse/GEODE-1296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15300960#comment-15300960 ] ASF GitHub Bot commented on GEODE-1296: --- Github user pdxrunner commented on the pull request: https://github.com/apache/incubator-geode/pull/145#issuecomment-221722725 This was checked in by dschneider. Closing the PR > OffHeapStoredObject.getRawBytes should assert that it is not called on > compressed data > -- > > Key: GEODE-1296 > URL: https://issues.apache.org/jira/browse/GEODE-1296 > Project: Geode > Issue Type: Bug > Components: offheap >Reporter: Darrel Schneider >Assignee: Kenneth Howe > Fix For: 1.0.0-incubating.M3 > > > The current code does this: > if (isCompressed()) { > throw new UnsupportedOperationException(); > } > It would be more clear if it just did this: > assert !isCompressed(); -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (GEODE-1296) OffHeapStoredObject.getRawBytes should assert that it is not called on compressed data
[ https://issues.apache.org/jira/browse/GEODE-1296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15300961#comment-15300961 ] ASF GitHub Bot commented on GEODE-1296: --- Github user pdxrunner closed the pull request at: https://github.com/apache/incubator-geode/pull/145 > OffHeapStoredObject.getRawBytes should assert that it is not called on > compressed data > -- > > Key: GEODE-1296 > URL: https://issues.apache.org/jira/browse/GEODE-1296 > Project: Geode > Issue Type: Bug > Components: offheap >Reporter: Darrel Schneider >Assignee: Kenneth Howe > Fix For: 1.0.0-incubating.M3 > > > The current code does this: > if (isCompressed()) { > throw new UnsupportedOperationException(); > } > It would be more clear if it just did this: > assert !isCompressed(); -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (GEODE-1296) OffHeapStoredObject.getRawBytes should assert that it is not called on compressed data
[ https://issues.apache.org/jira/browse/GEODE-1296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15300956#comment-15300956 ] ASF subversion and git services commented on GEODE-1296: Commit 6c626b7ebc134d85160ff2d253ed12762fe49728 in incubator-geode's branch refs/heads/develop from [~khowe] [ https://git-wip-us.apache.org/repos/asf?p=incubator-geode.git;h=6c626b7 ] GEODE-1296: change conditional in getRawBytes to assert > OffHeapStoredObject.getRawBytes should assert that it is not called on > compressed data > -- > > Key: GEODE-1296 > URL: https://issues.apache.org/jira/browse/GEODE-1296 > Project: Geode > Issue Type: Bug > Components: offheap >Reporter: Darrel Schneider >Assignee: Kenneth Howe > > The current code does this: > if (isCompressed()) { > throw new UnsupportedOperationException(); > } > It would be more clear if it just did this: > assert !isCompressed(); -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (GEODE-1296) OffHeapStoredObject.getRawBytes should assert that it is not called on compressed data
[ https://issues.apache.org/jira/browse/GEODE-1296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15300493#comment-15300493 ] ASF GitHub Bot commented on GEODE-1296: --- Github user dschneider-pivotal commented on the pull request: https://github.com/apache/incubator-geode/pull/145#issuecomment-221650434 The travis failure is a know intermittent issue in a new unit test. This change looks good. I will pull it in. > OffHeapStoredObject.getRawBytes should assert that it is not called on > compressed data > -- > > Key: GEODE-1296 > URL: https://issues.apache.org/jira/browse/GEODE-1296 > Project: Geode > Issue Type: Bug > Components: offheap >Reporter: Darrel Schneider >Assignee: Kenneth Howe > > The current code does this: > if (isCompressed()) { > throw new UnsupportedOperationException(); > } > It would be more clear if it just did this: > assert !isCompressed(); -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (GEODE-1296) OffHeapStoredObject.getRawBytes should assert that it is not called on compressed data
[ https://issues.apache.org/jira/browse/GEODE-1296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15300295#comment-15300295 ] ASF GitHub Bot commented on GEODE-1296: --- Github user pdxrunner commented on the pull request: https://github.com/apache/incubator-geode/pull/145#issuecomment-221624715 Precheckin passed with my most recent update. I think this one is ready to go now. > OffHeapStoredObject.getRawBytes should assert that it is not called on > compressed data > -- > > Key: GEODE-1296 > URL: https://issues.apache.org/jira/browse/GEODE-1296 > Project: Geode > Issue Type: Bug > Components: offheap >Reporter: Darrel Schneider >Assignee: Kenneth Howe > > The current code does this: > if (isCompressed()) { > throw new UnsupportedOperationException(); > } > It would be more clear if it just did this: > assert !isCompressed(); -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (GEODE-1296) OffHeapStoredObject.getRawBytes should assert that it is not called on compressed data
[ https://issues.apache.org/jira/browse/GEODE-1296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15291892#comment-15291892 ] ASF GitHub Bot commented on GEODE-1296: --- Github user dschneider-pivotal commented on a diff in the pull request: https://github.com/apache/incubator-geode/pull/145#discussion_r63931246 --- Diff: geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/OffHeapStoredObjectJUnitTest.java --- @@ -816,6 +820,7 @@ public void getRawBytesShouldThrowExceptionIfValueIsCompressed() { chunk.getRawBytes(); chunk.release(); +fail("Expected getRawBytes() for a compressed value to throw java.lang.AssertionError"); --- End diff -- Why is this "fail" call added. Doesn't the "expected" on the Test annotation take care of this? > OffHeapStoredObject.getRawBytes should assert that it is not called on > compressed data > -- > > Key: GEODE-1296 > URL: https://issues.apache.org/jira/browse/GEODE-1296 > Project: Geode > Issue Type: Bug > Components: offheap >Reporter: Darrel Schneider >Assignee: Kenneth Howe > > The current code does this: > if (isCompressed()) { > throw new UnsupportedOperationException(); > } > It would be more clear if it just did this: > assert !isCompressed(); -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (GEODE-1296) OffHeapStoredObject.getRawBytes should assert that it is not called on compressed data
[ https://issues.apache.org/jira/browse/GEODE-1296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15291881#comment-15291881 ] ASF GitHub Bot commented on GEODE-1296: --- Github user dschneider-pivotal commented on a diff in the pull request: https://github.com/apache/incubator-geode/pull/145#discussion_r63930600 --- Diff: geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/OffHeapStoredObjectJUnitTest.java --- @@ -42,6 +42,10 @@ @Category(UnitTest.class) public class OffHeapStoredObjectJUnitTest extends AbstractStoredObjectTestBase { + static { --- End diff -- Remove this static block. I talked with Kirk and we think that java assertions are enabled consistently from both gradle and the IDE > OffHeapStoredObject.getRawBytes should assert that it is not called on > compressed data > -- > > Key: GEODE-1296 > URL: https://issues.apache.org/jira/browse/GEODE-1296 > Project: Geode > Issue Type: Bug > Components: offheap >Reporter: Darrel Schneider >Assignee: Kenneth Howe > > The current code does this: > if (isCompressed()) { > throw new UnsupportedOperationException(); > } > It would be more clear if it just did this: > assert !isCompressed(); -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (GEODE-1296) OffHeapStoredObject.getRawBytes should assert that it is not called on compressed data
[ https://issues.apache.org/jira/browse/GEODE-1296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15291879#comment-15291879 ] ASF GitHub Bot commented on GEODE-1296: --- Github user dschneider-pivotal commented on a diff in the pull request: https://github.com/apache/incubator-geode/pull/145#discussion_r63930434 --- Diff: geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/OffHeapStoredObject.java --- @@ -417,11 +417,13 @@ public void setSerializedValue(byte[] value) { MemoryAllocatorImpl.getAllocator().getStats().incReads(); return result; } +/** + * This method should only be called on uncompressed objects + * @return byte array of the StoredObject value. + */ protected byte[] getRawBytes() { + assert !isCompressed(); byte[] result = getCompressedBytes(); --- End diff -- Combine these two lines into "return getCompressedBytes();" > OffHeapStoredObject.getRawBytes should assert that it is not called on > compressed data > -- > > Key: GEODE-1296 > URL: https://issues.apache.org/jira/browse/GEODE-1296 > Project: Geode > Issue Type: Bug > Components: offheap >Reporter: Darrel Schneider >Assignee: Kenneth Howe > > The current code does this: > if (isCompressed()) { > throw new UnsupportedOperationException(); > } > It would be more clear if it just did this: > assert !isCompressed(); -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (GEODE-1296) OffHeapStoredObject.getRawBytes should assert that it is not called on compressed data
[ https://issues.apache.org/jira/browse/GEODE-1296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15289304#comment-15289304 ] ASF GitHub Bot commented on GEODE-1296: --- Github user dschneider-pivotal commented on the pull request: https://github.com/apache/incubator-geode/pull/145#issuecomment-220090005 I think this should be changed to use the java "assert" keyword. The assertion should only be checked when assertions on the jvm are enabled. > OffHeapStoredObject.getRawBytes should assert that it is not called on > compressed data > -- > > Key: GEODE-1296 > URL: https://issues.apache.org/jira/browse/GEODE-1296 > Project: Geode > Issue Type: Bug > Components: offheap >Reporter: Darrel Schneider >Assignee: Kenneth Howe > > The current code does this: > if (isCompressed()) { > throw new UnsupportedOperationException(); > } > It would be more clear if it just did this: > assert !isCompressed(); -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (GEODE-1296) OffHeapStoredObject.getRawBytes should assert that it is not called on compressed data
[ https://issues.apache.org/jira/browse/GEODE-1296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15287145#comment-15287145 ] ASF GitHub Bot commented on GEODE-1296: --- GitHub user pdxrunner opened a pull request: https://github.com/apache/incubator-geode/pull/145 GEODE-1296: change conditional in getRawBytes to assert Made suggested change to getRawBytes. Updated corresponding unit test. See review request https://reviews.apache.org/r/47479/ You can merge this pull request into a Git repository by running: $ git pull https://github.com/pdxrunner/incubator-geode feature/GEODE-1296 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-geode/pull/145.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #145 commit 538e0483d3e6fa7e04f5834be27d5540fbda792f Author: Ken HoweDate: 2016-05-12T22:04:16Z GEODE-1296: change conditional in getRawBytes to assert Updated correspondiong unit test. > OffHeapStoredObject.getRawBytes should assert that it is not called on > compressed data > -- > > Key: GEODE-1296 > URL: https://issues.apache.org/jira/browse/GEODE-1296 > Project: Geode > Issue Type: Bug > Components: offheap >Reporter: Darrel Schneider >Assignee: Kenneth Howe > > The current code does this: > if (isCompressed()) { > throw new UnsupportedOperationException(); > } > It would be more clear if it just did this: > assert !isCompressed(); -- This message was sent by Atlassian JIRA (v6.3.4#6332)