Search in sources :

Example 16 with IdentifiedDataSerializable

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

the class TextProtocolsDataSerializerHook method createFactory.

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

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

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new RestValue();
        }
    };
    return new ArrayDataSerializableFactory(constructors);
}
Also used : IdentifiedDataSerializable(com.hazelcast.nio.serialization.IdentifiedDataSerializable) RestValue(com.hazelcast.internal.ascii.rest.RestValue) ArrayDataSerializableFactory(com.hazelcast.internal.serialization.impl.ArrayDataSerializableFactory) ConstructorFunction(com.hazelcast.util.ConstructorFunction) MemcacheEntry(com.hazelcast.internal.ascii.memcache.MemcacheEntry)

Example 17 with IdentifiedDataSerializable

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

the class ManagementDataSerializerHook method createFactory.

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

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

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

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

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

        @Override
        public IdentifiedDataSerializable createNew(Integer arg) {
            return new AddWanConfigOperation();
        }
    };
    return new ArrayDataSerializableFactory(constructors);
}
Also used : IdentifiedDataSerializable(com.hazelcast.nio.serialization.IdentifiedDataSerializable) ScriptExecutorOperation(com.hazelcast.internal.management.operation.ScriptExecutorOperation) UpdateManagementCenterUrlOperation(com.hazelcast.internal.management.operation.UpdateManagementCenterUrlOperation) MapConfigDTO(com.hazelcast.internal.management.dto.MapConfigDTO) UpdateMapConfigOperation(com.hazelcast.internal.management.operation.UpdateMapConfigOperation) ArrayDataSerializableFactory(com.hazelcast.internal.serialization.impl.ArrayDataSerializableFactory) ConstructorFunction(com.hazelcast.util.ConstructorFunction) AddWanConfigOperation(com.hazelcast.internal.management.operation.AddWanConfigOperation)

Example 18 with IdentifiedDataSerializable

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

