org.apache.flink.api.common.typeutils.NestedSerializersSnapshotDelegate Java Examples

The following examples show how to use org.apache.flink.api.common.typeutils.NestedSerializersSnapshotDelegate. 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: RowDataSerializer.java    From flink with Apache License 2.0 6 votes vote down vote up
@Override
public void readSnapshot(int readVersion, DataInputView in, ClassLoader userCodeClassLoader)
	throws IOException {
	int length = in.readInt();
	DataInputViewStream stream = new DataInputViewStream(in);
	previousTypes = new LogicalType[length];
	for (int i = 0; i < length; i++) {
		try {
			previousTypes[i] = InstantiationUtil.deserializeObject(
				stream,
				userCodeClassLoader
			);
		}
		catch (ClassNotFoundException e) {
			throw new IOException(e);
		}
	}
	this.nestedSerializersSnapshotDelegate = NestedSerializersSnapshotDelegate.readNestedSerializerSnapshots(
		in,
		userCodeClassLoader
	);
}
 
Example #2
Source File: RowDataSerializer.java    From flink with Apache License 2.0 6 votes vote down vote up
@Override
public void readSnapshot(int readVersion, DataInputView in, ClassLoader userCodeClassLoader)
	throws IOException {
	int length = in.readInt();
	DataInputViewStream stream = new DataInputViewStream(in);
	previousTypes = new LogicalType[length];
	for (int i = 0; i < length; i++) {
		try {
			previousTypes[i] = InstantiationUtil.deserializeObject(
				stream,
				userCodeClassLoader
			);
		} catch (ClassNotFoundException e) {
			throw new IOException(e);
		}
	}
	this.nestedSerializersSnapshotDelegate = NestedSerializersSnapshotDelegate.readNestedSerializerSnapshots(
		in,
		userCodeClassLoader
	);
}
 
Example #3
Source File: BaseRowSerializer.java    From flink with Apache License 2.0 6 votes vote down vote up
@Override
public void readSnapshot(int readVersion, DataInputView in, ClassLoader userCodeClassLoader)
		throws IOException {
	int length = in.readInt();
	DataInputViewStream stream = new DataInputViewStream(in);
	previousTypes = new LogicalType[length];
	for (int i = 0; i < length; i++) {
		try {
			previousTypes[i] = InstantiationUtil.deserializeObject(
					stream,
					userCodeClassLoader
			);
		}
		catch (ClassNotFoundException e) {
			throw new IOException(e);
		}
	}
	this.nestedSerializersSnapshotDelegate = NestedSerializersSnapshotDelegate.readNestedSerializerSnapshots(
			in,
			userCodeClassLoader
	);
}
 
Example #4
Source File: EitherSerializerSnapshot.java    From flink with Apache License 2.0 5 votes vote down vote up
/**
 * Constructor to create the snapshot for writing.
 */
public EitherSerializerSnapshot(
		TypeSerializer<L> leftSerializer,
		TypeSerializer<R> rightSerializer) {

	this.nestedSnapshot = new NestedSerializersSnapshotDelegate(leftSerializer, rightSerializer);
}
 
Example #5
Source File: SortedMapSerializerSnapshot.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public void readSnapshot(int readVersion, DataInputView in, ClassLoader userCodeClassLoader) throws IOException {
	try {
		comparator = InstantiationUtil.deserializeObject(
				new DataInputViewStream(in), userCodeClassLoader);
	} catch (ClassNotFoundException e) {
		throw new IOException(e);
	}
	this.nestedSerializersSnapshotDelegate = NestedSerializersSnapshotDelegate.readNestedSerializerSnapshots(
			in,
			userCodeClassLoader);
}
 
Example #6
Source File: GenericArraySerializerConfigSnapshot.java    From flink with Apache License 2.0 5 votes vote down vote up
private void readV1(DataInputView in, ClassLoader classLoader) throws IOException {
	nestedSnapshot = NestedSerializersSnapshotDelegate.legacyReadNestedSerializerSnapshots(in, classLoader);

	try (DataInputViewStream inViewWrapper = new DataInputViewStream(in)) {
		componentClass = InstantiationUtil.deserializeObject(inViewWrapper, classLoader);
	}
	catch (ClassNotFoundException e) {
		throw new IOException("Could not find requested element class in classpath.", e);
	}
}
 
Example #7
Source File: EitherSerializerSnapshot.java    From flink with Apache License 2.0 5 votes vote down vote up
/**
 * Constructor to create the snapshot for writing.
 */
