Esempio n. 1
0
        public void StreamingInitialize(ImplicitStreamSubscriberTable implicitStreamSubscriberTable)
        {
            if (null == implicitStreamSubscriberTable)
            {
                throw new ArgumentNullException("implicitStreamSubscriberTable");
            }
            grainBasedPubSub = new GrainBasedPubSubRuntime(GrainFactory);
            var tmp = new ImplicitStreamPubSub(implicitStreamSubscriberTable);

            implictPubSub = tmp;
            combinedGrainBasedAndImplicitPubSub = new StreamPubSubImpl(grainBasedPubSub, tmp);
            streamDirectory = new StreamDirectory();
        }
Esempio n. 2
0
        public void StreamingInitialize()
        {
            this.implicitStreamSubscriberTable = new ImplicitStreamSubscriberTable();
            this.grainBasedPubSub = new GrainBasedPubSubRuntime(this.GrainFactory);
            var tmp = new ImplicitStreamPubSub(this.implicitStreamSubscriberTable);

            this.implictPubSub = tmp;
            this.combinedGrainBasedAndImplicitPubSub = new StreamPubSubImpl(this.grainBasedPubSub, tmp);

            var typeManager = this.ServiceProvider.GetRequiredService <GrainTypeManager>();

            Type[] types = typeManager.GrainClassTypeData.Select(t => t.Value.Type).ToArray();
            this.ImplicitStreamSubscriberTable.InitImplicitStreamSubscribers(types);
        }
 public ClientProviderRuntime(
     IInternalGrainFactory grainFactory,
     IServiceProvider serviceProvider,
     ILoggerFactory loggerFactory,
     ImplicitStreamSubscriberTable implicitSubscriberTable,
     ClientGrainContext clientContext)
 {
     this.grainFactory            = grainFactory;
     this.ServiceProvider         = serviceProvider;
     this.implicitSubscriberTable = implicitSubscriberTable;
     this.clientContext           = clientContext;
     this.runtimeClient           = serviceProvider.GetService <IRuntimeClient>();
     //all async timer created through current class all share this logger for perf reasons
     this.timerLogger = loggerFactory.CreateLogger <AsyncTaskSafeTimer>();
 }
Esempio n. 4
0
 internal TypeManager(
     SiloAddress myAddr,
     GrainTypeManager grainTypeManager,
     ISiloStatusOracle oracle,
     OrleansTaskScheduler scheduler,
     TimeSpan refreshClusterMapInterval,
     ImplicitStreamSubscriberTable implicitStreamSubscriberTable,
     IInternalGrainFactory grainFactory,
     CachedVersionSelectorManager versionSelectorManager,
     ILoggerFactory loggerFactory)
     : base(Constants.TypeManagerId, myAddr, loggerFactory)
 {
     if (grainTypeManager == null)
     {
         throw new ArgumentNullException(nameof(grainTypeManager));
     }
     if (oracle == null)
     {
         throw new ArgumentNullException(nameof(oracle));
     }
     if (scheduler == null)
     {
         throw new ArgumentNullException(nameof(scheduler));
     }
     if (implicitStreamSubscriberTable == null)
     {
         throw new ArgumentNullException(nameof(implicitStreamSubscriberTable));
     }
     this.logger           = loggerFactory.CreateLogger <TypeManager>();
     this.grainTypeManager = grainTypeManager;
     this.statusOracle     = oracle;
     this.implicitStreamSubscriberTable = implicitStreamSubscriberTable;
     this.grainFactory           = grainFactory;
     this.versionSelectorManager = versionSelectorManager;
     this.scheduler = scheduler;
     this.refreshClusterMapInterval = refreshClusterMapInterval;
     // We need this so we can place needed local activations
     this.grainTypeManager.SetInterfaceMapsBySilo(new Dictionary <SiloAddress, GrainInterfaceMap>
     {
         { this.Silo, grainTypeManager.GetTypeCodeMap() }
     });
 }
        public SiloStreamProviderRuntime(
            IConsistentRingProvider consistentRingProvider,
            InsideRuntimeClient runtimeClient,
            ImplicitStreamSubscriberTable implicitStreamSubscriberTable,
            ILoggerFactory loggerFactory,
            ILocalSiloDetails siloDetails,
            IGrainContextAccessor grainContextAccessor)
        {
            this.loggerFactory          = loggerFactory;
            this.siloDetails            = siloDetails;
            this.grainContextAccessor   = grainContextAccessor;
            this.consistentRingProvider = consistentRingProvider;
            this.runtimeClient          = runtimeClient;
            this.logger           = this.loggerFactory.CreateLogger <SiloProviderRuntime>();
            this.grainBasedPubSub = new GrainBasedPubSubRuntime(this.GrainFactory);
            var tmp = new ImplicitStreamPubSub(this.runtimeClient.InternalGrainFactory, implicitStreamSubscriberTable);

            this.implictPubSub = tmp;
            this.combinedGrainBasedAndImplicitPubSub = new StreamPubSubImpl(this.grainBasedPubSub, tmp);
        }
