[
https://issues.apache.org/jira/browse/FLINK-1543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14320620#comment-14320620
]
ASF GitHub Bot commented on FLINK-1543:
---------------------------------------
Github user hsaputra commented on a diff in the pull request:
https://github.com/apache/flink/pull/394#discussion_r24689680
--- Diff:
flink-clients/src/main/java/org/apache/flink/client/CliFrontend.java ---
@@ -517,67 +521,83 @@ protected int list(String[] args) {
return 1;
}
- Iterable<ExecutionGraph> jobs =
AkkaUtils.<RunningJobs>ask(jobManager,
- RequestRunningJobs$.MODULE$,
getAkkaTimeout()).asJavaIterable();
+ final Future<Object> response = Patterns.ask(jobManager,
+
JobManagerMessages.getRequestRunningJobs(), new Timeout(getAkkaTimeout()));
- ArrayList<ExecutionGraph> runningJobs = null;
- ArrayList<ExecutionGraph> scheduledJobs = null;
- if (running) {
- runningJobs = new ArrayList<ExecutionGraph>();
- }
- if (scheduled) {
- scheduledJobs = new ArrayList<ExecutionGraph>();
+ Object result = null;
+
+ try{
+ result = Await.result(response,
getAkkaTimeout());
+ } catch (Exception exception) {
+ throw new IOException("Could not retrieve
running jobs from job manager.",
+ exception);
}
-
- for (ExecutionGraph rj : jobs) {
-
- if (running &&
rj.getState().equals(JobStatus.RUNNING)) {
- runningJobs.add(rj);
+
+ if(!(result instanceof RunningJobs)){
--- End diff --
More like nit style change. Most code in Flink add extra space between 'if'
and the '(' and also a space before '{'.
> Proper exception handling in actors
> -----------------------------------
>
> Key: FLINK-1543
> URL: https://issues.apache.org/jira/browse/FLINK-1543
> Project: Flink
> Issue Type: Improvement
> Reporter: Till Rohrmann
>
> With Akka's actors it is important to not throw exceptions in the actor
> thread, if one does not want that the actor restarts or stops. Many of the
> Java components which are called from the actor's receive method throw
> exceptions which are not properly handled by the actor thread. Therefore, we
> have to catch these exceptions and handle them properly.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)