Search in sources :

Example 6 with IdentifiedDataSerializable

use of com.hazelcast.nio.serialization.IdentifiedDataSerializable in project hazelcast by hazelcast.

the class MultiMapDataSerializerHook method createFactory.

public DataSerializableFactory createFactory() {
    ConstructorFunction<Integer, IdentifiedDataSerializable>[] constructors = new ConstructorFunction[ENTRY_SET_RESPONSE + 1];
    constructors[CLEAR_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ClearBackupOperation();
        }
    };
    constructors[CLEAR] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ClearOperation();
        }
    };
    constructors[CONTAINS_ENTRY] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ContainsEntryOperation();
        }
    };
    constructors[COUNT] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CountOperation();
        }
    };
    constructors[ENTRY_SET] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new EntrySetOperation();
        }
    };
    constructors[GET_ALL] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new GetAllOperation();
        }
    };
    constructors[KEY_SET] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new KeySetOperation();
        }
    };
    constructors[PUT_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new PutBackupOperation();
        }
    };
    constructors[PUT] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new PutOperation();
        }
    };
    constructors[REMOVE_ALL_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new RemoveAllBackupOperation();
        }
    };
    constructors[REMOVE_ALL] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new RemoveAllOperation();
        }
    };
    constructors[REMOVE_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new RemoveBackupOperation();
        }
    };
    constructors[REMOVE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new RemoveOperation();
        }
    };
    constructors[SIZE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new SizeOperation();
        }
    };
    constructors[VALUES] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ValuesOperation();
        }
    };
    constructors[TXN_COMMIT_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new TxnCommitBackupOperation();
        }
    };
    constructors[TXN_COMMIT] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new TxnCommitOperation();
        }
    };
    constructors[TXN_GENERATE_RECORD_ID] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new TxnGenerateRecordIdOperation();
        }
    };
    constructors[TXN_LOCK_AND_GET] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new TxnLockAndGetOperation();
        }
    };
    constructors[TXN_PREPARE_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new TxnPrepareBackupOperation();
        }
    };
    constructors[TXN_PREPARE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new TxnPrepareOperation();
        }
    };
    constructors[TXN_PUT] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new TxnPutOperation();
        }
    };
    constructors[TXN_PUT_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new TxnPutBackupOperation();
        }
    };
    constructors[TXN_REMOVE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new TxnRemoveOperation();
        }
    };
    constructors[TXN_REMOVE_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new TxnRemoveBackupOperation();
        }
    };
    constructors[TXN_REMOVE_ALL] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new TxnRemoveAllOperation();
        }
    };
    constructors[TXN_REMOVE_ALL_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new TxnRemoveAllBackupOperation();
        }
    };
    constructors[TXN_ROLLBACK_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new TxnRollbackBackupOperation();
        }
    };
    constructors[TXN_ROLLBACK] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new TxnRollbackOperation();
        }
    };
    constructors[MULTIMAP_OP_FACTORY] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new MultiMapOperationFactory();
        }
    };
    constructors[MULTIMAP_TRANSACTION_LOG_RECORD] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new MultiMapTransactionLogRecord();
        }
    };
    constructors[MULTIMAP_EVENT_FILTER] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new MultiMapEventFilter();
        }
    };
    constructors[MULTIMAP_RECORD] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new MultiMapRecord();
        }
    };
    constructors[MULTIMAP_MIGRATION_OPERATION] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new MultiMapMigrationOperation();
        }
    };
    constructors[MULTIMAP_RESPONSE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new MultiMapResponse();
        }
    };
    constructors[ENTRY_SET_RESPONSE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new EntrySetResponse();
        }
    };
    return new ArrayDataSerializableFactory(constructors);
}
Also used : TxnRemoveAllOperation(com.hazelcast.multimap.impl.txn.TxnRemoveAllOperation) RemoveAllOperation(com.hazelcast.multimap.impl.operations.RemoveAllOperation) GetAllOperation(com.hazelcast.multimap.impl.operations.GetAllOperation) TxnRemoveBackupOperation(com.hazelcast.multimap.impl.txn.TxnRemoveBackupOperation) TxnPrepareBackupOperation(com.hazelcast.multimap.impl.txn.TxnPrepareBackupOperation) EntrySetResponse(com.hazelcast.multimap.impl.operations.EntrySetResponse) ClearBackupOperation(com.hazelcast.multimap.impl.operations.ClearBackupOperation) MultiMapMigrationOperation(com.hazelcast.multimap.impl.operations.MultiMapMigrationOperation) TxnCommitOperation(com.hazelcast.multimap.impl.txn.TxnCommitOperation) MultiMapOperationFactory(com.hazelcast.multimap.impl.operations.MultiMapOperationFactory) TxnRemoveAllOperation(com.hazelcast.multimap.impl.txn.TxnRemoveAllOperation) TxnPrepareOperation(com.hazelcast.multimap.impl.txn.TxnPrepareOperation) KeySetOperation(com.hazelcast.multimap.impl.operations.KeySetOperation) PutBackupOperation(com.hazelcast.multimap.impl.operations.PutBackupOperation) TxnPutBackupOperation(com.hazelcast.multimap.impl.txn.TxnPutBackupOperation) ContainsEntryOperation(com.hazelcast.multimap.impl.operations.ContainsEntryOperation) CountOperation(com.hazelcast.multimap.impl.operations.CountOperation) SizeOperation(com.hazelcast.multimap.impl.operations.SizeOperation) TxnPutOperation(com.hazelcast.multimap.impl.txn.TxnPutOperation) MultiMapTransactionLogRecord(com.hazelcast.multimap.impl.txn.MultiMapTransactionLogRecord) IdentifiedDataSerializable(com.hazelcast.nio.serialization.IdentifiedDataSerializable) TxnRollbackOperation(com.hazelcast.multimap.impl.txn.TxnRollbackOperation) PutOperation(com.hazelcast.multimap.impl.operations.PutOperation) TxnPutOperation(com.hazelcast.multimap.impl.txn.TxnPutOperation) TxnRemoveAllBackupOperation(com.hazelcast.multimap.impl.txn.TxnRemoveAllBackupOperation) TxnRemoveOperation(com.hazelcast.multimap.impl.txn.TxnRemoveOperation) RemoveOperation(com.hazelcast.multimap.impl.operations.RemoveOperation) ClearOperation(com.hazelcast.multimap.impl.operations.ClearOperation) EntrySetOperation(com.hazelcast.multimap.impl.operations.EntrySetOperation) TxnRemoveOperation(com.hazelcast.multimap.impl.txn.TxnRemoveOperation) ConstructorFunction(com.hazelcast.util.ConstructorFunction) TxnPutBackupOperation(com.hazelcast.multimap.impl.txn.TxnPutBackupOperation) TxnCommitBackupOperation(com.hazelcast.multimap.impl.txn.TxnCommitBackupOperation) TxnLockAndGetOperation(com.hazelcast.multimap.impl.txn.TxnLockAndGetOperation) TxnRemoveAllBackupOperation(com.hazelcast.multimap.impl.txn.TxnRemoveAllBackupOperation) RemoveAllBackupOperation(com.hazelcast.multimap.impl.operations.RemoveAllBackupOperation) TxnGenerateRecordIdOperation(com.hazelcast.multimap.impl.txn.TxnGenerateRecordIdOperation) MultiMapResponse(com.hazelcast.multimap.impl.operations.MultiMapResponse) TxnRollbackBackupOperation(com.hazelcast.multimap.impl.txn.TxnRollbackBackupOperation) RemoveBackupOperation(com.hazelcast.multimap.impl.operations.RemoveBackupOperation) TxnRemoveBackupOperation(com.hazelcast.multimap.impl.txn.TxnRemoveBackupOperation) ArrayDataSerializableFactory(com.hazelcast.internal.serialization.impl.ArrayDataSerializableFactory) ValuesOperation(com.hazelcast.multimap.impl.operations.ValuesOperation)

