diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java index eaab13f..9132c59 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java @@ -292,6 +292,13 @@ public final class HConstants { /** Any artifacts left from migration can be moved here */ public static final String MIGRATION_NAME = ".migration"; + /** + * The directory from which co-processor/custom filter jars can be loaded + * dynamically by the region servers. This value can be overridden by the + * hbase.dynamic.jars.dir config. + */ + public static final String LIB_DIR = "lib"; + /** Used to construct the name of the compaction directory during compaction */ public static final String HREGION_COMPACTIONDIR_NAME = "compaction.dir"; @@ -843,7 +850,7 @@ public final class HConstants { Collections.unmodifiableList(Arrays.asList(new String[] { HREGION_LOGDIR_NAME, HREGION_OLDLOGDIR_NAME, CORRUPT_DIR_NAME, SPLIT_LOGDIR_NAME, HBCK_SIDELINEDIR_NAME, HFILE_ARCHIVE_DIRECTORY, SNAPSHOT_DIR_NAME, HBASE_TEMP_DIRECTORY, - OLD_SNAPSHOT_DIR_NAME, BASE_NAMESPACE_DIR, MIGRATION_NAME})); + OLD_SNAPSHOT_DIR_NAME, BASE_NAMESPACE_DIR, MIGRATION_NAME, LIB_DIR})); /** Directories that are not HBase user table directories */ public static final List HBASE_NON_USER_TABLE_DIRS = diff --git a/hbase-common/src/main/resources/hbase-default.xml b/hbase-common/src/main/resources/hbase-default.xml index 3079fc8..385cb10 100644 --- a/hbase-common/src/main/resources/hbase-default.xml +++ b/hbase-common/src/main/resources/hbase-default.xml @@ -977,6 +977,14 @@ possible configurations would overwhelm and obscure the important. are NULL, CRC32, CRC32C. - - + + hbase.dynamic.jars.dir + ${hbase.rootdir}/lib + + The directory from which the custom filter/co-processor jars can be loaded + dynamically by the region server without the need to restart. However, + an already loaded filter/co-processor class would not be un-loaded. See + HBASE-1936 for more details. + + diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/migration/NamespaceUpgrade.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/migration/NamespaceUpgrade.java index f5f3dcd..75c1927 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/migration/NamespaceUpgrade.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/migration/NamespaceUpgrade.java @@ -85,6 +85,10 @@ public class NamespaceUpgrade implements Tool { private static final String DOT_CORRUPT = ".corrupt"; private static final String DOT_SPLITLOG = "splitlog"; private static final String DOT_ARCHIVE = ".archive"; + + // The old default directory of hbase.dynamic.jars.dir(0.94.12 release). + private static final String DOT_LIB_DIR = ".lib"; + private static final String OLD_ACL = "_acl_"; /** Directories that are not HBase table directories */ static final List NON_USER_TABLE_DIRS = Arrays.asList(new String[] { @@ -97,7 +101,8 @@ public class NamespaceUpgrade implements Tool { HConstants.SNAPSHOT_DIR_NAME, HConstants.HBASE_TEMP_DIRECTORY, TMP_DATA_DIR, - OLD_ACL}); + OLD_ACL, + DOT_LIB_DIR}); public NamespaceUpgrade() throws IOException { super(); @@ -165,7 +170,9 @@ public class NamespaceUpgrade implements Tool { new Path [] {new Path(rootDir, DOT_OLD_LOGS), new Path(rootDir, HConstants.HREGION_OLDLOGDIR_NAME)}, new Path [] {new Path(rootDir, TMP_DATA_DIR), - new Path(rootDir, HConstants.BASE_NAMESPACE_DIR)}}; + new Path(rootDir, HConstants.BASE_NAMESPACE_DIR)}, + new Path[] { new Path(rootDir, DOT_LIB_DIR), + new Path(rootDir, HConstants.LIB_DIR)}}; for (Path [] dir: dirs) { Path src = dir[0]; Path tgt = dir[1];