Created on 09-08-2022 09:58 AM - edited 09-08-2022 01:24 PM
Hello,
Is there a way to retrieve all HDFS groups and respective users, in Cloudera, using Java or Scala/Spark code?
In other words, I’m looking for Java/Scala code equivalent to "hdfs groups <user1>, <user2>, ...".
Ideally, the code would run in Zeppelin.
Many thanks.
Created 09-08-2022 01:02 PM
Created 09-08-2022 12:57 PM
@phir1
I can think of something like a for maybe:
# for i in `cat <users_file>`; do hdfs groups $i; done
Created 09-08-2022 01:04 PM
Hi,
thank you for your suggestion, but I’m looking for example Java or Scala code that uses the Hadoop or Cloudera API, instead of scripting the « hdfs » tool on Linux.
Created 09-08-2022 01:02 PM
Try this
hdfs groups hdfs solr