コード例 #1
0
        internal static void EndInitialize()
        {
            s_cmod   = s_client.GetCommunicationModule <TrinityClientModule.TrinityClientModule>();
            s_cookie = s_cmod.MyCookie;
            int partitionCount = 0;

            s_redir_storages = null;

            using (var req = new RegisterClientRequestWriter(s_cmod.MyCookie))
                using (var rsp = s_ep.RegisterClient(req))
                {
                    partitionCount = rsp.PartitionCount;
                    s_instanceId   = rsp.InstanceId;
                }
            s_redir_storages = Enumerable.Range(0, partitionCount).Select(p => new RedirectedIStorage(s_ep, s_client, p) as IStorage).ToList() as IList <IStorage>;
        }
コード例 #2
0
        public void RegisterClient()
        {
            //  copy from initialization result
            m_client = s_client;
            m_ep     = s_ep;

            m_cmod   = m_client.GetCommunicationModule <TrinityClientModule.TrinityClientModule>();
            m_cookie = m_cmod.MyCookie;

            using (var req = new RegisterClientRequestWriter(m_cmod.MyCookie))
                using (var rsp = m_ep.RegisterClient(req))
                {
                    m_partitionCount = rsp.PartitionCount;
                    m_instanceId     = rsp.InstanceId;
                }

            //  after initialization, we switch from pass-through storage
            //  to redirecting storage.
            SetPartitionMethod(GetServerIdByCellIdDefault);

            m_redir_storages = Enumerable.Range(0, m_partitionCount).Select(p => new RedirectedIStorage(m_ep, m_client, p)).Cast <IStorage>().ToList();
        }