Exemplo n.º 1
0
 public RedirectedIStorage(IMessagePassingEndpoint ep, TrinityClient tc, int p)
 {
     m_ep        = ep;
     m_comminst  = tc;
     partitionId = p;
     m_mod       = GetCommunicationModule <TrinityClientModule.TrinityClientModule>();
 }
Exemplo n.º 2
0
 internal static void BeginInitialize(IMessagePassingEndpoint ep, TrinityClient tc)
 {
     s_ep             = ep;
     s_client         = tc;
     s_redir_storages = new List <IStorage> {
         new PassThroughIStorage(ep)
     };
 }
Exemplo n.º 3
0
        internal static void Initialize(IMessagePassingEndpoint ep, TrinityClient tc)
        {
            s_ep     = ep;
            s_client = tc;

            //  during initialization, there's a single
            //  PassThroughIStorage in our storage table.
            s_redir_storages = new List <IStorage> {
                new PassThroughIStorage(ep)
            };
        }
Exemplo n.º 4
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();
        }