use of org.apache.hadoop.yarn.client.SCMAdmin in project hadoop by apache.
the class TestSCMAdminProtocolService method startUp.
@Before
public void startUp() {
Configuration conf = new Configuration();
conf.set(YarnConfiguration.SCM_STORE_CLASS, InMemorySCMStore.class.getName());
cleaner = mock(CleanerService.class);
service = spy(new SCMAdminProtocolService(cleaner));
service.init(conf);
service.start();
YarnRPC rpc = YarnRPC.create(new Configuration());
InetSocketAddress scmAddress = conf.getSocketAddr(YarnConfiguration.SCM_ADMIN_ADDRESS, YarnConfiguration.DEFAULT_SCM_ADMIN_ADDRESS, YarnConfiguration.DEFAULT_SCM_ADMIN_PORT);
SCMAdminProxy = (SCMAdminProtocol) rpc.getProxy(SCMAdminProtocol.class, scmAddress, conf);
mockAdmin = mock(SCMAdminProtocol.class);
adminCLI = new SCMAdmin(new Configuration()) {
@Override
protected SCMAdminProtocol createSCMAdminProtocol() throws IOException {
return mockAdmin;
}
};
}
Aggregations