예제 #1
0
 public TableSerdes GetTableSerdes<T>(
     Table table,
     DataInputOutputSerde<T> aggregationSerde,
     StatementContext statementContext)
 {
     return null; // this implementation does not require serdes
 }
예제 #2
0
 public QueryPlanIndexItem(
     string[] hashProps,
     Type[] hashPropTypes,
     EventPropertyValueGetter hashGetter,
     MultiKeyFromObjectArray transformFireAndForget,
     DataInputOutputSerde hashKeySerde,
     string[] rangeProps,
     Type[] rangePropTypes,
     EventPropertyValueGetter[] rangeGetters,
     DataInputOutputSerde[] rangeKeySerdes,
     bool unique,
     EventAdvancedIndexProvisionRuntime advancedIndexProvisionDesc)
 {
     HashProps = hashProps;
     HashPropTypes = hashPropTypes;
     HashGetter = hashGetter;
     HashKeySerde = hashKeySerde;
     RangeProps = rangeProps == null || rangeProps.Length == 0 ? null : rangeProps;
     RangePropTypes = rangePropTypes;
     RangeGetters = rangeGetters;
     RangeKeySerdes = rangeKeySerdes;
     TransformFireAndForget = transformFireAndForget;
     IsUnique = unique;
     AdvancedIndexProvisionDesc = advancedIndexProvisionDesc;
 }
예제 #3
0
 public void RegisterSerde(
     EventTypeMetadata metadata,
     DataInputOutputSerde underlyingSerde,
     Type underlyingClass)
 {
     _serdes.Add(new EventTypeCollectedSerde(metadata, underlyingSerde, underlyingClass));
 }
예제 #4
0
 public DIONullableObjectArraySerde(
     Type componentType,
     DataInputOutputSerde componentBinding)
 {
     _componentType    = componentType;
     _componentBinding = componentBinding;
 }
예제 #5
0
 public EventTableFactory CreateComposite(
     int indexedStreamNum,
     EventType eventType,
     string[] indexProps,
     Type[] indexCoercionTypes,
     EventPropertyValueGetter indexGetter,
     MultiKeyFromObjectArray transformFireAndForget,
     DataInputOutputSerde keySerde,
     string[] rangeProps,
     Type[] rangeCoercionTypes,
     EventPropertyValueGetter[] rangeGetters,
     DataInputOutputSerde[] rangeSerdes,
     DataInputOutputSerde optionalValueSerde,
     bool isFireAndForget)
 {
     return new PropertyCompositeEventTableFactory(
         indexedStreamNum,
         indexProps,
         indexCoercionTypes,
         indexGetter,
         transformFireAndForget,
         rangeProps,
         rangeCoercionTypes,
         rangeGetters);
 }
예제 #6
0
        public void ActivateVariable(
            string name,
            DataInputOutputSerde serde)
        {
            var variable = ModuleIncidentals.Variables.Get(name);
            if (variable == null) {
                throw new ArgumentException("Failed to find variable information for '" + name + "'");
            }

            string contextDeploymentId = null;
            if (variable.OptionalContextName != null) {
                contextDeploymentId = ContextDeployTimeResolver.ResolveContextDeploymentId(
                    variable.OptionalContextModule,
                    variable.OptionalContextVisibility,
                    variable.OptionalContextName,
                    DeploymentId, ServicesContext.ContextPathRegistry);
            }

            ServicesContext.VariableManagementService.AddVariable(DeploymentId, variable, contextDeploymentId, serde);

            // for non-context variables we allocate the state
            if (contextDeploymentId == null) {
                ServicesContext.VariableManagementService.AllocateVariableState(
                    DeploymentId, name, DEFAULT_AGENT_INSTANCE_ID, IsRecovery, null, ServicesContext.EventBeanTypedEventFactory);
            }
        }
