use of org.apache.hadoop.yarn.server.api.protocolrecords.RunSharedCacheCleanerTaskRequest in project hadoop by apache.
the class TestSCMAdminProtocolService method testRunCleanerTask.
@Test
public void testRunCleanerTask() throws Exception {
doNothing().when(cleaner).runCleanerTask();
RunSharedCacheCleanerTaskRequest request = recordFactory.newRecordInstance(RunSharedCacheCleanerTaskRequest.class);
RunSharedCacheCleanerTaskResponse response = SCMAdminProxy.runCleanerTask(request);
Assert.assertTrue("cleaner task request isn't accepted", response.getAccepted());
verify(service, times(1)).runCleanerTask(any(RunSharedCacheCleanerTaskRequest.class));
}
use of org.apache.hadoop.yarn.server.api.protocolrecords.RunSharedCacheCleanerTaskRequest in project hadoop by apache.
the class SCMAdmin method runCleanerTask.
private int runCleanerTask() throws YarnException, IOException {
// run cleaner task right away
SCMAdminProtocol scmAdminProtocol = createSCMAdminProtocol();
RunSharedCacheCleanerTaskRequest request = recordFactory.newRecordInstance(RunSharedCacheCleanerTaskRequest.class);
RunSharedCacheCleanerTaskResponse response = scmAdminProtocol.runCleanerTask(request);
if (response.getAccepted()) {
System.out.println("request accepted by shared cache manager");
return 0;
} else {
System.out.println("request rejected by shared cache manager");
return 1;
}
}
Aggregations