Search in sources :

Example 1 with NettyMessageEncoder

use of org.apache.flink.runtime.io.network.netty.NettyMessage.NettyMessageEncoder in project flink by apache.

the class NettyMessageClientSideSerializationTest method setup.

@Before
public void setup() throws IOException, InterruptedException {
    networkBufferPool = new NetworkBufferPool(8, BUFFER_SIZE);
    inputGate = createSingleInputGate(1, networkBufferPool);
    RemoteInputChannel inputChannel = createRemoteInputChannel(inputGate, new TestingPartitionRequestClient());
    inputChannel.requestSubpartition();
    inputGate.setInputChannels(inputChannel);
    inputGate.setup();
    CreditBasedPartitionRequestClientHandler handler = new CreditBasedPartitionRequestClientHandler();
    handler.addInputChannel(inputChannel);
    channel = new EmbeddedChannel(// For outbound messages
    new NettyMessageEncoder(), // For inbound messages
    new NettyMessageClientDecoderDelegate(handler));
    inputChannelId = inputChannel.getInputChannelId();
}
Also used : EmbeddedChannel(org.apache.flink.shaded.netty4.io.netty.channel.embedded.EmbeddedChannel) NettyMessageEncoder(org.apache.flink.runtime.io.network.netty.NettyMessage.NettyMessageEncoder) TestingPartitionRequestClient(org.apache.flink.runtime.io.network.TestingPartitionRequestClient) NetworkBufferPool(org.apache.flink.runtime.io.network.buffer.NetworkBufferPool) RemoteInputChannel(org.apache.flink.runtime.io.network.partition.consumer.RemoteInputChannel) InputChannelTestUtils.createRemoteInputChannel(org.apache.flink.runtime.io.network.partition.InputChannelTestUtils.createRemoteInputChannel) Before(org.junit.Before)

Aggregations

TestingPartitionRequestClient (org.apache.flink.runtime.io.network.TestingPartitionRequestClient)1 NetworkBufferPool (org.apache.flink.runtime.io.network.buffer.NetworkBufferPool)1 NettyMessageEncoder (org.apache.flink.runtime.io.network.netty.NettyMessage.NettyMessageEncoder)1 InputChannelTestUtils.createRemoteInputChannel (org.apache.flink.runtime.io.network.partition.InputChannelTestUtils.createRemoteInputChannel)1 RemoteInputChannel (org.apache.flink.runtime.io.network.partition.consumer.RemoteInputChannel)1 EmbeddedChannel (org.apache.flink.shaded.netty4.io.netty.channel.embedded.EmbeddedChannel)1 Before (org.junit.Before)1