예제 #7
0
 public PropertyCompositeEventTableFactoryFactory(
     int indexedStreamNum,
     int? subqueryNum,
     bool isFireAndForget,
     string[] keyProps,
     Type[] keyTypes,
     EventPropertyValueGetter keyGetter,
     DataInputOutputSerde keySerde,
     string[] rangeProps,
     Type[] rangeTypes,
     EventPropertyValueGetter[] rangeGetters,
     DataInputOutputSerde[] rangeKeySerdes)
 {
     this._indexedStreamNum = indexedStreamNum;
     this._subqueryNum = subqueryNum;
     this._isFireAndForget = isFireAndForget;
     this._keyProps = keyProps;
     this._keyTypes = keyTypes;
     this._keyGetter = keyGetter;
     this._keySerde = keySerde;
     this._rangeProps = rangeProps;
     this._rangeTypes = rangeTypes;
     this._rangeGetters = rangeGetters;
     this._rangeKeySerdes = rangeKeySerdes;
 }
 public ResultSetProcessorGroupedOutputAllGroupReps MakeRSGroupedOutputAllNoOpt(
     AgentInstanceContext agentInstanceContext,
     Type[] groupKeyTypes,
     DataInputOutputSerde serde,
     EventType[] eventTypes)
 {
     return new ResultSetProcessorGroupedOutputAllGroupRepsImpl();
 }
 public ResultSetProcessorAggregateGroupedOutputLastHelper MakeRSAggregateGroupedOutputLastOpt(
     AgentInstanceContext agentInstanceContext,
     ResultSetProcessorAggregateGrouped processor,
     Type[] groupKeyTypes,
     DataInputOutputSerde serde)
 {
     return new ResultSetProcessorAggregateGroupedOutputLastHelperImpl(processor);
 }
 public AggregationServiceFactory GroupAll(
     AggregationServiceFactory nonHAFactory,
     AggregationRowFactory rowFactory,
     AggregationUseFlags useFlags,
     DataInputOutputSerde<AggregationRow> serde)
 {
     return nonHAFactory;
 }
 public ResultSetProcessorRowPerGroupUnboundHelper MakeRSRowPerGroupUnboundGroupRep(
     Type[] groupKeyTypes,
     DataInputOutputSerde serde,
     EventType eventType,
     AgentInstanceContext agentInstanceContext)
 {
     return new ResultSetProcessorRowPerGroupUnboundHelperImpl();
 }
        public void AddVariable(
            string deploymentId,
            VariableMetaData metaData,
            string optionalDeploymentIdContext,
            DataInputOutputSerde optionalSerde)
        {
            lock (this) {
                // check if already exists
                var deploymentEntry = DeploymentsWithVariables.Get(deploymentId);
                if (deploymentEntry != null) {
                    var variableX = deploymentEntry.GetVariable(metaData.VariableName);
                    if (variableX != null) {
                        throw new ArgumentException(
                            "Variable already exists by name '" +
                            metaData.VariableName +
                            "' and deployment '" +
                            deploymentId +
                            "'");
                    }
                }
                else {
                    deploymentEntry = new VariableDeployment();
                    DeploymentsWithVariables.Put(deploymentId, deploymentEntry);
                }

                // find empty spot
                var emptySpot = -1;
                var count = 0;
                foreach (var entry in variableVersionsPerCP) {
                    if (entry == null) {
                        emptySpot = count;
                        break;
                    }

                    count++;
                }

                int variableNumber;
                if (emptySpot != -1) {
                    variableNumber = emptySpot;
                    variableVersionsPerCP[emptySpot] = new ConcurrentDictionary<int, VariableReader>();
                    changeCallbacksPerCP[emptySpot] = null;
                }
                else {
                    variableNumber = currentVariableNumber;
                    variableVersionsPerCP.Add(new ConcurrentDictionary<int, VariableReader>());
                    changeCallbacksPerCP.Add(null);
                    currentVariableNumber++;
                }

                var variable = new Variable(variableNumber, deploymentId, metaData, optionalDeploymentIdContext);
                deploymentEntry.AddVariable(metaData.VariableName, variable);

                if (OptionalStateHandler != null && !metaData.IsConstant) {
                    OptionalStateHandler.AddVariable(deploymentId, metaData.VariableName, variable, optionalSerde);
                }
            }
        }
예제 #13
0
        public DataInputOutputSerde[] GetContextPartitionKeySerdeSubset(int nestingLevel)
        {
            var serdes = new DataInputOutputSerde[nestingLevel - 1];
            for (var i = 0; i < nestingLevel - 1; i++) {
                serdes[i] = ContextPartitionKeySerdes[i];
            }

            return serdes;
        }
