You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jw...@apache.org on 2020/05/20 20:46:03 UTC

[cassandra] branch trunk updated (dd1c811 -> b3a1c15)

This is an automated email from the ASF dual-hosted git repository.

jwest pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


    from dd1c811  Provide ability to configure IAuditLogger
     add ea202ce  EmptyType doesn't override writeValue so could attempt to write bytes when expected not to
     add 9519eb3  Merge branch 'cassandra-3.0' into cassandra-3.11
     new b3a1c15  Merge branch 'cassandra-3.11' into trunk

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 CHANGES.txt                                        |  1 +
 .../org/apache/cassandra/db/marshal/EmptyType.java | 76 +++++++++++++++++++-
 .../cassandra/serializers/EmptySerializer.java     |  1 +
 .../apache/cassandra/db/marshal/EmptyTypeTest.java | 83 ++++++++++++++++++++++
 4 files changed, 159 insertions(+), 2 deletions(-)
 create mode 100644 test/unit/org/apache/cassandra/db/marshal/EmptyTypeTest.java


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


[cassandra] 01/01: Merge branch 'cassandra-3.11' into trunk

Posted by jw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jwest pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit b3a1c159ac49ad375331856b12f3641585eddb30
Merge: dd1c811 9519eb3
Author: Jordan West <jw...@apache.org>
AuthorDate: Wed May 20 13:42:58 2020 -0700

    Merge branch 'cassandra-3.11' into trunk

 CHANGES.txt                                        |  1 +
 .../org/apache/cassandra/db/marshal/EmptyType.java | 76 +++++++++++++++++++-
 .../cassandra/serializers/EmptySerializer.java     |  1 +
 .../apache/cassandra/db/marshal/EmptyTypeTest.java | 83 ++++++++++++++++++++++
 4 files changed, 159 insertions(+), 2 deletions(-)

diff --cc CHANGES.txt
index b0e7224,a72fed9..c6c2358
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,37 -1,8 +1,38 @@@
 -3.11.7
 +4.0-alpha5
 + * Provide ability to configure IAuditLogger (CASSANDRA-15748)
 + * Fix nodetool enablefullquerylog blocking param parsing (CASSANDRA-15819)
 + * Add isTransient to SSTableMetadataView (CASSANDRA-15806)
 + * Fix tools/bin/fqltool for all shells (CASSANDRA-15820)
 + * Fix clearing of legacy size_estimates (CASSANDRA-15776)
 + * Update port when reconnecting to pre-4.0 SSL storage (CASSANDRA-15727)
 + * Only calculate dynamicBadnessThreshold once per loop in DynamicEndpointSnitch (CASSANDRA-15798)
 + * Cleanup redundant nodetool commands added in 4.0 (CASSANDRA-15256)
 + * Update to Python driver 3.23 for cqlsh (CASSANDRA-15793)
 + * Add tunable initial size and growth factor to RangeTombstoneList (CASSANDRA-15763)
 + * Improve debug logging in SSTableReader for index summary (CASSANDRA-15755)
 + * bin/sstableverify should support user provided token ranges (CASSANDRA-15753)
 + * Improve logging when mutation passed to commit log is too large (CASSANDRA-14781)
 + * replace LZ4FastDecompressor with LZ4SafeDecompressor (CASSANDRA-15560)
 + * Fix buffer pool NPE with concurrent release due to in-progress tiny pool eviction (CASSANDRA-15726)
 + * Avoid race condition when completing stream sessions (CASSANDRA-15666)
 + * Flush with fast compressors by default (CASSANDRA-15379)
 + * Fix CqlInputFormat regression from the switch to system.size_estimates (CASSANDRA-15637)
 + * Allow sending Entire SSTables over SSL (CASSANDRA-15740)
 + * Fix CQLSH UTF-8 encoding issue for Python 2/3 compatibility (CASSANDRA-15739)
 + * Fix batch statement preparation when multiple tables and parameters are used (CASSANDRA-15730)
 + * Fix regression with traceOutgoingMessage printing message size (CASSANDRA-15687)
 + * Ensure repaired data tracking reads a consistent amount of data across replicas (CASSANDRA-15601)
 + * Fix CQLSH to avoid arguments being evaluated (CASSANDRA-15660)
 + * Correct Visibility and Improve Safety of Methods in LatencyMetrics (CASSANDRA-15597)
 + * Allow cqlsh to run with Python2.7/Python3.6+ (CASSANDRA-15659,CASSANDRA-15573)
 + * Improve logging around incremental repair (CASSANDRA-15599)
 + * Do not check cdc_raw_directory filesystem space if CDC disabled (CASSANDRA-15688)
 + * Replace array iterators with get by index (CASSANDRA-15394)
 + * Minimize BTree iterator allocations (CASSANDRA-15389)
 +Merged from 3.11:
   * Fix CQL formatting of read command restrictions for slow query log (CASSANDRA-15503)
 - * Allow sstableloader to use SSL on the native port (CASSANDRA-14904)
  Merged from 3.0:
+  * EmptyType doesn't override writeValue so could attempt to write bytes when expected not to (CASSANDRA-15790)
   * Fix index queries on partition key columns when some partitions contains only static data (CASSANDRA-13666)
   * Avoid creating duplicate rows during major upgrades (CASSANDRA-15789)
   * liveDiskSpaceUsed and totalDiskSpaceUsed get corrupted if IndexSummaryRedistribution gets interrupted (CASSANDRA-15674)
