org.apache.flink.api.common.typeutils.base.GenericArraySerializer Java Examples
The following examples show how to use
org.apache.flink.api.common.typeutils.base.GenericArraySerializer.
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: AbstractGenericArraySerializerTest.java From Flink-CEPplus with Apache License 2.0 | 6 votes |
@SafeVarargs private final <T> void runTests(Class<T> type, TypeSerializer<T> componentSerializer, T[]... instances) { try { if (type == null || componentSerializer == null || instances == null || instances.length == 0) { throw new IllegalArgumentException(); } @SuppressWarnings("unchecked") Class<T[]> arrayClass = (Class<T[]>) (Class<?>) Array.newInstance(type, 0).getClass(); GenericArraySerializer<T> serializer = createSerializer(type, componentSerializer); SerializerTestInstance<T[]> test = new SerializerTestInstance<T[]>(serializer, arrayClass, -1, instances); test.testAll(); } catch (Exception e) { System.err.println(e.getMessage()); e.printStackTrace(); Assert.fail(e.getMessage()); } }
Example #2
Source File: AbstractGenericArraySerializerTest.java From flink with Apache License 2.0 | 6 votes |
@SafeVarargs private final <T> void runTests(Class<T> type, TypeSerializer<T> componentSerializer, T[]... instances) { try { if (type == null || componentSerializer == null || instances == null || instances.length == 0) { throw new IllegalArgumentException(); } @SuppressWarnings("unchecked") Class<T[]> arrayClass = (Class<T[]>) (Class<?>) Array.newInstance(type, 0).getClass(); GenericArraySerializer<T> serializer = createSerializer(type, componentSerializer); SerializerTestInstance<T[]> test = new SerializerTestInstance<T[]>(serializer, arrayClass, -1, instances); test.testAll(); } catch (Exception e) { System.err.println(e.getMessage()); e.printStackTrace(); Assert.fail(e.getMessage()); } }
Example #3
Source File: PythonTypeUtils.java From flink with Apache License 2.0 | 6 votes |
@SuppressWarnings("unchecked") @Override public TypeSerializer visit(ArrayType arrayType) { LogicalType elementType = arrayType.getElementType(); TypeSerializer<?> elementTypeSerializer = elementType.accept(this); Class<?> elementClass = elementType.accept(LogicalTypeToConversionClassConverter.INSTANCE); return new GenericArraySerializer(elementClass, elementTypeSerializer); }
Example #4
Source File: AbstractGenericArraySerializerTest.java From flink with Apache License 2.0 | 6 votes |
@SafeVarargs private final <T> void runTests(Class<T> type, TypeSerializer<T> componentSerializer, T[]... instances) { try { if (type == null || componentSerializer == null || instances == null || instances.length == 0) { throw new IllegalArgumentException(); } @SuppressWarnings("unchecked") Class<T[]> arrayClass = (Class<T[]>) (Class<?>) Array.newInstance(type, 0).getClass(); GenericArraySerializer<T> serializer = createSerializer(type, componentSerializer); SerializerTestInstance<T[]> test = new SerializerTestInstance<T[]>(serializer, arrayClass, -1, instances); test.testAll(); } catch (Exception e) { System.err.println(e.getMessage()); e.printStackTrace(); Assert.fail(e.getMessage()); } }
Example #5
Source File: ObjectArrayTypeInfo.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
@SuppressWarnings("unchecked") @Override @PublicEvolving public TypeSerializer<T> createSerializer(ExecutionConfig executionConfig) { return (TypeSerializer<T>) new GenericArraySerializer<C>( componentInfo.getTypeClass(), componentInfo.createSerializer(executionConfig)); }
Example #6
Source File: BasicArrayTypeInfo.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
@Override @SuppressWarnings("unchecked") @PublicEvolving public TypeSerializer<T> createSerializer(ExecutionConfig executionConfig) { // special case the string array if (componentInfo.getTypeClass().equals(String.class)) { return (TypeSerializer<T>) StringArraySerializer.INSTANCE; } else { return (TypeSerializer<T>) new GenericArraySerializer<>( this.componentInfo.getTypeClass(), this.componentInfo.createSerializer(executionConfig)); } }
Example #7
Source File: ObjectArrayTypeInfo.java From flink with Apache License 2.0 | 5 votes |
@SuppressWarnings("unchecked") @Override @PublicEvolving public TypeSerializer<T> createSerializer(ExecutionConfig executionConfig) { return (TypeSerializer<T>) new GenericArraySerializer<C>( componentInfo.getTypeClass(), componentInfo.createSerializer(executionConfig)); }
Example #8
Source File: BasicArrayTypeInfo.java From flink with Apache License 2.0 | 5 votes |
@Override @SuppressWarnings("unchecked") @PublicEvolving public TypeSerializer<T> createSerializer(ExecutionConfig executionConfig) { // special case the string array if (componentInfo.getTypeClass().equals(String.class)) { return (TypeSerializer<T>) StringArraySerializer.INSTANCE; } else { return (TypeSerializer<T>) new GenericArraySerializer<>( this.componentInfo.getTypeClass(), this.componentInfo.createSerializer(executionConfig)); } }
Example #9
Source File: ObjectArrayTypeInfo.java From flink with Apache License 2.0 | 5 votes |
@SuppressWarnings("unchecked") @Override @PublicEvolving public TypeSerializer<T> createSerializer(ExecutionConfig executionConfig) { return (TypeSerializer<T>) new GenericArraySerializer<C>( componentInfo.getTypeClass(), componentInfo.createSerializer(executionConfig)); }
Example #10
Source File: BasicArrayTypeInfo.java From flink with Apache License 2.0 | 5 votes |
@Override @SuppressWarnings("unchecked") @PublicEvolving public TypeSerializer<T> createSerializer(ExecutionConfig executionConfig) { // special case the string array if (componentInfo.getTypeClass().equals(String.class)) { return (TypeSerializer<T>) StringArraySerializer.INSTANCE; } else { return (TypeSerializer<T>) new GenericArraySerializer<>( this.componentInfo.getTypeClass(), this.componentInfo.createSerializer(executionConfig)); } }
Example #11
Source File: AbstractGenericArraySerializerTest.java From Flink-CEPplus with Apache License 2.0 | 4 votes |
private <T> GenericArraySerializer<T> createSerializer(Class<T> type, TypeSerializer<T> componentSerializer) { return new GenericArraySerializer<T>(type, componentSerializer); }
Example #12
Source File: AbstractGenericArraySerializerTest.java From flink with Apache License 2.0 | 4 votes |
private <T> GenericArraySerializer<T> createSerializer(Class<T> type, TypeSerializer<T> componentSerializer) { return new GenericArraySerializer<T>(type, componentSerializer); }
Example #13
Source File: AbstractGenericArraySerializerTest.java From flink with Apache License 2.0 | 4 votes |
private <T> GenericArraySerializer<T> createSerializer(Class<T> type, TypeSerializer<T> componentSerializer) { return new GenericArraySerializer<T>(type, componentSerializer); }
Example #14
Source File: CompositeTypeSerializerUpgradeTest.java From flink with Apache License 2.0 | 4 votes |
@Override public TypeSerializer<String[]> createPriorSerializer() { return new GenericArraySerializer<>(String.class, StringSerializer.INSTANCE); }
Example #15
Source File: CompositeTypeSerializerUpgradeTest.java From flink with Apache License 2.0 | 4 votes |
@Override public TypeSerializer<String[]> createUpgradedSerializer() { return new GenericArraySerializer<>(String.class, StringSerializer.INSTANCE); }