Search in sources :

Example 6 with BufferAndBacklog

use of org.apache.flink.runtime.io.network.partition.ResultSubpartition.BufferAndBacklog in project flink by apache.

the class BoundedBlockingSubpartitionAvailabilityTest method drainAvailableData.

private static List<BufferAndBacklog> drainAvailableData(ResultSubpartitionView reader) throws Exception {
    final ArrayList<BufferAndBacklog> list = new ArrayList<>();
    BufferAndBacklog bab;
    while ((bab = reader.getNextBuffer()) != null) {
        list.add(bab);
    }
    return list;
}
Also used : ArrayList(java.util.ArrayList) BufferAndBacklog(org.apache.flink.runtime.io.network.partition.ResultSubpartition.BufferAndBacklog)

Aggregations

BufferAndBacklog (org.apache.flink.runtime.io.network.partition.ResultSubpartition.BufferAndBacklog)6 Buffer (org.apache.flink.runtime.io.network.buffer.Buffer)3 ArrayList (java.util.ArrayList)2 NetworkBuffer (org.apache.flink.runtime.io.network.buffer.NetworkBuffer)2 ResultSubpartitionView (org.apache.flink.runtime.io.network.partition.ResultSubpartitionView)2 Test (org.junit.Test)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 DataOutputStream (java.io.DataOutputStream)1 IOException (java.io.IOException)1 ByteBuffer (java.nio.ByteBuffer)1 Collections (java.util.Collections)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 Optional (java.util.Optional)1 Random (java.util.Random)1 BiFunction (java.util.function.BiFunction)1 Function (java.util.function.Function)1 Function.identity (java.util.function.Function.identity)1 Collectors.toList (java.util.stream.Collectors.toList)1