Ejemplo n.º 1
0
 internal Dispatcher(
     OrleansTaskScheduler scheduler,
     MessageCenter transport,
     Catalog catalog,
     IOptionsMonitor <SiloMessagingOptions> messagingOptions,
     PlacementService placementService,
     ILocalGrainDirectory localGrainDirectory,
     GrainLocator grainLocator,
     ActivationCollector activationCollector,
     MessageFactory messageFactory,
     CompatibilityDirectorManager compatibilityDirectorManager,
     ILoggerFactory loggerFactory,
     RuntimeMessagingTrace messagingTrace,
     GrainVersionManifest versionManifest,
     IAsyncTimerFactory asyncTimerFactory,
     IncomingRequestMonitor incomingRequestMonitor)
 {
     _activationWorkloadMonitor = incomingRequestMonitor;
     this.scheduler             = scheduler;
     this.catalog                      = catalog;
     Transport                         = transport;
     this.messagingOptions             = messagingOptions.CurrentValue;
     this.invokeWorkItemLogger         = loggerFactory.CreateLogger <InvokeWorkItem>();
     this.placementService             = placementService;
     this.localGrainDirectory          = localGrainDirectory;
     this.grainLocator                 = grainLocator;
     this.activationCollector          = activationCollector;
     this.messageFactory               = messageFactory;
     this.compatibilityDirectorManager = compatibilityDirectorManager;
     this.messagingTrace               = messagingTrace;
     this._versionManifest             = versionManifest;
     logger = loggerFactory.CreateLogger <Dispatcher>();
 }
Ejemplo n.º 2
0
 internal Dispatcher(
     OrleansTaskScheduler scheduler,
     MessageCenter transport,
     Catalog catalog,
     IOptions <SiloMessagingOptions> messagingOptions,
     PlacementDirectorsManager placementDirectorsManager,
     ILocalGrainDirectory localGrainDirectory,
     IGrainLocator grainLocator,
     ActivationCollector activationCollector,
     MessageFactory messageFactory,
     CompatibilityDirectorManager compatibilityDirectorManager,
     ILoggerFactory loggerFactory,
     IOptions <SchedulingOptions> schedulerOptions,
     RuntimeMessagingTrace messagingTrace,
     GrainTypeManager grainTypeManager)
 {
     this.scheduler                    = scheduler;
     this.catalog                      = catalog;
     Transport                         = transport;
     this.messagingOptions             = messagingOptions.Value;
     this.invokeWorkItemLogger         = loggerFactory.CreateLogger <InvokeWorkItem>();
     this.placementDirectorsManager    = placementDirectorsManager;
     this.localGrainDirectory          = localGrainDirectory;
     this.grainLocator                 = grainLocator;
     this.activationCollector          = activationCollector;
     this.messageFactory               = messageFactory;
     this.compatibilityDirectorManager = compatibilityDirectorManager;
     this.messagingTrace               = messagingTrace;
     this.grainTypeManager             = grainTypeManager;
     this.schedulingOptions            = schedulerOptions.Value;
     logger = loggerFactory.CreateLogger <Dispatcher>();
 }
Ejemplo n.º 3
0
 internal Dispatcher(
     OrleansTaskScheduler scheduler,
     MessageCenter messageCenter,
     Catalog catalog,
     IOptionsMonitor <SiloMessagingOptions> messagingOptions,
     PlacementService placementService,
     ILocalGrainDirectory localGrainDirectory,
     MessageFactory messageFactory,
     ILoggerFactory loggerFactory,
     ActivationDirectory activationDirectory,
     RuntimeMessagingTrace messagingTrace,
     ILocalSiloDetails localSiloDetails)
 {
     _siloAddress             = localSiloDetails.SiloAddress;
     this.scheduler           = scheduler;
     this.catalog             = catalog;
     this.messageCenter       = messageCenter;
     this.messagingOptions    = messagingOptions.CurrentValue;
     this.placementService    = placementService;
     this.localGrainDirectory = localGrainDirectory;
     this.messageFactory      = messageFactory;
     this.activationDirectory = activationDirectory;
     this.messagingTrace      = messagingTrace;
     this.logger = loggerFactory.CreateLogger <Dispatcher>();
 }
