/**
* Get task clocks for all matrices from Master
* @return task clocks for all matrices from Master
* @throws ServiceException
*/
public Int2ObjectOpenHashMap<Int2IntOpenHashMap> getTaskMatrixClocks() throws ServiceException {
GetTaskMatrixClockResponse response = masterProxy.getTaskMatrixClocks(null,
GetTaskMatrixClockRequest.newBuilder().build());
Int2ObjectOpenHashMap<Int2IntOpenHashMap> taskIdToMatrixClocksMap = new Int2ObjectOpenHashMap<>(response.getTaskMatrixClocksCount());
List<TaskMatrixClock> taskMatrixClocks = response.getTaskMatrixClocksList();
int size = taskMatrixClocks.size();
int matrixNum;
for(int i = 0; i < size; i++) {
Int2IntOpenHashMap matrixIdToClockMap = new Int2IntOpenHashMap(taskMatrixClocks.get(i).getMatrixClocksCount());
taskIdToMatrixClocksMap.put(taskMatrixClocks.get(i).getTaskId().getTaskIndex(), matrixIdToClockMap);
List<MatrixClock> matrixClocks = taskMatrixClocks.get(i).getMatrixClocksList();
matrixNum = matrixClocks.size();
for(int j = 0; j < matrixNum; j++) {
matrixIdToClockMap.put(matrixClocks.get(j).getMatrixId(), matrixClocks.get(j).getClock());
}
}
return taskIdToMatrixClocksMap;
}
MasterClient.java 文件源码
java
阅读 32
收藏 0
点赞 0
评论 0
项目:angel
作者:
评论列表
文章目录