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

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