use of mesosphere.marathon.client.model.v2.GetAppResponse in project pravega by pravega.
the class MarathonBasedService method isRunning.
@Override
public boolean isRunning() {
try {
GetAppResponse app = marathonClient.getApp(this.id);
log.debug("App Details: {}", app);
// and the state of application is healthy.
if ((app.getApp().getTasksRunning().intValue() == app.getApp().getInstances().intValue()) && app.getApp().getTasksRunning().intValue() == app.getApp().getTasksHealthy().intValue()) {
log.info("App {} is running", this.id);
return true;
} else {
log.info("App {} is not running", this.id);
return false;
}
} catch (MarathonException ex) {
if (ex.getStatus() == NOT_FOUND.getStatusCode()) {
log.info("App is not running : {}", this.id);
return false;
}
throw new TestFrameworkException(RequestFailed, "Marathon Exception while fetching service details", ex);
}
}
Aggregations