• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# SiloAddress类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中SiloAddress的典型用法代码示例。如果您正苦于以下问题:C# SiloAddress类的具体用法?C# SiloAddress怎么用?C# SiloAddress使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SiloAddress类属于命名空间,在下文中一共展示了SiloAddress类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SystemTarget

 protected SystemTarget(GrainId grainId, SiloAddress silo, bool lowPriority)
 {
     GrainId = grainId;
     Silo = silo;
     ActivationId = ActivationId.GetSystemActivation(grainId, silo);
     SchedulingContext = new SchedulingContext(this, lowPriority);
 }
开发者ID:Carlm-MS,项目名称:orleans,代码行数:7,代码来源:SystemTarget.cs


示例2: TypeManager

        internal TypeManager(
            SiloAddress myAddr,
            GrainTypeManager grainTypeManager,
            ISiloStatusOracle oracle,
            OrleansTaskScheduler scheduler,
            TimeSpan refreshClusterMapTimeout,
            ImplicitStreamSubscriberTable implicitStreamSubscriberTable)
            : 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.scheduler = scheduler;
            this.hasToRefreshClusterGrainInterfaceMap = true;
            this.refreshClusterGrainInterfaceMapTimer = new AsyncTaskSafeTimer(
                    OnRefreshClusterMapTimer,
                    null,
                    TimeSpan.Zero,  // Force to do it once right now
                    refreshClusterMapTimeout); 
        }
开发者ID:Carlm-MS,项目名称:orleans,代码行数:29,代码来源:TypeManager.cs


示例3: TestMultiClusterGatewaySelection

        public void TestMultiClusterGatewaySelection()
        {
            var candidates = new SiloAddress[] {
                SiloAddress.New(new IPEndPoint(0,0),0),
                SiloAddress.New(new IPEndPoint(0,0),1),
                SiloAddress.New(new IPEndPoint(0,1),0),
                SiloAddress.New(new IPEndPoint(0,1),1),
                SiloAddress.New(new IPEndPoint(0,234),1),
                SiloAddress.New(new IPEndPoint(1,0),0),
                SiloAddress.New(new IPEndPoint(1,0),1),
                SiloAddress.New(new IPEndPoint(1,1),1),
                SiloAddress.New(new IPEndPoint(1,234),1),
                SiloAddress.New(new IPEndPoint(2,234),1),
                SiloAddress.New(new IPEndPoint(3,234),1),
                SiloAddress.New(new IPEndPoint(4,234),1),
            };
            
            Func<SiloAddress,UpdateFaultCombo> group = (SiloAddress a) => new UpdateFaultCombo(a.Endpoint.Port, a.Generation);

            // randomize order
            var r = new Random();
            var randomized = new SortedList<int,SiloAddress> ();
            foreach(var c in candidates)
                randomized.Add(r.Next(), c);

            var x = MembershipOracleData.DeterministicBalancedChoice(randomized.Values, 10, group);

            for (int i = 0; i < 10; i++)
                Assert.Equal(candidates[i], x[i]);
        }
开发者ID:caomw,项目名称:orleans,代码行数:30,代码来源:GatewaySelectionTest.cs


示例4: AzureGossipTableTests

        private AzureTableBasedGossipChannel gossipTable; // This type is internal

        public AzureGossipTableTests()
        {
            logger = LogManager.GetLogger("AzureGossipTableTests", LoggerType.Application);
        
            globalServiceId = Guid.NewGuid();
            deploymentId = "test-" + globalServiceId;

            IPAddress ip;
            if (!IPAddress.TryParse("127.0.0.1", out ip))
            {
                logger.Error(-1, "Could not parse ip address");
                return;
            }
            IPEndPoint ep1 = new IPEndPoint(ip, 21111);
            siloAddress1 = SiloAddress.New(ep1, 0);
            IPEndPoint ep2 = new IPEndPoint(ip, 21112);
            siloAddress2 = SiloAddress.New(ep2, 0);

            logger.Info("DeploymentId={0}", deploymentId);

            GlobalConfiguration config = new GlobalConfiguration
            {
                ServiceId = globalServiceId,
                ClusterId = "0",
                DeploymentId = deploymentId,
                DataConnectionString = TestDefaultConfiguration.DataConnectionString
            };

            gossipTable = new AzureTableBasedGossipChannel();
            var done = gossipTable.Initialize(config.ServiceId, config.DataConnectionString);
            if (!done.Wait(timeout))
            {
                throw new TimeoutException("Could not create/read table.");
            }
        }
