本文整理汇总了Java中org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppState.equals方法的典型用法代码示例。如果您正苦于以下问题:Java RMAppState.equals方法的具体用法?Java RMAppState.equals怎么用?Java RMAppState.equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppState
的用法示例。
在下文中一共展示了RMAppState.equals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: waitForState
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppState; //导入方法依赖的package包/类
public void waitForState(ApplicationId appId, RMAppState finalState)
throws Exception {
RMApp app = getRMContext().getRMApps().get(appId);
Assert.assertNotNull("app shouldn't be null", app);
int timeoutSecs = 0;
while (!finalState.equals(app.getState()) && timeoutSecs++ < 40) {
System.out.println("App : " + appId + " State is : " + app.getState()
+ " Waiting for state : " + finalState);
Thread.sleep(2000);
}
System.out.println("App State is : " + app.getState());
Assert.assertEquals("App state is not correct (timedout)", finalState,
app.getState());
}
示例2: isFinalState
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppState; //导入方法依赖的package包/类
protected boolean isFinalState(RMAppState state) {
return state.equals(RMAppState.FINISHING)
|| state.equals(RMAppState.FINISHED) || state.equals(RMAppState.FAILED)
|| state.equals(RMAppState.KILLED);
}