예제 #1
0
 public OnExprViewTableMerge(
     SubordWMatchExprLookupStrategy lookupStrategy,
     TableInstance tableInstance,
     AgentInstanceContext agentInstanceContext,
     InfraOnMergeViewFactory parent)
     : base(lookupStrategy, tableInstance, agentInstanceContext, parent.OnMergeHelper.IsRequiresTableWriteLock)
 {
     this.parent = parent;
 }
예제 #2
0
 public OnExprViewTableMergeInsertUnmatched(
     TableInstance tableInstance,
     AgentInstanceContext agentInstanceContext,
     InfraOnMergeViewFactory parent)
 {
     this.tableInstance = tableInstance;
     this.agentInstanceContext = agentInstanceContext;
     this.parent = parent;
 }
예제 #3
0
 /// <summary>
 ///     Ctor.
 /// </summary>
 /// <param name="factory">merge view factory</param>
 /// <param name="rootView">to indicate which events to delete</param>
 /// <param name="agentInstanceContext">context for expression evalauation</param>
 public OnExprViewNamedWindowMergeInsertUnmatched(
     NamedWindowRootViewInstance rootView,
     AgentInstanceContext agentInstanceContext,
     InfraOnMergeViewFactory factory)
 {
     this.rootView = rootView;
     this.agentInstanceContext = agentInstanceContext;
     this.factory = factory;
 }
예제 #4
0
 public OnExprViewNamedWindowMerge(
     SubordWMatchExprLookupStrategy lookupStrategy,
     NamedWindowRootViewInstance rootView,
     AgentInstanceContext agentInstanceContext,
     InfraOnMergeViewFactory parent)
     : base(
         lookupStrategy,
         rootView,
         agentInstanceContext)
 {
     this.parent = parent;
 }
예제 #5
0
        public static void ApplyDelta(
            OneEventCollection newData,
            OneEventCollection oldData,
            InfraOnMergeViewFactory parent,
            NamedWindowRootViewInstance rootView,
            AgentInstanceContext agentInstanceContext,
            ViewSupport viewable)
        {
            if (!newData.IsEmpty() || oldData != null && !oldData.IsEmpty()) {
                var metricHandle = rootView.AgentInstanceContext.StatementContext.EpStatementHandle.MetricsHandle;
                if (metricHandle.IsEnabled && !newData.IsEmpty()) {
                    agentInstanceContext.MetricReportingService.AccountTime(
                        metricHandle,
                        default(PerformanceMetrics),
                        newData.ToArray().Length);
                }

                var statementResultService = agentInstanceContext.StatementResultService;

                // Events to delete are indicated via old data
                // The on-merge listeners receive the events deleted, but only if there is interest
                if (statementResultService.IsMakeNatural) {
                    var eventsPerStreamNaturalNew = newData.IsEmpty() ? null : newData.ToArray();
                    var eventsPerStreamNaturalOld = oldData == null || oldData.IsEmpty() ? null : oldData.ToArray();
                    rootView.Update(
                        EventBeanUtility.Denaturalize(eventsPerStreamNaturalNew),
                        EventBeanUtility.Denaturalize(eventsPerStreamNaturalOld));
                    viewable.Child.Update(eventsPerStreamNaturalNew, eventsPerStreamNaturalOld);
                }
                else {
                    var eventsPerStreamNew = newData.IsEmpty() ? null : newData.ToArray();
                    var eventsPerStreamOld = oldData == null || oldData.IsEmpty() ? null : oldData.ToArray();
                    rootView.Update(eventsPerStreamNew, eventsPerStreamOld);
                    if (statementResultService.IsMakeSynthetic) {
                        viewable.Child.Update(eventsPerStreamNew, eventsPerStreamOld);
                    }
                }
            }
        }