Пример #1
0
        private string GetMapData()
        {
            try
            {

                HadoopJobConfiguration myConfig = new HadoopJobConfiguration();
                myConfig.InputPath = "/demo/simple/in";
                myConfig.OutputFolder = "/demo/simple/out";

                //connect to cluster
                Uri myUri = new Uri("hdfs://0.0.0.0:19000");

                string userName = null;

                string passWord = null;

                //Microsoft.Hadoop.WebHDFS.WebHDFSClient.MapReduce.IHadoop myCluster = Microsoft.Hadoop.MapReduce.Hadoop.Connect(myUri, userName, passWord);
                Microsoft.Hadoop.WebHDFS.WebHDFSClient client = new Microsoft.Hadoop.WebHDFS.WebHDFSClient(myUri, userName);
                return client.GetHomeDirectory().Result;
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return string.Empty;
        }
Пример #2
0
        private string GetMapData()
        {
            try
            {
                HadoopJobConfiguration myConfig = new HadoopJobConfiguration();
                myConfig.InputPath    = "/demo/simple/in";
                myConfig.OutputFolder = "/demo/simple/out";

                //connect to cluster
                Uri myUri = new Uri("hdfs://0.0.0.0:19000");

                string userName = null;

                string passWord = null;

                //Microsoft.Hadoop.WebHDFS.WebHDFSClient.MapReduce.IHadoop myCluster = Microsoft.Hadoop.MapReduce.Hadoop.Connect(myUri, userName, passWord);
                Microsoft.Hadoop.WebHDFS.WebHDFSClient client = new Microsoft.Hadoop.WebHDFS.WebHDFSClient(myUri, userName);
                return(client.GetHomeDirectory().Result);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(string.Empty);
        }