hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-15752 ClassNotFoundException is encountered when custom WAL codec is not found in WALPlayer job
Date Tue, 03 May 2016 08:57:33 GMT
Repository: hbase
Updated Branches:
  refs/heads/master c06a976a9 -> c77a15300


HBASE-15752 ClassNotFoundException is encountered when custom WAL codec is not found in WALPlayer
job


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

Branch: refs/heads/master
Commit: c77a153001a59954481929b629a4f78492b3da46
Parents: c06a976
Author: tedyu <yuzhihong@gmail.com>
Authored: Tue May 3 01:57:25 2016 -0700
Committer: tedyu <yuzhihong@gmail.com>
Committed: Tue May 3 01:57:25 2016 -0700

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hbase/mapreduce/WALPlayer.java     | 7 +++++++
 .../apache/hadoop/hbase/regionserver/wal/WALCellCodec.java    | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/c77a1530/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/WALPlayer.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/WALPlayer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/WALPlayer.java
index 9d9cee0..d36721e 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/WALPlayer.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/WALPlayer.java
@@ -44,6 +44,7 @@ import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.RegionLocator;
 import org.apache.hadoop.hbase.client.Table;
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
+import org.apache.hadoop.hbase.regionserver.wal.WALCellCodec;
 import org.apache.hadoop.hbase.regionserver.wal.WALEdit;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.wal.WALKey;
@@ -292,6 +293,12 @@ public class WALPlayer extends Configured implements Tool {
       // No reducers.
       job.setNumReduceTasks(0);
     }
+    String codecCls = WALCellCodec.getWALCellCodecClass(conf);
+    try {
+      TableMapReduceUtil.addDependencyJars(conf, Class.forName(codecCls));
+    } catch (Exception e) {
+      throw new IOException("Cannot determine wal codec class " + codecCls, e);
+    }
     return job;
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/c77a1530/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/WALCellCodec.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/WALCellCodec.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/WALCellCodec.java
index 6b89e89..87850aa 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/WALCellCodec.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/WALCellCodec.java
@@ -82,7 +82,7 @@ public class WALCellCodec implements Codec {
     this.compression = compression;
   }
 
-  static String getWALCellCodecClass(Configuration conf) {
+  public static String getWALCellCodecClass(Configuration conf) {
     return conf.get(WAL_CELL_CODEC_CLASS_KEY, WALCellCodec.class.getName());
   }
 


Mime
View raw message