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

The following examples show how to use org.apache.flink.api.java.typeutils.runtime.RuntimeSerializerFactory. 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: BinaryOperatorTestBase.java    From Flink-CEPplus with 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 File: BinaryOperatorTestBase.java    From flink with 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 File: BinaryOperatorTestBase.java    From flink with 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 File: UnaryOperatorTestBase.java    From Flink-CEPplus with 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 File: UnaryOperatorTestBase.java    From flink with 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 File: UnaryOperatorTestBase.java    From flink with 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 File: JavaApiPostPass.java    From flink with 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 #8
Source File: TestTaskContext.java    From Flink-CEPplus with 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 #9
Source File: BinaryOperatorTestBase.java    From flink with 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 File: TestTaskContext.java    From flink with 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 #11
Source File: TestTaskContext.java    From flink with 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 File: JavaApiPostPass.java    From flink with 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 #13
Source File: BinaryOperatorTestBase.java    From flink with 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 File: TestTaskContext.java    From flink with 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 #15
Source File: TestTaskContext.java    From flink with 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 File: JavaApiPostPass.java    From Flink-CEPplus with 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 #17
Source File: BinaryOperatorTestBase.java    From Flink-CEPplus with 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 File: TestTaskContext.java    From Flink-CEPplus with 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());
}