public EitherSerializerSnapshot(
		TypeSerializer<L> leftSerializer,
		TypeSerializer<R> rightSerializer) {

	this.nestedSnapshot = new NestedSerializersSnapshotDelegate(leftSerializer, rightSerializer);
}
 
Example #8
Source File: SortedMapSerializerSnapshot.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public void readSnapshot(int readVersion, DataInputView in, ClassLoader userCodeClassLoader) throws IOException {
	try {
		comparator = InstantiationUtil.deserializeObject(
				new DataInputViewStream(in), userCodeClassLoader);
	} catch (ClassNotFoundException e) {
		throw new IOException(e);
	}
	this.nestedSerializersSnapshotDelegate = NestedSerializersSnapshotDelegate.readNestedSerializerSnapshots(
			in,
			userCodeClassLoader);
}
 
Example #9
Source File: GenericArraySerializerConfigSnapshot.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
private void readV1(DataInputView in, ClassLoader classLoader) throws IOException {
	nestedSnapshot = NestedSerializersSnapshotDelegate.legacyReadNestedSerializerSnapshots(in, classLoader);

	try (DataInputViewStream inViewWrapper = new DataInputViewStream(in)) {
		componentClass = InstantiationUtil.deserializeObject(inViewWrapper, classLoader);
	}
	catch (ClassNotFoundException e) {
		throw new IOException("Could not find requested element class in classpath.", e);
	}
}
 
Example #10
Source File: GenericArraySerializerConfigSnapshot.java    From flink with Apache License 2.0 5 votes vote down vote up
private void readV1(DataInputView in, ClassLoader classLoader) throws IOException {
	nestedSnapshot = NestedSerializersSnapshotDelegate.legacyReadNestedSerializerSnapshots(in, classLoader);

	try (DataInputViewStream inViewWrapper = new DataInputViewStream(in)) {
		componentClass = InstantiationUtil.deserializeObject(inViewWrapper, classLoader);
	}
	catch (ClassNotFoundException e) {
		throw new IOException("Could not find requested element class in classpath.", e);
	}
}
 
Example #11
Source File: EitherSerializerSnapshot.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
/**
 * Constructor to create the snapshot for writing.
 */
public EitherSerializerSnapshot(
		TypeSerializer<L> leftSerializer,
		TypeSerializer<R> rightSerializer) {

	this.nestedSnapshot = new NestedSerializersSnapshotDelegate(leftSerializer, rightSerializer);
}
 
Example #12
Source File: GenericArraySerializerConfigSnapshot.java    From flink with Apache License 2.0 4 votes vote down vote up
private void readV2(DataInputView in, ClassLoader classLoader) throws IOException {
	componentClass = InstantiationUtil.resolveClassByName(in, classLoader);
	nestedSnapshot = NestedSerializersSnapshotDelegate.readNestedSerializerSnapshots(in, classLoader);
}
 
Example #13
Source File: EitherSerializerSnapshot.java    From flink with Apache License 2.0 4 votes vote down vote up
private void readV1(DataInputView in, ClassLoader classLoader) throws IOException {
	nestedSnapshot = NestedSerializersSnapshotDelegate.legacyReadNestedSerializerSnapshots(in, classLoader);
}
 
Example #14
Source File: EitherSerializerSnapshot.java    From flink with Apache License 2.0 4 votes vote down vote up
private void readV2(DataInputView in, ClassLoader classLoader) throws IOException {
	nestedSnapshot = NestedSerializersSnapshotDelegate.readNestedSerializerSnapshots(in, classLoader);
}
 
Example #15
Source File: RowDataSerializer.java    From flink with Apache License 2.0 4 votes vote down vote up
RowDataSerializerSnapshot(LogicalType[] types, TypeSerializer[] serializers) {
	this.previousTypes = types;
	this.nestedSerializersSnapshotDelegate = new NestedSerializersSnapshotDelegate(
		serializers);
}
 
Example #16
Source File: GenericArraySerializerConfigSnapshot.java    From flink with Apache License 2.0 4 votes vote down vote up
/**
 * Constructor to create the snapshot for writing.
 */
public GenericArraySerializerConfigSnapshot(GenericArraySerializer<C> serializer) {
	this.componentClass = serializer.getComponentClass();
	this.nestedSnapshot = new NestedSerializersSnapshotDelegate(serializer.getComponentSerializer());
}
 
Example #17
Source File: RowDataSerializer.java    From flink with Apache License 2.0 4 votes vote down vote up
RowDataSerializerSnapshot(LogicalType[] types, TypeSerializer[] serializers) {
	this.previousTypes = types;
	this.nestedSerializersSnapshotDelegate = new NestedSerializersSnapshotDelegate(
		serializers);
}
 