the class MapReduceDataSerializerHook method createFactory.

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

        @Override
        public IdentifiedDataSerializable createNew(Integer arg) {
            return new MapKeyValueSource();
        }
    };
    constructors[KEY_VALUE_SOURCE_MULTIMAP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        @Override
        public IdentifiedDataSerializable createNew(Integer arg) {
            return new MultiMapKeyValueSource();
        }
    };
    constructors[REDUCER_CHUNK_MESSAGE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        @Override
        public IdentifiedDataSerializable createNew(Integer arg) {
            return new IntermediateChunkNotification();
        }
    };
    constructors[REDUCER_LAST_CHUNK_MESSAGE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        @Override
        public IdentifiedDataSerializable createNew(Integer arg) {
            return new LastChunkNotification();
        }
    };
    constructors[TRACKED_JOB_OPERATION] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        @Override
        public IdentifiedDataSerializable createNew(Integer arg) {
            return new KeyValueJobOperation();
        }
    };
    constructors[REQUEST_PARTITION_MAPPING] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        @Override
        public IdentifiedDataSerializable createNew(Integer arg) {
            return new RequestPartitionMapping();
        }
    };
    constructors[REQUEST_PARTITION_REDUCING] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        @Override
        public IdentifiedDataSerializable createNew(Integer arg) {
            return new RequestPartitionReducing();
        }
    };
    constructors[REQUEST_PARTITION_PROCESSED] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        @Override
        public IdentifiedDataSerializable createNew(Integer arg) {
            return new RequestPartitionProcessed();
        }
    };
    constructors[GET_RESULT_OPERATION] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        @Override
        public IdentifiedDataSerializable createNew(Integer arg) {
            return new GetResultOperation();
        }
    };
    constructors[START_PROCESSING_OPERATION] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        @Override
        public IdentifiedDataSerializable createNew(Integer arg) {
            return new StartProcessingJobOperation();
        }
    };
    constructors[REQUEST_PARTITION_RESULT] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        @Override
        public IdentifiedDataSerializable createNew(Integer arg) {
            return new RequestPartitionResult();
        }
    };
    constructors[REDUCING_FINISHED_MESSAGE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        @Override
        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ReducingFinishedNotification();
        }
    };
    constructors[FIRE_NOTIFICATION_OPERATION] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        @Override
        public IdentifiedDataSerializable createNew(Integer arg) {
            return new FireNotificationOperation();
        }
    };
    constructors[REQUEST_MEMBERID_ASSIGNMENT] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        @Override
        public IdentifiedDataSerializable createNew(Integer arg) {
            return new RequestMemberIdAssignment();
        }
    };
    constructors[PROCESS_STATS_UPDATE_OPERATION] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        @Override
        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ProcessStatsUpdateOperation();
        }
    };
    constructors[NOTIFY_REMOTE_EXCEPTION_OPERATION] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        @Override
        public IdentifiedDataSerializable createNew(Integer arg) {
            return new NotifyRemoteExceptionOperation();
        }
    };
    constructors[CANCEL_JOB_SUPERVISOR_OPERATION] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        @Override
        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CancelJobSupervisorOperation();
        }
    };
    constructors[KEY_VALUE_SOURCE_LIST] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        @Override
        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ListKeyValueSource();
        }
    };
    constructors[KEY_VALUE_SOURCE_SET] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        @Override
        public IdentifiedDataSerializable createNew(Integer arg) {
            return new SetKeyValueSource();
        }
    };
    constructors[KEYS_ASSIGNMENT_RESULT] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        @Override
        public IdentifiedDataSerializable createNew(Integer arg) {
            return new KeysAssignmentResult();
        }
    };
    constructors[KEYS_ASSIGNMENT_OPERATION] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        @Override
        public IdentifiedDataSerializable createNew(Integer arg) {
            return new KeysAssignmentOperation();
        }
    };
    constructors[POSTPONE_PARTITION_PROCESSING_OPERATION] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        @Override
        public IdentifiedDataSerializable createNew(Integer arg) {
            return new PostPonePartitionProcessing();
        }
    };
    constructors[HASH_MAP_ADAPTER] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        @Override
        public IdentifiedDataSerializable createNew(Integer arg) {
            return new HashMapAdapter();
        }
    };
    constructors[COMBINER_RESULT_LIST] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        @Override
        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CombinerResultList();
        }
    };
    return new ArrayDataSerializableFactory(constructors);
}
Also used : GetResultOperation(com.hazelcast.mapreduce.impl.operation.GetResultOperation) KeyValueJobOperation(com.hazelcast.mapreduce.impl.operation.KeyValueJobOperation) ProcessStatsUpdateOperation(com.hazelcast.mapreduce.impl.operation.ProcessStatsUpdateOperation) LastChunkNotification(com.hazelcast.mapreduce.impl.notification.LastChunkNotification) KeysAssignmentResult(com.hazelcast.mapreduce.impl.operation.KeysAssignmentResult) ReducingFinishedNotification(com.hazelcast.mapreduce.impl.notification.ReducingFinishedNotification) RequestPartitionProcessed(com.hazelcast.mapreduce.impl.operation.RequestPartitionProcessed) IdentifiedDataSerializable(com.hazelcast.nio.serialization.IdentifiedDataSerializable) KeysAssignmentOperation(com.hazelcast.mapreduce.impl.operation.KeysAssignmentOperation) PostPonePartitionProcessing(com.hazelcast.mapreduce.impl.operation.PostPonePartitionProcessing) IntermediateChunkNotification(com.hazelcast.mapreduce.impl.notification.IntermediateChunkNotification) ConstructorFunction(com.hazelcast.util.ConstructorFunction) RequestPartitionReducing(com.hazelcast.mapreduce.impl.operation.RequestPartitionReducing) FireNotificationOperation(com.hazelcast.mapreduce.impl.operation.FireNotificationOperation) RequestPartitionResult(com.hazelcast.mapreduce.impl.operation.RequestPartitionResult) RequestPartitionMapping(com.hazelcast.mapreduce.impl.operation.RequestPartitionMapping) StartProcessingJobOperation(com.hazelcast.mapreduce.impl.operation.StartProcessingJobOperation) RequestMemberIdAssignment(com.hazelcast.mapreduce.impl.operation.RequestMemberIdAssignment) ArrayDataSerializableFactory(com.hazelcast.internal.serialization.impl.ArrayDataSerializableFactory) CancelJobSupervisorOperation(com.hazelcast.mapreduce.impl.operation.CancelJobSupervisorOperation) NotifyRemoteExceptionOperation(com.hazelcast.mapreduce.impl.operation.NotifyRemoteExceptionOperation)

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