List of usage examples for org.apache.hadoop.hdfs DFSConfigKeys DFS_PERMISSIONS_ENABLED_KEY
String DFS_PERMISSIONS_ENABLED_KEY
To view the source code for org.apache.hadoop.hdfs DFSConfigKeys DFS_PERMISSIONS_ENABLED_KEY.
Click Source Link
From source file:org.trustedanalytics.auth.gateway.hdfs.integration.config.LocalConfiguration.java
License:Apache License
@Bean @Qualifier(Qualifiers.CONFIGURATION)//from w w w .j a v a 2 s . c o m public org.apache.hadoop.conf.Configuration initializeHdfsCluster() throws IOException, InterruptedException, URISyntaxException { File baseDir = new File("./target/hdfs/" + "testName").getAbsoluteFile(); FileUtil.fullyDelete(baseDir); org.apache.hadoop.conf.Configuration conf = new org.apache.hadoop.conf.Configuration(false); conf.set(MiniDFSCluster.HDFS_MINIDFS_BASEDIR, baseDir.getAbsolutePath()); conf.setBoolean(DFSConfigKeys.DFS_PERMISSIONS_ENABLED_KEY, true); conf.setBoolean(DFSConfigKeys.DFS_NAMENODE_ACLS_ENABLED_KEY, true); MiniDFSCluster.Builder builder = new MiniDFSCluster.Builder(conf); MiniDFSCluster cluster = builder.build(); UserGroupInformation.createUserForTesting("cf", new String[] { "cf" }); UserGroupInformation.createUserForTesting("super", new String[] { "supergroup" }); return cluster.getConfiguration(0); }
From source file:org.trustedanalytics.cfbroker.store.hdfs.service.SimpleHdfsClientTest.java
License:Apache License
@BeforeClass public static void initialize() throws IOException { File baseDir = new File("./target/hdfs/" + "testName").getAbsoluteFile(); FileUtil.fullyDelete(baseDir);//w ww .j av a 2s .c o m Configuration conf = new Configuration(false); conf.set(MiniDFSCluster.HDFS_MINIDFS_BASEDIR, baseDir.getAbsolutePath()); conf.setBoolean(DFSConfigKeys.DFS_PERMISSIONS_ENABLED_KEY, true); conf.setBoolean(DFSConfigKeys.DFS_NAMENODE_ACLS_ENABLED_KEY, true); MiniDFSCluster.Builder builder = new MiniDFSCluster.Builder(conf); cluster = builder.build(); cluster.waitClusterUp(); }