Search in sources :

Example 6 with ConstructorFunction

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);
}
Also used : IdentifiedDataSerializable(com.hazelcast.nio.serialization.IdentifiedDataSerializable) ConstructorFunction(com.hazelcast.internal.util.ConstructorFunction) ArrayDataSerializableFactory(com.hazelcast.internal.serialization.impl.ArrayDataSerializableFactory) CompositeValue(com.hazelcast.query.impl.CompositeValue)

Example 7 with ConstructorFunction

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);
}
Also used : ConcatWSFunction(com.hazelcast.sql.impl.expression.string.ConcatWSFunction) LowerFunction(com.hazelcast.sql.impl.expression.string.LowerFunction) IndexEqualsFilter(com.hazelcast.sql.impl.exec.scan.index.IndexEqualsFilter) IsFalsePredicate(com.hazelcast.sql.impl.expression.predicate.IsFalsePredicate) Mapping(com.hazelcast.sql.impl.schema.Mapping) HeapRow(com.hazelcast.sql.impl.row.HeapRow) SearchPredicate(com.hazelcast.sql.impl.expression.predicate.SearchPredicate) PositionFunction(com.hazelcast.sql.impl.expression.string.PositionFunction) ConcatFunction(com.hazelcast.sql.impl.expression.string.ConcatFunction) IsNotTruePredicate(com.hazelcast.sql.impl.expression.predicate.IsNotTruePredicate) OrPredicate(com.hazelcast.sql.impl.expression.predicate.OrPredicate) ExtractFunction(com.hazelcast.sql.impl.expression.datetime.ExtractFunction) IndexFilterValue(com.hazelcast.sql.impl.exec.scan.index.IndexFilterValue) IsNullPredicate(com.hazelcast.sql.impl.expression.predicate.IsNullPredicate) UpperFunction(com.hazelcast.sql.impl.expression.string.UpperFunction) QueryDataType(com.hazelcast.sql.impl.type.QueryDataType) MappingField(com.hazelcast.sql.impl.schema.MappingField) DoubleBiFunction(com.hazelcast.sql.impl.expression.math.DoubleBiFunction) TrimFunction(com.hazelcast.sql.impl.expression.string.TrimFunction) ToEpochMillisFunction(com.hazelcast.sql.impl.expression.datetime.ToEpochMillisFunction) RandFunction(com.hazelcast.sql.impl.expression.math.RandFunction) CharLengthFunction(com.hazelcast.sql.impl.expression.string.CharLengthFunction) SqlYearMonthInterval(com.hazelcast.sql.impl.type.SqlYearMonthInterval) LikeFunction(com.hazelcast.sql.impl.expression.string.LikeFunction) ReplaceFunction(com.hazelcast.sql.impl.expression.string.ReplaceFunction) IsNotFalsePredicate(com.hazelcast.sql.impl.expression.predicate.IsNotFalsePredicate) ComparisonPredicate(com.hazelcast.sql.impl.expression.predicate.ComparisonPredicate) SubstringFunction(com.hazelcast.sql.impl.expression.string.SubstringFunction) QueryPath(com.hazelcast.sql.impl.extract.QueryPath) IndexRangeFilter(com.hazelcast.sql.impl.exec.scan.index.IndexRangeFilter) ToTimestampTzFunction(com.hazelcast.sql.impl.expression.datetime.ToTimestampTzFunction) InitcapFunction(com.hazelcast.sql.impl.expression.string.InitcapFunction) AndPredicate(com.hazelcast.sql.impl.expression.predicate.AndPredicate) IndexInFilter(com.hazelcast.sql.impl.exec.scan.index.IndexInFilter) SqlDaySecondInterval(com.hazelcast.sql.impl.type.SqlDaySecondInterval) NotPredicate(com.hazelcast.sql.impl.expression.predicate.NotPredicate) View(com.hazelcast.sql.impl.schema.view.View) ConstructorFunction(com.hazelcast.internal.util.ConstructorFunction) IsNotNullPredicate(com.hazelcast.sql.impl.expression.predicate.IsNotNullPredicate) DoubleFunction(com.hazelcast.sql.impl.expression.math.DoubleFunction) AsciiFunction(com.hazelcast.sql.impl.expression.string.AsciiFunction) IsTruePredicate(com.hazelcast.sql.impl.expression.predicate.IsTruePredicate) ArrayDataSerializableFactory(com.hazelcast.internal.serialization.impl.ArrayDataSerializableFactory)

