sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject git commit: SQOOP-1664: Sqoop2: Remove the unused SqoopFileOutputFormat class
Date Tue, 04 Nov 2014 16:01:38 GMT
Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 bb52e54ee -> f43878bc7


SQOOP-1664: Sqoop2: Remove the unused SqoopFileOutputFormat class

(Veena Basavaraj via Jarek Jarcec Cecho)


Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/f43878bc
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/f43878bc
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/f43878bc

Branch: refs/heads/sqoop2
Commit: f43878bc75821d4e439ab7fd104bbcf3219b49b5
Parents: bb52e54
Author: Jarek Jarcec Cecho <jarcec@apache.org>
Authored: Tue Nov 4 08:01:13 2014 -0800
Committer: Jarek Jarcec Cecho <jarcec@apache.org>
Committed: Tue Nov 4 08:01:13 2014 -0800

----------------------------------------------------------------------
 .../sqoop/job/mr/SqoopFileOutputFormat.java     | 101 -------------------
 .../java/org/apache/sqoop/job/JobUtils.java     |   5 -
 2 files changed, 106 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/f43878bc/execution/mapreduce/src/main/java/org/apache/sqoop/job/mr/SqoopFileOutputFormat.java
----------------------------------------------------------------------
diff --git a/execution/mapreduce/src/main/java/org/apache/sqoop/job/mr/SqoopFileOutputFormat.java
b/execution/mapreduce/src/main/java/org/apache/sqoop/job/mr/SqoopFileOutputFormat.java
deleted file mode 100644
index f451044..0000000
--- a/execution/mapreduce/src/main/java/org/apache/sqoop/job/mr/SqoopFileOutputFormat.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.sqoop.job.mr;
-
-import java.io.IOException;
-
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.io.NullWritable;
-import org.apache.hadoop.io.compress.CompressionCodec;
-import org.apache.hadoop.io.compress.DefaultCodec;
-import org.apache.hadoop.mapreduce.JobContext;
-import org.apache.hadoop.mapreduce.JobStatus;
-import org.apache.hadoop.mapreduce.OutputCommitter;
-import org.apache.hadoop.mapreduce.RecordWriter;
-import org.apache.hadoop.mapreduce.TaskAttemptContext;
-import org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter;
-import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
-import org.apache.log4j.Logger;
-import org.apache.sqoop.common.Direction;
-import org.apache.sqoop.job.MRJobConstants;
-import org.apache.sqoop.job.io.SqoopWritable;
-
-/**
- * An output format for MapReduce job.
- */
-public class SqoopFileOutputFormat
-    extends FileOutputFormat<SqoopWritable, NullWritable> {
-
-  public static final Logger LOG =
-    Logger.getLogger(SqoopFileOutputFormat.class);
-
-  public static final Class<? extends CompressionCodec> DEFAULT_CODEC =
-      DefaultCodec.class;
-
-  @Override
-  public RecordWriter<SqoopWritable, NullWritable> getRecordWriter(
-      TaskAttemptContext context) throws IOException {
-    Configuration conf = context.getConfiguration();
-
-    Path filepath = getDefaultWorkFile(context, "");
-    String filename = filepath.toString();
-    conf.set(MRJobConstants.JOB_MR_OUTPUT_FILE, filename);
-
-    boolean isCompressed = getCompressOutput(context);
-    if (isCompressed) {
-      String codecname =
-          conf.get(MRJobConstants.HADOOP_COMPRESS_CODEC, DEFAULT_CODEC.getName());
-      conf.set(MRJobConstants.JOB_MR_OUTPUT_CODEC, codecname);
-    }
-
-    return  new SqoopOutputFormatLoadExecutor(context).getRecordWriter();
-  }
-
-  @Override
-  public synchronized OutputCommitter getOutputCommitter(TaskAttemptContext context) throws
IOException {
-    Path output = getOutputPath(context);
-    return new DestroyerFileOutputCommitter(output, context);
-  }
-
-  public class DestroyerFileOutputCommitter extends FileOutputCommitter {
-
-    public DestroyerFileOutputCommitter(Path outputPath, TaskAttemptContext context) throws
IOException {
-      super(outputPath, context);
-    }
-
-    @Override
-    public void commitJob(JobContext context) throws IOException {
-      super.commitJob(context);
-
-      Configuration config = context.getConfiguration();
-      SqoopDestroyerExecutor.executeDestroyer(true, config, Direction.FROM);
-      SqoopDestroyerExecutor.executeDestroyer(true, config, Direction.TO);
-    }
-
-    @Override
-    public void abortJob(JobContext context, JobStatus.State state) throws IOException {
-      super.abortJob(context, state);
-
-      Configuration config = context.getConfiguration();
-      SqoopDestroyerExecutor.executeDestroyer(false, config, Direction.FROM);
-      SqoopDestroyerExecutor.executeDestroyer(false, config, Direction.TO);
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/sqoop/blob/f43878bc/execution/mapreduce/src/test/java/org/apache/sqoop/job/JobUtils.java
----------------------------------------------------------------------
diff --git a/execution/mapreduce/src/test/java/org/apache/sqoop/job/JobUtils.java b/execution/mapreduce/src/test/java/org/apache/sqoop/job/JobUtils.java
index 0d14fc7..7ce8011 100644
--- a/execution/mapreduce/src/test/java/org/apache/sqoop/job/JobUtils.java
+++ b/execution/mapreduce/src/test/java/org/apache/sqoop/job/JobUtils.java
@@ -26,12 +26,7 @@ import org.apache.hadoop.mapreduce.Job;
 import org.apache.hadoop.mapreduce.Mapper;
 import org.apache.hadoop.mapreduce.OutputFormat;
 import org.apache.sqoop.job.io.SqoopWritable;
-import org.apache.sqoop.job.mr.SqoopFileOutputFormat;
-import org.apache.sqoop.job.mr.SqoopInputFormat;
-import org.apache.sqoop.job.mr.SqoopMapper;
-import org.apache.sqoop.job.mr.SqoopNullOutputFormat;
 import org.apache.sqoop.job.mr.SqoopSplit;
-import org.junit.Assert;
 
 public class JobUtils {
 


Mime
View raw message