Hadoop setfacl via Scala/Java

huangapple go评论84阅读模式
英文:

Hadoop setfacl via Scala/Java

问题

有没有办法通过Scala/Java执行hdfs dfs -setfacl命令?通过hdfs shell执行速度很慢。

例如,我想将这个命令重写如下:

Seq("hdfs", "dfs", "-setfacl", "-R", "-m", "group:hive:rwx", s"$targetTableFolderPath/$targetPartitionValue").!!

用Scala代码来实现。在fs: FileSystem上是否有我可以调用的方法?怎么做?

英文:

Is there a way to do hdfs dfs -setfacl via Scala/Java? Doing it via hdfs shell is slow.

e.g. I would like to rewrite this:
Seq("hdfs", "dfs", "-setfacl", "-R", "-m", "group:hive:rwx", s"$targetTableFolderPath/$targetPartitionValue").!!

into Scala code. Is there a method on fs: FileSystem that I could call? How?

答案1

得分: 1

以下是已翻译的内容:

你可能希望使用 Hadoop API。这里是 HdfsAdmin 类的(Java)文档:

https://hadoop.apache.org/docs/current/api/

英文:

You may want to use hadoop API. Here are the (java)docs for the HdfsAdmin class:

https://hadoop.apache.org/docs/current/api/

huangapple
  • 本文由 发表于 2020年10月2日 16:37:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/64168515.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定