Example 7 with IdentifiedDataSerializable

use of com.hazelcast.nio.serialization.IdentifiedDataSerializable in project hazelcast by hazelcast.

the class PredicateDataSerializerHook method createFactory.

@Override
public DataSerializableFactory createFactory() {
    ConstructorFunction<Integer, IdentifiedDataSerializable>[] constructors = new ConstructorFunction[LEN];
    constructors[SQL_PREDICATE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new SqlPredicate();
        }
    };
    constructors[AND_PREDICATE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new AndPredicate();
        }
    };
    constructors[BETWEEN_PREDICATE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new BetweenPredicate();
        }
    };
    constructors[EQUAL_PREDICATE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new EqualPredicate();
        }
    };
    constructors[GREATERLESS_PREDICATE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new GreaterLessPredicate();
        }
    };
    constructors[LIKE_PREDICATE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new LikePredicate();
        }
    };
    constructors[ILIKE_PREDICATE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ILikePredicate();
        }
    };
    constructors[IN_PREDICATE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new InPredicate();
        }
    };
    constructors[INSTANCEOF_PREDICATE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new InstanceOfPredicate();
        }
    };
    constructors[NOTEQUAL_PREDICATE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new NotEqualPredicate();
        }
    };
    constructors[NOT_PREDICATE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new NotPredicate();
        }
    };
    constructors[OR_PREDICATE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new OrPredicate();
        }
    };
    constructors[REGEX_PREDICATE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new RegexPredicate();
        }
    };
    constructors[FALSE_PREDICATE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return FalsePredicate.INSTANCE;
        }
    };
    constructors[TRUE_PREDICATE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return TruePredicate.INSTANCE;
        }
    };
    constructors[PAGING_PREDICATE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new PagingPredicate();
        }
    };
    constructors[PARTITION_PREDICATE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new PartitionPredicate();
        }
    };
    constructors[NULL_OBJECT] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new IndexImpl.NullObject();
        }
    };
    return new ArrayDataSerializableFactory(constructors);
}
Also used : IdentifiedDataSerializable(com.hazelcast.nio.serialization.IdentifiedDataSerializable) SqlPredicate(com.hazelcast.query.SqlPredicate) ConstructorFunction(com.hazelcast.util.ConstructorFunction) PagingPredicate(com.hazelcast.query.PagingPredicate) PartitionPredicate(com.hazelcast.query.PartitionPredicate) IndexImpl(com.hazelcast.query.impl.IndexImpl) ArrayDataSerializableFactory(com.hazelcast.internal.serialization.impl.ArrayDataSerializableFactory)

