AnsweredAssumed Answered

Creating/editing table permissions with Java API

Question asked by boucherj on Feb 13, 2018
Latest reply on Feb 17, 2018 by snayeem

I'm well aware that it is possible to do this with the REST API, but my question is can this be done with the Java API.

 

Looking at the following thread, MapRFileAce and MapRFileSystem Java APIs : documentation not available?, it may be feasible to do so using the MapRCliCommands:

import com.mapr.fs.clicommands.MapRCliCommands;
import org.apache.hadoop.util.ToolRunner;
...
String cliArgs [] = {"-setace" ,"-R", "-aces", "rf:u:root|u:mapr,wf:u:root|u:mapr,ac:u:root|u:mapr,dc:u:root|u:mapr","-preservemodebits","true","-setinherit","true",aceTestPathStr};
MapRCliCommands shell = new MapRCliCommands();
int status = ToolRunner.run(shell, cliArgs);

(or whatever other MapR client command line ?)

 

Also looking at Index of /groups/mapr-public/com/mapr/hadoop/maprfs/5.2.2.201801021050-mapr there is a public method in com.mapr.fs.tables.MapRAdmin called

void setTablePermissions(Path table, Map<String, String> permissions)

 

I'll experiment with the above, but if there is someone that knows if this works / is recommended, please let me know.

 

Thanks,

 

Jacques

Outcomes