congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
ExecutionConfig.registerTypeWithKryoSerializer
Code IndexAdd Tabnine to your IDE (free)

How to use
registerTypeWithKryoSerializer
method
in
org.apache.flink.api.common.ExecutionConfig

Best Java code snippets using org.apache.flink.api.common.ExecutionConfig.registerTypeWithKryoSerializer (Showing top 20 results out of 315)

origin: apache/flink

/**
 * Registers the given Serializer via its class as a serializer for the given type at the KryoSerializer.
 *
 * @param type The class of the types serialized with the given serializer.
 * @param serializerClass The class of the serializer to use.
 */
public void registerTypeWithKryoSerializer(Class<?> type, Class<? extends Serializer<?>> serializerClass) {
  config.registerTypeWithKryoSerializer(type, serializerClass);
}
origin: apache/flink

/**
 * Registers the given type with a Kryo Serializer.
 *
 * <p>Note that the serializer instance must be serializable (as defined by java.io.Serializable),
 * because it may be distributed to the worker nodes by java serialization.
 *
 * @param type The class of the types serialized with the given serializer.
 * @param serializer The serializer to use.
 */
public <T extends Serializer<?> & Serializable>void registerTypeWithKryoSerializer(Class<?> type, T serializer) {
  config.registerTypeWithKryoSerializer(type, serializer);
}
origin: apache/flink

/**
 * Registers the given Serializer via its class as a serializer for the
 * given type at the KryoSerializer.
 *
 * @param type
 *         The class of the types serialized with the given serializer.
 * @param serializerClass
 *         The class of the serializer to use.
 */
@SuppressWarnings("rawtypes")
public void registerTypeWithKryoSerializer(Class<?> type, Class<? extends Serializer> serializerClass) {
  config.registerTypeWithKryoSerializer(type, serializerClass);
}
origin: apache/flink

/**
 * Registers the given type with a Kryo Serializer.
 *
 * <p>Note that the serializer instance must be serializable (as defined by
 * java.io.Serializable), because it may be distributed to the worker nodes
 * by java serialization.
 *
 * @param type
 *         The class of the types serialized with the given serializer.
 * @param serializer
 *         The serializer to use.
 */
public <T extends Serializer<?> & Serializable>void registerTypeWithKryoSerializer(Class<?> type, T serializer) {
  config.registerTypeWithKryoSerializer(type, serializer);
}
origin: apache/flink

@Override
public void addAvroSerializersIfRequired(ExecutionConfig reg, Class<?> type) {
  if (org.apache.avro.specific.SpecificRecordBase.class.isAssignableFrom(type) ||
    org.apache.avro.generic.GenericData.Record.class.isAssignableFrom(type)) {
    // Avro POJOs contain java.util.List which have GenericData.Array as their runtime type
    // because Kryo is not able to serialize them properly, we use this serializer for them
    reg.registerTypeWithKryoSerializer(GenericData.Array.class, Serializers.SpecificInstanceCollectionSerializerForArrayList.class);
    // We register this serializer for users who want to use untyped Avro records (GenericData.Record).
    // Kryo is able to serialize everything in there, except for the Schema.
    // This serializer is very slow, but using the GenericData.Records of Kryo is in general a bad idea.
    // we add the serializer as a default serializer because Avro is using a private sub-type at runtime.
    reg.addDefaultKryoSerializer(Schema.class, AvroSchemaSerializer.class);
  }
}
origin: apache/flink

@Override
protected <T> TypeSerializer<T> createSerializer(Class<T> type) {
  ExecutionConfig conf = new ExecutionConfig();
  conf.registerTypeWithKryoSerializer(LocalDate.class, LocalDateSerializer.class);
  TypeInformation<T> typeInfo = new GenericTypeInfo<T>(type);
  return typeInfo.createSerializer(conf);
}
origin: apache/flink

@Test
public void testDuplicateSerializerWithRegisteredSerializerClass() {
  ExecutionConfig executionConfig = new ExecutionConfig();
  executionConfig.registerTypeWithKryoSerializer(WrappedString.class, TestSerializer.class);
  runDuplicateSerializerTest(executionConfig);
}
origin: apache/flink

@Test
public void testDuplicateSerializerWithRegisteredSerializerInstance() {
  ExecutionConfig executionConfig = new ExecutionConfig();
  executionConfig.registerTypeWithKryoSerializer(WrappedString.class, new TestSerializer());
  runDuplicateSerializerTest(executionConfig);
}
origin: apache/flink

