Exemplo n.º 1
0
        public ContextManagerNested(
            ILockManager lockManager,
            ContextControllerFactoryServiceContext factoryServiceContext)
        {
            _iLock                     = lockManager.CreateLock(GetType());
            _contextName               = factoryServiceContext.ContextName;
            _servicesContext           = factoryServiceContext.ServicesContext;
            _contextPartitionIdManager = factoryServiceContext.AgentInstanceContextCreate.StatementContext.ContextControllerFactoryService.AllocatePartitionIdMgr(
                _contextName, factoryServiceContext.AgentInstanceContextCreate.StatementContext.StatementId);
            _nestedContextFactories = factoryServiceContext.AgentInstanceContextCreate.StatementContext.ContextControllerFactoryService.GetFactory(
                factoryServiceContext);

            StatementAIResourceRegistryFactory resourceRegistryFactory =
                () => new StatementAIResourceRegistry(new AIRegistryAggregationMap(), new AIRegistryExprMap());

            var contextProps = ContextPropertyEventType.GetNestedTypeBase();

            foreach (var factory in _nestedContextFactories)
            {
                contextProps.Put(factory.FactoryContext.ContextName, factory.ContextBuiltinProps);
            }
            var contextPropsType = _servicesContext.EventAdapterService.CreateAnonymousMapType(
                _contextName, contextProps, true);
            var registry = new ContextPropertyRegistryImpl(
                Collections.GetEmptyList <ContextDetailPartitionItem>(), contextPropsType);

            _contextDescriptor = new ContextDescriptor(
                _contextName, false, registry, resourceRegistryFactory, this, factoryServiceContext.Detail);
        }
Exemplo n.º 2
0
 public EventBusSource(
     ILockManager lockManager,
     IThreadLocalManager threadLocalManager)
 {
     _iLock           = lockManager.CreateLock(GetType());
     _collectorDataTL = threadLocalManager.Create <EPDataFlowEventBeanCollectorContext>(() => null);
 }
 /// <summary>
 /// Ctor.
 /// </summary>
 /// <param name="lockManager">The lock manager.</param>
 /// <param name="knownTypes">types known at cache construction type, may be an empty list for the ANY type variance.</param>
 public VariantPropertyGetterCache(ILockManager lockManager, EventType[] knownTypes)
 {
     _iLock      = lockManager.CreateLock(GetType());
     _knownTypes = knownTypes;
     _allGetters = new Dictionary <EventType, VariantPropertyGetterRow>();
     _properties = new List <String>();
 }
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="timeSourceService">time source provider</param>
 /// <param name="lockManager">The lock manager.</param>
 public SchedulingServiceImpl(TimeSourceService timeSourceService, ILockManager lockManager)
 {
     _uLock         = lockManager.CreateLock(GetType());
     _timeHandleMap = new SortedList <long, IDictionary <long, ScheduleHandle> >();
     _handleSetMap  = new Dictionary <ScheduleHandle, IDictionary <long, ScheduleHandle> >();
     // initialize time to just before now as there is a check for duplicate external time events
     _currentTime = timeSourceService.GetTimeMillis() - 1;
 }
Exemplo n.º 5
0
 public EPStatementSource(
     ILockManager lockManager,
     IThreadLocalManager threadLocalManager)
 {
     _iLock                 = lockManager.CreateLock(MethodBase.GetCurrentMethod().DeclaringType);
     _collectorDataTL       = threadLocalManager.Create <EPDataFlowIRStreamCollectorContext>(() => null);
     _lifeCycleEventHandler = Observe;
 }
Exemplo n.º 6
0
 /// <summary>
 /// Constructor - takes the event type index to manipulate as its parameter.
 /// </summary>
 /// <param name="lockManager">The lock manager.</param>
 /// <param name="eventTypeIndex">index to manipulate</param>
 /// <param name="allowIsolation">if set to <c>true</c> [allow isolation].</param>
 public EventTypeIndexBuilder(
     ILockManager lockManager,
     EventTypeIndex eventTypeIndex,
     bool allowIsolation)
 {
     _eventTypeIndex      = eventTypeIndex;
     _callbacksLock       = lockManager.CreateLock(GetType());
     _isolatableCallbacks = allowIsolation ? new Dictionary <FilterHandle, EventTypeIndexBuilderValueIndexesPair>() : null;
 }
