use of com.tencent.angel.protobuf.generated.MLProtos.PSLocationProto in project angel by Tencent.
the class AngelClient method waitForAllPS.
protected void waitForAllPS(int psNumber) throws ServiceException, InterruptedException {
boolean isAllPSReady = true;
while (true) {
GetAllPSLocationResponse response = master.getAllPSLocation(null, GetAllPSLocationRequest.newBuilder().build());
List<PSLocationProto> psLocs = response.getPsLocationsList();
int size = psLocs.size();
if (size == psNumber) {
isAllPSReady = true;
for (int i = 0; i < size; i++) {
if (psLocs.get(i).getPsStatus() == PSStatus.PS_NOTREADY) {
isAllPSReady = false;
break;
}
}
if (isAllPSReady) {
return;
}
}
Thread.sleep(100);
}
}
Aggregations