use of com.hazelcast.internal.util.ConstructorFunction 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 PagingPredicateImpl();
}
};
constructors[PARTITION_PREDICATE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
public IdentifiedDataSerializable createNew(Integer arg) {
return new PartitionPredicateImpl();
}
};
constructors[NULL_OBJECT] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
public IdentifiedDataSerializable createNew(Integer arg) {
return IndexImpl.NULL;
}
};
constructors[COMPOSITE_VALUE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
@Override
public IdentifiedDataSerializable createNew(Integer arg) {
return new CompositeValue();
}
};
constructors[NEGATIVE_INFINITY] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
@Override
public IdentifiedDataSerializable createNew(Integer arg) {
return CompositeValue.NEGATIVE_INFINITY;
}
};
constructors[POSITIVE_INFINITY] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
@Override
public IdentifiedDataSerializable createNew(Integer arg) {
return CompositeValue.POSITIVE_INFINITY;
}
};
return new ArrayDataSerializableFactory(constructors);
}
use of com.hazelcast.internal.util.ConstructorFunction in project hazelcast by hazelcast.
the class SqlDataSerializerHook method createFactory.
@SuppressWarnings("unchecked")
@Override
public DataSerializableFactory createFactory() {
ConstructorFunction<Integer, IdentifiedDataSerializable>[] constructors = new ConstructorFunction[LEN];
constructors[QUERY_DATA_TYPE] = arg -> new QueryDataType();
constructors[QUERY_ID] = arg -> new QueryId();
constructors[ROW_HEAP] = arg -> new HeapRow();
constructors[ROW_EMPTY] = arg -> EmptyRow.INSTANCE;
constructors[LAZY_TARGET] = arg -> new LazyTarget();
constructors[INDEX_FILTER_VALUE] = arg -> new IndexFilterValue();
constructors[INDEX_FILTER_EQUALS] = arg -> new IndexEqualsFilter();
constructors[INDEX_FILTER_RANGE] = arg -> new IndexRangeFilter();
constructors[INDEX_FILTER_IN] = arg -> new IndexInFilter();
constructors[EXPRESSION_COLUMN] = arg -> new ColumnExpression<>();
constructors[EXPRESSION_IS_NULL] = arg -> new IsNullPredicate();
constructors[TARGET_DESCRIPTOR_GENERIC] = arg -> GenericQueryTargetDescriptor.DEFAULT;
constructors[QUERY_PATH] = arg -> new QueryPath();
constructors[EXPRESSION_CONSTANT] = arg -> new ConstantExpression<>();
constructors[EXPRESSION_PARAMETER] = arg -> new ParameterExpression<>();
constructors[EXPRESSION_CAST] = arg -> new CastExpression<>();
constructors[EXPRESSION_DIVIDE] = arg -> new DivideFunction<>();
constructors[EXPRESSION_MINUS] = arg -> new MinusFunction<>();
constructors[EXPRESSION_MULTIPLY] = arg -> new MultiplyFunction<>();
constructors[EXPRESSION_PLUS] = arg -> new PlusFunction<>();
constructors[EXPRESSION_UNARY_MINUS] = arg -> new UnaryMinusFunction<>();
constructors[EXPRESSION_AND] = arg -> new AndPredicate();
constructors[EXPRESSION_OR] = arg -> new OrPredicate();
constructors[EXPRESSION_NOT] = arg -> new NotPredicate();
constructors[EXPRESSION_COMPARISON] = arg -> new ComparisonPredicate();
constructors[EXPRESSION_IS_TRUE] = arg -> new IsTruePredicate();
constructors[EXPRESSION_IS_NOT_TRUE] = arg -> new IsNotTruePredicate();
constructors[EXPRESSION_IS_FALSE] = arg -> new IsFalsePredicate();
constructors[EXPRESSION_IS_NOT_FALSE] = arg -> new IsNotFalsePredicate();
constructors[EXPRESSION_IS_NOT_NULL] = arg -> new IsNotNullPredicate();
constructors[EXPRESSION_ABS] = arg -> new AbsFunction<>();
constructors[EXPRESSION_SIGN] = arg -> new SignFunction<>();
constructors[EXPRESSION_RAND] = arg -> new RandFunction();
constructors[EXPRESSION_DOUBLE] = arg -> new DoubleFunction();
constructors[EXPRESSION_FLOOR_CEIL] = arg -> new FloorCeilFunction<>();
constructors[EXPRESSION_ROUND_TRUNCATE] = arg -> new RoundTruncateFunction<>();
constructors[INTERVAL_YEAR_MONTH] = arg -> new SqlYearMonthInterval();
constructors[INTERVAL_DAY_SECOND] = arg -> new SqlDaySecondInterval();
constructors[EXPRESSION_ASCII] = arg -> new AsciiFunction();
constructors[EXPRESSION_CHAR_LENGTH] = arg -> new CharLengthFunction();
constructors[EXPRESSION_INITCAP] = arg -> new InitcapFunction();
constructors[EXPRESSION_LOWER] = arg -> new LowerFunction();
constructors[EXPRESSION_UPPER] = arg -> new UpperFunction();
constructors[EXPRESSION_CONCAT] = arg -> new ConcatFunction();
constructors[EXPRESSION_LIKE] = arg -> new LikeFunction();
constructors[EXPRESSION_SUBSTRING] = arg -> new SubstringFunction();
constructors[EXPRESSION_TRIM] = arg -> new TrimFunction();
constructors[EXPRESSION_REPLACE] = arg -> new ReplaceFunction();
constructors[EXPRESSION_POSITION] = arg -> new PositionFunction();
constructors[EXPRESSION_REMAINDER] = arg -> new RemainderFunction<>();
constructors[EXPRESSION_CONCAT_WS] = arg -> new ConcatWSFunction();
constructors[EXPRESSION_CASE] = arg -> new CaseExpression<>();
constructors[EXPRESSION_EXTRACT] = arg -> new ExtractFunction();
constructors[EXPRESSION_DOUBLE_DOUBLE] = arg -> new DoubleBiFunction();
constructors[EXPRESSION_TO_TIMESTAMP_TZ] = arg -> new ToTimestampTzFunction();
constructors[EXPRESSION_TO_EPOCH_MILLIS] = arg -> new ToEpochMillisFunction();
constructors[MAPPING] = arg -> new Mapping();
constructors[MAPPING_FIELD] = arg -> new MappingField();
constructors[EXPRESSION_SEARCHABLE] = arg -> new SearchableExpression<>();
constructors[EXPRESSION_SEARCH] = arg -> new SearchPredicate();
constructors[VIEW] = arg -> new View();
return new ArrayDataSerializableFactory(constructors);
}
use of com.hazelcast.internal.util.ConstructorFunction in project hazelcast by hazelcast.
the class CacheDataSerializerHook method createFactory.
public DataSerializableFactory createFactory() {
ConstructorFunction<Integer, IdentifiedDataSerializable>[] constructors = new ConstructorFunction[LEN];
constructors[GET] = arg -> new CacheGetOperation();
constructors[CONTAINS_KEY] = arg -> new CacheContainsKeyOperation();
constructors[PUT] = arg -> new CachePutOperation();
constructors[PUT_IF_ABSENT] = arg -> new CachePutIfAbsentOperation();
constructors[REMOVE] = arg -> new CacheRemoveOperation();
constructors[GET_AND_REMOVE] = arg -> new CacheGetAndRemoveOperation();
constructors[REPLACE] = arg -> new CacheReplaceOperation();
constructors[GET_AND_REPLACE] = arg -> new CacheGetAndReplaceOperation();
constructors[PUT_BACKUP] = arg -> new CachePutBackupOperation();
constructors[PUT_ALL_BACKUP] = arg -> new CachePutAllBackupOperation();
constructors[REMOVE_BACKUP] = arg -> new CacheRemoveBackupOperation();
constructors[SIZE] = arg -> new CacheSizeOperation();
constructors[SIZE_FACTORY] = arg -> new CacheSizeOperationFactory();
constructors[CLEAR_FACTORY] = arg -> new CacheClearOperationFactory();
constructors[GET_ALL] = arg -> new CacheGetAllOperation();
constructors[GET_ALL_FACTORY] = arg -> new CacheGetAllOperationFactory();
constructors[LOAD_ALL] = arg -> new CacheLoadAllOperation();
constructors[LOAD_ALL_FACTORY] = arg -> new CacheLoadAllOperationFactory();
constructors[EXPIRY_POLICY] = arg -> new HazelcastExpiryPolicy();
constructors[KEY_ITERATOR] = arg -> new CacheFetchKeysOperation();
constructors[KEY_ITERATION_RESULT] = arg -> new CacheKeysWithCursor();
constructors[ENTRY_PROCESSOR] = arg -> new CacheEntryProcessorOperation();
constructors[CLEAR_RESPONSE] = arg -> new CacheClearResponse();
constructors[GET_CONFIG] = arg -> new CacheGetConfigOperation();
constructors[MANAGEMENT_CONFIG] = arg -> new CacheManagementConfigOperation();
constructors[LISTENER_REGISTRATION] = arg -> new CacheListenerRegistrationOperation();
constructors[DESTROY_CACHE] = arg -> new CacheDestroyOperation();
constructors[CACHE_EVENT_DATA] = arg -> new CacheEventDataImpl();
constructors[CACHE_EVENT_DATA_SET] = arg -> new CacheEventSet();
constructors[BACKUP_ENTRY_PROCESSOR] = arg -> new CacheBackupEntryProcessorOperation();
constructors[CLEAR] = arg -> new CacheClearOperation();
constructors[CLEAR_BACKUP] = arg -> new CacheClearBackupOperation();
constructors[REMOVE_ALL] = arg -> new CacheRemoveAllOperation();
constructors[REMOVE_ALL_BACKUP] = arg -> new CacheRemoveAllBackupOperation();
constructors[REMOVE_ALL_FACTORY] = arg -> new CacheRemoveAllOperationFactory();
constructors[PUT_ALL] = arg -> new CachePutAllOperation();
constructors[ENTRY_ITERATOR] = arg -> new CacheFetchEntriesOperation();
constructors[ENTRY_ITERATION_RESULT] = arg -> new CacheEntriesWithCursor();
constructors[CACHE_PARTITION_LOST_EVENT_FILTER] = arg -> new CachePartitionLostEventFilter();
constructors[DEFAULT_CACHE_ENTRY_VIEW] = arg -> new DefaultCacheEntryView();
constructors[CACHE_REPLICATION] = arg -> new CacheReplicationOperation();
constructors[CACHE_POST_JOIN] = arg -> new OnJoinCacheOperation();
constructors[CACHE_DATA_RECORD] = arg -> new CacheDataRecord();
constructors[CACHE_OBJECT_RECORD] = arg -> new CacheObjectRecord();
constructors[CACHE_PARTITION_EVENT_DATA] = arg -> new CachePartitionEventData();
constructors[CACHE_INVALIDATION_METADATA] = arg -> new CacheGetInvalidationMetaDataOperation();
constructors[CACHE_INVALIDATION_METADATA_RESPONSE] = arg -> new CacheGetInvalidationMetaDataOperation.MetaDataResponse();
constructors[CACHE_ASSIGN_AND_GET_UUIDS] = arg -> new CacheAssignAndGetUuidsOperation();
constructors[CACHE_ASSIGN_AND_GET_UUIDS_FACTORY] = arg -> new CacheAssignAndGetUuidsOperationFactory();
constructors[CACHE_NEAR_CACHE_STATE_HOLDER] = arg -> new CacheNearCacheStateHolder();
constructors[CACHE_EVENT_LISTENER_ADAPTOR] = arg -> new CacheEventListenerAdaptor();
constructors[EVENT_JOURNAL_SUBSCRIBE_OPERATION] = arg -> new CacheEventJournalSubscribeOperation();
constructors[EVENT_JOURNAL_READ_OPERATION] = arg -> new CacheEventJournalReadOperation<>();
constructors[EVENT_JOURNAL_DESERIALIZING_CACHE_EVENT] = arg -> new DeserializingEventJournalCacheEvent<>();
constructors[EVENT_JOURNAL_INTERNAL_CACHE_EVENT] = arg -> new InternalEventJournalCacheEvent();
constructors[EVENT_JOURNAL_READ_RESULT_SET] = arg -> new CacheEventJournalReadResultSetImpl<>();
constructors[PRE_JOIN_CACHE_CONFIG] = arg -> new PreJoinCacheConfig();
constructors[CACHE_BROWSER_ENTRY_VIEW] = arg -> new GetCacheEntryViewEntryProcessor.CacheBrowserEntryView();
constructors[GET_CACHE_ENTRY_VIEW_PROCESSOR] = arg -> new GetCacheEntryViewEntryProcessor();
constructors[MERGE_FACTORY] = arg -> new CacheMergeOperationFactory();
constructors[MERGE] = arg -> new CacheMergeOperation();
constructors[ADD_CACHE_CONFIG_OPERATION] = arg -> new AddCacheConfigOperation();
constructors[SET_EXPIRY_POLICY] = arg -> new CacheSetExpiryPolicyOperation();
constructors[SET_EXPIRY_POLICY_BACKUP] = arg -> new CacheSetExpiryPolicyBackupOperation();
constructors[EXPIRE_BATCH_BACKUP] = arg -> new CacheExpireBatchBackupOperation();
constructors[CACHE_CONFIG] = arg -> new CacheConfig<>();
return new ArrayDataSerializableFactory(constructors);
}
use of com.hazelcast.internal.util.ConstructorFunction in project hazelcast by hazelcast.
the class JetSqlSerializerHook method createFactory.
@SuppressWarnings("unchecked")
@Override
public DataSerializableFactory createFactory() {
ConstructorFunction<Integer, IdentifiedDataSerializable>[] constructors = new ConstructorFunction[LEN];
constructors[JSON_QUERY] = arg -> new JsonQueryFunction();
constructors[JSON_PARSE] = arg -> new JsonParseFunction();
constructors[JSON_VALUE] = arg -> new JsonValueFunction<>();
constructors[JSON_OBJECT] = arg -> new JsonObjectFunction();
constructors[JSON_ARRAY] = arg -> new JsonArrayFunction();
constructors[MAP_INDEX_SCAN_METADATA] = arg -> new MapIndexScanMetadata();
constructors[ROW_PROJECTOR_PROCESSOR_SUPPLIER] = arg -> new RowProjectorProcessorSupplier();
constructors[KV_ROW_PROJECTOR_SUPPLIER] = arg -> new KvRowProjector.Supplier();
constructors[ROOT_RESULT_CONSUMER_SINK_SUPPLIER] = arg -> new RootResultConsumerSink.Supplier();
constructors[SQL_ROW_COMPARATOR] = arg -> new ExpressionUtil.SqlRowComparator();
constructors[FIELD_COLLATION] = arg -> new FieldCollation();
constructors[ROW_GET_MAYBE_SERIALIZED_FN] = arg -> new AggregateAbstractPhysicalRule.RowGetMaybeSerializedFn();
constructors[NULL_FUNCTION] = arg -> AggregateAbstractPhysicalRule.NullFunction.INSTANCE;
constructors[ROW_GET_FN] = arg -> new AggregateAbstractPhysicalRule.RowGetFn();
constructors[AGGREGATE_CREATE_SUPPLIER] = arg -> new AggregateAbstractPhysicalRule.AggregateCreateSupplier();
constructors[AGGREGATE_ACCUMULATE_FUNCTION] = arg -> new AggregateAbstractPhysicalRule.AggregateAccumulateFunction();
constructors[AGGREGATE_COMBINE_FUNCTION] = arg -> AggregateAbstractPhysicalRule.AggregateCombineFunction.INSTANCE;
constructors[AGGREGATE_EXPORT_FINISH_FUNCTION] = arg -> AggregateAbstractPhysicalRule.AggregateExportFinishFunction.INSTANCE;
constructors[AGGREGATE_SUM_SUPPLIER] = arg -> new AggregateAbstractPhysicalRule.AggregateSumSupplier();
constructors[AGGREGATE_AVG_SUPPLIER] = arg -> new AggregateAbstractPhysicalRule.AggregateAvgSupplier();
constructors[AGGREGATE_COUNT_SUPPLIER] = arg -> new AggregateAbstractPhysicalRule.AggregateCountSupplier();
return new ArrayDataSerializableFactory(constructors);
}
use of com.hazelcast.internal.util.ConstructorFunction in project hazelcast by hazelcast.
the class ReplicatedMapDataSerializerHook method createFactoryInternal.
private static DataSerializableFactory createFactoryInternal() {
ConstructorFunction<Integer, IdentifiedDataSerializable>[] constructors = new ConstructorFunction[LEN];
constructors[CLEAR] = arg -> new ClearOperation();
constructors[ENTRY_VIEW] = arg -> new ReplicatedMapEntryView();
constructors[REPLICATE_UPDATE] = arg -> new ReplicateUpdateOperation();
constructors[REPLICATE_UPDATE_TO_CALLER] = arg -> new ReplicateUpdateToCallerOperation();
constructors[PUT_ALL] = arg -> new PutAllOperation();
constructors[PUT] = arg -> new PutOperation();
constructors[REMOVE] = arg -> new RemoveOperation();
constructors[SIZE] = arg -> new SizeOperation();
constructors[VERSION_RESPONSE_PAIR] = arg -> new VersionResponsePair();
constructors[GET] = arg -> new GetOperation();
constructors[CHECK_REPLICA_VERSION] = arg -> new CheckReplicaVersionOperation();
constructors[CONTAINS_KEY] = arg -> new ContainsKeyOperation();
constructors[CONTAINS_VALUE] = arg -> new ContainsValueOperation();
constructors[ENTRY_SET] = arg -> new EntrySetOperation();
constructors[EVICTION] = arg -> new EvictionOperation();
constructors[IS_EMPTY] = arg -> new IsEmptyOperation();
constructors[KEY_SET] = arg -> new KeySetOperation();
constructors[REPLICATION] = arg -> new ReplicationOperation();
constructors[REQUEST_MAP_DATA] = arg -> new RequestMapDataOperation();
constructors[SYNC_REPLICATED_DATA] = arg -> new SyncReplicatedMapDataOperation();
constructors[VALUES] = arg -> new ValuesOperation();
constructors[CLEAR_OP_FACTORY] = arg -> new ClearOperationFactory();
constructors[PUT_ALL_OP_FACTORY] = arg -> new PutAllOperationFactory();
constructors[RECORD_MIGRATION_INFO] = arg -> new RecordMigrationInfo();
constructors[MERGE_FACTORY] = arg -> new MergeOperationFactory();
constructors[MERGE] = arg -> new MergeOperation();
return new ArrayDataSerializableFactory(constructors);
}
Aggregations