cassandra-pr mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jasobrown <...@git.apache.org>
Subject [GitHub] cassandra pull request #253: CASSANDRA-13630
Date Mon, 10 Sep 2018 02:34:56 GMT
Github user jasobrown commented on a diff in the pull request:

    https://github.com/apache/cassandra/pull/253#discussion_r216185533
  
    --- Diff: test/unit/org/apache/cassandra/net/async/ChannelWriterTest.java ---
    @@ -70,32 +86,71 @@ public static void before()
         @Before
         public void setup()
         {
    -        OutboundConnectionIdentifier id = OutboundConnectionIdentifier.small(InetAddressAndPort.getByAddressOverrideDefaults(InetAddresses.forString("127.0.0.1"),
0),
    -                                                                             InetAddressAndPort.getByAddressOverrideDefaults(InetAddresses.forString("127.0.0.2"),
0));
    +        if (type == ChannelWriterType.LARGE_MESSAGE)
    +        {
    +            id = OutboundConnectionIdentifier.large(InetAddressAndPort.getByAddressOverrideDefaults(InetAddresses.forString("127.0.0.1"),
0),
    +                                                    InetAddressAndPort.getByAddressOverrideDefaults(InetAddresses.forString("127.0.0.2"),
0));
    +        }
    +        else
    +        {
    +            id = OutboundConnectionIdentifier.small(InetAddressAndPort.getByAddressOverrideDefaults(InetAddresses.forString("127.0.0.1"),
0),
    +                                                    InetAddressAndPort.getByAddressOverrideDefaults(InetAddresses.forString("127.0.0.2"),
0));
    +        }
    +
             channel = new EmbeddedChannel();
             omc = new NonSendingOutboundMessagingConnection(id, null, Optional.empty());
    -        channelWriter = ChannelWriter.create(channel, omc::handleMessageResult, Optional.empty());
    -        channel.pipeline().addFirst(new MessageOutHandler(id, MessagingService.current_version,
channelWriter, () -> null));
    -        coalescingStrategy = CoalescingStrategies.newCoalescingStrategy(CoalescingStrategies.Strategy.FIXED.name(),
COALESCE_WINDOW_MS, null, "test");
    +        wrapper = new MessageOutWrapper();
    +        OutboundConnectionParams.Builder builder = OutboundConnectionParams.builder()
    +                                                                           .messageResultConsumer(this::handleMessageResult)
    +                                                                           .coalescingStrategy(Optional.empty())
    +                                                                           .protocolVersion(MessagingService.current_version)
    +                                                                           .connectionId(id);
    +
    +        if (type == ChannelWriterType.COALESCING)
    +            coalescingStrategy = CoalescingStrategies.newCoalescingStrategy(CoalescingStrategies.Strategy.FIXED.name(),
COALESCE_WINDOW_MS, null, "test");
    +        else
    +            coalescingStrategy = Optional.empty();
    --- End diff --
    
    Wait for CASSANDRA-14503 :)


---

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


Mime
View raw message