Exemple #1
0
            /// <summary>Method to be overridden by sub classes for specific behavior</summary>
            /// <exception cref="System.Exception"/>
            internal virtual int DoWorkInternal(GetConf tool, string[] args)
            {
                string value = tool.GetConf().GetTrimmed(key);

                if (value != null)
                {
                    tool.PrintOut(value);
                    return(0);
                }
                tool.PrintError("Configuration " + key + " is missing.");
                return(-1);
            }
Exemple #2
0
            /// <exception cref="System.IO.IOException"/>
            internal override int DoWorkInternal(GetConf tool, string[] args)
            {
                Configuration config = tool.GetConf();
                IList <DFSUtil.ConfiguredNNAddress> cnnlist = DFSUtil.FlattenAddressMap(DFSUtil.GetNNServiceRpcAddressesForCluster
                                                                                            (config));

                if (!cnnlist.IsEmpty())
                {
                    foreach (DFSUtil.ConfiguredNNAddress cnn in cnnlist)
                    {
                        IPEndPoint rpc = cnn.GetAddress();
                        tool.PrintOut(rpc.GetHostName() + ":" + rpc.Port);
                    }
                    return(0);
                }
                tool.PrintError("Did not get namenode service rpc addresses.");
                return(-1);
            }