Java Code Examples for org.apache.flink.api.java.typeutils.runtime.kryo.KryoPojosForMigrationTests.Dog

The following examples show how to use org.apache.flink.api.java.typeutils.runtime.kryo.KryoPojosForMigrationTests.Dog. 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: KryoSerializerSnapshotTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void addingTypesIsCompatibleAfterReconfiguration() {
	oldConfig.registerKryoType(Animal.class);

	newConfig.registerKryoType(Animal.class);
	newConfig.registerTypeWithKryoSerializer(Dog.class, DogKryoSerializer.class);

	assertThat(resolveKryoCompatibility(oldConfig, newConfig),
		isCompatibleWithReconfiguredSerializer());
}
 
Example 2
Source Project: Flink-CEPplus   Source File: KryoSerializerSnapshotTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void replacingKryoSerializersIsCompatibleAsIs() {
	oldConfig.registerKryoType(Animal.class);
	oldConfig.registerTypeWithKryoSerializer(Dog.class, DogKryoSerializer.class);

	newConfig.registerKryoType(Animal.class);
	newConfig.registerTypeWithKryoSerializer(Dog.class, DogV2KryoSerializer.class);

	// it is compatible as is, since Kryo does not expose compatibility API with KryoSerializers
	// so we can not know if DogKryoSerializer is compatible with DogV2KryoSerializer
	assertThat(resolveKryoCompatibility(oldConfig, newConfig),
		isCompatibleAsIs());
}
 
Example 3
Source Project: Flink-CEPplus   Source File: KryoSerializerSnapshotTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void reorderingIsCompatibleAfterReconfiguration() {
	oldConfig.registerKryoType(Parrot.class);
	oldConfig.registerKryoType(Dog.class);

	newConfig.registerKryoType(Dog.class);
	newConfig.registerKryoType(Parrot.class);

	assertThat(resolveKryoCompatibility(oldConfig, newConfig),
		isCompatibleWithReconfiguredSerializer());
}
 
Example 4
Source Project: flink   Source File: KryoSerializerSnapshotTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void addingTypesIsCompatibleAfterReconfiguration() {
	oldConfig.registerKryoType(Animal.class);

	newConfig.registerKryoType(Animal.class);
	newConfig.registerTypeWithKryoSerializer(Dog.class, DogKryoSerializer.class);

	assertThat(resolveKryoCompatibility(oldConfig, newConfig),
		isCompatibleWithReconfiguredSerializer());
}
 
Example 5
Source Project: flink   Source File: KryoSerializerSnapshotTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void replacingKryoSerializersIsCompatibleAsIs() {
	oldConfig.registerKryoType(Animal.class);
	oldConfig.registerTypeWithKryoSerializer(Dog.class, DogKryoSerializer.class);

	newConfig.registerKryoType(Animal.class);
	newConfig.registerTypeWithKryoSerializer(Dog.class, DogV2KryoSerializer.class);

	// it is compatible as is, since Kryo does not expose compatibility API with KryoSerializers
	// so we can not know if DogKryoSerializer is compatible with DogV2KryoSerializer
	assertThat(resolveKryoCompatibility(oldConfig, newConfig),
		isCompatibleAsIs());
}
 
Example 6
Source Project: flink   Source File: KryoSerializerSnapshotTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void reorderingIsCompatibleAfterReconfiguration() {
	oldConfig.registerKryoType(Parrot.class);
	oldConfig.registerKryoType(Dog.class);

	newConfig.registerKryoType(Dog.class);
	newConfig.registerKryoType(Parrot.class);

	assertThat(resolveKryoCompatibility(oldConfig, newConfig),
		isCompatibleWithReconfiguredSerializer());
}
 
Example 7
Source Project: flink   Source File: KryoSerializerSnapshotTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void addingTypesIsCompatibleAfterReconfiguration() {
	oldConfig.registerKryoType(Animal.class);

	newConfig.registerKryoType(Animal.class);
	newConfig.registerTypeWithKryoSerializer(Dog.class, DogKryoSerializer.class);

	assertThat(resolveKryoCompatibility(oldConfig, newConfig),
		isCompatibleWithReconfiguredSerializer());
}
 
