hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject hbase git commit: HBASE-15752 ClassNotFoundException is encountered when custom WAL codec is not found in WALPlayer job
Date Thu, 05 May 2016 00:05:19 GMT
Repository: hbase
Updated Branches:
  refs/heads/0.98 176bd1cd3 -> 7564bf316


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

Conflicts:
	hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/WALPlayer.java


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

Branch: refs/heads/0.98
Commit: 7564bf3160cfa1591d042e55cb37e853c35b9ffa
Parents: 176bd1c
Author: tedyu <yuzhihong@gmail.com>
Authored: Tue May 3 07:01:08 2016 -0700
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Wed May 4 17:02:03 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/7564bf31/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 8566bb6..4927cb6 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
@@ -37,6 +37,7 @@ import org.apache.hadoop.hbase.client.Mutation;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 import org.apache.hadoop.hbase.regionserver.wal.HLogKey;
+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.mapreduce.Job;
@@ -258,6 +259,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/7564bf31/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 b0c0599..f744b63 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
@@ -78,7 +78,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