Java Code Examples for org.apache.flink.api.common.serialization.SerializationSchema#InitializationContext

The following examples show how to use org.apache.flink.api.common.serialization.SerializationSchema#InitializationContext . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FlinkKafkaProducerTest.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public void open(SerializationSchema.InitializationContext context) throws Exception {
	openCalled = true;
}
 
Example 2
Source File: FlinkKafkaProducerTest.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public void open(SerializationSchema.InitializationContext context) throws Exception {
	openCalled = true;
}
 
Example 3
Source File: KafkaSerializationSchemaWrapper.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public void open(SerializationSchema.InitializationContext context) throws Exception {
	serializationSchema.open(context);
}
 
Example 4
Source File: MockSerializationSchema.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public void open(SerializationSchema.InitializationContext context) throws Exception {
	assertThat("Open was called multiple times", openCalled, is(false));
	assertThat(context.getMetricGroup(), notNullValue(MetricGroup.class));
	this.openCalled = true;
}
 
Example 5
Source File: KafkaSerializationSchema.java    From flink with Apache License 2.0 2 votes vote down vote up
/**
 * Initialization method for the schema. It is called before the actual working methods
 * {@link #serialize(Object, Long)} and thus suitable for one time setup work.
 *
 * <p>The provided {@link SerializationSchema.InitializationContext} can be used to access additional
 * features such as e.g. registering user metrics.
 *
 * @param context Contextual information that can be used during initialization.
 */
default void open(SerializationSchema.InitializationContext context) throws Exception {
}