예제 #14
0
 public EventTypeCollectedSerde(
     EventTypeMetadata metadata,
     DataInputOutputSerde underlyingSerde,
     Type underlying)
 {
     Metadata = metadata;
     UnderlyingSerde = underlyingSerde;
     Underlying = underlying;
 }
 public ResultSetProcessorRowPerGroupOutputLastHelper MakeRSRowPerGroupOutputLastOpt(
     AgentInstanceContext agentInstanceContext,
     ResultSetProcessorRowPerGroup resultSetProcessorRowPerGroup,
     Type[] groupKeyTypes,
     DataInputOutputSerde serde,
     EventType[] eventTypes)
 {
     return new ResultSetProcessorRowPerGroupOutputLastHelperImpl(resultSetProcessorRowPerGroup);
 }
예제 #16
0
 public EventTableFactory CreateUnindexed(
     int indexedStreamNum,
     EventType eventType,
     DataInputOutputSerde optionalValueSerde,
     bool isFireAndForget,
     EventTableFactoryFactoryContext eventTableFactoryContext)
 {
     return new UnindexedEventTableFactory(indexedStreamNum);
 }
 public ResultSetProcessorGroupedOutputFirstHelper MakeRSGroupedOutputFirst(
     AgentInstanceContext agentInstanceContext,
     Type[] groupKeyTypes,
     OutputConditionPolledFactory optionalOutputFirstConditionFactory,
     AggregationGroupByRollupDesc optionalGroupByRollupDesc,
     int optionalRollupLevel,
     DataInputOutputSerde serde)
 {
     return new ResultSetProcessorGroupedOutputFirstHelperImpl();
 }
예제 #18
0
 public ProxyAggregationGroupByRollupLevel(
     int levelNumber,
     int levelOffset,
     int[] rollupKeys,
     DataInputOutputSerde subkeySerde,
     Func<object, object> procComputeSubkey)
     : base(levelNumber, levelOffset, rollupKeys, subkeySerde)
 {
     ProcComputeSubkey = procComputeSubkey;
 }
 public AggregationServiceFactory GroupByRollup(
     AggregationServiceFactory nonHAFactory,
     AggregationGroupByRollupDesc groupByRollupDesc,
     AggregationRowFactory rowFactory,
     AggregationUseFlags useFlags,
     DataInputOutputSerde<AggregationRow> serde,
     Type[] groupByTypes)
 {
     return nonHAFactory;
 }
예제 #20
0
 public AggregationGroupByRollupLevel(
     int levelNumber,
     int levelOffset,
     int[] rollupKeys,
     DataInputOutputSerde subkeySerde)
 {
     LevelNumber = levelNumber;
     LevelOffset = levelOffset;
     RollupKeys = rollupKeys;
     SubkeySerde = subkeySerde;
 }
예제 #21
0
        public TableSerdes(
            DataInputOutputSerde[] column,
            DataInputOutputSerde<AggregationRow> aggregations)
        {
            if (column == null || aggregations == null) {
                throw new ArgumentException("Expected serdes not received");
            }

            ColumnStartingZero = column;
            Aggregations = aggregations;
        }
예제 #22
0
        private DataInputOutputSerdeForge SerdeMayArray(
            Type type,
            SerdeProviderAdditionalInfo info)
        {
            if (type.IsArray)
            {
                DataInputOutputSerde mkSerde = GetMKSerdeClassForComponentType(type.GetElementType());
                return(new DataInputOutputSerdeForgeSingleton(mkSerde.GetType()));
            }

            return(SerdeForClass(type, info));
        }
예제 #23
0
 public EventTableFactory CreateSorted(
     int indexedStreamNum,
     EventType eventType,
     string indexedProp,
     Type indexType,
     EventPropertyValueGetter getter,
     DataInputOutputSerde serde,
     DataInputOutputSerde optionalValueSerde,
     bool isFireAndForget,
     EventTableFactoryFactoryContext eventTableFactoryContext)
 {
     return new PropertySortedEventTableFactory(indexedStreamNum, indexedProp, getter, indexType);
 }
 public AggregationServiceFactory GroupBy(
     AggregationServiceFactory nonHAFactory,
     AggregationRowFactory rowFactory,
     AggregationUseFlags useFlags,
     DataInputOutputSerde<AggregationRow> serde,
     Type[] groupByTypes,
     AggSvcGroupByReclaimAgedEvalFuncFactory reclaimMaxAge,
     AggSvcGroupByReclaimAgedEvalFuncFactory reclaimFreq,
     TimeAbacus timeAbacus,
     DataInputOutputSerde groupKeySerde)
 {
     return nonHAFactory;
 }
