pan3793 commented on code in PR #4898:
URL: https://github.com/apache/kyuubi/pull/4898#discussion_r1209645581


##########
kyuubi-common/src/main/scala/org/apache/kyuubi/operation/log/OperationLog.scala:
##########
@@ -133,8 +133,10 @@ class OperationLog(path: Path) {
       var line: String = reader.readLine()
       while ((i < lastRows || maxRows <= 0) && line != null) {
         logs.add(line)
-        line = reader.readLine()
         i += 1
+        if (i < lastRows || maxRows <= 0) {

Review Comment:
   ```
       val logs = new JArrayList[String]
       var rows = 0
       try {
         var line: String = null
         do {
           line = reader.readLine()
           if (line != null) { logs.add(line); rows += 1 }
         } while ((rows < lastRows || maxRows <= 0) && line != null)
         (logs, rows)
       } catch {
         ...
       }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to