Java Code Examples for org.apache.flink.api.common.typeutils.base.array.StringArraySerializer

The following examples show how to use org.apache.flink.api.common.typeutils.base.array.StringArraySerializer. 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: BasicArrayTypeInfo.java    License: Apache License 2.0 5 votes vote down vote up
@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 2
Source Project: flink   Source File: BasicArrayTypeInfo.java    License: Apache License 2.0 5 votes vote down vote up
@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 3
Source Project: flink   Source File: BasicArrayTypeInfo.java    License: Apache License 2.0 5 votes vote down vote up
@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 4
Source Project: Flink-CEPplus   Source File: StringArraySerializerTest.java    License: Apache License 2.0 4 votes vote down vote up
@Override
protected TypeSerializer<String[]> createSerializer() {
	return new StringArraySerializer();
}
 
Example 5
Source Project: Flink-CEPplus   Source File: StringArraySerializerTest.java    License: Apache License 2.0 4 votes vote down vote up
@Test
public void arrayTypeIsMutable() {
	StringArraySerializer serializer = (StringArraySerializer) createSerializer();
	assertFalse(serializer.isImmutableType());
}
 
Example 6
Source Project: flink   Source File: StringArraySerializerTest.java    License: Apache License 2.0 4 votes vote down vote up
@Override
protected TypeSerializer<String[]> createSerializer() {
	return new StringArraySerializer();
}
 
Example 7
Source Project: flink   Source File: StringArraySerializerTest.java    License: Apache License 2.0 4 votes vote down vote up
@Test
public void arrayTypeIsMutable() {
	StringArraySerializer serializer = (StringArraySerializer) createSerializer();
	assertFalse(serializer.isImmutableType());
}
 
Example 8
Source Project: flink   Source File: StringArraySerializerTest.java    License: Apache License 2.0 4 votes vote down vote up
@Override
protected TypeSerializer<String[]> createSerializer() {
	return new StringArraySerializer();
}
 
Example 9
Source Project: flink   Source File: StringArraySerializerTest.java    License: Apache License 2.0 4 votes vote down vote up
@Test
public void arrayTypeIsMutable() {
	StringArraySerializer serializer = (StringArraySerializer) createSerializer();
	assertFalse(serializer.isImmutableType());
}