@Override public void monitor() { if (connection.open()) { try { ClusterSummary summary = connection.getClusterSummary(); List<SupervisorSummary> supervisors = summary.get_supervisors(); PlatformSystemPart part = getState().getPlatform(); aggregate(part, supervisors); sendSummaryEvent(part, null, MonitoringManager.DEMO_MSG_INFRASTRUCTURE); } catch (TException e) { LOGGER.error("Cannot obtain thrift data " + e.getMessage(), e); } catch (IllegalStateException e) { // monitoring runs longer than topology exists... ignore } } }
@Override protected void failover(Throwable th) { connection.close(); // hope that it silently closes and a reconnect happens in the next round }