dfs = new MiniDFSCluster(conf, slaves, true, null);
// Ensure that the protocols authorized on the name node are only the HDFS protocols.
Set<Class<?>> protocolsWithAcls = NameNodeAdapter.getRpcServer(dfs.getNameNode())
.getServiceAuthorizationManager().getProtocolsWithAcls();
Service[] hdfsServices = new HDFSPolicyProvider().getServices();
for (Service service : hdfsServices) {
if (!protocolsWithAcls.contains(service.getProtocol()))
fail("service authorization manager has no entry for protocol " + service.getProtocol());
}
if (hdfsServices.length != protocolsWithAcls.size())
fail("there should be an entry for every HDFS service in the protocols with ACLs map");
fileSys = dfs.getFileSystem();
JobConf mrConf = new JobConf(conf);
mr = new MiniMRCluster(slaves, fileSys.getUri().toString(), 1,
null, null, mrConf);
// Ensure that the protocols configured for the name node did not change
// when the MR cluster was started.
protocolsWithAcls = NameNodeAdapter.getRpcServer(dfs.getNameNode())
.getServiceAuthorizationManager().getProtocolsWithAcls();
hdfsServices = new HDFSPolicyProvider().getServices();
for (Service service : hdfsServices) {
if (!protocolsWithAcls.contains(service.getProtocol()))
fail("service authorization manager has no entry for protocol " + service.getProtocol());
}
if (hdfsServices.length != protocolsWithAcls.size())