Example 8 with ConstructorFunction

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);
}
Also used : CacheGetOperation(com.hazelcast.cache.impl.operation.CacheGetOperation) CacheLoadAllOperation(com.hazelcast.cache.impl.operation.CacheLoadAllOperation) CacheRemoveAllOperationFactory(com.hazelcast.cache.impl.operation.CacheRemoveAllOperationFactory) HazelcastExpiryPolicy(com.hazelcast.cache.HazelcastExpiryPolicy) CacheAssignAndGetUuidsOperationFactory(com.hazelcast.client.impl.protocol.task.cache.CacheAssignAndGetUuidsOperationFactory) AddCacheConfigOperation(com.hazelcast.cache.impl.operation.AddCacheConfigOperation) GetCacheEntryViewEntryProcessor(com.hazelcast.internal.management.operation.GetCacheEntryViewEntryProcessor) CacheGetAndRemoveOperation(com.hazelcast.cache.impl.operation.CacheGetAndRemoveOperation) CacheGetAllOperationFactory(com.hazelcast.cache.impl.operation.CacheGetAllOperationFactory) CacheEntryProcessorOperation(com.hazelcast.cache.impl.operation.CacheEntryProcessorOperation) CacheRemoveAllOperation(com.hazelcast.cache.impl.operation.CacheRemoveAllOperation) CacheAssignAndGetUuidsOperation(com.hazelcast.client.impl.protocol.task.cache.CacheAssignAndGetUuidsOperation) CacheMergeOperationFactory(com.hazelcast.cache.impl.operation.CacheMergeOperationFactory) CachePutOperation(com.hazelcast.cache.impl.operation.CachePutOperation) CacheReplicationOperation(com.hazelcast.cache.impl.operation.CacheReplicationOperation) CacheEventJournalSubscribeOperation(com.hazelcast.cache.impl.journal.CacheEventJournalSubscribeOperation) CacheClearOperation(com.hazelcast.cache.impl.operation.CacheClearOperation) CachePutAllBackupOperation(com.hazelcast.cache.impl.operation.CachePutAllBackupOperation) CacheSetExpiryPolicyBackupOperation(com.hazelcast.cache.impl.operation.CacheSetExpiryPolicyBackupOperation) CacheSizeOperationFactory(com.hazelcast.cache.impl.operation.CacheSizeOperationFactory) InternalEventJournalCacheEvent(com.hazelcast.cache.impl.journal.InternalEventJournalCacheEvent) CacheGetAndReplaceOperation(com.hazelcast.cache.impl.operation.CacheGetAndReplaceOperation) DefaultCacheEntryView(com.hazelcast.cache.impl.merge.entry.DefaultCacheEntryView) CacheExpireBatchBackupOperation(com.hazelcast.cache.impl.operation.CacheExpireBatchBackupOperation) CacheRemoveBackupOperation(com.hazelcast.cache.impl.operation.CacheRemoveBackupOperation) CacheGetAllOperation(com.hazelcast.cache.impl.operation.CacheGetAllOperation) OnJoinCacheOperation(com.hazelcast.cache.impl.operation.OnJoinCacheOperation) CacheObjectRecord(com.hazelcast.cache.impl.record.CacheObjectRecord) CacheDestroyOperation(com.hazelcast.cache.impl.operation.CacheDestroyOperation) CacheNearCacheStateHolder(com.hazelcast.cache.impl.operation.CacheNearCacheStateHolder) CacheLoadAllOperationFactory(com.hazelcast.cache.impl.operation.CacheLoadAllOperationFactory) CacheSizeOperation(com.hazelcast.cache.impl.operation.CacheSizeOperation) CacheClearBackupOperation(com.hazelcast.cache.impl.operation.CacheClearBackupOperation) CachePutIfAbsentOperation(com.hazelcast.cache.impl.operation.CachePutIfAbsentOperation) CacheFetchEntriesOperation(com.hazelcast.cache.impl.operation.CacheFetchEntriesOperation) CacheGetInvalidationMetaDataOperation(com.hazelcast.cache.impl.operation.CacheGetInvalidationMetaDataOperation) CacheRemoveAllBackupOperation(com.hazelcast.cache.impl.operation.CacheRemoveAllBackupOperation) CacheListenerRegistrationOperation(com.hazelcast.cache.impl.operation.CacheListenerRegistrationOperation) CacheContainsKeyOperation(com.hazelcast.cache.impl.operation.CacheContainsKeyOperation) CachePutBackupOperation(com.hazelcast.cache.impl.operation.CachePutBackupOperation) CacheRemoveOperation(com.hazelcast.cache.impl.operation.CacheRemoveOperation) CacheFetchKeysOperation(com.hazelcast.cache.impl.operation.CacheFetchKeysOperation) CacheClearOperationFactory(com.hazelcast.cache.impl.operation.CacheClearOperationFactory) ConstructorFunction(com.hazelcast.internal.util.ConstructorFunction) CacheBackupEntryProcessorOperation(com.hazelcast.cache.impl.operation.CacheBackupEntryProcessorOperation) CacheReplaceOperation(com.hazelcast.cache.impl.operation.CacheReplaceOperation) CacheManagementConfigOperation(com.hazelcast.cache.impl.operation.CacheManagementConfigOperation) CacheSetExpiryPolicyOperation(com.hazelcast.cache.impl.operation.CacheSetExpiryPolicyOperation) CacheDataRecord(com.hazelcast.cache.impl.record.CacheDataRecord) CacheGetConfigOperation(com.hazelcast.cache.impl.operation.CacheGetConfigOperation) CachePutAllOperation(com.hazelcast.cache.impl.operation.CachePutAllOperation) CachePartitionLostEventFilter(com.hazelcast.cache.impl.event.CachePartitionLostEventFilter) ArrayDataSerializableFactory(com.hazelcast.internal.serialization.impl.ArrayDataSerializableFactory) CacheMergeOperation(com.hazelcast.cache.impl.operation.CacheMergeOperation)

