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

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

commit b8f36f0cba5e8aefa7a32f5a17184ef4af9256d7
Merge: 90e0ef27e4 7e65d04e9c
Author: Jacek Lewandowski <[email protected]>
AuthorDate: Wed Oct 4 18:45:54 2023 +0200

    Merge branch 'cassandra-5.0' into trunk
    
    * cassandra-5.0:
      Fix CQLConnectionTest and SimpleClient

 .../apache/cassandra/transport/SimpleClient.java   | 22 ++++--
 .../cassandra/transport/CQLConnectionTest.java     | 87 ++++++++++++++--------
 2 files changed, 73 insertions(+), 36 deletions(-)

diff --cc src/java/org/apache/cassandra/transport/SimpleClient.java
index 8e270a3f55,726e161ff5..f4a1b9fd3f
--- a/src/java/org/apache/cassandra/transport/SimpleClient.java
+++ b/src/java/org/apache/cassandra/transport/SimpleClient.java
@@@ -27,8 -27,8 +27,6 @@@ import java.util.concurrent.atomic.Atom
  
  import com.google.common.annotations.VisibleForTesting;
  import com.google.common.primitives.Ints;
--import org.apache.cassandra.transport.ClientResourceLimits.Overload;
--import org.apache.cassandra.utils.concurrent.NonBlockingRateLimiter;
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
@@@ -49,17 -49,17 +47,18 @@@ import org.apache.cassandra.db.Consiste
  import org.apache.cassandra.net.*;
  import org.apache.cassandra.security.ISslContextFactory;
  import org.apache.cassandra.security.SSLFactory;
++import org.apache.cassandra.transport.ClientResourceLimits.Overload;
  import org.apache.cassandra.transport.messages.*;
++import org.apache.cassandra.utils.concurrent.NonBlockingRateLimiter;
  import org.apache.cassandra.utils.concurrent.UncheckedInterruptedException;
  
  import static org.apache.cassandra.net.SocketFactory.newSslHandler;
  import static org.apache.cassandra.transport.CQLMessageHandler.envelopeSize;
  import static org.apache.cassandra.transport.Flusher.MAX_FRAMED_PAYLOAD_SIZE;
  import static 
org.apache.cassandra.transport.PipelineConfigurator.SSL_FACTORY_CONTEXT_DESCRIPTION;
--import static 
org.apache.cassandra.utils.concurrent.NonBlockingRateLimiter.NO_OP_LIMITER;
--
  import static org.apache.cassandra.utils.Clock.Global.currentTimeMillis;
  import static 
org.apache.cassandra.utils.concurrent.BlockingQueues.newBlockingQueue;
++import static 
org.apache.cassandra.utils.concurrent.NonBlockingRateLimiter.NO_OP_LIMITER;
  
  public class SimpleClient implements Closeable
  {
diff --cc test/unit/org/apache/cassandra/transport/CQLConnectionTest.java
index b538417964,0ef61a5bdd..110b58d5eb
--- a/test/unit/org/apache/cassandra/transport/CQLConnectionTest.java
+++ b/test/unit/org/apache/cassandra/transport/CQLConnectionTest.java
@@@ -30,7 -30,7 +30,9 @@@ import java.util.concurrent.TimeUnit
  import java.util.concurrent.atomic.AtomicLong;
  import java.util.function.*;
  
+ import com.google.common.util.concurrent.Uninterruptibles;
++
 +import org.apache.cassandra.transport.ClientResourceLimits.Overload;
  import org.junit.Before;
  import org.junit.Test;
  import org.slf4j.Logger;
@@@ -53,10 -53,12 +55,11 @@@ import org.apache.cassandra.net.*
  import org.apache.cassandra.net.proxy.InboundProxyHandler;
  import org.apache.cassandra.service.NativeTransportService;
  import org.apache.cassandra.transport.CQLMessageHandler.MessageConsumer;
 -import org.apache.cassandra.transport.ClientResourceLimits.Overload;
  import org.apache.cassandra.transport.messages.*;
  import org.apache.cassandra.utils.FBUtilities;
 -import org.apache.cassandra.utils.concurrent.Condition;
  import org.apache.cassandra.utils.concurrent.NonBlockingRateLimiter;
 +import org.apache.cassandra.utils.concurrent.Condition;
+ import org.awaitility.Awaitility;
  
  import static 
org.apache.cassandra.config.EncryptionOptions.TlsEncryptionPolicy.UNENCRYPTED;
  import static org.apache.cassandra.io.util.FileUtils.ONE_MIB;
@@@ -184,7 -183,7 +184,7 @@@ public class CQLConnectionTes
          // after the error is first received and we race between handling the 
exception
          // caused by remote disconnection and checking the connection status.
  
--        Function<ByteBuf, ByteBuf> corruptor = new Function<ByteBuf, 
ByteBuf>()
++        Function<ByteBuf, ByteBuf> corruptor = new Function<>()
          {
              // Don't corrupt the first frame as this would fail early and 
bypass capacity allocation.
              // Instead, allow enough bytes to fill the first frame through 
untouched. Then, corrupt


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to