use of com.hazelcast.replicatedmap.impl.record.ReplicatedMapEntryView in project hazelcast by hazelcast.
the class AbstractReplicatedMapMergePolicyTest method merge_draw_mergingWins.
@Test
public void merge_draw_mergingWins() {
ReplicatedMapEntryView existing = entryWithGivenPropertyAndValue(1, EXISTING);
ReplicatedMapEntryView merging = entryWithGivenPropertyAndValue(1, MERGING);
assertEquals(MERGING, policy.merge("map", merging, existing));
}
use of com.hazelcast.replicatedmap.impl.record.ReplicatedMapEntryView in project hazelcast by hazelcast.
the class AbstractReplicatedMapMergePolicyTest method merge_mergingWins.
@Test
public void merge_mergingWins() {
ReplicatedMapEntryView existing = entryWithGivenPropertyAndValue(1, EXISTING);
ReplicatedMapEntryView merging = entryWithGivenPropertyAndValue(333, MERGING);
assertEquals(MERGING, policy.merge("map", merging, existing));
}
use of com.hazelcast.replicatedmap.impl.record.ReplicatedMapEntryView in project hazelcast by hazelcast.
the class AbstractReplicatedMapMergePolicyTest method merge_existingWins.
@Test
public void merge_existingWins() {
ReplicatedMapEntryView existing = entryWithGivenPropertyAndValue(333, EXISTING);
ReplicatedMapEntryView merging = entryWithGivenPropertyAndValue(1, MERGING);
assertEquals(EXISTING, policy.merge("map", merging, existing));
}
use of com.hazelcast.replicatedmap.impl.record.ReplicatedMapEntryView in project hazelcast by hazelcast.
the class ReplicatedMapDataSerializerHook method createFactoryInternal.
private static DataSerializableFactory createFactoryInternal() {
ConstructorFunction<Integer, IdentifiedDataSerializable>[] constructors = new ConstructorFunction[LEN];
constructors[CLEAR] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
@Override
public IdentifiedDataSerializable createNew(Integer arg) {
return new ClearOperation();
}
};
constructors[ENTRY_VIEW] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
@Override
public IdentifiedDataSerializable createNew(Integer arg) {
return new ReplicatedMapEntryView();
}
};
constructors[REPLICATE_UPDATE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
@Override
public IdentifiedDataSerializable createNew(Integer arg) {
return new ReplicateUpdateOperation();
}
};
constructors[REPLICATE_UPDATE_TO_CALLER] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
@Override
public IdentifiedDataSerializable createNew(Integer arg) {
return new ReplicateUpdateToCallerOperation();
}
};
constructors[PUT_ALL] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
@Override
public IdentifiedDataSerializable createNew(Integer arg) {
return new PutAllOperation();
}
};
constructors[PUT] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
@Override
public IdentifiedDataSerializable createNew(Integer arg) {
return new PutOperation();
}
};
constructors[REMOVE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
@Override
public IdentifiedDataSerializable createNew(Integer arg) {
return new RemoveOperation();
}
};
constructors[SIZE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
@Override
public IdentifiedDataSerializable createNew(Integer arg) {
return new SizeOperation();
}
};
constructors[MERGE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
@Override
public IdentifiedDataSerializable createNew(Integer arg) {
return new MergeOperation();
}
};
constructors[VERSION_RESPONSE_PAIR] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
@Override
public IdentifiedDataSerializable createNew(Integer arg) {
return new VersionResponsePair();
}
};
constructors[GET] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
@Override
public IdentifiedDataSerializable createNew(Integer arg) {
return new GetOperation();
}
};
constructors[CHECK_REPLICA_VERSION] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
@Override
public IdentifiedDataSerializable createNew(Integer arg) {
return new CheckReplicaVersionOperation();
}
};
constructors[CONTAINS_KEY] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
@Override
public IdentifiedDataSerializable createNew(Integer arg) {
return new ContainsKeyOperation();
}
};
constructors[CONTAINS_VALUE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
@Override
public IdentifiedDataSerializable createNew(Integer arg) {
return new ContainsValueOperation();
}
};
constructors[ENTRY_SET] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
@Override
public IdentifiedDataSerializable createNew(Integer arg) {
return new EntrySetOperation();
}
};
constructors[EVICTION] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
@Override
public IdentifiedDataSerializable createNew(Integer arg) {
return new EvictionOperation();
}
};
constructors[IS_EMPTY] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
@Override
public IdentifiedDataSerializable createNew(Integer arg) {
return new IsEmptyOperation();
}
};
constructors[KEY_SET] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
@Override
public IdentifiedDataSerializable createNew(Integer arg) {
return new KeySetOperation();
}
};
constructors[REPLICATION] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
@Override
public IdentifiedDataSerializable createNew(Integer arg) {
return new ReplicationOperation();
}
};
constructors[REQUEST_MAP_DATA] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
@Override
public IdentifiedDataSerializable createNew(Integer arg) {
return new RequestMapDataOperation();
}
};
constructors[SYNC_REPLICATED_DATA] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
@Override
public IdentifiedDataSerializable createNew(Integer arg) {
return new SyncReplicatedMapDataOperation();
}
};
constructors[VALUES] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
@Override
public IdentifiedDataSerializable createNew(Integer arg) {
return new ValuesOperation();
}
};
constructors[CLEAR_OP_FACTORY] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
@Override
public IdentifiedDataSerializable createNew(Integer arg) {
return new ClearOperationFactory();
}
};
constructors[PUT_ALL_OP_FACTORY] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
@Override
public IdentifiedDataSerializable createNew(Integer arg) {
return new PutAllOperationFactory();
}
};
constructors[RECORD_MIGRATION_INFO] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
@Override
public IdentifiedDataSerializable createNew(Integer arg) {
return new RecordMigrationInfo();
}
};
constructors[HIGHER_HITS_MERGE_POLICY] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
@Override
public IdentifiedDataSerializable createNew(Integer arg) {
return HigherHitsMapMergePolicy.INSTANCE;
}
};
constructors[LATEST_UPDATE_MERGE_POLICY] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
@Override
public IdentifiedDataSerializable createNew(Integer arg) {
return LatestUpdateMapMergePolicy.INSTANCE;
}
};
constructors[PASS_THROUGH_MERGE_POLICY] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
@Override
public IdentifiedDataSerializable createNew(Integer arg) {
return PassThroughMergePolicy.INSTANCE;
}
};
constructors[PUT_IF_ABSENT_MERGE_POLICY] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
@Override
public IdentifiedDataSerializable createNew(Integer arg) {
return PutIfAbsentMapMergePolicy.INSTANCE;
}
};
return new ArrayDataSerializableFactory(constructors);
}
use of com.hazelcast.replicatedmap.impl.record.ReplicatedMapEntryView in project hazelcast by hazelcast.
the class PassThroughMapMergePolicyTest method merge_mergingNotNull.
@Test
public void merge_mergingNotNull() {
ReplicatedMapEntryView existing = entryWithGivenValue(EXISTING);
ReplicatedMapEntryView merging = entryWithGivenValue(MERGING);
assertEquals(MERGING, policy.merge("map", merging, existing));
}
Aggregations