From b7b14cc80a503a23fa4bce78b917ae8e2b4f97f4 Mon Sep 17 00:00:00 2001 From: Zhihong Yu Date: Fri, 4 Oct 2013 20:40:40 +0000 Subject: [PATCH] HBASE-9687 ClassNotFoundException is thrown when ExportSnapshot runs against hadoop cluster where HBase is not installed on the same node as resourcemanager git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1529288 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java | 3 ++- .../org/apache/hadoop/hbase/snapshot/TestExportSnapshot.java | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java index b96044ea865..41e18588a3c 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java @@ -45,7 +45,7 @@ import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.io.HFileLink; import org.apache.hadoop.hbase.io.HLogLink; import org.apache.hadoop.hbase.mapreduce.JobUtil; -import org.apache.hadoop.hbase.protobuf.ProtobufUtil; +import org.apache.hadoop.hbase.mapreduce.TableMapReduceUtil; import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription; import org.apache.hadoop.hbase.regionserver.StoreFileInfo; import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; @@ -529,6 +529,7 @@ public final class ExportSnapshot extends Configured implements Tool { Job job = new Job(conf); job.setJobName("ExportSnapshot"); job.setJarByClass(ExportSnapshot.class); + TableMapReduceUtil.addDependencyJars(job); job.setMapperClass(ExportMapper.class); job.setInputFormatClass(SequenceFileInputFormat.class); job.setOutputFormatClass(NullOutputFormat.class); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.java index b11a5d74621..32ae1cf5db5 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.java @@ -83,6 +83,7 @@ public class TestExportSnapshot { TEST_UTIL.getConfiguration().setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 6); TEST_UTIL.getConfiguration().setBoolean("hbase.master.enabletable.roundrobin", true); TEST_UTIL.startMiniCluster(3); + TEST_UTIL.startMiniMapReduceCluster(); } @AfterClass