Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

change FS to hdfs java

Configuration conf = new Configuration();
conf.set("fs.defaultFS", "hdfs://hadoop:8020");
conf.set("fs.hdfs.impl", "org.apache.hadoop.hdfs.DistributedFileSystem");
FileSystem fs = FileSystem.get(conf);
RemoteIterator<LocatedFileStatus> ri = fs.listFiles(fs.getHomeDirectory(), false);
while (ri.hasNext()) {
    LocatedFileStatus lfs = ri.next();
    log.debug(lfs.getPath().toString());
}
fs.close();
Comment

PREVIOUS NEXT
Code Example
Java :: java pattern matching 
Java :: Labeled continue Statement Java 
Java :: java program for calendar using applet 
Java :: Armstrong Numbers Between Two Integers 
Java :: print different variable datatype 
Java :: how to get map with string as key and Arraylist as value in java 
Java :: how to do 4th root java 
Java :: check is element present in queue java 
Java :: java circular buffer implementation on array 
Java :: javafx treeview directory 
Java :: how to use int 
Java :: how to use protobuf in java 
Java :: bukkit scheduler self cancelling task 
Java :: Rotate Vector by an angle 
Java :: hashtable 
Java :: arraylist add method 
Java :: string split java 
Java :: camel java 
Java :: java jcombobox selected item changed 
Java :: how to sprint minecraft java 
Java :: java float 
Java :: java read all text from file 
Java :: $950 at 6% per annum for three years. 
Java :: how to calculate min, max and average and write the output into into a text file in java 
Sql :: delete mysql ubuntu 20.04 
Sql :: psql drop column 
Sql :: how to get notinteger value in sql 
Sql :: sql server conection string 
Sql :: get all tables postgres 
Sql :: mysql drop database if exists 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =