示例#1
0
 @Override
 public RecordCursor cursor() {
   Builder table = InMemoryRecordSet.builder(TASK_TABLE);
   for (TaskInfo taskInfo : taskManager.getAllTaskInfo()) {
     TaskStats stats = taskInfo.getStats();
     table.addRow(
         nodeId,
         taskInfo.getTaskId().toString(),
         taskInfo.getTaskId().getStageId().toString(),
         taskInfo.getTaskId().getQueryId().toString(),
         taskInfo.getState().toString(),
         (long) stats.getTotalDrivers(),
         (long) stats.getQueuedDrivers(),
         (long) stats.getRunningDrivers(),
         (long) stats.getCompletedDrivers(),
         toMillis(stats.getTotalScheduledTime()),
         toMillis(stats.getTotalCpuTime()),
         toMillis(stats.getTotalUserTime()),
         toMillis(stats.getTotalBlockedTime()),
         toBytes(stats.getRawInputDataSize()),
         stats.getRawInputPositions(),
         toBytes(stats.getProcessedInputDataSize()),
         stats.getProcessedInputPositions(),
         toBytes(stats.getOutputDataSize()),
         stats.getOutputPositions(),
         toTimeStamp(stats.getCreateTime()),
         toTimeStamp(stats.getFirstStartTime()),
         toTimeStamp(taskInfo.getLastHeartbeat()),
         toTimeStamp(stats.getEndTime()));
   }
   return table.build().cursor();
 }
示例#2
0
 @Override
 public RecordCursor cursor(ConnectorSession session, TupleDomain<Integer> constraint) {
   Builder table = InMemoryRecordSet.builder(NODES_TABLE);
   AllNodes allNodes = nodeManager.getAllNodes();
   addRows(table, allNodes.getActiveNodes(), ACTIVE);
   addRows(table, allNodes.getInactiveNodes(), INACTIVE);
   addRows(table, allNodes.getShuttingDownNodes(), SHUTTING_DOWN);
   return table.build().cursor();
 }
示例#3
0
 private void addRows(Builder table, Set<Node> nodes, NodeState state) {
   for (Node node : nodes) {
     table.addRow(
         node.getNodeIdentifier(),
         node.getHttpUri().toString(),
         getNodeVersion(node),
         isCoordinator(node),
         state.toString().toLowerCase());
   }
 }