Пример #1
0
 /// <summary>
 /// Ctor.
 /// </summary>
 /// <param name="getter">for "prev" function access</param>
 /// <param name="meta">general metadata for grouping</param>
 public RegexPartitionStateRepoGroup(RegexPartitionStateRandomAccessGetter getter,
                                     RegexPartitionStateRepoGroupMeta meta,
                                     bool keepScheduleState,
                                     RegexPartitionTerminationStateComparator terminationStateCompare)
 {
     _getter = getter;
     _meta   = meta;
     _states = new NullableDictionary <Object, RegexPartitionStateImpl>();
     _optionalIntervalSchedules = keepScheduleState ? new RegexPartitionStateRepoScheduleStateImpl(terminationStateCompare) : null;
 }
Пример #2
0
        public static Object GetKeys(EventBean theEvent, RegexPartitionStateRepoGroupMeta meta)
        {
            var eventsPerStream = meta.EventsPerStream;

            eventsPerStream[0] = theEvent;

            var partitionExpressions = meta.PartitionExpressions;

            if (partitionExpressions.Length == 1)
            {
                if (InstrumentationHelper.ENABLED)
                {
                    InstrumentationHelper.Get().QExprValue(meta.PartitionExpressionNodes[0], eventsPerStream);
                    var value = partitionExpressions[0].Evaluate(new EvaluateParams(eventsPerStream, true, meta.ExprEvaluatorContext));
                    InstrumentationHelper.Get().AExprValue(value);
                    return(value);
                }
                else
                {
                    return(partitionExpressions[0].Evaluate(new EvaluateParams(eventsPerStream, true, meta.ExprEvaluatorContext)));
                }
            }

            var keys  = new Object[partitionExpressions.Length];
            var count = 0;
            var exprEvaluatorContext = meta.ExprEvaluatorContext;

            foreach (var node in partitionExpressions)
            {
                if (InstrumentationHelper.ENABLED)
                {
                    InstrumentationHelper.Get().QExprValue(meta.PartitionExpressionNodes[count], eventsPerStream);
                }
                keys[count] = node.Evaluate(new EvaluateParams(eventsPerStream, true, exprEvaluatorContext));
                if (InstrumentationHelper.ENABLED)
                {
                    InstrumentationHelper.Get().AExprValue(keys[count]);
                }
                count++;
            }
            return(new MultiKeyUntyped(keys));
        }
Пример #3
0
 public RegexPartitionStateRepo MakePartitioned(RegexPartitionStateRandomAccessGetter prevGetter, RegexPartitionStateRepoGroupMeta stateRepoGroupMeta, AgentInstanceContext agentInstanceContext, EventRowRegexNFAView view, bool keepScheduleState, RegexPartitionTerminationStateComparator terminationStateCompare)
 {
     return(new RegexPartitionStateRepoGroup(prevGetter, stateRepoGroupMeta, keepScheduleState, terminationStateCompare));
 }