Exemplo n.º 7
0
 /// <summary>
 /// Ctor.
 /// </summary>
 /// <param name="lockManager">The lock manager.</param>
 /// <param name="eventAdapterService">for dynamic event type creation</param>
 /// <param name="metadata">event type metadata</param>
 /// <param name="eventTypeId">The event type id.</param>
 /// <param name="underlyngType">is the underlying type returned by the event type</param>
 protected BaseConfigurableEventType(
     ILockManager lockManager,
     EventAdapterService eventAdapterService,
     EventTypeMetadata metadata,
     int eventTypeId,
     Type underlyngType)
 {
     _iLock               = lockManager.CreateLock(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
     _eventTypeId         = eventTypeId;
     _eventAdapterService = eventAdapterService;
     _metadata            = metadata;
     _underlyngType       = underlyngType;
 }
 public ExprTimePeriodEvalDeltaConstGivenDtxAdd(
     ILockManager lockManager,
     ExprTimePeriodImpl.TimePeriodAdder[] adders,
     int[] added,
     TimeZoneInfo timeZone,
     TimeAbacus timeAbacus)
 {
     _iLock             = lockManager.CreateLock(MethodBase.GetCurrentMethod().DeclaringType);
     _adders            = adders;
     _added             = added;
     _dateTime          = new DateTimeEx(DateTimeOffset.Now, timeZone);
     _timeAbacus        = timeAbacus;
     _indexMicroseconds = ExprTimePeriodUtil.FindIndexMicroseconds(adders);
 }
Exemplo n.º 9
0
 /// <summary>
 /// Ctor.
 /// </summary>
 /// <param name="runtime">for processing events</param>
 /// <param name="beanEventType">the event type</param>
 /// <param name="eventAdapterService">factory for event beans and event types</param>
 /// <param name="threadingService">for inbound threading</param>
 /// <param name="lockManager">The lock manager.</param>
 public EventSenderBean(
     EPRuntimeEventSender runtime,
     BeanEventType beanEventType,
     EventAdapterService eventAdapterService,
     ThreadingService threadingService,
     ILockManager lockManager)
 {
     _iLock               = lockManager.CreateLock(GetType());
     _runtime             = runtime;
     _beanEventType       = beanEventType;
     _eventAdapterService = eventAdapterService;
     _compatibleClasses   = new HashSet <Type>();
     _threadingService    = threadingService;
 }
Exemplo n.º 10
0
        /// <summary>
        /// Ctor.
        /// </summary>
        /// <param name="namedWindowName">Name of the named window.</param>
        /// <param name="namedWindowMgmtService">service for dispatching results</param>
        /// <param name="namedWindowDispatchService">The named window dispatch service.</param>
        /// <param name="contextName">Name of the context.</param>
        /// <param name="eventType">the type of event held by the named window</param>
        /// <param name="statementResultService">for coordinating on whether insert and remove stream events should be posted</param>
        /// <param name="revisionProcessor">for revision processing</param>
        /// <param name="eplExpression">epl expression</param>
        /// <param name="statementName">statement name</param>
        /// <param name="isPrioritized">if the engine is running with prioritized execution</param>
        /// <param name="isEnableSubqueryIndexShare">if set to <c>true</c> [is enable subquery index share].</param>
        /// <param name="enableQueryPlanLog">if set to <c>true</c> [enable query plan log].</param>
        /// <param name="metricReportingService">The metric reporting service.</param>
        /// <param name="isBatchingDataWindow">if set to <c>true</c> [is batching data window].</param>
        /// <param name="isVirtualDataWindow">if set to <c>true</c> [is virtual data window].</param>
        /// <param name="optionalUniqueKeyProps">The optional unique key props.</param>
        /// <param name="eventTypeAsName">Name of the event type as.</param>
        /// <param name="statementContextCreateWindow">The statement context create window.</param>
        /// <param name="lockManager">The lock manager.</param>
        public NamedWindowProcessor(
            string namedWindowName,
            NamedWindowMgmtService namedWindowMgmtService,
            NamedWindowDispatchService namedWindowDispatchService,
            string contextName,
            EventType eventType,
            StatementResultService statementResultService,
            ValueAddEventProcessor revisionProcessor,
            string eplExpression,
            string statementName,
            bool isPrioritized,
            bool isEnableSubqueryIndexShare,
            bool enableQueryPlanLog,
            MetricReportingService metricReportingService,
            bool isBatchingDataWindow,
            bool isVirtualDataWindow,
            ICollection <string> optionalUniqueKeyProps,
            string eventTypeAsName,
            StatementContext statementContextCreateWindow, ILockManager lockManager)
        {
            _namedWindowName              = namedWindowName;
            _contextName                  = contextName;
            _eventType                    = eventType;
            _eplExpression                = eplExpression;
            _statementName                = statementName;
            _isEnableSubqueryIndexShare   = isEnableSubqueryIndexShare;
            _isVirtualDataWindow          = isVirtualDataWindow;
            _optionalUniqueKeyProps       = optionalUniqueKeyProps;
            _eventTypeAsName              = eventTypeAsName;
            _statementContextCreateWindow = statementContextCreateWindow;

            _rootView = new NamedWindowRootView(revisionProcessor, enableQueryPlanLog, metricReportingService, eventType, isBatchingDataWindow, isEnableSubqueryIndexShare, optionalUniqueKeyProps);
            _tailView = namedWindowDispatchService.CreateTailView(
                eventType, namedWindowMgmtService, namedWindowDispatchService, statementResultService, revisionProcessor,
                isPrioritized, isBatchingDataWindow, contextName, statementContextCreateWindow.TimeSourceService,
                statementContextCreateWindow.ConfigSnapshot.EngineDefaults.Threading);
            _lock = lockManager.CreateLock(MethodBase.GetCurrentMethod().DeclaringType);
        }
Exemplo n.º 11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SimpleServiceDirectory"/> class.
 /// </summary>
 public SimpleServiceDirectory(ILockManager lockManager)
 {
     _dataTable = new Dictionary <string, object>();
     _dataLock  = lockManager.CreateLock(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
 }
Exemplo n.º 12
0
 public ExprDeclaredServiceImpl(ILockManager lockManager)
 {
     _iLock             = lockManager.CreateLock(MethodBase.GetCurrentMethod().DeclaringType);
     _globalExpressions = new Dictionary <String, ExpressionDeclItem>();
     _globalScripts     = new Dictionary <String, List <ExpressionScriptProvided> >();
 }
Exemplo n.º 13
0
 /// <summary>
 /// Ctor.
 /// </summary>
 /// <param name="classIdentifiers">is a list of type names to check type for</param>
 /// <param name="lockManager">The lock manager.</param>
 public ExprInstanceofNode(string[] classIdentifiers, ILockManager lockManager)
 {
     _oLock            = lockManager.CreateLock(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
     _classIdentifiers = classIdentifiers;
 }
Exemplo n.º 14
0
 public DeploymentStateServiceImpl(ILockManager lockManager)
 {
     _lock        = lockManager.CreateLock(GetType());
     _deployments = new ConcurrentDictionary <String, DeploymentInformation>();
 }