英文:
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:
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论