本文整理汇总了Java中org.apache.hadoop.security.authorize.HadoopPolicyProvider类的典型用法代码示例。如果您正苦于以下问题:Java HadoopPolicyProvider类的具体用法?Java HadoopPolicyProvider怎么用?Java HadoopPolicyProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HadoopPolicyProvider类属于org.apache.hadoop.security.authorize包,在下文中一共展示了HadoopPolicyProvider类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setUp
import org.apache.hadoop.security.authorize.HadoopPolicyProvider; //导入依赖的package包/类
public void setUp() throws Exception {
// Read the testConfig.xml file
readTestConfigFile();
// Start up the mini dfs cluster
boolean success = false;
conf = new Configuration();
conf.setClass(PolicyProvider.POLICY_PROVIDER_CONFIG,
HadoopPolicyProvider.class, PolicyProvider.class);
conf.setBoolean(ServiceAuthorizationManager.SERVICE_AUTHORIZATION_CONFIG,
true);
dfsCluster = new MiniDFSCluster(conf, 1, true, null);
namenode = conf.get("fs.default.name", "file:///");
clitestDataDir = new File(TEST_CACHE_DATA_DIR).
toURI().toString().replace(' ', '+');
username = System.getProperty("user.name");
FileSystem fs = dfsCluster.getFileSystem();
assertTrue("Not a HDFS: "+fs.getUri(),
fs instanceof DistributedFileSystem);
dfs = (DistributedFileSystem) fs;
// Start up mini mr cluster
JobConf mrConf = new JobConf(conf);
mrCluster = new MiniMRCluster(1, dfsCluster.getFileSystem().getUri().toString(), 1,
null, null, mrConf);
jobtracker = mrCluster.createJobConf().get("mapred.job.tracker", "local");
success = true;
assertTrue("Error setting up Mini DFS & MR clusters", success);
}
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:34,代码来源:TestCLI.java
示例2: setUp
import org.apache.hadoop.security.authorize.HadoopPolicyProvider; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
super.setUp();
conf.setClass(PolicyProvider.POLICY_PROVIDER_CONFIG,
HadoopPolicyProvider.class, PolicyProvider.class);
mrConf = new JobConf(conf);
mrCluster = new MiniMRCluster(1, dfsCluster.getFileSystem().getUri().toString(), 1,
null, null, mrConf);
jobtracker = mrCluster.createJobConf().get(JTConfig.JT_IPC_ADDRESS, "local");
}
开发者ID:rekhajoshm,项目名称:mapreduce-fork,代码行数:11,代码来源:TestMRCLI.java
注:本文中的org.apache.hadoop.security.authorize.HadoopPolicyProvider类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论