1/*2 * Licensed to the Apache Software Foundation (ASF) under one3 * or more contributor license agreements. See the NOTICE file4 * distributed with this work for additional information5 * regarding copyright ownership. The ASF licenses this file6 * to you under the Apache License, Version 2.0 (the7 * "License"); you may not use this file except in compliance8 * with the License. You may obtain a copy of the License at9 *10 * http://www.apache.org/licenses/LICENSE-2.011 *12 * Unless required by applicable law or agreed to in writing, software13 * distributed under the License is distributed on an "AS IS" BASIS,14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.15 * See the License for the specific language governing permissions and16 * limitations under the License.17 */18package org.apache.giraph.utils;
1920import java.io.IOException;
2122import org.apache.hadoop.mapreduce.JobContext;
23import org.apache.hadoop.mapreduce.OutputCommitter;
24import org.apache.hadoop.mapreduce.TaskAttemptContext;
2526/**27 * Output committer which has abstract commit method28 */29publicabstractclassDefaultOutputCommitterextends OutputCommitter {
30/**31 * For cleaning up the job's output after job completion. Note that this32 * is invoked for jobs with final run state as33 * {@link org.apache.hadoop.mapreduce.JobStatus.State#SUCCEEDED}34 *35 * @param jobContext Context of the job whose output is being written.36 */37publicabstractvoid commit(JobContext jobContext) throws IOException;
3839 @Override
40publicfinalvoid setupJob(JobContext jobContext) throws IOException {
41 }
4243 @Override
44publicfinalvoid setupTask(TaskAttemptContext taskContext)
45throws IOException {
46 }
4748 @Override
49publicfinalvoid commitJob(JobContext jobContext)
50throws IOException {
51super.commitJob(jobContext);
52 commit(jobContext);
53 }
5455 @Override
56publicfinalboolean needsTaskCommit(TaskAttemptContext taskContext)
57throws IOException {
58// Digraph does not require a task commit and there is a bug in Corona59// which triggers t568870660// Avoiding the task commit should work around this.61return false;
62 }
6364 @Override
65publicfinalvoid commitTask(TaskAttemptContext context) throws IOException {
66 }
6768 @Override
69publicfinalvoid abortTask(TaskAttemptContext taskContext)
70throws IOException {
71 }
72 }