示例#1
0
        public virtual void TestRefreshCallQueueProtocol()
        {
            RefreshCallQueueProtocolClientSideTranslatorPB translator = (RefreshCallQueueProtocolClientSideTranslatorPB
                                                                         )NameNodeProxies.CreateNonHAProxy <RefreshCallQueueProtocol>(conf, nnAddress, UserGroupInformation
                                                                                                                                      .GetCurrentUser(), true).GetProxy();

            NUnit.Framework.Assert.IsTrue(translator.IsMethodSupported("refreshCallQueue"));
        }
示例#2
0
        public virtual void TestGetUserMappingsProtocol()
        {
            GetUserMappingsProtocolClientSideTranslatorPB translator = (GetUserMappingsProtocolClientSideTranslatorPB
                                                                        )NameNodeProxies.CreateNonHAProxy <GetUserMappingsProtocol>(conf, nnAddress, UserGroupInformation
                                                                                                                                    .GetCurrentUser(), true).GetProxy();

            NUnit.Framework.Assert.IsTrue(translator.IsMethodSupported("getGroupsForUser"));
        }
示例#3
0
        public virtual void TestClientNamenodeProtocol()
        {
            ClientProtocol cp = NameNodeProxies.CreateNonHAProxy <ClientProtocol>(conf, nnAddress
                                                                                  , UserGroupInformation.GetCurrentUser(), true).GetProxy();

            RpcClientUtil.IsMethodSupported(cp, typeof(ClientNamenodeProtocolPB), RPC.RpcKind
                                            .RpcProtocolBuffer, RPC.GetProtocolVersion(typeof(ClientNamenodeProtocolPB)), "mkdirs"
                                            );
        }
示例#4
0
        public virtual void TesJournalProtocol()
        {
            JournalProtocolTranslatorPB translator = (JournalProtocolTranslatorPB)NameNodeProxies
                                                     .CreateNonHAProxy <JournalProtocol>(conf, nnAddress, UserGroupInformation.GetCurrentUser
                                                                                             (), true).GetProxy();

            //Nameode doesn't implement JournalProtocol
            NUnit.Framework.Assert.IsFalse(translator.IsMethodSupported("startLogSegment"));
        }
 public DummyLegacyFailoverProxyProvider(Configuration conf, URI uri, Type xface)
 {
     try
     {
         this.proxy = NameNodeProxies.CreateNonHAProxy(conf, NameNode.GetAddress(uri), xface
                                                       , UserGroupInformation.GetCurrentUser(), false).GetProxy();
         this.xface = xface;
     }
     catch (IOException)
     {
     }
 }
示例#6
0
        public virtual void TestNamenodeProtocol()
        {
            NamenodeProtocol np = NameNodeProxies.CreateNonHAProxy <NamenodeProtocol>(conf, nnAddress
                                                                                      , UserGroupInformation.GetCurrentUser(), true).GetProxy();
            bool exists = RpcClientUtil.IsMethodSupported(np, typeof(NamenodeProtocolPB), RPC.RpcKind
                                                          .RpcProtocolBuffer, RPC.GetProtocolVersion(typeof(NamenodeProtocolPB)), "rollEditLog"
                                                          );

            NUnit.Framework.Assert.IsTrue(exists);
            exists = RpcClientUtil.IsMethodSupported(np, typeof(NamenodeProtocolPB), RPC.RpcKind
                                                     .RpcProtocolBuffer, RPC.GetProtocolVersion(typeof(NamenodeProtocolPB)), "bogusMethod"
                                                     );
            NUnit.Framework.Assert.IsFalse(exists);
        }
示例#7
0
        /// <summary>Get an RPC proxy for each NN in an HA nameservice.</summary>
        /// <remarks>
        /// Get an RPC proxy for each NN in an HA nameservice. Used when a given RPC
        /// call should be made on every NN in an HA nameservice, not just the active.
        /// </remarks>
        /// <param name="conf">configuration</param>
        /// <param name="nsId">the nameservice to get all of the proxies for.</param>
        /// <param name="xface">the protocol class.</param>
        /// <returns>a list of RPC proxies for each NN in the nameservice.</returns>
        /// <exception cref="System.IO.IOException">in the event of error.</exception>
        public static IList <NameNodeProxies.ProxyAndInfo <T> > GetProxiesForAllNameNodesInNameservice
        <T>(Configuration conf, string nsId)
        {
            System.Type xface = typeof(T);
            IDictionary <string, IPEndPoint> nnAddresses = DFSUtil.GetRpcAddressesForNameserviceId
                                                               (conf, nsId, null);
            IList <NameNodeProxies.ProxyAndInfo <T> > proxies = new AList <NameNodeProxies.ProxyAndInfo
                                                                           <T> >(nnAddresses.Count);

            foreach (IPEndPoint nnAddress in nnAddresses.Values)
            {
                NameNodeProxies.ProxyAndInfo <T> proxyInfo = null;
                proxyInfo = NameNodeProxies.CreateNonHAProxy(conf, nnAddress, xface, UserGroupInformation
                                                             .GetCurrentUser(), false);
                proxies.AddItem(proxyInfo);
            }
            return(proxies);
        }