hdfs icon indicating copy to clipboard operation
hdfs copied to clipboard

Can I set more configuration when access hdfs?

Open wymli opened this issue 2 years ago • 0 comments

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);

wymli avatar Jan 12 '23 06:01 wymli