Configuration config = new Configuration();
|
2.Create HDFS file
|
Configuration config = new Configuration();
|
|
Configuration config = new Configuration(); |
Configuration config = new Configuration(); |
Configuration config = new Configuration();
|
Configuration config = new Configuration();
|
import org.apache.hadoop.conf.*; public class DFSOperater { Configuration conf = new Configuration(); FileSystem fs = FileSystem.get(conf); for(int i=0; i < dataNodeStats.length; i++){ } boolean isExists = fs.exists(f); if(isExists){ if(isDeleted)System.out.println("now delete " + f.getName()); System.out.println("create and write [" + f.getName() + "] to hdfs:"); System.out.println("locations of file in HDFS:"); System.out.println(hosts); long modificationTime = filestatus.getModificationTime(); // measured in milliseconds since the epoch Date d = new Date(modificationTime); System.out.println("read [" + f.getName() + "] from hdfs:"); } catch (Exception e) { e.printStackTrace(); }
|