@Test
public void testAvroToRow() throws Exception {
  ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
  env.getConfig().registerTypeWithKryoSerializer(LocalDate.class, AvroKryoSerializerUtils.JodaLocalDateSerializer.class);
  env.getConfig().registerTypeWithKryoSerializer(LocalTime.class, AvroKryoSerializerUtils.JodaLocalTimeSerializer.class);
  BatchTableEnvironment tEnv = TableEnvironment.getTableEnvironment(env, config());
  Table t = tEnv.fromDataSet(testData(env));
  Table result = t.select("*");
  List<Row> results = tEnv.toDataSet(result, Row.class).collect();
  String expected =
    "black,null,Whatever,[true],[hello],true,java.nio.HeapByteBuffer[pos=0 lim=10 cap=10]," +
    "2014-03-01,java.nio.HeapByteBuffer[pos=0 lim=2 cap=2],[7, -48],0.0,GREEN," +
    "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],42,{},null,null,null,123456," +
    "12:12:12.000,123456,2014-03-01T12:12:12.321Z,null\n" +
    "blue,null,Charlie,[],[],false,java.nio.HeapByteBuffer[pos=0 lim=10 cap=10],2014-03-01," +
    "java.nio.HeapByteBuffer[pos=0 lim=2 cap=2],[7, -48],1.337,RED,null,1337,{}," +
    "{\"num\": 42, \"street\": \"Bakerstreet\", \"city\": \"Berlin\", \"state\": " +
    "\"Berlin\", \"zip\": \"12049\"},null,null,123456,12:12:12.000,123456," +
    "2014-03-01T12:12:12.321Z,null\n" +
    "yellow,null,Terminator,[false],[world],false," +
    "java.nio.HeapByteBuffer[pos=0 lim=10 cap=10],2014-03-01," +
    "java.nio.HeapByteBuffer[pos=0 lim=2 cap=2],[7, -48],0.0,GREEN," +
    "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],1,{},null,null,null,123456," +
    "12:12:12.000,123456,2014-03-01T12:12:12.321Z,null";
  TestBaseUtils.compareResultAsText(results, expected);
}
origin: apache/flink

