use of org.apache.flink.core.memory.DataOutputViewStreamWrapper in project flink by apache.
the class ImmutableAggregatingStateTest method setUp.
@Before
public void setUp() throws Exception {
if (!aggrStateDesc.isSerializerInitialized()) {
aggrStateDesc.initializeSerializerUnlessSet(new ExecutionConfig());
}
final String initValue = "42";
ByteArrayOutputStream out = new ByteArrayOutputStream();
aggrStateDesc.getSerializer().serialize(initValue, new DataOutputViewStreamWrapper(out));
aggrState = ImmutableAggregatingState.createState(aggrStateDesc, out.toByteArray());
}
use of org.apache.flink.core.memory.DataOutputViewStreamWrapper in project flink by apache.
the class PostVersionedIOReadableWritableTest method serializeWithPostVersionedReadableWritable.
private byte[] serializeWithPostVersionedReadableWritable(byte[] payload) throws IOException {
TestPostVersionedReadableWritable versionedReadableWritable = new TestPostVersionedReadableWritable(payload);
byte[] serialized;
try (ByteArrayOutputStreamWithPos out = new ByteArrayOutputStreamWithPos()) {
versionedReadableWritable.write(new DataOutputViewStreamWrapper(out));
serialized = out.toByteArray();
}
return serialized;
}
use of org.apache.flink.core.memory.DataOutputViewStreamWrapper in project flink by apache.
the class PostVersionedIOReadableWritableTest method serializeWithNonVersionedReadableWritable.
private byte[] serializeWithNonVersionedReadableWritable(byte[] payload) throws IOException {
TestNonVersionedReadableWritable versionedReadableWritable = new TestNonVersionedReadableWritable(payload);
byte[] serialized;
try (ByteArrayOutputStreamWithPos out = new ByteArrayOutputStreamWithPos()) {
versionedReadableWritable.write(new DataOutputViewStreamWrapper(out));
serialized = out.toByteArray();
}
return serialized;
}
use of org.apache.flink.core.memory.DataOutputViewStreamWrapper in project flink by apache.
the class RecordITCase method setUp.
@Before
public void setUp() throws Exception {
PipedInputStream pipedInput = new PipedInputStream(32 * 1024 * 1024);
this.in = new DataInputViewStreamWrapper(pipedInput);
this.out = new DataOutputViewStreamWrapper(new PipedOutputStream(pipedInput));
}
use of org.apache.flink.core.memory.DataOutputViewStreamWrapper in project flink by apache.
the class PrimitiveDataTypeTest method setup.
@Before
public void setup() throws Exception {
in = new PipedInputStream(1000);
out = new PipedOutputStream(in);
mIn = new DataInputViewStreamWrapper(in);
mOut = new DataOutputViewStreamWrapper(out);
}
Aggregations