• <legend id='LQojt'><style id='LQojt'><dir id='LQojt'><q id='LQojt'></q></dir></style></legend>

    <i id='LQojt'><tr id='LQojt'><dt id='LQojt'><q id='LQojt'><span id='LQojt'><b id='LQojt'><form id='LQojt'><ins id='LQojt'></ins><ul id='LQojt'></ul><sub id='LQojt'></sub></form><legend id='LQojt'></legend><bdo id='LQojt'><pre id='LQojt'><center id='LQojt'></center></pre></bdo></b><th id='LQojt'></th></span></q></dt></tr></i><div id='LQojt'><tfoot id='LQojt'></tfoot><dl id='LQojt'><fieldset id='LQojt'></fieldset></dl></div>
    <tfoot id='LQojt'></tfoot>

    <small id='LQojt'></small><noframes id='LQojt'>

    • <bdo id='LQojt'></bdo><ul id='LQojt'></ul>

        hdfs中的文件路径

        时间:2023-09-26

        <legend id='Wr1Ww'><style id='Wr1Ww'><dir id='Wr1Ww'><q id='Wr1Ww'></q></dir></style></legend>
        1. <small id='Wr1Ww'></small><noframes id='Wr1Ww'>

            <tbody id='Wr1Ww'></tbody>
            <bdo id='Wr1Ww'></bdo><ul id='Wr1Ww'></ul>

                  <tfoot id='Wr1Ww'></tfoot>
                  <i id='Wr1Ww'><tr id='Wr1Ww'><dt id='Wr1Ww'><q id='Wr1Ww'><span id='Wr1Ww'><b id='Wr1Ww'><form id='Wr1Ww'><ins id='Wr1Ww'></ins><ul id='Wr1Ww'></ul><sub id='Wr1Ww'></sub></form><legend id='Wr1Ww'></legend><bdo id='Wr1Ww'><pre id='Wr1Ww'><center id='Wr1Ww'></center></pre></bdo></b><th id='Wr1Ww'></th></span></q></dt></tr></i><div id='Wr1Ww'><tfoot id='Wr1Ww'></tfoot><dl id='Wr1Ww'><fieldset id='Wr1Ww'></fieldset></dl></div>
                  本文介绍了hdfs中的文件路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我想从 Hadoop 文件系统中读取文件.

                  I want to read the file from the Hadoop File System.

                  为了实现文件的正确路径,我需要hdfs的主机名和端口地址.

                  In order to achieve the correct path of the file, I need host name and port address of the hdfs.

                  所以最后我的文件路径看起来像

                  so finally my path of the file will look something like

                  Path path = new Path("hdfs://123.23.12.4344:9000/user/filename.txt")
                  

                  现在我想知道提取 HostName = "123.23.12.4344" &端口:9000?

                  Now I want to know to extract the HostName = "123.23.12.4344" & port: 9000?

                  基本上,我想访问 Amazon EMR 上的文件系统,但是当我使用

                  Basically, I want to access the FileSystem on Amazon EMR but, when I use

                   FileSystem fs = FileSystem.get(getConf());

                  我得到

                   
                  You possibly called FileSystem.get(conf) when you should have called FileSystem.get(uri, conf) to obtain a file system supporting your path
                  

                  所以我决定使用 URI.(我必须使用 URI)但我不确定如何访问 URI.

                  So I decided to use URI. (I have to use URI) but I am not sure how to access the URI.

                  推荐答案

                  您可以使用这两种方法中的任何一种来解决您的错误.

                  You can use either of the two ways to solve your error.

                  1.

                  String infile = "file.txt";
                  Path ofile = new Path(infile);
                  FileSystem fs = ofile.getFileSystem(getConf());
                  

                  2.

                  Configuration conf = getConf();
                  System.out.println("fs.default.name : - " + conf.get("fs.default.name"));
                  // It prints uri  as : hdfs://10.214.15.165:9000 or something
                  String uri = conf.get("fs.default.name");
                  FileSystem fs = FileSystem.get(uri,getConf());
                  

                  这篇关于hdfs中的文件路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何以编程方式获取 Hadoop 在 Web 界面中显示的所 下一篇:如何在 Reducer 中访问 Mapper Counter 值?

                  相关文章

                  最新文章

                • <i id='fNGm8'><tr id='fNGm8'><dt id='fNGm8'><q id='fNGm8'><span id='fNGm8'><b id='fNGm8'><form id='fNGm8'><ins id='fNGm8'></ins><ul id='fNGm8'></ul><sub id='fNGm8'></sub></form><legend id='fNGm8'></legend><bdo id='fNGm8'><pre id='fNGm8'><center id='fNGm8'></center></pre></bdo></b><th id='fNGm8'></th></span></q></dt></tr></i><div id='fNGm8'><tfoot id='fNGm8'></tfoot><dl id='fNGm8'><fieldset id='fNGm8'></fieldset></dl></div>
                    <bdo id='fNGm8'></bdo><ul id='fNGm8'></ul>

                  1. <legend id='fNGm8'><style id='fNGm8'><dir id='fNGm8'><q id='fNGm8'></q></dir></style></legend>

                    1. <tfoot id='fNGm8'></tfoot>

                      <small id='fNGm8'></small><noframes id='fNGm8'>