public void testOutputBufferedBeingClearedInCaseOfException() throws Exception {
  ExecutionConfig executionConfig = new ExecutionConfig();
  executionConfig.registerTypeWithKryoSerializer(TestRecord.class, new TestRecordSerializer());
  executionConfig.registerKryoType(TestRecord.class);
origin: DTStack/flinkx

/**
 * Registers the given type with a Kryo Serializer.
 *
 * <p>Note that the serializer instance must be serializable (as defined by java.io.Serializable),
 * because it may be distributed to the worker nodes by java serialization.
 *
 * @param type The class of the types serialized with the given serializer.
 * @param serializer The serializer to use.
 */
public <T extends Serializer<?> & Serializable>void registerTypeWithKryoSerializer(Class<?> type, T serializer) {
  config.registerTypeWithKryoSerializer(type, serializer);
}
origin: org.apache.flink/flink-java

/**
 * Registers the given Serializer via its class as a serializer for the given type at the KryoSerializer.
 *
 * @param type The class of the types serialized with the given serializer.
 * @param serializerClass The class of the serializer to use.
 */
public void registerTypeWithKryoSerializer(Class<?> type, Class<? extends Serializer<?>> serializerClass) {
  config.registerTypeWithKryoSerializer(type, serializerClass);
}
origin: DTStack/flinkx

/**
 * Registers the given Serializer via its class as a serializer for the given type at the KryoSerializer.
 *
 * @param type The class of the types serialized with the given serializer.
 * @param serializerClass The class of the serializer to use.
 */
public void registerTypeWithKryoSerializer(Class<?> type, Class<? extends Serializer<?>> serializerClass) {
  config.registerTypeWithKryoSerializer(type, serializerClass);
}
origin: com.alibaba.blink/flink-java

/**
 * Registers the given Serializer via its class as a serializer for the given type at the KryoSerializer.
 *
 * @param type The class of the types serialized with the given serializer.
 * @param serializerClass The class of the serializer to use.
 */
public void registerTypeWithKryoSerializer(Class<?> type, Class<? extends Serializer<?>> serializerClass) {
  config.registerTypeWithKryoSerializer(type, serializerClass);
}
origin: DTStack/flinkx

/**
 * Registers the given Serializer via its class as a serializer for the
 * given type at the KryoSerializer.
 *
 * @param type
 *         The class of the types serialized with the given serializer.
 * @param serializerClass
 *         The class of the serializer to use.
 */
@SuppressWarnings("rawtypes")
public void registerTypeWithKryoSerializer(Class<?> type, Class<? extends Serializer> serializerClass) {
  config.registerTypeWithKryoSerializer(type, serializerClass);
}
origin: org.apache.flink/flink-streaming-java_2.11

/**
 * Registers the given Serializer via its class as a serializer for the
 * given type at the KryoSerializer.
 *
 * @param type
 *         The class of the types serialized with the given serializer.
 * @param serializerClass
 *         The class of the serializer to use.
 */
@SuppressWarnings("rawtypes")
public void registerTypeWithKryoSerializer(Class<?> type, Class<? extends Serializer> serializerClass) {
  config.registerTypeWithKryoSerializer(type, serializerClass);
}
origin: org.apache.flink/flink-java

/**
 * Registers the given type with a Kryo Serializer.
 *
 * <p>Note that the serializer instance must be serializable (as defined by java.io.Serializable),
 * because it may be distributed to the worker nodes by java serialization.
 *
 * @param type The class of the types serialized with the given serializer.
 * @param serializer The serializer to use.
 */
public <T extends Serializer<?> & Serializable>void registerTypeWithKryoSerializer(Class<?> type, T serializer) {
  config.registerTypeWithKryoSerializer(type, serializer);
}
origin: com.alibaba.blink/flink-java

/**
 * Registers the given type with a Kryo Serializer.
 *
 * <p>Note that the serializer instance must be serializable (as defined by java.io.Serializable),
 * because it may be distributed to the worker nodes by java serialization.
 *
 * @param type The class of the types serialized with the given serializer.
 * @param serializer The serializer to use.
 */
public <T extends Serializer<?> & Serializable>void registerTypeWithKryoSerializer(Class<?> type, T serializer) {
  config.registerTypeWithKryoSerializer(type, serializer);
}
origin: org.apache.flink/flink-streaming-java_2.10

/**
 * Registers the given Serializer via its class as a serializer for the
 * given type at the KryoSerializer.
 *
 * @param type
 *         The class of the types serialized with the given serializer.
 * @param serializerClass
 *         The class of the serializer to use.
 */
@SuppressWarnings("rawtypes")
public void registerTypeWithKryoSerializer(Class<?> type, Class<? extends Serializer> serializerClass) {
  config.registerTypeWithKryoSerializer(type, serializerClass);
}
origin: org.apache.flink/flink-streaming-java

/**
 * Registers the given Serializer via its class as a serializer for the
 * given type at the KryoSerializer.
 *
 * @param type
 *         The class of the types serialized with the given serializer.
 * @param serializerClass
 *         The class of the serializer to use.
 */
@SuppressWarnings("rawtypes")
public void registerTypeWithKryoSerializer(Class<?> type, Class<? extends Serializer> serializerClass) {
  config.registerTypeWithKryoSerializer(type, serializerClass);
}
org.apache.flink.api.commonExecutionConfigregisterTypeWithKryoSerializer

Javadoc

Registers the given type with a Kryo Serializer. Note that the serializer instance must be serializable (as defined by java.io.Serializable), because it may be distributed to the worker nodes by java serialization.

Popular methods of ExecutionConfig

  • <init>
  • isObjectReuseEnabled
    Returns whether object reuse has been enabled or disabled. @see #enableObjectReuse()
  • disableSysoutLogging
    Disables the printing of progress update messages to System.out
  • getAutoWatermarkInterval
    Returns the interval of the automatic watermark emission.
  • setGlobalJobParameters
    Register a custom, serializable user configuration object.
  • enableObjectReuse
    Enables reusing objects that Flink internally uses for deserialization and passing data to user-code
  • setAutoWatermarkInterval
    Sets the interval of the automatic watermark emission. Watermarks are used throughout the streaming
  • disableObjectReuse
    Disables reusing objects that Flink internally uses for deserialization and passing data to user-cod
  • getRestartStrategy
    Returns the restart strategy which has been set for the current job.
  • isSysoutLoggingEnabled
    Gets whether progress update messages should be printed to System.out
  • registerKryoType
    Registers the given type with the serialization stack. If the type is eventually serialized as a POJ
  • setRestartStrategy
    Sets the restart strategy to be used for recovery. ExecutionConfig config = env.getConfig();
  • registerKryoType,
  • setRestartStrategy,
  • getParallelism,
  • addDefaultKryoSerializer,
  • getGlobalJobParameters,
  • getNumberOfExecutionRetries,
  • getRegisteredKryoTypes,
  • setParallelism,
  • getDefaultKryoSerializerClasses

Popular in Java

  • Finding current android device location
  • findViewById (Activity)
  • getExternalFilesDir (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • JPanel (javax.swing)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now