You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by fhueske <gi...@git.apache.org> on 2014/11/03 12:03:44 UTC

[GitHub] incubator-flink pull request: [FLINK-1139] Fix for HadoopOF with D...

GitHub user fhueske opened a pull request:

    https://github.com/apache/incubator-flink/pull/173

    [FLINK-1139] Fix for HadoopOF with DOP > 1 

    This PR allows to execute HadoopOFs with DOP > 1.
    It adds a hook to JM that is executed after the last OutputFormat finished. 
    Hadoop FileOutputFormats need this hook to clean-up temporary files.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/fhueske/incubator-flink hadoopOF

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-flink/pull/173.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #173
    
----
commit 8f7ba0869d678d1f2f5340fa52b337a0ce8b7d34
Author: Fabian Hueske <fh...@apache.org>
Date:   2014-10-06T14:27:25Z

    [FLINK-1139] Added FinalizeOnMaster hook to run code after the last task of an OutputFormat completed

commit 99a1c9ca204c1c9183a537e46c2fa01ad3632e4f
Author: Fabian Hueske <fh...@apache.org>
Date:   2014-10-06T14:28:00Z

    [FLINK-1139] Fixed HadoopOutputFormat to run with DOP > 1

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-flink pull request: [FLINK-1139] Fix for HadoopOF with D...

Posted by StephanEwen <gi...@git.apache.org>.
Github user StephanEwen commented on the pull request:

    https://github.com/apache/incubator-flink/pull/173#issuecomment-65961213
  
    This looks good now.
    
    +1 to merge


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-flink pull request: [FLINK-1139] Fix for HadoopOF with D...

Posted by fhueske <gi...@git.apache.org>.
Github user fhueske commented on the pull request:

    https://github.com/apache/incubator-flink/pull/173#issuecomment-64097626
  
    Replaced exception by missing `ExecutionGraph.fail()`
    Added test case with failing `finalizeOnMaster()` call.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-flink pull request: [FLINK-1139] Fix for HadoopOF with D...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-flink/pull/173


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-flink pull request: [FLINK-1139] Fix for HadoopOF with D...

Posted by StephanEwen <gi...@git.apache.org>.
Github user StephanEwen commented on the pull request:

    https://github.com/apache/incubator-flink/pull/173#issuecomment-63957071
  
    This adds a hook at a very sensitive point. There one blocking issue that can cause the job to hang.
    
    I would also not merge this without a test where the `finalizeGlobal()` method throws an exception. That way we can be sure that the system handles such failures properly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-flink pull request: [FLINK-1139] Fix for HadoopOF with D...

Posted by StephanEwen <gi...@git.apache.org>.
Github user StephanEwen commented on a diff in the pull request:

    https://github.com/apache/incubator-flink/pull/173#discussion_r20709227
  
    --- Diff: flink-core/src/main/java/org/apache/flink/api/common/operators/GenericDataSinkBase.java ---
    @@ -292,13 +294,23 @@ public void accept(Visitor<Operator<?>> visitor) {
     	
     	protected void executeOnCollections(List<IN> inputData) throws Exception {
     		OutputFormat<IN> format = this.formatWrapper.getUserCodeObject();
    +		
    +		if(format instanceof InitializeOnMaster) {
    --- End diff --
    
    Good catch!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-flink pull request: [FLINK-1139] Fix for HadoopOF with D...

Posted by StephanEwen <gi...@git.apache.org>.
Github user StephanEwen commented on a diff in the pull request:

    https://github.com/apache/incubator-flink/pull/173#discussion_r20709141
  
    --- Diff: flink-addons/flink-hadoop-compatibility/src/main/java/org/apache/flink/hadoopcompatibility/mapred/HadoopOutputFormat.java ---
    @@ -141,7 +142,20 @@ public void close() throws IOException {
     		if (this.fileOutputCommitter.needsTaskCommit(this.context)) {
     			this.fileOutputCommitter.commitTask(this.context);
     		}
    -		this.fileOutputCommitter.commitJob(this.jobContext);
    +	}
    +	
    +	@Override
    +	public void finalizeGlobal(int parallelism) throws IOException {
    +
    +		try {
    +			this.jobContext = HadoopUtils.instantiateJobContext(this.jobConf, new JobID());
    --- End diff --
    
    This method is the last thing that runs from an operator. I would make all variables stack variables, not fields of the class.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-flink pull request: [FLINK-1139] Fix for HadoopOF with D...

Posted by StephanEwen <gi...@git.apache.org>.
Github user StephanEwen commented on a diff in the pull request:

    https://github.com/apache/incubator-flink/pull/173#discussion_r20709391
  
    --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionJobVertex.java ---
    @@ -282,6 +282,14 @@ private void subtaskInFinalState(int subtask) {
     				numSubtasksInFinalState++;
     				
     				if (numSubtasksInFinalState == parallelism) {
    +					
    --- End diff --
    
    BLOCKER: This here introduces a critical bug. This function is not meant to abort with an exception. It should be
    ```
    try {
        getJobVertex().finalizeOnMaster(getGraph().getUserClassLoader());
    }
    catch (Throwable t) {
        getGraph().fail(t);
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-flink pull request: [FLINK-1139] Fix for HadoopOF with D...

Posted by fhueske <gi...@git.apache.org>.
Github user fhueske commented on the pull request:

    https://github.com/apache/incubator-flink/pull/173#issuecomment-64325764
  
    Only the last two commits are part of this PR. The other commit sneaked in because the Github mirror was not synced with the Apache git.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-flink pull request: [FLINK-1139] Fix for HadoopOF with D...

Posted by fhueske <gi...@git.apache.org>.
Github user fhueske commented on the pull request:

    https://github.com/apache/incubator-flink/pull/173#issuecomment-66038696
  
    Thanks! Will merge now


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-flink pull request: [FLINK-1139] Fix for HadoopOF with D...

Posted by rmetzger <gi...@git.apache.org>.
Github user rmetzger commented on the pull request:

    https://github.com/apache/incubator-flink/pull/173#issuecomment-62366100
  
    Looks good.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-flink pull request: [FLINK-1139] Fix for HadoopOF with D...

Posted by fhueske <gi...@git.apache.org>.
Github user fhueske commented on the pull request:

    https://github.com/apache/incubator-flink/pull/173#issuecomment-63943775
  
    Any further comments? Otherwise, I'll merge it in the next days.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---