开发者ID:jdom,项目名称:orleans,代码行数:37,代码来源:AzureGossipTableTests.cs


示例5: ActivationAddress

 private ActivationAddress(SiloAddress silo, GrainId grain, ActivationId activation, MultiClusterStatus status)
 {
     Silo = silo;
     Grain = grain;
     Activation = activation;
     Status = status;
 }
开发者ID:PaulNorth,项目名称:orleans,代码行数:7,代码来源:ActivationAddress.cs


示例6: GetAddress

        public static ActivationAddress GetAddress(SiloAddress silo, GrainId grain, ActivationId activation, MultiClusterStatus status = MultiClusterStatus.Owned)
        {
            // Silo part is not mandatory
            if (grain == null) throw new ArgumentNullException("grain");

            return new ActivationAddress(silo, grain, activation, status);
        }
开发者ID:PaulNorth,项目名称:orleans,代码行数:7,代码来源:ActivationAddress.cs


示例7: GetAddress

        public static ActivationAddress GetAddress(SiloAddress silo, GrainId grain, ActivationId activation)
        {
            // Silo part is not mandatory
            if (grain == null) throw new ArgumentNullException("grain");

            return new ActivationAddress(silo, grain, activation);
        }
开发者ID:osjimenez,项目名称:orleans,代码行数:7,代码来源:ActivationAddress.cs


示例8: VirtualBucketsRingProvider

        internal VirtualBucketsRingProvider(SiloAddress siloAddr, int nBucketsPerSilo)
        {
            if (nBucketsPerSilo <= 0 )
                throw new IndexOutOfRangeException("numBucketsPerSilo is out of the range. numBucketsPerSilo = " + nBucketsPerSilo);

            logger = TraceLogger.GetLogger(typeof(VirtualBucketsRingProvider).Name);
                        
            statusListeners = new List<IRingRangeListener>();
            bucketsMap = new SortedDictionary<uint, SiloAddress>();
            sortedBucketsList = new List<Tuple<uint, SiloAddress>>();
            myAddress = siloAddr;
            numBucketsPerSilo = nBucketsPerSilo;
            lockable = new object();
            running = true;
            myRange = RangeFactory.CreateFullRange();

            logger.Info("Starting {0} on silo {1}.", typeof(VirtualBucketsRingProvider).Name, siloAddr.ToStringWithHashCode());

            StringValueStatistic.FindOrCreate(StatisticNames.CONSISTENTRING_RING, ToString);
            IntValueStatistic.FindOrCreate(StatisticNames.CONSISTENTRING_RINGSIZE, () => GetRingSize());
            StringValueStatistic.FindOrCreate(StatisticNames.CONSISTENTRING_MYRANGE_RINGDISTANCE, () => String.Format("x{0,8:X8}", ((IRingRangeInternal)myRange).RangeSize()));
            FloatValueStatistic.FindOrCreate(StatisticNames.CONSISTENTRING_MYRANGE_RINGPERCENTAGE, () => (float)((IRingRangeInternal)myRange).RangePercentage());
            FloatValueStatistic.FindOrCreate(StatisticNames.CONSISTENTRING_AVERAGERINGPERCENTAGE, () =>
            {
                int size = GetRingSize();
                return size == 0 ? 0 : ((float)100.0/(float) size);
            });           

            // add myself to the list of members
            AddServer(myAddress);
        }
