import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
public class renameFile {
public static void main(String [] args) throws IOException, URISyntaxException {
FileSystem file = FileSystem.get(new URI("hdfs://Master:9000"),new Configuration());
file.rename(new Path("/user/hadoop/file5.abc"), new Path("/user/hadoop/file5.txt"));
file.close();
}
}
hdfs 文件名修改
最新推荐文章于 2024-08-28 18:37:30 发布