use of org.apache.flink.core.memory.DataOutputViewStreamWrapper in project flink by apache.
the class FoldApplyAllWindowFunction method setOutputType.
@Override
public void setOutputType(TypeInformation<R> outTypeInfo, ExecutionConfig executionConfig) {
// out type is not used, just use this for the execution config
accSerializer = accTypeInformation.createSerializer(executionConfig);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputViewStreamWrapper out = new DataOutputViewStreamWrapper(baos);
try {
accSerializer.serialize(initialValue, out);
} catch (IOException ioe) {
throw new RuntimeException("Unable to serialize initial value of type " + initialValue.getClass().getSimpleName() + " of fold window function.", ioe);
}
serializedInitialValue = baos.toByteArray();
}
use of org.apache.flink.core.memory.DataOutputViewStreamWrapper in project flink by apache.
the class StreamGroupedFold method setOutputType.
@Override
public void setOutputType(TypeInformation<OUT> outTypeInfo, ExecutionConfig executionConfig) {
outTypeSerializer = outTypeInfo.createSerializer(executionConfig);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputViewStreamWrapper out = new DataOutputViewStreamWrapper(baos);
try {
outTypeSerializer.serialize(initialValue, out);
} catch (IOException ioe) {
throw new RuntimeException("Unable to serialize initial value of type " + initialValue.getClass().getSimpleName() + " of fold operator.", ioe);
}
serializedInitialValue = baos.toByteArray();
}
use of org.apache.flink.core.memory.DataOutputViewStreamWrapper in project flink by apache.
the class FoldApplyProcessAllWindowFunction method setOutputType.
@Override
public void setOutputType(TypeInformation<R> outTypeInfo, ExecutionConfig executionConfig) {
accSerializer = accTypeInformation.createSerializer(executionConfig);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputViewStreamWrapper out = new DataOutputViewStreamWrapper(baos);
try {
accSerializer.serialize(initialValue, out);
} catch (IOException ioe) {
throw new RuntimeException("Unable to serialize initial value of type " + initialValue.getClass().getSimpleName() + " of fold window function.", ioe);
}
serializedInitialValue = baos.toByteArray();
}
use of org.apache.flink.core.memory.DataOutputViewStreamWrapper in project flink by apache.
the class FoldApplyProcessWindowFunction method setOutputType.
@Override
public void setOutputType(TypeInformation<R> outTypeInfo, ExecutionConfig executionConfig) {
accSerializer = accTypeInformation.createSerializer(executionConfig);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputViewStreamWrapper out = new DataOutputViewStreamWrapper(baos);
try {
accSerializer.serialize(initialValue, out);
} catch (IOException ioe) {
throw new RuntimeException("Unable to serialize initial value of type " + initialValue.getClass().getSimpleName() + " of fold window function.", ioe);
}
serializedInitialValue = baos.toByteArray();
}
use of org.apache.flink.core.memory.DataOutputViewStreamWrapper in project flink by apache.
the class FoldApplyWindowFunction method setOutputType.
@Override
public void setOutputType(TypeInformation<R> outTypeInfo, ExecutionConfig executionConfig) {
// out type is not used, just use this for the execution config
accSerializer = accTypeInformation.createSerializer(executionConfig);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputViewStreamWrapper out = new DataOutputViewStreamWrapper(baos);
try {
accSerializer.serialize(initialValue, out);
} catch (IOException ioe) {
throw new RuntimeException("Unable to serialize initial value of type " + initialValue.getClass().getSimpleName() + " of fold window function.", ioe);
}
serializedInitialValue = baos.toByteArray();
}
Aggregations