Example 8 with IdentifiedDataSerializable

use of com.hazelcast.nio.serialization.IdentifiedDataSerializable in project hazelcast by hazelcast.

the class DataSerializableConventionsTest method test_identifiedDataSerializables_haveUniqueFactoryAndTypeId.

/**
     * Fails when {@link IdentifiedDataSerializable} classes:
     * - do not have a default no-args constructor
     * - factoryId/id pairs are not unique per class
     */
@Test
public void test_identifiedDataSerializables_haveUniqueFactoryAndTypeId() throws Exception {
    Set<String> classesWithInstantiationProblems = new TreeSet<String>();
    Set<String> classesThrowingUnsupportedOperationException = new TreeSet<String>();
    Multimap<Integer, Integer> factoryToTypeId = HashMultimap.create();
    Set<Class<? extends IdentifiedDataSerializable>> identifiedDataSerializables = getIDSConcreteClasses();
    for (Class<? extends IdentifiedDataSerializable> klass : identifiedDataSerializables) {
        // exclude classes which are known to be meant for local use only
        if (!AbstractLocalOperation.class.isAssignableFrom(klass)) {
            // wrap all of this in try-catch, as it is legitimate for some classes to throw UnsupportedOperationException
            try {
                Constructor<? extends IdentifiedDataSerializable> ctor = klass.getDeclaredConstructor();
                ctor.setAccessible(true);
                IdentifiedDataSerializable instance = ctor.newInstance();
                int factoryId = instance.getFactoryId();
                int typeId = instance.getId();
                if (factoryToTypeId.containsEntry(factoryId, typeId)) {
                    fail("Factory-Type ID pair {" + factoryId + ", " + typeId + "} from " + klass.toString() + " is already" + " registered in another type.");
                } else {
                    factoryToTypeId.put(factoryId, typeId);
                }
            } catch (UnsupportedOperationException e) {
                // expected from local operation classes not meant for serialization
                // gather those and print them to system.out for information at end of test
                classesThrowingUnsupportedOperationException.add(klass.getName());
            } catch (InstantiationException e) {
                classesWithInstantiationProblems.add(klass.getName() + " failed with " + e.getMessage());
            } catch (NoSuchMethodException e) {
                classesWithInstantiationProblems.add(klass.getName() + " failed with " + e.getMessage());
            }
        }
    }
    if (!classesThrowingUnsupportedOperationException.isEmpty()) {
        System.out.println("INFO: " + classesThrowingUnsupportedOperationException.size() + " classes threw" + " UnsupportedOperationException in getFactoryId/getId invocation:");
        for (String className : classesThrowingUnsupportedOperationException) {
            System.out.println(className);
        }
    }
    if (!classesWithInstantiationProblems.isEmpty()) {
        System.out.println("There are " + classesWithInstantiationProblems.size() + " classes which threw an exception while" + " attempting to invoke a default no-args constructor. See console output for exception details." + " List of problematic classes:");
        for (String className : classesWithInstantiationProblems) {
            System.out.println(className);
        }
        fail("There are " + classesWithInstantiationProblems.size() + " classes which threw an exception while" + " attempting to invoke a default no-args constructor. See test output for exception details.");
    }
}
Also used : IdentifiedDataSerializable(com.hazelcast.nio.serialization.IdentifiedDataSerializable) AbstractLocalOperation(com.hazelcast.spi.AbstractLocalOperation) TreeSet(java.util.TreeSet) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 9 with IdentifiedDataSerializable

