Java Code Examples for org.apache.flink.api.java.typeutils.runtime.RuntimeSerializerFactory

The following examples show how to use org.apache.flink.api.java.typeutils.runtime.RuntimeSerializerFactory. These examples are extracted from open source projects. 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 Project: Flink-CEPplus   Source File: BinaryOperatorTestBase.java    License: Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
public void addInputSorted(MutableObjectIterator<IN> input, TypeSerializer<IN> serializer, TypeComparator<IN> comp) throws Exception {
	this.inputSerializers.add(serializer);
	UnilateralSortMerger<IN> sorter = new UnilateralSortMerger<>(
			this.memManager,
			this.ioManager,
			input,
			this.owner,
			new RuntimeSerializerFactory<>(serializer, (Class<IN>) serializer.createInstance().getClass()),
			comp,
			this.perSortFractionMem,
			32,
			0.8f,
			true /*use large record handler*/,
			false
	);
	this.sorters.add(sorter);
	this.inputs.add(null);
}
 
Example 2
Source Project: flink   Source File: BinaryOperatorTestBase.java    License: Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
public void addInputSorted(MutableObjectIterator<IN> input, TypeSerializer<IN> serializer, TypeComparator<IN> comp) throws Exception {
	this.inputSerializers.add(serializer);
	UnilateralSortMerger<IN> sorter = new UnilateralSortMerger<>(
			this.memManager,
			this.ioManager,
			input,
			this.owner,
			new RuntimeSerializerFactory<>(serializer, (Class<IN>) serializer.createInstance().getClass()),
			comp,
			this.perSortFractionMem,
			32,
			0.8f,
			true /*use large record handler*/,
			false
	);
	this.sorters.add(sorter);
	this.inputs.add(null);
}
 
Example 3
Source Project: flink   Source File: BinaryOperatorTestBase.java    License: Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
public void addInputSorted(MutableObjectIterator<IN> input, TypeSerializer<IN> serializer, TypeComparator<IN> comp) throws Exception {
	this.inputSerializers.add(serializer);
	UnilateralSortMerger<IN> sorter = new UnilateralSortMerger<>(
			this.memManager,
			this.ioManager,
			input,
			this.owner,
			new RuntimeSerializerFactory<>(serializer, (Class<IN>) serializer.createInstance().getClass()),
			comp,
			this.perSortFractionMem,
			32,
			0.8f,
			true /*use large record handler*/,
			false
	);
	this.sorters.add(sorter);
	this.inputs.add(null);
}
 
Example 4
Source Project: Flink-CEPplus   Source File: UnaryOperatorTestBase.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public <X> TypeSerializerFactory<X> getInputSerializer(int index) {
	if (index != 0) {
		throw new IllegalArgumentException();
	}
	
	@SuppressWarnings("unchecked")
	TypeSerializer<X> ser = (TypeSerializer<X>) inputSerializer;
	return new RuntimeSerializerFactory<X>(ser, (Class<X>) ser.createInstance().getClass());
}
 
Example 5
Source Project: flink   Source File: UnaryOperatorTestBase.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public <X> TypeSerializerFactory<X> getInputSerializer(int index) {
	if (index != 0) {
		throw new IllegalArgumentException();
	}
	
	@SuppressWarnings("unchecked")
	TypeSerializer<X> ser = (TypeSerializer<X>) inputSerializer;
	return new RuntimeSerializerFactory<X>(ser, (Class<X>) ser.createInstance().getClass());
}
 
Example 6
Source Project: flink   Source File: UnaryOperatorTestBase.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public <X> TypeSerializerFactory<X> getInputSerializer(int index) {
	if (index != 0) {
		throw new IllegalArgumentException();
	}
	
	@SuppressWarnings("unchecked")
	TypeSerializer<X> ser = (TypeSerializer<X>) inputSerializer;
	return new RuntimeSerializerFactory<X>(ser, (Class<X>) ser.createInstance().getClass());
}
 
Example 7
Source Project: Flink-CEPplus   Source File: TestTaskContext.java    License: Apache License 2.0 4 votes vote down vote up
@SuppressWarnings("unchecked")
public <X> void setInput1(MutableObjectIterator<X> input, TypeSerializer<X> serializer) {
	this.input1 = input;
	this.serializer1 = new RuntimeSerializerFactory<X>(serializer, (Class<X>) serializer.createInstance().getClass());
}
 
