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 14:01:21 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 0ee3ca2a7 -> a7b31f74d


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/a7b31f74
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/a7b31f74
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/a7b31f74

Branch: refs/heads/branch-1
Commit: a7b31f74dbc4f6a6d0c1f6134ecbf809ab691dd4
Parents: 0ee3ca2
Author: tedyu <yuzhihong@gmail.com>
Authored: Tue May 3 07:01:08 2016 -0700
Committer: tedyu <yuzhihong@gmail.com>
Committed: Tue May 3 07:01:08 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/a7b31f74/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 6b5286b..f16aecb 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
@@ -38,6 +38,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;
@@ -294,6 +295,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/a7b31f74/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 05d733d..5c62ef2 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
@@ -79,7 +79,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