Esempio n. 6
0
        internal TypeManager(
            SiloAddress myAddr,
            GrainTypeManager grainTypeManager,
            ISiloStatusOracle oracle,
            OrleansTaskScheduler scheduler,
            TimeSpan refreshClusterMapTimeout,
            ImplicitStreamSubscriberTable implicitStreamSubscriberTable,
            IInternalGrainFactory grainFactory,
            CachedVersionSelectorManager versionSelectorManager)
            : base(Constants.TypeManagerId, myAddr)
        {
            if (grainTypeManager == null)
            {
                throw new ArgumentNullException(nameof(grainTypeManager));
            }
            if (oracle == null)
            {
                throw new ArgumentNullException(nameof(oracle));
            }
            if (scheduler == null)
            {
                throw new ArgumentNullException(nameof(scheduler));
            }
            if (implicitStreamSubscriberTable == null)
            {
                throw new ArgumentNullException(nameof(implicitStreamSubscriberTable));
            }

            this.grainTypeManager = grainTypeManager;
            this.statusOracle     = oracle;
            this.implicitStreamSubscriberTable = implicitStreamSubscriberTable;
            this.grainFactory           = grainFactory;
            this.versionSelectorManager = versionSelectorManager;
            this.scheduler = scheduler;
            this.hasToRefreshClusterGrainInterfaceMap = true;
            this.refreshClusterGrainInterfaceMapTimer = new AsyncTaskSafeTimer(
                OnRefreshClusterMapTimer,
                null,
                TimeSpan.Zero,      // Force to do it once right now
                refreshClusterMapTimeout);
        }
        public ClientStreamingProviderRuntime(
            IInternalGrainFactory grainFactory,
            IServiceProvider serviceProvider,
            ILoggerFactory loggerFactory,
            ImplicitStreamSubscriberTable implicitSubscriberTable,
            ClientGrainContext clientContext)
        {
            this.grainFactory            = grainFactory;
            this.ServiceProvider         = serviceProvider;
            this.implicitSubscriberTable = implicitSubscriberTable;
            this.clientContext           = clientContext;
            this.runtimeClient           = serviceProvider.GetService <IRuntimeClient>();
            //all async timer created through current class all share this logger for perf reasons
            this.timerLogger = loggerFactory.CreateLogger <AsyncTaskSafeTimer>();
            grainBasedPubSub = new GrainBasedPubSubRuntime(GrainFactory);
            var tmp = new ImplicitStreamPubSub(this.grainFactory, this.implicitSubscriberTable);

            implicitPubSub = tmp;
            combinedGrainBasedAndImplicitPubSub = new StreamPubSubImpl(grainBasedPubSub, tmp);
            streamDirectory = new StreamDirectory();
        }
