[
https://issues.apache.org/jira/browse/TEZ-1351?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14081800#comment-14081800
]
Bikas Saha commented on TEZ-1351:
---------------------------------
[~daijy] clarified the situation offline. Currently, MROutput.close() is
finalizing the record writers etc. There are potential issues here. close() as
a Tez API is a symmetric opposite of initialize(). In that sense its expected
to do something like uninitialize(). These methods are part of Tez task
lifecycle of setup and destroy. These should not be merged with actual output
writing operations. E.g. commit() is called before close() but that may cause
outputs to remain un-materialized because the record writers have not been
terminated.
We could add a new method MROutput.finalize() that essentially does what
close() does today and commit() should be called after that.
Alternatively, we can keep close() as is but change Tez Output.close() to
Output.uninitialize().
> Need to invoke isCommitRequired inside MROutput.commit()
> --------------------------------------------------------
>
> Key: TEZ-1351
> URL: https://issues.apache.org/jira/browse/TEZ-1351
> Project: Apache Tez
> Issue Type: Bug
> Reporter: Daniel Dai
> Assignee: Siddharth Seth
> Fix For: 0.5.0
>
>
> In MROutput.commit, we need to check isCommitRequired before invoking
> commitTask.
> Currently we did this check inside Pig:
> {code}
> if (fileOutput.isCommitRequired()) {
> fileOutput.commit();
> }
> {code}
> However, in some loader, output file is generated only after
> fileOutput.close, which is part of fileOutput.commit. The isCommitRequired
> check is too early. A walk around is to invoke fileOutput.close before
> isCommitRequired:
> {code}
> fileOutput.close();
> if (fileOutput.isCommitRequired()) {
> fileOutput.commit();
> }
> {code}
> But we are told there is a plan to make MROutput.close private.
--
This message was sent by Atlassian JIRA
(v6.2#6252)