You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by GitBox <gi...@apache.org> on 2020/06/10 14:49:36 UTC
[GitHub] [zeppelin] zjffdu opened a new pull request #3794: [ZEPPELIN-4873]. Display rich duration info for insert into flink job
zjffdu opened a new pull request #3794:
URL: https://github.com/apache/zeppelin/pull/3794
### What is this PR for?
Trivial PR which display rich duration info instead of just x seconds. See screenshot below.
### What type of PR is it?
[ Improvement ]
### Todos
* [ ] - Task
### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-4873
### How should this be tested?
* CI pass
### Screenshots (if appropriate)
### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [zeppelin] zjffdu commented on a change in pull request #3794: [ZEPPELIN-4873]. Display rich duration info for insert into flink job
Posted by GitBox <gi...@apache.org>.
zjffdu commented on a change in pull request #3794:
URL: https://github.com/apache/zeppelin/pull/3794#discussion_r439301954
##########
File path: flink/interpreter/src/main/java/org/apache/zeppelin/flink/JobManager.java
##########
@@ -110,7 +111,7 @@ public int getJobProgress(String paragraphId) {
}
public void cancelJob(InterpreterContext context) throws InterpreterException {
- LOGGER.info("Canceling job associated of paragraph: "+ context.getParagraphId());
+ LOGGER.info("Canceling job associated of paragraph: " + context.getParagraphId());
Review comment:
fixed
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [zeppelin] asfgit closed pull request #3794: [ZEPPELIN-4873]. Display rich duration info for insert into flink job
Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #3794:
URL: https://github.com/apache/zeppelin/pull/3794
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [zeppelin] zjffdu commented on a change in pull request #3794: [ZEPPELIN-4873]. Display rich duration info for insert into flink job
Posted by GitBox <gi...@apache.org>.
zjffdu commented on a change in pull request #3794:
URL: https://github.com/apache/zeppelin/pull/3794#discussion_r439983588
##########
File path: flink/interpreter/src/main/java/org/apache/zeppelin/flink/JobManager.java
##########
@@ -218,15 +222,39 @@ public void run() {
}
}
- public void cancel () {
- this.running.set(false);
- synchronized (running) {
- running.notify();
- }
+ public void cancel() {
+ this.running.set(false);
+ synchronized (running) {
+ running.notify();
}
+ }
- public int getProgress () {
- return progress;
- }
+ public int getProgress() {
+ return progress;
}
}
+
+ static String toRichTimeDuration(long duration) {
+ long days = TimeUnit.SECONDS.toDays(duration);
Review comment:
It seems using Duration doesn't' save work compared current approach, I still have to get days and minus it from duration, and the same for hours, minutes, seconds. So I didn't change it.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [zeppelin] Reamer commented on a change in pull request #3794: [ZEPPELIN-4873]. Display rich duration info for insert into flink job
Posted by GitBox <gi...@apache.org>.
Reamer commented on a change in pull request #3794:
URL: https://github.com/apache/zeppelin/pull/3794#discussion_r440014723
##########
File path: flink/interpreter/src/main/java/org/apache/zeppelin/flink/JobManager.java
##########
@@ -218,15 +222,39 @@ public void run() {
}
}
- public void cancel () {
- this.running.set(false);
- synchronized (running) {
- running.notify();
- }
+ public void cancel() {
+ this.running.set(false);
+ synchronized (running) {
+ running.notify();
}
+ }
- public int getProgress () {
- return progress;
- }
+ public int getProgress() {
+ return progress;
}
}
+
+ static String toRichTimeDuration(long duration) {
+ long days = TimeUnit.SECONDS.toDays(duration);
Review comment:
Is `String.format("%d:%02d:%02d", s / 3600, (s % 3600) / 60, (s % 60));` to simple?
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [zeppelin] alexott commented on a change in pull request #3794: [ZEPPELIN-4873]. Display rich duration info for insert into flink job
Posted by GitBox <gi...@apache.org>.
alexott commented on a change in pull request #3794:
URL: https://github.com/apache/zeppelin/pull/3794#discussion_r439811531
##########
File path: flink/interpreter/src/main/java/org/apache/zeppelin/flink/JobManager.java
##########
@@ -218,15 +222,39 @@ public void run() {
}
}
- public void cancel () {
- this.running.set(false);
- synchronized (running) {
- running.notify();
- }
+ public void cancel() {
+ this.running.set(false);
+ synchronized (running) {
+ running.notify();
}
+ }
- public int getProgress () {
- return progress;
- }
+ public int getProgress() {
+ return progress;
}
}
+
+ static String toRichTimeDuration(long duration) {
Review comment:
would be useful to add a javadoc for it, saying what is parameter is - seconds, milliseconds, etc.?
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [zeppelin] zjffdu commented on a change in pull request #3794: [ZEPPELIN-4873]. Display rich duration info for insert into flink job
Posted by GitBox <gi...@apache.org>.
zjffdu commented on a change in pull request #3794:
URL: https://github.com/apache/zeppelin/pull/3794#discussion_r439984527
##########
File path: flink/interpreter/src/main/java/org/apache/zeppelin/flink/JobManager.java
##########
@@ -218,15 +222,39 @@ public void run() {
}
}
- public void cancel () {
- this.running.set(false);
- synchronized (running) {
- running.notify();
- }
+ public void cancel() {
+ this.running.set(false);
+ synchronized (running) {
+ running.notify();
}
+ }
- public int getProgress () {
- return progress;
- }
+ public int getProgress() {
+ return progress;
}
}
+
+ static String toRichTimeDuration(long duration) {
Review comment:
javadoc is added
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [zeppelin] alexott commented on a change in pull request #3794: [ZEPPELIN-4873]. Display rich duration info for insert into flink job
Posted by GitBox <gi...@apache.org>.
alexott commented on a change in pull request #3794:
URL: https://github.com/apache/zeppelin/pull/3794#discussion_r438861174
##########
File path: flink/interpreter/src/main/java/org/apache/zeppelin/flink/JobManager.java
##########
@@ -110,7 +111,7 @@ public int getJobProgress(String paragraphId) {
}
public void cancelJob(InterpreterContext context) throws InterpreterException {
- LOGGER.info("Canceling job associated of paragraph: "+ context.getParagraphId());
+ LOGGER.info("Canceling job associated of paragraph: " + context.getParagraphId());
Review comment:
It makes sense to use `{}` placeholder instead of concatenation - it won't lead to the call of the `context.getParagraphId()` if logger is not configured for INFO
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [zeppelin] alexott commented on a change in pull request #3794: [ZEPPELIN-4873]. Display rich duration info for insert into flink job
Posted by GitBox <gi...@apache.org>.
alexott commented on a change in pull request #3794:
URL: https://github.com/apache/zeppelin/pull/3794#discussion_r439811422
##########
File path: flink/interpreter/src/main/java/org/apache/zeppelin/flink/JobManager.java
##########
@@ -218,15 +222,39 @@ public void run() {
}
}
- public void cancel () {
- this.running.set(false);
- synchronized (running) {
- running.notify();
- }
+ public void cancel() {
+ this.running.set(false);
+ synchronized (running) {
+ running.notify();
}
+ }
- public int getProgress () {
- return progress;
- }
+ public int getProgress() {
+ return progress;
}
}
+
+ static String toRichTimeDuration(long duration) {
+ long days = TimeUnit.SECONDS.toDays(duration);
Review comment:
Maybe just use [Duration](https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html) data type, and then use corresponding functions, like, `toDays`, `toHours`, ...?
----------------------------------------------------------------
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:
users@infra.apache.org