Search in sources :

Example 1 with NetworkPartitionConnectionInfo

use of org.apache.flink.runtime.shuffle.NettyShuffleDescriptor.NetworkPartitionConnectionInfo in project flink by apache.

the class ResultPartitionDeploymentDescriptorTest method testSerializationWithNettyShuffleDescriptor.

/**
 * Tests simple de/serialization with {@link NettyShuffleDescriptor}.
 */
@Test
public void testSerializationWithNettyShuffleDescriptor() throws IOException {
    ShuffleDescriptor shuffleDescriptor = new NettyShuffleDescriptor(producerLocation, new NetworkPartitionConnectionInfo(connectionID), resultPartitionID);
    ResultPartitionDeploymentDescriptor copy = createCopyAndVerifyResultPartitionDeploymentDescriptor(shuffleDescriptor);
    assertThat(copy.getShuffleDescriptor(), instanceOf(NettyShuffleDescriptor.class));
    NettyShuffleDescriptor shuffleDescriptorCopy = (NettyShuffleDescriptor) copy.getShuffleDescriptor();
    assertThat(shuffleDescriptorCopy.getResultPartitionID(), is(resultPartitionID));
    assertThat(shuffleDescriptorCopy.isUnknown(), is(false));
    assertThat(shuffleDescriptorCopy.isLocalTo(producerLocation), is(true));
    assertThat(shuffleDescriptorCopy.getConnectionId(), is(connectionID));
}
Also used : NettyShuffleDescriptor(org.apache.flink.runtime.shuffle.NettyShuffleDescriptor) NetworkPartitionConnectionInfo(org.apache.flink.runtime.shuffle.NettyShuffleDescriptor.NetworkPartitionConnectionInfo) ShuffleDescriptor(org.apache.flink.runtime.shuffle.ShuffleDescriptor) UnknownShuffleDescriptor(org.apache.flink.runtime.shuffle.UnknownShuffleDescriptor) NettyShuffleDescriptor(org.apache.flink.runtime.shuffle.NettyShuffleDescriptor) Test(org.junit.Test)

Aggregations

NettyShuffleDescriptor (org.apache.flink.runtime.shuffle.NettyShuffleDescriptor)1 NetworkPartitionConnectionInfo (org.apache.flink.runtime.shuffle.NettyShuffleDescriptor.NetworkPartitionConnectionInfo)1 ShuffleDescriptor (org.apache.flink.runtime.shuffle.ShuffleDescriptor)1 UnknownShuffleDescriptor (org.apache.flink.runtime.shuffle.UnknownShuffleDescriptor)1 Test (org.junit.Test)1