Example #18
Source File: SortedMapSerializerSnapshot.java    From flink with Apache License 2.0 4 votes vote down vote up
SortedMapSerializerSnapshot(SortedMapSerializer<K, V> sortedMapSerializer) {
	this.comparator = sortedMapSerializer.getComparator();
	TypeSerializer[] typeSerializers =
			new TypeSerializer<?>[] { sortedMapSerializer.getKeySerializer(), sortedMapSerializer.getValueSerializer() };
	this.nestedSerializersSnapshotDelegate = new NestedSerializersSnapshotDelegate(typeSerializers);
}
 
Example #19
Source File: GenericArraySerializerConfigSnapshot.java    From flink with Apache License 2.0 4 votes vote down vote up
private void readV2(DataInputView in, ClassLoader classLoader) throws IOException {
	componentClass = InstantiationUtil.resolveClassByName(in, classLoader);
	nestedSnapshot = NestedSerializersSnapshotDelegate.readNestedSerializerSnapshots(in, classLoader);
}
 
Example #20
Source File: GenericArraySerializerConfigSnapshot.java    From flink with Apache License 2.0 4 votes vote down vote up
/**
 * Constructor to create the snapshot for writing.
 */
public GenericArraySerializerConfigSnapshot(GenericArraySerializer<C> serializer) {
	this.componentClass = serializer.getComponentClass();
	this.nestedSnapshot = new NestedSerializersSnapshotDelegate(serializer.getComponentSerializer());
}
 
Example #21
Source File: EitherSerializerSnapshot.java    From flink with Apache License 2.0 4 votes vote down vote up
private void readV2(DataInputView in, ClassLoader classLoader) throws IOException {
	nestedSnapshot = NestedSerializersSnapshotDelegate.readNestedSerializerSnapshots(in, classLoader);
}
 
Example #22
Source File: EitherSerializerSnapshot.java    From flink with Apache License 2.0 4 votes vote down vote up
private void readV1(DataInputView in, ClassLoader classLoader) throws IOException {
	nestedSnapshot = NestedSerializersSnapshotDelegate.legacyReadNestedSerializerSnapshots(in, classLoader);
}
 
Example #23
Source File: BaseRowSerializer.java    From flink with Apache License 2.0 4 votes vote down vote up
BaseRowSerializerSnapshot(LogicalType[] types, TypeSerializer[] serializers) {
	this.previousTypes = types;
	this.nestedSerializersSnapshotDelegate = new NestedSerializersSnapshotDelegate(
			serializers);
}
 
Example #24
Source File: SortedMapSerializerSnapshot.java    From flink with Apache License 2.0 4 votes vote down vote up
SortedMapSerializerSnapshot(SortedMapSerializer<K, V> sortedMapSerializer) {
	this.comparator = sortedMapSerializer.getComparator();
	TypeSerializer[] typeSerializers =
			new TypeSerializer<?>[] { sortedMapSerializer.getKeySerializer(), sortedMapSerializer.getValueSerializer() };
	this.nestedSerializersSnapshotDelegate = new NestedSerializersSnapshotDelegate(typeSerializers);
}
 
Example #25
Source File: GenericArraySerializerConfigSnapshot.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
private void readV2(DataInputView in, ClassLoader classLoader) throws IOException {
	componentClass = InstantiationUtil.resolveClassByName(in, classLoader);
	nestedSnapshot = NestedSerializersSnapshotDelegate.readNestedSerializerSnapshots(in, classLoader);
}
 
Example #26
Source File: GenericArraySerializerConfigSnapshot.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
/**
 * Constructor to create the snapshot for writing.
 */
public GenericArraySerializerConfigSnapshot(GenericArraySerializer<C> serializer) {
	this.componentClass = serializer.getComponentClass();
	this.nestedSnapshot = new NestedSerializersSnapshotDelegate(serializer.getComponentSerializer());
}
 
Example #27
Source File: EitherSerializerSnapshot.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
private void readV2(DataInputView in, ClassLoader classLoader) throws IOException {
	nestedSnapshot = NestedSerializersSnapshotDelegate.readNestedSerializerSnapshots(in, classLoader);
}
 
Example #28
Source File: EitherSerializerSnapshot.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
private void readV1(DataInputView in, ClassLoader classLoader) throws IOException {
	nestedSnapshot = NestedSerializersSnapshotDelegate.legacyReadNestedSerializerSnapshots(in, classLoader);
}