Esempio n. 8
0
        public SiloProviderRuntime(
            IConsistentRingProvider consistentRingProvider,
            ISiloRuntimeClient runtimeClient,
            ImplicitStreamSubscriberTable implicitStreamSubscriberTable,
            OrleansTaskScheduler scheduler,
            ActivationDirectory activationDirectory,
            ILoggerFactory loggerFactory,
            ILocalSiloDetails siloDetails)
        {
            this.loggerFactory          = loggerFactory;
            this.siloDetails            = siloDetails;
            this.scheduler              = scheduler;
            this.activationDirectory    = activationDirectory;
            this.consistentRingProvider = consistentRingProvider;
            this.runtimeClient          = runtimeClient;
            this.logger           = this.loggerFactory.CreateLogger <SiloProviderRuntime>();
            this.grainBasedPubSub = new GrainBasedPubSubRuntime(this.GrainFactory);
            var tmp = new ImplicitStreamPubSub(this.runtimeClient.InternalGrainFactory, implicitStreamSubscriberTable);

            this.implictPubSub = tmp;
            this.combinedGrainBasedAndImplicitPubSub = new StreamPubSubImpl(this.grainBasedPubSub, tmp);
        }
Esempio n. 9
0
        public SiloProviderRuntime(
            Silo silo,
            GlobalConfiguration config,
            IGrainFactory grainFactory,
            IConsistentRingProvider consistentRingProvider,
            ISiloRuntimeClient runtimeClient,
            IServiceProvider serviceProvider,
            ImplicitStreamSubscriberTable implicitStreamSubscriberTable)
        {
            this.silo = silo;
            this.consistentRingProvider = consistentRingProvider;
            this.runtimeClient          = runtimeClient;
            this.ServiceId       = config.ServiceId;
            this.SiloIdentity    = silo.SiloAddress.ToLongString();
            this.GrainFactory    = grainFactory;
            this.ServiceProvider = serviceProvider;

            this.grainBasedPubSub = new GrainBasedPubSubRuntime(this.GrainFactory);
            var tmp = new ImplicitStreamPubSub(implicitStreamSubscriberTable);

            this.implictPubSub = tmp;
            this.combinedGrainBasedAndImplicitPubSub = new StreamPubSubImpl(this.grainBasedPubSub, tmp);
        }
Esempio n. 10
0
        internal TypeManager(
            SiloAddress myAddr,
            GrainTypeManager grainTypeManager,
            ISiloStatusOracle oracle,
            OrleansTaskScheduler scheduler,
            TimeSpan refreshClusterMapTimeout,
            ImplicitStreamSubscriberTable implicitStreamSubscriberTable,
            IInternalGrainFactory grainFactory,
            CachedVersionSelectorManager versionSelectorManager)
            : base(Constants.TypeManagerId, myAddr)
        {
            if (grainTypeManager == null)
            {
                throw new ArgumentNullException(nameof(grainTypeManager));
            }
            if (oracle == null)
            {
                throw new ArgumentNullException(nameof(oracle));
            }
            if (scheduler == null)
            {
                throw new ArgumentNullException(nameof(scheduler));
            }
            if (implicitStreamSubscriberTable == null)
            {
                throw new ArgumentNullException(nameof(implicitStreamSubscriberTable));
            }

            this.grainTypeManager = grainTypeManager;
            this.statusOracle     = oracle;
            this.implicitStreamSubscriberTable = implicitStreamSubscriberTable;
            this.grainFactory           = grainFactory;
            this.versionSelectorManager = versionSelectorManager;
            this.scheduler = scheduler;
            this.refreshClusterMapTimeout = refreshClusterMapTimeout;
        }
Esempio n. 11
0
 public static void StreamingInitialize(ImplicitStreamSubscriberTable implicitStreamSubscriberTable)
 {
     Instance.implicitStreamSubscriberTable = implicitStreamSubscriberTable;
     Instance.pubSub = new StreamPubSubImpl(new GrainBasedPubSubRuntime(), implicitStreamSubscriberTable);
 }