use of com.hazelcast.nio.serialization.IdentifiedDataSerializable in project hazelcast by hazelcast.

the class DataSerializableConventionsTest method test_identifiedDataSerializables_areInstancesOfSameClass_whenConstructedFromFactory.

/**
     * Locates {@link IdentifiedDataSerializable} classes via reflection, iterates over them and asserts an instance created by
     * a factory is of the same classes as an instance created via reflection.
     */
@Test
public void test_identifiedDataSerializables_areInstancesOfSameClass_whenConstructedFromFactory() throws Exception {
    Set<Class<? extends DataSerializerHook>> dsHooks = REFLECTIONS.getSubTypesOf(DataSerializerHook.class);
    Map<Integer, DataSerializableFactory> factories = new HashMap<Integer, DataSerializableFactory>();
    for (Class<? extends DataSerializerHook> hookClass : dsHooks) {
        DataSerializerHook dsHook = hookClass.newInstance();
        DataSerializableFactory factory = dsHook.createFactory();
        factories.put(dsHook.getFactoryId(), factory);
    }
    Set<Class<? extends IdentifiedDataSerializable>> identifiedDataSerializables = getIDSConcreteClasses();
    for (Class<? extends IdentifiedDataSerializable> klass : identifiedDataSerializables) {
        if (AbstractLocalOperation.class.isAssignableFrom(klass)) {
            continue;
        }
        // wrap all of this in try-catch, as it is legitimate for some classes to throw UnsupportedOperationException
        try {
            Constructor<? extends IdentifiedDataSerializable> ctor = klass.getDeclaredConstructor();
            ctor.setAccessible(true);
            IdentifiedDataSerializable instance = ctor.newInstance();
            int factoryId = instance.getFactoryId();
            int typeId = instance.getId();
            if (!factories.containsKey(factoryId)) {
                fail("Factory with ID " + factoryId + " declared in " + klass + " not found. Is such a factory ID " + "registered?");
            }
            IdentifiedDataSerializable instanceFromFactory = factories.get(factoryId).create(typeId);
            assertNotNull("Factory with ID " + factoryId + " returned null for type with ID " + typeId, instanceFromFactory);
            assertTrue("Factory with ID " + factoryId + " instantiated an object of " + instanceFromFactory.getClass() + " while expected type was " + instance.getClass(), instanceFromFactory.getClass().equals(instance.getClass()));
        } catch (UnsupportedOperationException ignored) {
        // expected from local operation classes not meant for serialization
        }
    }
}
Also used : IdentifiedDataSerializable(com.hazelcast.nio.serialization.IdentifiedDataSerializable) HashMap(java.util.HashMap) DataSerializableFactory(com.hazelcast.nio.serialization.DataSerializableFactory) DataSerializerHook(com.hazelcast.internal.serialization.DataSerializerHook) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 10 with IdentifiedDataSerializable

