private boolean shouldPublishDataInTask() {
    boolean publishDataAtJobLevel = this.taskState.getPropAsBoolean(ConfigurationKeys.PUBLISH_DATA_AT_JOB_LEVEL,
        ConfigurationKeys.DEFAULT_PUBLISH_DATA_AT_JOB_LEVEL);
    if (publishDataAtJobLevel) {
      LOG.info(String
          .format("%s is true. Will publish data at the job level.", ConfigurationKeys.PUBLISH_DATA_AT_JOB_LEVEL));
      return false;
    }

    JobCommitPolicy jobCommitPolicy = JobCommitPolicy.getCommitPolicy(this.taskState);

    if (jobCommitPolicy == JobCommitPolicy.COMMIT_SUCCESSFUL_TASKS) {
      return this.taskState.getWorkingState() == WorkUnitState.WorkingState.SUCCESSFUL;
    }

    if (jobCommitPolicy == JobCommitPolicy.COMMIT_ON_PARTIAL_SUCCESS) {
      return true;
    }

    LOG.info("Will publish data at the job level with job commit policy: " + jobCommitPolicy);
    return false;
  }
private boolean shouldPublishDataInTask ( ) { boolean publishDataAtJobLevel = this . taskState . getPropAsBoolean ( ConfigurationKeys . PUBLISH_DATA_AT_JOB_LEVEL , ConfigurationKeys . DEFAULT_PUBLISH_DATA_AT_JOB_LEVEL ) ; if ( publishDataAtJobLevel ) { LOG . info ( String . format ( "%s is true. Will publish data at the job level." , ConfigurationKeys . PUBLISH_DATA_AT_JOB_LEVEL ) ) ; return false ; } JobCommitPolicy jobCommitPolicy = JobCommitPolicy . getCommitPolicy ( this . taskState ) ; if ( jobCommitPolicy == JobCommitPolicy . COMMIT_SUCCESSFUL_TASKS ) { return this . taskState . getWorkingState ( ) == WorkUnitState . WorkingState . SUCCESSFUL ; } if ( jobCommitPolicy == JobCommitPolicy . COMMIT_ON_PARTIAL_SUCCESS ) { return true ; } LOG . info ( "Will publish data at the job level with job commit policy: " + jobCommitPolicy ) ; return false ; }
Whether the task should directly publish its output data to the final publisher output directory.

<p>
The task should publish its output data directly if {@link ConfigurationKeys#PUBLISH_DATA_AT_JOB_LEVEL}
is set to false AND any of the following conditions is satisfied:

<ul>
<li>The {@link JobCommitPolicy#COMMIT_ON_PARTIAL_SUCCESS} policy is used.</li>
<li>The {@link JobCommitPolicy#COMMIT_SUCCESSFUL_TASKS} policy is used. and all {@link Fork}s of this
{@link Task} succeeded.</li>
</ul>
</p>