hdfs
hdfs copied to clipboard
Can I set more configuration when access hdfs?
I'm accessing a remote fs using hdfs protocol, but some conf in core-site.xml
should be changed.
I wonder could we access hdfs like the following code, dynamically set key value config.
Configuration conf = new Configuration();
conf.set("fs.cfs.impl", "com.volcengine.cloudfs.fs.CfsFileSystem");
conf.set("cfs.client.network.segment", vpcNet);
conf.set("cfs.access.key", ak);
conf.set("cfs.secret.key", sk);
// Optional:
// conf.set("cfs.security.token", sk);
FileSystem fs = FileSystem.get("cfs://xxxx.cfs-cn-beijing.ivolces.com", conf);