示例#1
0
        public void Close()
        {
            Enumerable
            .Range(0, PartitionCount)
            .SelectMany(PartitionTable)
            .OfType <DynamicRemoteStorage>()
            .ForEach(s =>
            {
                try
                {
                    int id = GetInstanceId(s.ReplicaInformation.Id);
                    using (var request = new StorageInformationWriter(MyPartitionId, m_nameservice.InstanceId))
                    { m_module.NotifyRemoteStorageOnLeaving(id, request); }
                }
                catch { }
            });

            m_cancelSrc.Cancel();

            m_backupctl.Dispose();
            m_taskexec.Dispose();
            m_partitioner.Dispose();
            m_healthmon.Dispose();
            m_cloudidx.Dispose();
            m_persistent_storage.Dispose();

            m_nameservice.Dispose();
            m_chunktable.Dispose();
            m_taskqueue.Dispose();
            m_healthmanager.Dispose();
            m_backupmgr.Dispose();
        }
示例#2
0
        private async Task MasterNotifyProc()
        {
            if (!m_nameservice.IsMaster)
            {
                return;
            }
            using (var req = new StorageInformationWriter(MyPartitionId, m_nameservice.InstanceId))
            {
                var rsps = await Utils.Integers(m_nameservice.PartitionCount)
                           .Select(i => m_partitions(i)
                                   .Broadcast(p => p.AnnounceMaster(req)))
                           .Unwrap();

                rsps.SelectMany(_ => _).ForEach(_ => _.Dispose());
            }
        }