hdfs中,用户的回收站用类org.apache.hadoop.fs.Trash来表示,这个类主要包含了四个属性。
public Trash(FileSystem fs,Configuration conf)throws IOException(
super(conf);
this.fs=fs;
this.trash=new Path(fs.getHomeDirectory(),TRASH);
this.current=new Path(trash,CURRENT);
this.interval=conf.getLong("fs.trash.interval",60)*MSECS_PER_MINUTE;
)
fs:文件系统
trash:回收站目录(/user/用户名/.Trash)
current:存放被用户删除的文件/目录的路径(/user/用户名/.Trash/current)
interval:被用户删除的文件目录在回收站中的生命周期;
默认情况下interval为0,namenode每隔interval分钟来删除回收站的目录