Search in sources :

Example 1 with InMemorySCMStore

use of org.apache.hadoop.yarn.server.sharedcachemanager.store.InMemorySCMStore in project hadoop by apache.

the class TestClientSCMProtocolService method startUp.

@Before
public void startUp() {
    Configuration conf = new Configuration();
    conf.set(YarnConfiguration.SCM_STORE_CLASS, InMemorySCMStore.class.getName());
    conf.set(YarnConfiguration.SHARED_CACHE_ROOT, testDir.getPath());
    AppChecker appChecker = spy(new DummyAppChecker());
    store = new InMemorySCMStore(appChecker);
    store.init(conf);
    store.start();
    service = new ClientProtocolService(store);
    service.init(conf);
    service.start();
    YarnRPC rpc = YarnRPC.create(new Configuration());
    InetSocketAddress scmAddress = conf.getSocketAddr(YarnConfiguration.SCM_CLIENT_SERVER_ADDRESS, YarnConfiguration.DEFAULT_SCM_CLIENT_SERVER_ADDRESS, YarnConfiguration.DEFAULT_SCM_CLIENT_SERVER_PORT);
    clientSCMProxy = (ClientSCMProtocol) rpc.getProxy(ClientSCMProtocol.class, scmAddress, conf);
}
Also used : YarnConfiguration(org.apache.hadoop.yarn.conf.YarnConfiguration) Configuration(org.apache.hadoop.conf.Configuration) InetSocketAddress(java.net.InetSocketAddress) InMemorySCMStore(org.apache.hadoop.yarn.server.sharedcachemanager.store.InMemorySCMStore) YarnRPC(org.apache.hadoop.yarn.ipc.YarnRPC) Before(org.junit.Before)

Example 2 with InMemorySCMStore

use of org.apache.hadoop.yarn.server.sharedcachemanager.store.InMemorySCMStore in project hadoop by apache.

the class TestSharedCacheUploaderService method startUp.

@Before
public void startUp() {
    Configuration conf = new Configuration();
    conf.set(YarnConfiguration.SCM_STORE_CLASS, InMemorySCMStore.class.getName());
    conf.set(YarnConfiguration.SHARED_CACHE_ROOT, testDir.getPath());
    AppChecker appChecker = spy(new DummyAppChecker());
    store = new InMemorySCMStore(appChecker);
    store.init(conf);
    store.start();
    service = new SharedCacheUploaderService(store);
    service.init(conf);
    service.start();
    YarnRPC rpc = YarnRPC.create(new Configuration());
    InetSocketAddress scmAddress = conf.getSocketAddr(YarnConfiguration.SCM_UPLOADER_SERVER_ADDRESS, YarnConfiguration.DEFAULT_SCM_UPLOADER_SERVER_ADDRESS, YarnConfiguration.DEFAULT_SCM_UPLOADER_SERVER_PORT);
    proxy = (SCMUploaderProtocol) rpc.getProxy(SCMUploaderProtocol.class, scmAddress, conf);
}
Also used : YarnConfiguration(org.apache.hadoop.yarn.conf.YarnConfiguration) Configuration(org.apache.hadoop.conf.Configuration) InetSocketAddress(java.net.InetSocketAddress) InMemorySCMStore(org.apache.hadoop.yarn.server.sharedcachemanager.store.InMemorySCMStore) YarnRPC(org.apache.hadoop.yarn.ipc.YarnRPC) Before(org.junit.Before)

Aggregations

InetSocketAddress (java.net.InetSocketAddress)2 Configuration (org.apache.hadoop.conf.Configuration)2 YarnConfiguration (org.apache.hadoop.yarn.conf.YarnConfiguration)2 YarnRPC (org.apache.hadoop.yarn.ipc.YarnRPC)2 InMemorySCMStore (org.apache.hadoop.yarn.server.sharedcachemanager.store.InMemorySCMStore)2 Before (org.junit.Before)2