查询资源

Query REST服务是rest服务中最复杂的。它包含节点的详细信息,以及其它在openLooKeng上执行的查询的状态和历史的详细信息。

  • GET /v1/query

此服务返回有关当前在openLooKeng协调节点上执行的查询的信息和统计信息。

当你将浏览器指向一个openLooKeng坐标时,你会看到此服务输出的一个渲染的版本,将显示最近的在openLooKeng上执行的查询。

  • GET /v1/query/{queryId}

可调用此服务收集详细的有关查询的统计数据。如果您加载openLooKeng协调节点的Web界面,您会看到一个关于当前查询的清单。单击查询将显示指向此服务的链接。

响应样例

  1. {
  2. "queryId" : "20131229_211533_00017_dk5x2",
  3. "session" : {
  4. "user" : "tobrien",
  5. "source" : "openlk-cli",
  6. "catalog" : "jmx",
  7. "schema" : "jmx",
  8. "remoteUserAddress" : ""192.168.1.1"",
  9. "userAgent" : "StatementClient/0.55-SNAPSHOT",
  10. "startTime" : 1388351852026
  11. },
  12. "state" : "FINISHED",
  13. "self" : "http://127.0.0.1:8080/v1/query/20131229_211533_00017_dk5x2",
  14. "fieldNames" : [ "name" ],
  15. "query" : "select name from \"java.lang:type=runtime\"",
  16. "queryStats" : {
  17. "createTime" : "2013-12-29T16:17:32.027-05:00",
  18. "executionStartTime" : "2013-12-29T16:17:32.086-05:00",
  19. "lastHeartbeat" : "2013-12-29T16:17:44.561-05:00",
  20. "endTime" : "2013-12-29T16:17:32.152-05:00",
  21. "elapsedTime" : "125.00ms",
  22. "queuedTime" : "1.31ms",
  23. "analysisTime" : "4.84ms",
  24. "distributedPlanningTime" : "353.00us",
  25. "totalTasks" : 2,
  26. "runningTasks" : 0,
  27. "completedTasks" : 2,
  28. "totalDrivers" : 2,
  29. "queuedDrivers" : 0,
  30. "runningDrivers" : 0,
  31. "completedDrivers" : 2,
  32. "totalMemoryReservation" : "0B",
  33. "totalScheduledTime" : "5.84ms",
  34. "totalCpuTime" : "710.49us",
  35. "totalBlockedTime" : "27.38ms",
  36. "rawInputDataSize" : "27B",
  37. "rawInputPositions" : 1,
  38. "processedInputDataSize" : "32B",
  39. "processedInputPositions" : 1,
  40. "outputDataSize" : "32B",
  41. "outputPositions" : 1
  42. },
  43. "outputStage" : ...
  44. }