Example 8
Source Project: flink   Source File: KryoSerializerSnapshotTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void replacingKryoSerializersIsCompatibleAsIs() {
	oldConfig.registerKryoType(Animal.class);
	oldConfig.registerTypeWithKryoSerializer(Dog.class, DogKryoSerializer.class);

	newConfig.registerKryoType(Animal.class);
	newConfig.registerTypeWithKryoSerializer(Dog.class, DogV2KryoSerializer.class);

	// it is compatible as is, since Kryo does not expose compatibility API with KryoSerializers
	// so we can not know if DogKryoSerializer is compatible with DogV2KryoSerializer
	assertThat(resolveKryoCompatibility(oldConfig, newConfig),
		isCompatibleAsIs());
}
 
Example 9
Source Project: flink   Source File: KryoSerializerSnapshotTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void reorderingIsCompatibleAfterReconfiguration() {
	oldConfig.registerKryoType(Parrot.class);
	oldConfig.registerKryoType(Dog.class);

	newConfig.registerKryoType(Dog.class);
	newConfig.registerKryoType(Parrot.class);

	assertThat(resolveKryoCompatibility(oldConfig, newConfig),
		isCompatibleWithReconfiguredSerializer());
}
 
Example 10
Source Project: flink   Source File: KryoSerializerUpgradeTest.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public TypeSerializer<Animal> createPriorSerializer() {
	ExecutionConfig executionConfig = new ExecutionConfig();
	executionConfig.registerKryoType(Dog.class);
	executionConfig.registerKryoType(Cat.class);
	executionConfig.registerKryoType(Parrot.class);

	return new KryoSerializer<>(Animal.class, executionConfig);
}
 
Example 11
Source Project: flink   Source File: KryoSerializerUpgradeTest.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public TypeSerializer<Animal> createUpgradedSerializer() {
	ExecutionConfig executionConfig = new ExecutionConfig();
	executionConfig.registerKryoType(DummyClassOne.class);
	executionConfig.registerKryoType(Dog.class);
	executionConfig.registerKryoType(DummyClassTwo.class);
	executionConfig.registerKryoType(Cat.class);
	executionConfig.registerKryoType(Parrot.class);

	return new KryoSerializer<>(Animal.class, executionConfig);
}
 
Example 12
Source Project: flink   Source File: KryoSerializerUpgradeTest.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public TypeSerializer<Animal> createPriorSerializer() {
	ExecutionConfig executionConfig = new ExecutionConfig();
	executionConfig.registerTypeWithKryoSerializer(
			Dog.class,
			KryoPojosForMigrationTests.DogKryoSerializer.class);
	executionConfig.registerKryoType(Cat.class);
	executionConfig.registerTypeWithKryoSerializer(
			Parrot.class,
			KryoPojosForMigrationTests.ParrotKryoSerializer.class);

	return new KryoSerializer<>(Animal.class, executionConfig);
}
 
Example 13
Source Project: flink   Source File: KryoSerializerUpgradeTest.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public TypeSerializer<Animal> createUpgradedSerializer() {
	ExecutionConfig executionConfig = new ExecutionConfig();
	executionConfig.registerKryoType(DummyClassOne.class);
	executionConfig.registerTypeWithKryoSerializer(
			Dog.class,
			KryoPojosForMigrationTests.DogV2KryoSerializer.class);
	executionConfig.registerKryoType(DummyClassTwo.class);
	executionConfig.registerKryoType(Cat.class);
	executionConfig.registerTypeWithKryoSerializer(
			Parrot.class,
			KryoPojosForMigrationTests.ParrotKryoSerializer.class);

	return new KryoSerializer<>(Animal.class, executionConfig);
}
 
Example 14
Source Project: flink   Source File: KryoSerializerUpgradeTest.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public Animal createTestData() {
	return new Dog("Hasso");
}
 
Example 15
Source Project: flink   Source File: KryoSerializerUpgradeTest.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public Matcher<Animal> testDataMatcher() {
	return is(new Dog("Hasso"));
}
 
Example 16
Source Project: flink   Source File: KryoSerializerUpgradeTest.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public Matcher<Animal> testDataMatcher() {
	return is(new Dog("Hasso"));
}
 
Example 17
Source Project: flink   Source File: KryoSerializerUpgradeTest.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public Animal createTestData() {
	return new Dog("Hasso");
}
 
Example 18
Source Project: flink   Source File: KryoSerializerUpgradeTest.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public Matcher<Animal> testDataMatcher() {
	return is(new Dog("Hasso"));
}
 
Example 19
Source Project: flink   Source File: KryoSerializerUpgradeTest.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public Animal createTestData() {
	return new Dog("Hasso");
}
 
Example 20
Source Project: flink   Source File: KryoSerializerUpgradeTest.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public Matcher<Animal> testDataMatcher() {
	return is(new Dog("Hasso"));
}