public NamedWindowOnMergeViewFactory(EventType namedWindowEventType, NamedWindowOnMergeHelper namedWindowOnMergeHelper, StatementResultService statementResultService, StatementMetricHandle createNamedWindowMetricHandle, MetricReportingService metricReportingService) : base(namedWindowEventType) { _namedWindowOnMergeHelper = namedWindowOnMergeHelper; _statementResultService = statementResultService; _createNamedWindowMetricHandle = createNamedWindowMetricHandle; _metricReportingService = metricReportingService; }
public static NamedWindowOnExprFactory Make( EventType namedWindowEventType, string namedWindowName, string namedWindowAlias, OnTriggerDesc onTriggerDesc, EventType filterEventType, string filterStreamName, bool addToFront, InternalEventRouter internalEventRouter, EventType outputEventType, StatementContext statementContext, StatementMetricHandle createNamedWindowMetricsHandle, bool isDistinct, StreamSelector?optionalStreamSelector, string optionalInsertIntoTableName) { if (onTriggerDesc.OnTriggerType == OnTriggerType.ON_DELETE) { return(new NamedWindowOnDeleteViewFactory(namedWindowEventType, statementContext.StatementResultService)); } else if (onTriggerDesc.OnTriggerType == OnTriggerType.ON_SELECT) { EventBeanReader eventBeanReader = null; if (isDistinct) { if (outputEventType is EventTypeSPI) { eventBeanReader = ((EventTypeSPI)outputEventType).GetReader(); } if (eventBeanReader == null) { eventBeanReader = new EventBeanReaderDefaultImpl(outputEventType); } } var windowDesc = (OnTriggerWindowDesc)onTriggerDesc; return(new NamedWindowOnSelectViewFactory( namedWindowEventType, internalEventRouter, addToFront, statementContext.EpStatementHandle, eventBeanReader, isDistinct, statementContext.StatementResultService, statementContext.InternalEventEngineRouteDest, windowDesc.IsDeleteAndSelect, optionalStreamSelector, optionalInsertIntoTableName)); } else if (onTriggerDesc.OnTriggerType == OnTriggerType.ON_UPDATE) { var updateDesc = (OnTriggerWindowUpdateDesc)onTriggerDesc; var updateHelper = EventBeanUpdateHelperFactory.Make( namedWindowName, (EventTypeSPI)namedWindowEventType, updateDesc.Assignments, namedWindowAlias, filterEventType, true); return(new NamedWindowOnUpdateViewFactory( namedWindowEventType, statementContext.StatementResultService, updateHelper)); } else if (onTriggerDesc.OnTriggerType == OnTriggerType.ON_MERGE) { var onMergeTriggerDesc = (OnTriggerMergeDesc)onTriggerDesc; var onMergeHelper = new NamedWindowOnMergeHelper( statementContext, onMergeTriggerDesc, filterEventType, filterStreamName, internalEventRouter, namedWindowName, (EventTypeSPI)namedWindowEventType); return(new NamedWindowOnMergeViewFactory( namedWindowEventType, onMergeHelper, statementContext.StatementResultService, createNamedWindowMetricsHandle, statementContext.MetricReportingService)); } else { throw new IllegalStateException("Unknown trigger type " + onTriggerDesc.OnTriggerType); } }