yiheng commented on a change in pull request #238: [LIVY-689] Deliver stage 
process message to the end user using thriftserver
URL: https://github.com/apache/incubator-livy/pull/238#discussion_r328897232
 
 

 ##########
 File path: rsc/src/main/java/org/apache/livy/rsc/RSCClient.java
 ##########
 @@ -413,6 +426,28 @@ private void handle(ChannelHandlerContext ctx, JobResult 
msg) {
       }
     }
 
+    private void handle(ChannelHandlerContext ctx, JobProcessMessage msg){
+      if (operationMessage != null){
+        StringBuilder bar = new StringBuilder();
+        String head = "[Stage " + msg.stageId + ":";
+        String tail = "(" + msg.completed + " + " + msg.actived + ") / " + 
msg.all + "]";
+        int processWid = TerminalWidth - head.length() - tail.length();
+        int barWid = processWid * msg.completed / msg.all;
+        bar.append(head);
+        for (int i = 0; i < processWid; i++) {
+          if (i < barWid){
+            bar.append("=");
+          }else if (i == barWid){
+            bar.append(">");
+          }else {
 
 Review comment:
   space

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to