开发者ID:stanroze,项目名称:orleans,代码行数:31,代码来源:VirtualBucketsRingProvider.cs


示例9: ForceGarbageCollection

 public Task ForceGarbageCollection(SiloAddress[] siloAddresses)
 {
     var silos = GetSiloAddresses(siloAddresses);
     logger.Info("Forcing garbage collection on {0}", Utils.EnumerableToString(silos));
     List<Task> actionPromises = PerformPerSiloAction(silos,
         s => GetSiloControlReference(s).ForceGarbageCollection());
     return Task.WhenAll(actionPromises);
 }
开发者ID:PaulNorth,项目名称:orleans,代码行数:8,代码来源:ManagementGrain.cs


示例10: ClientObserverRegistrar

 internal ClientObserverRegistrar(SiloAddress myAddr, ILocalGrainDirectory dir, OrleansTaskScheduler scheduler, ClusterConfiguration config)
     : base(Constants.ClientObserverRegistrarId, myAddr)
 {
     grainDirectory = dir;
     myAddress = myAddr;
     this.scheduler = scheduler;
     orleansConfig = config;
     logger = LogManager.GetLogger(typeof(ClientObserverRegistrar).Name);
 }
开发者ID:MikeHardman,项目名称:orleans,代码行数:9,代码来源:ClientObserverRegistrar.cs


示例11: DuplicateActivationException

 // Implementation of exception serialization with custom properties according to:
 // http://stackoverflow.com/questions/94488/what-is-the-correct-way-to-make-a-custom-net-exception-serializable
 protected DuplicateActivationException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     if (info != null)
     {
         ActivationToUse = (ActivationAddress) info.GetValue("ActivationToUse", typeof (ActivationAddress));
         PrimaryDirectoryForGrain = (SiloAddress) info.GetValue("PrimaryDirectoryForGrain", typeof (SiloAddress));
     }
 }
开发者ID:naeemkhedarun,项目名称:orleans,代码行数:11,代码来源:Catalog.cs


示例12: GetImplicitStreamSubscriberTable

 public Task<Streams.ImplicitStreamSubscriberTable> GetImplicitStreamSubscriberTable(SiloAddress silo)
 {
     Streams.ImplicitStreamSubscriberTable table = SiloProviderRuntime.Instance.ImplicitStreamSubscriberTable;
     if (null == table)
     {
         throw new InvalidOperationException("the implicit stream subscriber table is not initialized");
     }
     return Task.FromResult(table);
 }
开发者ID:caomw,项目名称:orleans,代码行数:9,代码来源:TypeManager.cs


示例13: TryGetSiloName

 internal bool TryGetSiloName(SiloAddress siloAddress, out string siloName)
 {
     if (siloAddress.Equals(MyAddress))
     {
         siloName = SiloName;
         return true;
     }
     return localNamesTableCopy.TryGetValue(siloAddress, out siloName);
 }
开发者ID:sbambach,项目名称:orleans,代码行数:9,代码来源:MembershipOracleData.cs


示例14: Init

 public async Task Init(string deploymentId, string storageConnectionString, SiloAddress siloAddress, string siloName, IPEndPoint gateway, string hostName)
 {
     this.deploymentId = deploymentId;
     this.siloAddress = siloAddress;
     this.siloName = siloName;
     this.gateway = gateway;
     myHostName = hostName;
     storage = new AzureTableDataManager<SiloMetricsData>( INSTANCE_TABLE_NAME, storageConnectionString, logger);
     await storage.InitTableAsync().WithTimeout(initTimeout);
 }
开发者ID:caomw,项目名称:orleans,代码行数:10,代码来源:SiloMetricsTableDataManager.cs


示例15: SetLogLevel

        public Task SetLogLevel(SiloAddress[] siloAddresses, string logName, int traceLevel)
        {
            var silos = GetSiloAddresses(siloAddresses);
            logger.Info("SetLogLevel[{1}]={2} {0}", Utils.EnumerableToString(silos), logName, traceLevel);

            List<Task> actionPromises = PerformPerSiloAction(silos,
                s => GetSiloControlReference(s).SetLogLevel(logName, traceLevel));

            return Task.WhenAll(actionPromises);
        }
