You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by li...@apache.org on 2013/01/18 20:18:53 UTC
svn commit: r1435305 -
/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java
Author: liyin
Date: Fri Jan 18 19:18:53 2013
New Revision: 1435305
URL: http://svn.apache.org/viewvc?rev=1435305&view=rev
Log:
[HBASE-6967][89-fb] Bugfix for dynamic loading in Store
Author: adela
Summary:
Store should work with the default compaction hook when there
is no jar specified. The bug was introduced with:
https://phabricator.fb.com/D680766
Test Plan: run full unitest suite
Reviewers: liyintang
Reviewed By: liyintang
CC: hbase-eng@
Differential Revision: https://phabricator.fb.com/D682078
Task ID: 2027229
Modified:
hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java
Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java?rev=1435305&r1=1435304&r2=1435305&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java (original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java Fri Jan 18 19:18:53 2013
@@ -260,11 +260,14 @@ public class Store extends SchemaConfigu
String compactHookString = conf.get(HConstants.COMPACTION_HOOK);
if (compactHookString != null && !compactHookString.isEmpty()) {
String compactionHookJar = conf.get(HConstants.COMPACTION_HOOK_JAR);
- if (compactionHookJar == null || compactionHookJar.isEmpty()) {
- throw new IllegalArgumentException("The path of the custom jar for the compaction hook is not provided");
+ if (compactionHookJar != null && !compactionHookJar.isEmpty()) {
+ try {
+ DynamicClassLoader.load(compactionHookJar, compactHookString);
+ } catch (ClassNotFoundException e) {
+ throw new IllegalArgumentException(e);
+ }
}
try {
- DynamicClassLoader.load(compactionHookJar, compactHookString);
this.compactHook = (CompactionHook) Class.forName(compactHookString).newInstance();
} catch (InstantiationException e) {
throw new IllegalArgumentException(e);