use of com.hazelcast.nio.serialization.IdentifiedDataSerializable in project hazelcast by hazelcast.

the class WanDataSerializerHookTest method testExistingTypes.

@Test
public void testExistingTypes() {
    WanDataSerializerHook hook = new WanDataSerializerHook();
    IdentifiedDataSerializable wanReplicationEvent = hook.createFactory().create(WanDataSerializerHook.WAN_REPLICATION_EVENT);
    assertTrue(wanReplicationEvent instanceof WanReplicationEvent);
    IdentifiedDataSerializable mapUpdate = hook.createFactory().create(WanDataSerializerHook.MAP_REPLICATION_UPDATE);
    assertTrue(mapUpdate instanceof MapReplicationUpdate);
    IdentifiedDataSerializable mapRemove = hook.createFactory().create(WanDataSerializerHook.MAP_REPLICATION_REMOVE);
    assertTrue(mapRemove instanceof MapReplicationRemove);
}
Also used : IdentifiedDataSerializable(com.hazelcast.nio.serialization.IdentifiedDataSerializable) MapReplicationRemove(com.hazelcast.map.impl.wan.MapReplicationRemove) WanReplicationEvent(com.hazelcast.wan.WanReplicationEvent) MapReplicationUpdate(com.hazelcast.map.impl.wan.MapReplicationUpdate) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Aggregations

IdentifiedDataSerializable (com.hazelcast.nio.serialization.IdentifiedDataSerializable)18 ConstructorFunction (com.hazelcast.util.ConstructorFunction)14 ArrayDataSerializableFactory (com.hazelcast.internal.serialization.impl.ArrayDataSerializableFactory)13 QuickTest (com.hazelcast.test.annotation.QuickTest)3 Test (org.junit.Test)3 ParallelTest (com.hazelcast.test.annotation.ParallelTest)2 HazelcastExpiryPolicy (com.hazelcast.cache.HazelcastExpiryPolicy)1 CachePartitionLostEventFilter (com.hazelcast.cache.impl.event.CachePartitionLostEventFilter)1 DefaultCacheEntryView (com.hazelcast.cache.impl.merge.entry.DefaultCacheEntryView)1 CacheBackupEntryProcessorOperation (com.hazelcast.cache.impl.operation.CacheBackupEntryProcessorOperation)1 CacheClearBackupOperation (com.hazelcast.cache.impl.operation.CacheClearBackupOperation)1 CacheClearOperation (com.hazelcast.cache.impl.operation.CacheClearOperation)1 CacheClearOperationFactory (com.hazelcast.cache.impl.operation.CacheClearOperationFactory)1 CacheContainsKeyOperation (com.hazelcast.cache.impl.operation.CacheContainsKeyOperation)1 CacheCreateConfigOperation (com.hazelcast.cache.impl.operation.CacheCreateConfigOperation)1 CacheDestroyOperation (com.hazelcast.cache.impl.operation.CacheDestroyOperation)1 CacheEntryIteratorOperation (com.hazelcast.cache.impl.operation.CacheEntryIteratorOperation)1 CacheEntryProcessorOperation (com.hazelcast.cache.impl.operation.CacheEntryProcessorOperation)1 CacheGetAllOperation (com.hazelcast.cache.impl.operation.CacheGetAllOperation)1 CacheGetAllOperationFactory (com.hazelcast.cache.impl.operation.CacheGetAllOperationFactory)1