Exemple #1
0
 public InsideRuntimeClient(
     Dispatcher dispatcher,
     Catalog catalog,
     ILocalGrainDirectory directory,
     ClusterConfiguration config,
     IConsistentRingProvider ring,
     GrainTypeManager typeManager,
     TypeMetadataCache typeMetadataCache,
     Func<ISiloStatusOracle> siloStatusOracle,
     OrleansTaskScheduler scheduler)
 {
     this.dispatcher = dispatcher;
     MySilo = catalog.LocalSilo;
     this.directory = directory;
     ConsistentRingProvider = ring;
     Catalog = catalog;
     disposables = new List<IDisposable>();
     callbacks = new ConcurrentDictionary<CorrelationId, CallbackData>();
     Config = config;
     config.OnConfigChange("Globals/Message", () => ResponseTimeout = Config.Globals.ResponseTimeout);
     RuntimeClient.Current = this;
     this.typeManager = typeManager;
     this.Scheduler = scheduler;
     this.siloStatusOracle = new Lazy<ISiloStatusOracle>(siloStatusOracle);
     this.ConcreteGrainFactory = new GrainFactory(this, typeMetadataCache);
     RuntimeClient.Current = this;
 }
 internal EquallyDevidedRangeRingProvider(IConsistentRingProvider provider, int mySubRangeIndex, int numSubRanges)
 {
     if (mySubRangeIndex < 0 || mySubRangeIndex >= numSubRanges)
         throw new IndexOutOfRangeException("mySubRangeIndex is out of the range. mySubRangeIndex = " + mySubRangeIndex + " numSubRanges = " + numSubRanges);
     
     ringProvider = provider;
     this.numSubRanges = numSubRanges;
     this.mySubRangeIndex = mySubRangeIndex;
     grainStatusListeners = new List<IAsyncRingRangeListener>();
     ringProvider.SubscribeToRangeChangeEvents(this);
     logger = TraceLogger.GetLogger(typeof(EquallyDevidedRangeRingProvider).Name);
 }
        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);
        }
        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);
        }
 public InsideRuntimeClient(
     Dispatcher dispatcher,
     Catalog catalog,
     ILocalGrainDirectory directory,
     SiloAddress silo,
     ClusterConfiguration config,
     IConsistentRingProvider ring,
     GrainTypeManager typeManager)
 {
     this.dispatcher        = dispatcher;
     MySilo                 = silo;
     this.directory         = directory;
     ConsistentRingProvider = ring;
     Catalog                = catalog;
     disposables            = new List <IDisposable>();
     callbacks              = new ConcurrentDictionary <CorrelationId, CallbackData>();
     Config                 = config;
     config.OnConfigChange("Globals/Message", () => ResponseTimeout = Config.Globals.ResponseTimeout);
     CallbackData.Config   = Config.Globals;
     RuntimeClient.Current = this;
     this.typeManager      = typeManager;
 }
 public InsideRuntimeClient(
     Dispatcher dispatcher,
     Catalog catalog,
     ILocalGrainDirectory directory,
     SiloAddress silo,
     ClusterConfiguration config,
     IConsistentRingProvider ring,
     GrainTypeManager typeManager)
 {
     this.dispatcher = dispatcher;
     MySilo = silo;
     this.directory = directory;
     ConsistentRingProvider = ring;
     Catalog = catalog;
     disposables = new List<IDisposable>();
     callbacks = new ConcurrentDictionary<CorrelationId, CallbackData>();
     Config = config;
     config.OnConfigChange("Globals/Message", () => ResponseTimeout = Config.Globals.ResponseTimeout);
     CallbackData.Config = Config.Globals;
     RuntimeClient.Current = this;
     this.typeManager = typeManager;
 }
Exemple #7
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);
        }
 internal TestHooksSystemTarget(Silo silo) : base(Constants.TestHooksSystemTargetId, silo.SiloAddress)
 {
     this.silo = silo;
     consistentRingProvider = silo.RingProvider;
 }
 public TestHooksSystemTarget(ISiloHost host, ILocalSiloDetails siloDetails, ILoggerFactory loggerFactory)
     : base(Constants.TestHooksSystemTargetId, siloDetails.SiloAddress, loggerFactory)
 {
     this.host = host;
     consistentRingProvider = this.host.Services.GetRequiredService <IConsistentRingProvider>();
 }
 public TestHooksSystemTarget(ISilo silo, ILocalSiloDetails siloDetails)
     : base(Constants.TestHooksSystemTargetId, siloDetails.SiloAddress)
 {
     this.silo = silo;
     consistentRingProvider = this.silo.Services.GetRequiredService <IConsistentRingProvider>();
 }
Exemple #11
0
 internal TestHooksSystemTarget(Silo silo) : base(Constants.TestHooksSystemTargetId, silo.SiloAddress)
 {
     this.silo = silo;
     consistentRingProvider = silo.RingProvider;
 }