PageRenderTime 108ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/htest/hivetest/src/main/java/com/zdingke/hive/model/JobProcessLog.java

https://gitlab.com/zhengdingke/htest
Java | 59 lines | 45 code | 14 blank | 0 comment | 1 complexity | 09008f47de8c9577dbbc6ac4a7ca3e94 MD5 | raw file
  1. package com.zdingke.hive.model;
  2. import java.util.List;
  3. import com.alibaba.fastjson.JSON;
  4. public class JobProcessLog {
  5. private String queryId;
  6. private List<TaskInfo> taskInfos;
  7. private ProcessInfo processInfo;
  8. private static final String SPACE = " ";
  9. public JobProcessLog(String queryId, List<TaskInfo> taskInfos, ProcessInfo processInfo) {
  10. this.queryId = queryId;
  11. this.taskInfos = taskInfos;
  12. this.processInfo = processInfo;
  13. }
  14. public String getQueryId() {
  15. return queryId;
  16. }
  17. public void setQueryId(String queryId) {
  18. this.queryId = queryId;
  19. }
  20. public List<TaskInfo> getTaskInfos() {
  21. return taskInfos;
  22. }
  23. public void setTaskInfos(List<TaskInfo> taskInfos) {
  24. this.taskInfos = taskInfos;
  25. }
  26. public ProcessInfo getProcessInfo() {
  27. return processInfo;
  28. }
  29. public void setProcessInfo(ProcessInfo processInfo) {
  30. this.processInfo = processInfo;
  31. }
  32. @Override
  33. public String toString() {
  34. return JSON.toJSONString(this);
  35. }
  36. public String toRest() {
  37. String begin = this.getProcessInfo().getElapsedTime() + SPACE;
  38. StringBuilder sb = new StringBuilder();
  39. sb.append(begin);
  40. for (TaskInfo taskInfo : this.getTaskInfos()) {
  41. sb.append(taskInfo.toRest()).append(SPACE);
  42. }
  43. return sb.toString();
  44. }
  45. }