use of org.apache.ignite.internal.processors.cache.persistence.wal.serializer.RecordV1Serializer in project ignite by apache.
the class IgniteWalSerializerVersionTest method testCheckDifferentSerializerVersions.
/**
* @throws Exception If failed.
*/
public void testCheckDifferentSerializerVersions() throws Exception {
System.setProperty(IGNITE_WAL_SERIALIZER_VERSION, "1");
IgniteEx ig0 = (IgniteEx) startGrid();
IgniteWriteAheadLogManager wal0 = ig0.context().cache().context().wal();
RecordSerializer ser0 = U.field(wal0, "serializer");
assertTrue(ser0 instanceof RecordV1Serializer);
stopGrid();
System.setProperty(IGNITE_WAL_SERIALIZER_VERSION, "2");
IgniteEx ig1 = (IgniteEx) startGrid();
IgniteWriteAheadLogManager wal1 = ig1.context().cache().context().wal();
RecordSerializer ser1 = U.field(wal1, "serializer");
assertTrue(ser1 instanceof RecordV2Serializer);
stopGrid();
System.setProperty(IGNITE_WAL_SERIALIZER_VERSION, "3");
GridTestUtils.assertThrowsAnyCause(log, new GPC<Void>() {
@Override
public Void call() throws Exception {
startGrid();
return null;
}
}, IgniteCheckedException.class, "Failed to create a serializer with the given version");
System.setProperty(IGNITE_WAL_SERIALIZER_VERSION, "1");
IgniteEx ig2 = (IgniteEx) startGrid();
IgniteWriteAheadLogManager wal2 = ig2.context().cache().context().wal();
RecordSerializer ser2 = U.field(wal2, "serializer");
assertTrue(ser2 instanceof RecordV1Serializer);
stopGrid();
}
Aggregations