hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ekta Agrawal <ektacloudst...@gmail.com>
Subject hadoop java connection problem
Date Fri, 06 Jun 2014 10:19:38 GMT

I am trying to read and write the file from HDFS.I am trying to read it and
display it on console. It runs without giving any error, warning or
exception but also it is not printing the data from file on console, My
file is already saved in hdfs , I can see it on user interface. I think
there is some problem with the path I have given, I am not sure as I am
connecting hadoop first time to java .I am using eclipse as IDE. Can
somebody look into this?

Path pt=new Path("hdfs://localhost:54310/user/hduser/project11/a.txt");
 FileSystem fs = FileSystem.get(new Configuration());
  BufferedReader br=new BufferedReader(new InputStreamReader(fs.open(pt)));
   String line;
                while (( line=br.readLine()) != null){

 if anybody has some idea of this. Please Share.


View raw message