use of com.tencent.angel.localcluster.LocalMaster in project angel by Tencent.
the class AngelLocalClient method updateMaster.
@Override
protected void updateMaster(int maxWaitSeconds) throws Exception {
int tryTime = 0;
TConnection connection = TConnectionManager.getConnection(conf);
while (tryTime < maxWaitSeconds) {
LocalMaster localMaster = LocalClusterContext.get().getMaster();
if (localMaster == null || localMaster.getAppMaster().getAppContext().getMasterService() == null) {
Thread.sleep(1000);
tryTime++;
continue;
}
masterLocation = localMaster.getAppMaster().getAppContext().getMasterService().getLocation();
if (masterLocation == null) {
Thread.sleep(1000);
tryTime++;
continue;
}
try {
LOG.info("start to create rpc client to am");
master = connection.getMasterService(masterLocation.getIp(), masterLocation.getPort());
startHeartbeat();
break;
} catch (ServiceException e) {
Thread.sleep(1000);
tryTime++;
}
}
}
Aggregations