Search in sources :

Example 1 with LatestUpdateMergePolicy

use of com.hazelcast.spi.merge.LatestUpdateMergePolicy in project hazelcast by hazelcast.

the class SplitBrainDataSerializerHook method createFactory.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new PutIfAbsentMergePolicy();
        }
    };
    return new ArrayDataSerializableFactory(constructors);
}
Also used : ExpirationTimeMergePolicy(com.hazelcast.spi.merge.ExpirationTimeMergePolicy) LatestUpdateMergePolicy(com.hazelcast.spi.merge.LatestUpdateMergePolicy) PutIfAbsentMergePolicy(com.hazelcast.spi.merge.PutIfAbsentMergePolicy) IdentifiedDataSerializable(com.hazelcast.nio.serialization.IdentifiedDataSerializable) LatestAccessMergePolicy(com.hazelcast.spi.merge.LatestAccessMergePolicy) PassThroughMergePolicy(com.hazelcast.spi.merge.PassThroughMergePolicy) HyperLogLogMergePolicy(com.hazelcast.spi.merge.HyperLogLogMergePolicy) ConstructorFunction(com.hazelcast.internal.util.ConstructorFunction) HigherHitsMergePolicy(com.hazelcast.spi.merge.HigherHitsMergePolicy) ArrayDataSerializableFactory(com.hazelcast.internal.serialization.impl.ArrayDataSerializableFactory) DiscardMergePolicy(com.hazelcast.spi.merge.DiscardMergePolicy)

Aggregations

ArrayDataSerializableFactory (com.hazelcast.internal.serialization.impl.ArrayDataSerializableFactory)1 ConstructorFunction (com.hazelcast.internal.util.ConstructorFunction)1 IdentifiedDataSerializable (com.hazelcast.nio.serialization.IdentifiedDataSerializable)1 DiscardMergePolicy (com.hazelcast.spi.merge.DiscardMergePolicy)1 ExpirationTimeMergePolicy (com.hazelcast.spi.merge.ExpirationTimeMergePolicy)1 HigherHitsMergePolicy (com.hazelcast.spi.merge.HigherHitsMergePolicy)1 HyperLogLogMergePolicy (com.hazelcast.spi.merge.HyperLogLogMergePolicy)1 LatestAccessMergePolicy (com.hazelcast.spi.merge.LatestAccessMergePolicy)1 LatestUpdateMergePolicy (com.hazelcast.spi.merge.LatestUpdateMergePolicy)1 PassThroughMergePolicy (com.hazelcast.spi.merge.PassThroughMergePolicy)1 PutIfAbsentMergePolicy (com.hazelcast.spi.merge.PutIfAbsentMergePolicy)1