Search in sources :

Example 1 with SCMAdmin

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;
        }
    };
}
Also used : YarnConfiguration(org.apache.hadoop.yarn.conf.YarnConfiguration) Configuration(org.apache.hadoop.conf.Configuration) InetSocketAddress(java.net.InetSocketAddress) SCMAdminProtocol(org.apache.hadoop.yarn.server.api.SCMAdminProtocol) SCMAdmin(org.apache.hadoop.yarn.client.SCMAdmin) InMemorySCMStore(org.apache.hadoop.yarn.server.sharedcachemanager.store.InMemorySCMStore) YarnRPC(org.apache.hadoop.yarn.ipc.YarnRPC) IOException(java.io.IOException) Before(org.junit.Before)

Aggregations

IOException (java.io.IOException)1 InetSocketAddress (java.net.InetSocketAddress)1 Configuration (org.apache.hadoop.conf.Configuration)1 SCMAdmin (org.apache.hadoop.yarn.client.SCMAdmin)1 YarnConfiguration (org.apache.hadoop.yarn.conf.YarnConfiguration)1 YarnRPC (org.apache.hadoop.yarn.ipc.YarnRPC)1 SCMAdminProtocol (org.apache.hadoop.yarn.server.api.SCMAdminProtocol)1 InMemorySCMStore (org.apache.hadoop.yarn.server.sharedcachemanager.store.InMemorySCMStore)1 Before (org.junit.Before)1