Ejemplo n.º 4
0
        public Catalog(
            ILocalSiloDetails localSiloDetails,
            GrainLocator grainLocator,
            GrainDirectoryResolver grainDirectoryResolver,
            ILocalGrainDirectory grainDirectory,
            ActivationDirectory activationDirectory,
            ActivationCollector activationCollector,
            IServiceProvider serviceProvider,
            ILoggerFactory loggerFactory,
            IOptions <GrainCollectionOptions> collectionOptions,
            RuntimeMessagingTrace messagingTrace,
            GrainContextActivator grainActivator,
            GrainPropertiesResolver grainPropertiesResolver)
            : base(Constants.CatalogType, localSiloDetails.SiloAddress, loggerFactory)
        {
            this.LocalSilo               = localSiloDetails.SiloAddress;
            this.localSiloName           = localSiloDetails.Name;
            this.grainLocator            = grainLocator;
            this.grainDirectoryResolver  = grainDirectoryResolver;
            this.directory               = grainDirectory;
            this.activations             = activationDirectory;
            this.serviceProvider         = serviceProvider;
            this.collectionOptions       = collectionOptions;
            this.grainActivator          = grainActivator;
            this.grainPropertiesResolver = grainPropertiesResolver;
            this.logger = loggerFactory.CreateLogger <Catalog>();
            this.activationCollector = activationCollector;
            this.RuntimeClient       = serviceProvider.GetRequiredService <InsideRuntimeClient>();

            GC.GetTotalMemory(true); // need to call once w/true to ensure false returns OK value

            IntValueStatistic.FindOrCreate(StatisticNames.CATALOG_ACTIVATION_COUNT, () => activations.Count);
            activationsCreated   = CounterStatistic.FindOrCreate(StatisticNames.CATALOG_ACTIVATION_CREATED);
            activationsDestroyed = CounterStatistic.FindOrCreate(StatisticNames.CATALOG_ACTIVATION_DESTROYED);
            IntValueStatistic.FindOrCreate(StatisticNames.MESSAGING_PROCESSING_ACTIVATION_DATA_ALL, () =>
            {
                long counter = 0;
                lock (activations)
                {
                    foreach (var activation in activations)
                    {
                        if (activation.Value is ActivationData data)
                        {
                            counter += data.GetRequestCount();
                        }
                    }
                }
                return(counter);
            });
            grainDirectory.SetSiloRemovedCatalogCallback(this.OnSiloStatusChange);
            RegisterSystemTarget(this);
        }
 public ActivationMessageScheduler(
     Catalog catalog,
     Dispatcher dispatcher,
     GrainVersionManifest versionManifest,
     RuntimeMessagingTrace messagingTrace,
     ActivationCollector activationCollector,
     OrleansTaskScheduler scheduler,
     CompatibilityDirectorManager compatibilityDirectorManager,
     IncomingRequestMonitor incomingRequestMonitor)
 {
     _incomingRequestMonitor = incomingRequestMonitor;
     _catalog                      = catalog;
     _versionManifest              = versionManifest;
     _messagingTrace               = messagingTrace;
     _activationCollector          = activationCollector;
     _scheduler                    = scheduler;
     _compatibilityDirectorManager = compatibilityDirectorManager;
     _dispatcher                   = dispatcher;
 }
Ejemplo n.º 6
0
 public InternalGrainRuntime(
     MessageCenter messageCenter,
     Catalog catalog,
     GrainVersionManifest versionManifest,
     RuntimeMessagingTrace messagingTrace,
     GrainLocator grainLocator,
     CompatibilityDirectorManager compatibilityDirectorManager,
     IOptions <GrainCollectionOptions> collectionOptions,
     ILocalGrainDirectory localGrainDirectory,
     IActivationWorkingSet activationWorkingSet)
 {
     MessageCenter                = messageCenter;
     Catalog                      = catalog;
     RuntimeClient                = catalog.RuntimeClient;
     GrainVersionManifest         = versionManifest;
     MessagingTrace               = messagingTrace;
     CompatibilityDirectorManager = compatibilityDirectorManager;
     GrainLocator                 = grainLocator;
     CollectionOptions            = collectionOptions;
     LocalGrainDirectory          = localGrainDirectory;
     ActivationWorkingSet         = activationWorkingSet;
 }