Displays the file information of a group of paths in the Hadoop file system.
// Display the file information of a group of paths in the Hadoop File System
// We can use this program to display the Union of a group of path set directories.
Package com;
Import java. io. IOException;
Import java.net. URI;
Import org. apache. hadoop. conf. Configuration;
Import org. apache. hadoop. fs. FileStatus;
Import org. apache. hadoop. fs. FileSystem;
Import org. apache. hadoop. fs. FileUtil;
Import org. apache. hadoop. fs. Path;
Public class ListStatus {
/**
* @ Param args
* @ Throws IOException
*/
Public static void main (String [] args) throws IOException {
// TODO Auto-generated method stub
String uri = args [0];
Configuration conf = new Configuration ();
FileSystem fs = FileSystem. get (URI. create (uri), conf );
Path [] paths = new Path [args. length];
For (int I = 0; I <paths. length; I ++ ){
Paths [I] = new Path (args [I]);
}
FileStatus [] status = fs. listStatus (paths );
Path [] listedPaths = FileUtil. stat2Paths (status );
For (Path p: listedPaths ){
System. out. println (p );
}
}
}
Tutorial on standalone/pseudo-distributed installation and configuration of Hadoop2.4.1 under Ubuntu14.04
Install and configure Hadoop2.2.0 on CentOS
Build a Hadoop environment on Ubuntu 13.04
Cluster configuration for Ubuntu 12.10 + Hadoop 1.2.1
Build a Hadoop environment on Ubuntu (standalone mode + pseudo Distribution Mode)
Configuration of Hadoop environment in Ubuntu
Detailed tutorial on creating a Hadoop environment for standalone Edition
Build a Hadoop environment (using virtual machines to build two Ubuntu systems in a Winodws environment)