Example 8
Source Project: Flink-CEPplus   Source File: TestTaskContext.java    License: Apache License 2.0 4 votes vote down vote up
@SuppressWarnings("unchecked")
public <X> void setInput2(MutableObjectIterator<X> input, TypeSerializer<X> serializer) {
	this.input2 = input;
	this.serializer2 = new RuntimeSerializerFactory<X>(serializer, (Class<X>) serializer.createInstance().getClass());
}
 
Example 9
Source Project: Flink-CEPplus   Source File: BinaryOperatorTestBase.java    License: Apache License 2.0 4 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
public <X> TypeSerializerFactory<X> getInputSerializer(int index) {
	TypeSerializer<X> ser = (TypeSerializer<X>) this.inputSerializers.get(index);
	return new RuntimeSerializerFactory<>(ser, (Class<X>) ser.createInstance().getClass());
}
 
Example 10
Source Project: Flink-CEPplus   Source File: JavaApiPostPass.java    License: Apache License 2.0 4 votes vote down vote up
private <T> TypeSerializerFactory<?> createSerializer(TypeInformation<T> typeInfo) {
	TypeSerializer<T> serializer = typeInfo.createSerializer(executionConfig);

	return new RuntimeSerializerFactory<T>(serializer, typeInfo.getTypeClass());
}
 
Example 11
Source Project: flink   Source File: TestTaskContext.java    License: Apache License 2.0 4 votes vote down vote up
@SuppressWarnings("unchecked")
public <X> void setInput1(MutableObjectIterator<X> input, TypeSerializer<X> serializer) {
	this.input1 = input;
	this.serializer1 = new RuntimeSerializerFactory<X>(serializer, (Class<X>) serializer.createInstance().getClass());
}
 
Example 12
Source Project: flink   Source File: TestTaskContext.java    License: Apache License 2.0 4 votes vote down vote up
@SuppressWarnings("unchecked")
public <X> void setInput2(MutableObjectIterator<X> input, TypeSerializer<X> serializer) {
	this.input2 = input;
	this.serializer2 = new RuntimeSerializerFactory<X>(serializer, (Class<X>) serializer.createInstance().getClass());
}
 
Example 13
Source Project: flink   Source File: BinaryOperatorTestBase.java    License: Apache License 2.0 4 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
public <X> TypeSerializerFactory<X> getInputSerializer(int index) {
	TypeSerializer<X> ser = (TypeSerializer<X>) this.inputSerializers.get(index);
	return new RuntimeSerializerFactory<>(ser, (Class<X>) ser.createInstance().getClass());
}
 
Example 14
Source Project: flink   Source File: JavaApiPostPass.java    License: Apache License 2.0 4 votes vote down vote up
private <T> TypeSerializerFactory<?> createSerializer(TypeInformation<T> typeInfo) {
	TypeSerializer<T> serializer = typeInfo.createSerializer(executionConfig);

	return new RuntimeSerializerFactory<T>(serializer, typeInfo.getTypeClass());
}
 
Example 15
Source Project: flink   Source File: TestTaskContext.java    License: Apache License 2.0 4 votes vote down vote up
@SuppressWarnings("unchecked")
public <X> void setInput1(MutableObjectIterator<X> input, TypeSerializer<X> serializer) {
	this.input1 = input;
	this.serializer1 = new RuntimeSerializerFactory<X>(serializer, (Class<X>) serializer.createInstance().getClass());
}
 
Example 16
Source Project: flink   Source File: TestTaskContext.java    License: Apache License 2.0 4 votes vote down vote up
@SuppressWarnings("unchecked")
public <X> void setInput2(MutableObjectIterator<X> input, TypeSerializer<X> serializer) {
	this.input2 = input;
	this.serializer2 = new RuntimeSerializerFactory<X>(serializer, (Class<X>) serializer.createInstance().getClass());
}
 
Example 17
Source Project: flink   Source File: BinaryOperatorTestBase.java    License: Apache License 2.0 4 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
public <X> TypeSerializerFactory<X> getInputSerializer(int index) {
	TypeSerializer<X> ser = (TypeSerializer<X>) this.inputSerializers.get(index);
	return new RuntimeSerializerFactory<>(ser, (Class<X>) ser.createInstance().getClass());
}
 
Example 18
Source Project: flink   Source File: JavaApiPostPass.java    License: Apache License 2.0 4 votes vote down vote up
private <T> TypeSerializerFactory<?> createSerializer(TypeInformation<T> typeInfo) {
	TypeSerializer<T> serializer = typeInfo.createSerializer(executionConfig);

	return new RuntimeSerializerFactory<T>(serializer, typeInfo.getTypeClass());
}