开发者ID:naeemkhedarun,项目名称:orleans,代码行数:10,代码来源:ManagementGrain.cs


示例16: SiloStatusChangeNotification

 /// <summary>
 /// Called when the status of a silo in the cluster changes.
 /// - Notify listeners
 /// </summary>
 /// <param name="updatedSilo">Silo which status has changed</param>
 /// <param name="status">new silo status</param>
 public void SiloStatusChangeNotification(SiloAddress updatedSilo, SiloStatus status)
 {
     if (status.Equals(SiloStatus.Dead))
     {
         // just clean up garbage from immatureSilos.
         bool ignore;
         immatureSilos.TryRemove(updatedSilo, out ignore);
     }
     SiloStatusChangeNotification().Ignore();
 }
开发者ID:sbambach,项目名称:orleans,代码行数:16,代码来源:DeploymentBasedQueueBalancer.cs


示例17: AddConfiguration

 public void AddConfiguration(string deploymentId, bool isSilo, string siloName, SiloAddress address, IPEndPoint gateway, string hostName)
 {
     SiloName = siloName;
     DeploymentId = deploymentId;
     HostName = hostName;
     TelemetryConfiguration.Active.ContextInitializers.Add(new AppInInitializer(DeploymentId));
     var tc = new TelemetryConfiguration();
     Telemetry = new TelemetryClient();
     Telemetry.InstrumentationKey = InstrumentationKey;
     Initialized = true;
 }
开发者ID:kowalot,项目名称:Pk.OrleansUtils,代码行数:11,代码来源:AppInStatisticsPublisher.cs


示例18: AddConfiguration

 public void AddConfiguration(string deployment, bool silo, string siloId, SiloAddress address, IPEndPoint gatewayAddress, string hostName)
 {
     deploymentId = deployment;
     isSilo = silo;
     siloName = siloId;
     siloAddress = address;
     gateway = gatewayAddress;
     myHostName = hostName;
     if (!isSilo)
         generation = SiloAddress.AllocateNewGeneration();
 }
开发者ID:stanroze,项目名称:orleans,代码行数:11,代码来源:SqlStatisticsPublisher.cs


示例19: TestInitialize

        public void TestInitialize()
        {
            deploymentId = "test-" + Guid.NewGuid();
            generation = SiloAddress.AllocateNewGeneration();
            siloAddress = SiloAddress.NewLocalAddress(generation);

            logger.Info("DeploymentId={0} Generation={1}", deploymentId, generation);

            logger.Info("Initializing SiloInstanceManager");
            manager = OrleansSiloInstanceManager.GetManager(deploymentId, StorageTestConstants.DataConnectionString)
                .WaitForResultWithThrow(SiloInstanceTableTestConstants.Timeout);
        }
开发者ID:fgq841103,项目名称:orleans,代码行数:12,代码来源:SiloInstanceTableManagerTests.cs


示例20: ClientObserverRegistrar

 public ClientObserverRegistrar(
     SiloInitializationParameters initializationParameters,
     ILocalGrainDirectory dir,
     OrleansTaskScheduler scheduler,
     ClusterConfiguration config)
     : base(Constants.ClientObserverRegistrarId, initializationParameters.SiloAddress)
 {
     grainDirectory = dir;
     myAddress = initializationParameters.SiloAddress;
     this.scheduler = scheduler;
     orleansConfig = config;
     logger = LogManager.GetLogger(typeof(ClientObserverRegistrar).Name);
 }
开发者ID:Carlm-MS,项目名称:orleans,代码行数:13,代码来源:ClientObserverRegistrar.cs



注:本文中的SiloAddress类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Sim类代码示例发布时间:2022-05-24
下一篇:
C# Signature类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap