[KYUUBI #691] Rename getQueryLog to fetchQueryLog

<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/NetEase/kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->
Rename `ExecuteStatement#getQueryLog` to `ExecuteStatement#fetchQueryLog`, to suppress IDEA complaination **Accessor-like named method has Unit result type** and make it more readable.

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.readthedocs.io/en/latest/tools/testing.html#running-tests) locally before make a pull request

Closes #691 from pan3793/readable.

Closes #691

96c0c26 [Cheng Pan] Rename getQueryLog to fetchQueryLog

Authored-by: Cheng Pan <379377944@qq.com>
Signed-off-by: Kent Yao <yao@apache.org>
This commit is contained in:
Cheng Pan 2021-06-13 22:39:27 +08:00 committed by Kent Yao
parent 16cfee2fca
commit 15f6438ab9
No known key found for this signature in database
GPG Key ID: F7051850A0AF904D

View File

@ -84,7 +84,7 @@ class ExecuteStatement(
var statusResp = client.GetOperationStatus(statusReq)
var isComplete = false
while (!isComplete) {
getQueryLog()
fetchQueryLog()
verifyTStatus(statusResp.getStatus)
val remoteState = statusResp.getOperationState
info(s"Query[$statementId] in ${remoteState.name()}")
@ -118,10 +118,10 @@ class ExecuteStatement(
}
}
// see if anymore log could be fetched
getQueryLog()
fetchQueryLog()
} catch onError()
private def getQueryLog(): Unit = {
private def fetchQueryLog(): Unit = {
getOperationLog.foreach { logger =>
try {
val resp = client.FetchResults(fetchLogReq)