use of com.alibaba.maxgraph.proto.RoleType in project GraphScope by alibaba.
the class Frontend method startHBThread.
protected void startHBThread() {
hbSchedule = new ScheduledThreadPoolExecutor(1, CommonUtil.createFactoryWithDefaultExceptionHandler("HB_THREAD", LOG));
hbSchedule.scheduleWithFixedDelay(() -> {
if (clientManager.isCoordinatorRelatedClientNotReady()) {
LOG.info("wait am ready.");
} else {
try {
LOG.info("send hb {} to am", endpoint);
Map<RoleType, Map<Integer, Endpoint>> workerInfoMap = clientManager.getServerDataApiClient().workerHeartbeat(instanceConfig.getServerId(), endpoint, RoleType.FRONTEND, CommonUtil.getYarnLogDir(), this.aliveId, this.roleId);
updateWorkerConnection(workerInfoMap);
} catch (Exception e) {
LOG.error("register to am failed:{}", e);
}
}
}, 1, instanceConfig.getFrontendAmHbIntervalSeconds(), TimeUnit.SECONDS);
}
Aggregations