diff --cc src/java/org/apache/cassandra/db/marshal/EmptyType.java
index d3dd4c2,00c919d..88d62c4
--- a/src/java/org/apache/cassandra/db/marshal/EmptyType.java
+++ b/src/java/org/apache/cassandra/db/marshal/EmptyType.java
@@@ -22,11 -26,14 +26,14 @@@ import org.slf4j.LoggerFactory
  import org.apache.cassandra.cql3.CQL3Type;
  import org.apache.cassandra.cql3.Constants;
  import org.apache.cassandra.cql3.Term;
- import org.apache.cassandra.serializers.TypeSerializer;
- import org.apache.cassandra.transport.ProtocolVersion;
+ import org.apache.cassandra.io.util.DataInputPlus;
+ import org.apache.cassandra.io.util.DataOutputPlus;
 -import org.apache.cassandra.serializers.TypeSerializer;
 -import org.apache.cassandra.transport.ProtocolVersion;
  import org.apache.cassandra.serializers.EmptySerializer;
  import org.apache.cassandra.serializers.MarshalException;
++import org.apache.cassandra.serializers.TypeSerializer;
++import org.apache.cassandra.transport.ProtocolVersion;
  import org.apache.cassandra.utils.ByteBufferUtil;
+ import org.apache.cassandra.utils.NoSpamLogger;
  
  /**
   * A type that only accept empty data.
diff --cc test/unit/org/apache/cassandra/db/marshal/EmptyTypeTest.java
index 0000000,30f63b3..b362666
mode 000000,100644..100644
--- a/test/unit/org/apache/cassandra/db/marshal/EmptyTypeTest.java
+++ b/test/unit/org/apache/cassandra/db/marshal/EmptyTypeTest.java
@@@ -1,0 -1,94 +1,83 @@@
+ package org.apache.cassandra.db.marshal;
+ 
+ import java.nio.ByteBuffer;
+ 
 -import org.junit.Assert;
+ import org.junit.Test;
+ 
+ import org.apache.cassandra.io.util.DataInputPlus;
+ import org.apache.cassandra.io.util.DataOutputPlus;
+ import org.apache.cassandra.serializers.MarshalException;
+ import org.apache.cassandra.utils.ByteBufferUtil;
+ import org.mockito.Mockito;
+ 
++import static org.assertj.core.api.Assertions.assertThat;
++import static org.assertj.core.api.Assertions.assertThatThrownBy;
+ 
+ public class EmptyTypeTest
+ {
+     @Test
+     public void isFixed()
+     {
 -        Assert.assertEquals(0, EmptyType.instance.valueLengthIfFixed());
++        assertThat(EmptyType.instance.valueLengthIfFixed()).isEqualTo(0);
+     }
+ 
+     @Test
+     public void writeEmptyAllowed()
+     {
+         DataOutputPlus output = Mockito.mock(DataOutputPlus.class);
+         EmptyType.instance.writeValue(ByteBufferUtil.EMPTY_BYTE_BUFFER, output);
+ 
+         Mockito.verifyNoInteractions(output);
+     }
+ 
+     @Test
+     public void writeNonEmpty()
+     {
+         DataOutputPlus output = Mockito.mock(DataOutputPlus.class);
+         ByteBuffer rejected = ByteBuffer.wrap("this better fail".getBytes());
+ 
 -        boolean thrown = false;
 -        try
 -        {
 -            EmptyType.instance.writeValue(rejected, output);
 -        }
 -        catch (AssertionError e)
 -        {
 -            thrown = true;
 -        }
 -        Assert.assertTrue("writeValue did not reject non-empty input", thrown);
 -
++        assertThatThrownBy(() -> EmptyType.instance.writeValue(rejected, output))
++                  .isInstanceOf(AssertionError.class);
+         Mockito.verifyNoInteractions(output);
+     }
+ 
+     @Test
+     public void read()
+     {
+         DataInputPlus input = Mockito.mock(DataInputPlus.class);
+ 
+         ByteBuffer buffer = EmptyType.instance.readValue(input);
 -        Assert.assertNotNull(buffer);
 -        Assert.assertFalse("empty type returned back non-empty data", buffer.hasRemaining());
++        assertThat(buffer)
++                  .isNotNull()
++                  .matches(b -> !b.hasRemaining());
+ 
+         buffer = EmptyType.instance.readValue(input, 42);
 -        Assert.assertNotNull(buffer);
 -        Assert.assertFalse("empty type returned back non-empty data", buffer.hasRemaining());
++        assertThat(buffer)
++                  .isNotNull()
++                  .matches(b -> !b.hasRemaining());
+ 
+         Mockito.verifyNoInteractions(input);
+     }
+ 
+     @Test
+     public void decompose()
+     {
+         ByteBuffer buffer = EmptyType.instance.decompose(null);
 -        Assert.assertEquals(0, buffer.remaining());
++        assertThat(buffer.remaining()).isEqualTo(0);
+     }
+ 
+     @Test
+     public void composeEmptyInput()
+     {
+         Void result = EmptyType.instance.compose(ByteBufferUtil.EMPTY_BYTE_BUFFER);
 -        Assert.assertNull(result);
++        assertThat(result).isNull();
+     }
+ 
+     @Test
+     public void composeNonEmptyInput()
+     {
 -        try
 -        {
 -            EmptyType.instance.compose(ByteBufferUtil.bytes("should fail"));
 -            Assert.fail("compose is expected to reject non-empty values, but did not");
 -        }
 -        catch (MarshalException e) {
 -            Assert.assertEquals("EmptyType only accept empty values", e.getMessage());
 -        }
++        assertThatThrownBy(() -> EmptyType.instance.compose(ByteBufferUtil.bytes("should fail")))
++                  .isInstanceOf(MarshalException.class)
++                  .hasMessage("EmptyType only accept empty values");
+     }
+ }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org