public void Open(DataFlowOpOpenContext openContext) { FilterValueSet valueSet; try { IList <ExprNode> filters = new ExprNode[0]; if (filter != null) { filters = new ExprNode[] { filter }; } var spec = FilterSpecCompiler.MakeFilterSpec( _eventType, _eventType.Name, filters, null, null, null, new StreamTypeServiceImpl( _eventType, _eventType.Name, true, _agentInstanceContext.EngineURI), null, _agentInstanceContext.StatementContext, new List <int>()); valueSet = spec.GetValueSet(null, _agentInstanceContext, null); } catch (ExprValidationException ex) { throw new EPException("Failed to open filter: " + ex.Message, ex); } var handle = new EPStatementAgentInstanceHandle(_agentInstanceContext.StatementContext.EpStatementHandle, _agentInstanceContext.AgentInstanceLock, 0, new StatementAgentInstanceFilterVersion()); _callbackHandle = new EPStatementHandleCallback(handle, this); _filterServiceEntry = _agentInstanceContext.StatementContext.FilterService.Add(valueSet, _callbackHandle); }
public void Open(DataFlowOpOpenContext openContext) { using (_iLock.Acquire()) { // start observing statement management _statementLifecycleSvc.LifecycleEvent += _lifeCycleEventHandler; if (_statementName != null) { EPStatement stmt = _statementLifecycleSvc.GetStatementByName(_statementName); if (stmt != null) { AddStatement(stmt); } } else { String[] statements = _statementLifecycleSvc.StatementNames; foreach (String name in statements) { EPStatement stmt = _statementLifecycleSvc.GetStatementByName(name); if (_statementFilter.Pass(stmt)) { AddStatement(stmt); } } } } }
public void Open(DataFlowOpOpenContext openContext) { var reader = _inputSource.GetAsReader(); if (reader != null) { _reader = reader; } else { _reader = new StreamReader(_inputSource.GetAsStream()); } }
public void Open(DataFlowOpOpenContext openContext) { var adapter = agentInstanceContext.DataFlowFilterServiceAdapter; var filterService = agentInstanceContext.FilterService; var filterValues = factory.FilterSpecActivatable.Plan.EvaluateValueSet( null, agentInstanceContext, agentInstanceContext.StatementContextFilterEvalEnv); if (filterValues != null) { adapter.AddFilterCallback( this, agentInstanceContext, factory.FilterSpecActivatable.FilterForEventType, filterValues, factory.FilterSpecActivatable.FilterCallbackId); var filtersVersion = filterService.FiltersVersion; agentInstanceContext.EpStatementAgentInstanceHandle.StatementFilterVersion.StmtFilterVersion = filtersVersion; } }
public void Open(DataFlowOpOpenContext openContext) { var file = new FileInfo(_filename); if (file.Exists && !_append) { throw new EPException("File already exists '" + _filename + "'"); } try { if (_append) { _writer = File.AppendText(file.ToString()); } else { _writer = File.CreateText(file.ToString()); } } catch (FileNotFoundException e) { throw new EPException($"Failed to open '{file}' for writing", e); } }
public void Open(DataFlowOpOpenContext openContext) { lock (this) { // start observing statement management var spi = (EPRuntimeSPI) agentInstanceContext.Runtime; spi.DeploymentService.AddDeploymentStateListener(this); if (statementDeploymentId != null && statementName != null) { var stmt = spi.DeploymentService.GetStatement(statementDeploymentId, statementName); if (stmt != null) { AddStatement(stmt); } } else { var deployments = spi.DeploymentService.Deployments; foreach (var deploymentId in deployments) { var info = spi.DeploymentService.GetDeployment(deploymentId); if (info == null) { continue; } foreach (var stmt in info.Statements) { if (statementFilter.Pass(ToContext(stmt))) { AddStatement(stmt); } } } } } }
public void Open(DataFlowOpOpenContext openContext) { // no action }
public void Open(DataFlowOpOpenContext openContext) { }
public void Open(DataFlowOpOpenContext openContext) { }
public void Open(DataFlowOpOpenContext openContext) { _lifecycle.Add(openContext); }
public void Open(DataFlowOpOpenContext openContext) { _reader = new CSVReader(_adapterInputSource); }