예제 #25
0
 public AggregationLocalGroupByLevel(
     AggregationRowFactory rowFactory,
     DataInputOutputSerde<AggregationRow> rowSerde,
     Type[] groupKeyTypes,
     ExprEvaluator groupKeyEval,
     bool isDefaultLevel,
     DataInputOutputSerde keySerde)
 {
     RowFactory = rowFactory;
     RowSerde = rowSerde;
     GroupKeyTypes = groupKeyTypes;
     GroupKeyEval = groupKeyEval;
     IsDefaultLevel = isDefaultLevel;
     KeySerde = keySerde;
 }
예제 #26
0
 public PropertySortedFactoryFactory(
     int indexedStreamNum,
     int? subqueryNum,
     bool isFireAndForget,
     string indexProp,
     Type indexType,
     EventPropertyValueGetter valueGetter,
     DataInputOutputSerde indexSerde)
     : base(indexedStreamNum, subqueryNum, isFireAndForget)
 {
     _indexProp = indexProp;
     _indexType = indexType;
     _valueGetter = valueGetter;
     _indexSerde = indexSerde;
 }
예제 #27
0
 public ExprFilterSpecLookupable(
     String expression,
     ExprEventEvaluator eval,
     ExprEvaluator expr,
     Type returnType,
     bool isNonPropertyEval,
     DataInputOutputSerde valueSerde)
 {
     _expression = expression;
     _eval = eval;
     _expr = expr;
     _returnType = Boxing.GetBoxedType(returnType); // For type consistency for recovery and serde define as boxed type
     _isNonPropertyEval = isNonPropertyEval;
     _valueSerde = valueSerde;
 }
예제 #28
0
 /// <summary>
 ///     NOTE: Code-generation-invoked method, method name and parameter order matters
 /// </summary>
 /// <param name="output">output</param>
 /// <param name="unitKey">unit key</param>
 /// <param name="writer">writer</param>
 /// <param name="serdeNullable">binding</param>
 /// <param name="circularBuffer">buffer</param>
 /// <param name="numDataPoints">points</param>
 /// <param name="currentBufferElementPointer">pointer</param>
 /// <param name="sizeBuf">size</param>
 /// <throws>IOException io error</throws>
 public static void Write(
     DataOutput output,
     byte[] unitKey,
     EventBeanCollatedWriter writer,
     DataInputOutputSerde serdeNullable,
     object[] circularBuffer,
     long numDataPoints,
     int currentBufferElementPointer,
     int sizeBuf)
 {
     output.WriteBoolean(circularBuffer != null);
     if (circularBuffer != null) {
         output.WriteLong(numDataPoints);
         output.WriteInt(currentBufferElementPointer);
         for (var i = 0; i < sizeBuf; i++) {
             serdeNullable.Write(circularBuffer[i], output, unitKey, writer);
         }
     }
 }
예제 #29
0
 public PropertyHashedFactoryFactory(
     int indexedStreamNum,
     int? subqueryNum,
     bool isFireAndForget,
     String[] indexProps,
     Type[] indexTypes,
     bool unique,
     EventPropertyValueGetter valueGetter,
     MultiKeyFromObjectArray transformFireAndForget,
     DataInputOutputSerde keySerde)
     : base(indexedStreamNum, subqueryNum, isFireAndForget)
 {
     this.indexProps = indexProps;
     this.indexTypes = indexTypes;
     this.unique = unique;
     this.valueGetter = valueGetter;
     this.transformFireAndForget = transformFireAndForget;
     this.keySerde = keySerde;
 }
예제 #30
0
 public EventTableFactory CreateHashedOnly(
     int indexedStreamNum,
     EventType eventType,
     string[] indexProps,
     Type[] indexTypes,
     MultiKeyFromObjectArray transformFireAndForget,
     DataInputOutputSerde keySerde,
     bool unique,
     string optionalIndexName,
     EventPropertyValueGetter getter,
     DataInputOutputSerde optionalValueSerde,
     bool isFireAndForget,
     EventTableFactoryFactoryContext eventTableFactoryContext)
 {
     return new PropertyHashedEventTableFactory(
         indexedStreamNum,
         indexProps,
         unique,
         optionalIndexName,
         getter,
         transformFireAndForget);
 }