Example 9 with ConstructorFunction

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);
}
Also used : KvRowProjector(com.hazelcast.jet.sql.impl.connector.keyvalue.KvRowProjector) AggregateAbstractPhysicalRule(com.hazelcast.jet.sql.impl.opt.physical.AggregateAbstractPhysicalRule) JsonParseFunction(com.hazelcast.jet.sql.impl.expression.json.JsonParseFunction) FieldCollation(com.hazelcast.jet.sql.impl.opt.FieldCollation) JsonObjectFunction(com.hazelcast.jet.sql.impl.expression.json.JsonObjectFunction) RowProjectorProcessorSupplier(com.hazelcast.jet.sql.impl.connector.map.RowProjectorProcessorSupplier) ConstructorFunction(com.hazelcast.internal.util.ConstructorFunction) JsonArrayFunction(com.hazelcast.jet.sql.impl.expression.json.JsonArrayFunction) MapIndexScanMetadata(com.hazelcast.sql.impl.exec.scan.MapIndexScanMetadata) RootResultConsumerSink(com.hazelcast.jet.sql.impl.processors.RootResultConsumerSink) ArrayDataSerializableFactory(com.hazelcast.internal.serialization.impl.ArrayDataSerializableFactory) JsonQueryFunction(com.hazelcast.jet.sql.impl.expression.json.JsonQueryFunction)

Example 10 with ConstructorFunction

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);
}
Also used : ReplicatedMapEntryView(com.hazelcast.replicatedmap.impl.record.ReplicatedMapEntryView) RecordMigrationInfo(com.hazelcast.replicatedmap.impl.record.RecordMigrationInfo) ConstructorFunction(com.hazelcast.internal.util.ConstructorFunction) ArrayDataSerializableFactory(com.hazelcast.internal.serialization.impl.ArrayDataSerializableFactory)

Aggregations

ConstructorFunction (com.hazelcast.internal.util.ConstructorFunction)20 ArrayDataSerializableFactory (com.hazelcast.internal.serialization.impl.ArrayDataSerializableFactory)16 IdentifiedDataSerializable (com.hazelcast.nio.serialization.IdentifiedDataSerializable)5 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)3 QuickTest (com.hazelcast.test.annotation.QuickTest)3 Test (org.junit.Test)3 VersionAwareConstructorFunction (com.hazelcast.internal.util.VersionAwareConstructorFunction)2 MemberVersion (com.hazelcast.version.MemberVersion)2 Version (com.hazelcast.version.Version)2 HazelcastExpiryPolicy (com.hazelcast.cache.HazelcastExpiryPolicy)1 CachePartitionLostEventFilter (com.hazelcast.cache.impl.event.CachePartitionLostEventFilter)1 CacheEventJournalSubscribeOperation (com.hazelcast.cache.impl.journal.CacheEventJournalSubscribeOperation)1 InternalEventJournalCacheEvent (com.hazelcast.cache.impl.journal.InternalEventJournalCacheEvent)1 DefaultCacheEntryView (com.hazelcast.cache.impl.merge.entry.DefaultCacheEntryView)1 AddCacheConfigOperation (com.hazelcast.cache.impl.operation.AddCacheConfigOperation)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