diff --git a/CHANGES.txt b/CHANGES.txt index f939edd3245..1a96b8a1690 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -26,6 +26,7 @@ Trunk (unreleased changes) always kill the region server for the META region. This makes the test more deterministic and getting META reassigned was problematic. + HADOOP-2155 Method expecting HBaseConfiguration throws NPE when given Configuration IMPROVEMENTS HADOOP-2401 Add convenience put method that takes writable diff --git a/src/java/org/apache/hadoop/hbase/HBaseAdmin.java b/src/java/org/apache/hadoop/hbase/HBaseAdmin.java index a2161a9d6b4..6496b7fb519 100644 --- a/src/java/org/apache/hadoop/hbase/HBaseAdmin.java +++ b/src/java/org/apache/hadoop/hbase/HBaseAdmin.java @@ -20,22 +20,19 @@ package org.apache.hadoop.hbase; import java.io.IOException; -import java.util.NoSuchElementException; import java.util.Map; +import java.util.NoSuchElementException; import java.util.SortedMap; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; - -import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.io.ImmutableBytesWritable; +import org.apache.hadoop.hbase.util.Writables; import org.apache.hadoop.io.MapWritable; import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Writable; import org.apache.hadoop.ipc.RemoteException; -import org.apache.hadoop.hbase.io.ImmutableBytesWritable; -import org.apache.hadoop.hbase.util.Writables; - /** * Provides administrative functions for HBase */ @@ -53,7 +50,7 @@ public class HBaseAdmin implements HConstants { * @param conf Configuration object * @throws MasterNotRunningException */ - public HBaseAdmin(Configuration conf) throws MasterNotRunningException { + public HBaseAdmin(HBaseConfiguration conf) throws MasterNotRunningException { this.connection = HConnectionManager.getConnection(conf); this.pause = conf.getLong("hbase.client.pause", 30 * 1000); this.numRetries = conf.getInt("hbase.client.retries.number", 5); diff --git a/src/java/org/apache/hadoop/hbase/HBaseConfiguration.java b/src/java/org/apache/hadoop/hbase/HBaseConfiguration.java index 980c5ffb0da..d3323db461b 100644 --- a/src/java/org/apache/hadoop/hbase/HBaseConfiguration.java +++ b/src/java/org/apache/hadoop/hbase/HBaseConfiguration.java @@ -28,8 +28,7 @@ public class HBaseConfiguration extends Configuration { /** constructor */ public HBaseConfiguration() { super(); - addResource("hbase-default.xml"); - addResource("hbase-site.xml"); + addHbaseResources(); } /** @@ -38,5 +37,13 @@ public class HBaseConfiguration extends Configuration { */ public HBaseConfiguration(final Configuration c) { super(c); + if (!(c instanceof HBaseConfiguration)) { + addHbaseResources(); + } + } + + private void addHbaseResources() { + addResource("hbase-default.xml"); + addResource("hbase-site.xml"); } } diff --git a/src/java/org/apache/hadoop/hbase/HConnectionManager.java b/src/java/org/apache/hadoop/hbase/HConnectionManager.java index b6f8ca57788..0300ff7dba6 100644 --- a/src/java/org/apache/hadoop/hbase/HConnectionManager.java +++ b/src/java/org/apache/hadoop/hbase/HConnectionManager.java @@ -30,15 +30,13 @@ import java.util.TreeMap; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.ipc.RPC; -import org.apache.hadoop.ipc.RemoteException; +import org.apache.hadoop.hbase.io.ImmutableBytesWritable; +import org.apache.hadoop.hbase.util.Writables; import org.apache.hadoop.io.MapWritable; import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Writable; - -import org.apache.hadoop.hbase.io.ImmutableBytesWritable; -import org.apache.hadoop.hbase.util.Writables; +import org.apache.hadoop.ipc.RPC; +import org.apache.hadoop.ipc.RemoteException; /** * A non-instantiable class that manages connections to multiple tables in @@ -65,7 +63,7 @@ public class HConnectionManager implements HConstants { * @param conf * @return HConnection object for the instance specified by the configuration */ - public static HConnection getConnection(Configuration conf) { + public static HConnection getConnection(HBaseConfiguration conf) { HConnection connection; synchronized (HBASE_INSTANCES) { String instanceName = conf.get(HBASE_DIR, DEFAULT_HBASE_DIR); @@ -84,7 +82,7 @@ public class HConnectionManager implements HConstants { * Delete connection information for the instance specified by the configuration * @param conf */ - public static void deleteConnection(Configuration conf) { + public static void deleteConnection(HBaseConfiguration conf) { synchronized (HBASE_INSTANCES) { HBASE_INSTANCES.remove(conf.get(HBASE_DIR, DEFAULT_HBASE_DIR)); } @@ -106,7 +104,7 @@ public class HConnectionManager implements HConstants { private final Integer rootRegionLock = new Integer(0); private final Integer metaRegionLock = new Integer(0); - private volatile Configuration conf; + private volatile HBaseConfiguration conf; // Map tableName -> (Map startRow -> (HRegionInfo, HServerAddress) private Map> tablesToServers; @@ -125,7 +123,7 @@ public class HConnectionManager implements HConstants { * @param conf Configuration object */ @SuppressWarnings("unchecked") - public TableServers(Configuration conf) { + public TableServers(HBaseConfiguration conf) { this.conf = LocalHBaseCluster.doLocal(new HBaseConfiguration(conf)); String serverClassName = diff --git a/src/java/org/apache/hadoop/hbase/HMaster.java b/src/java/org/apache/hadoop/hbase/HMaster.java index e74c184e70b..6f45ce9ee9f 100644 --- a/src/java/org/apache/hadoop/hbase/HMaster.java +++ b/src/java/org/apache/hadoop/hbase/HMaster.java @@ -94,7 +94,7 @@ HMasterRegionInterface { volatile AtomicBoolean closed = new AtomicBoolean(true); volatile boolean fsOk; Path dir; - Configuration conf; + HBaseConfiguration conf; FileSystem fs; Random rand; int threadWakeFrequency; @@ -868,7 +868,7 @@ HMasterRegionInterface { * @param conf - Configuration object * @throws IOException */ - public HMaster(Configuration conf) throws IOException { + public HMaster(HBaseConfiguration conf) throws IOException { this(new Path(conf.get(HBASE_DIR, DEFAULT_HBASE_DIR)), new HServerAddress(conf.get(MASTER_ADDRESS, DEFAULT_MASTER_ADDRESS)), conf); @@ -882,7 +882,7 @@ HMasterRegionInterface { * * @throws IOException */ - public HMaster(Path dir, HServerAddress address, Configuration conf) + public HMaster(Path dir, HServerAddress address, HBaseConfiguration conf) throws IOException { this.fsOk = true; this.dir = dir; @@ -3044,7 +3044,7 @@ HMasterRegionInterface { printUsageAndExit(); } - Configuration conf = new HBaseConfiguration(); + HBaseConfiguration conf = new HBaseConfiguration(); // Process command-line args. TODO: Better cmd-line processing // (but hopefully something not as painful as cli options). diff --git a/src/java/org/apache/hadoop/hbase/HMerge.java b/src/java/org/apache/hadoop/hbase/HMerge.java index 1d380b32526..ab83fbb9285 100644 --- a/src/java/org/apache/hadoop/hbase/HMerge.java +++ b/src/java/org/apache/hadoop/hbase/HMerge.java @@ -28,14 +28,12 @@ import java.util.TreeSet; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; +import org.apache.hadoop.hbase.util.Writables; import org.apache.hadoop.io.DataInputBuffer; import org.apache.hadoop.io.Text; -import org.apache.hadoop.hbase.util.Writables; - /** * A non-instantiable class that has a static method capable of compacting * a table by merging adjacent regions that have grown too small. @@ -61,7 +59,7 @@ class HMerge implements HConstants { * @param tableName - Table to be compacted * @throws IOException */ - public static void merge(Configuration conf, FileSystem fs, Text tableName) + public static void merge(HBaseConfiguration conf, FileSystem fs, Text tableName) throws IOException { HConnection connection = HConnectionManager.getConnection(conf); boolean masterIsRunning = connection.isMasterRunning(); @@ -82,7 +80,7 @@ class HMerge implements HConstants { } private static abstract class Merger { - protected Configuration conf; + protected HBaseConfiguration conf; protected FileSystem fs; protected Text tableName; protected Path dir; @@ -93,7 +91,7 @@ class HMerge implements HConstants { protected HStoreKey key; protected HRegionInfo info; - protected Merger(Configuration conf, FileSystem fs, Text tableName) + protected Merger(HBaseConfiguration conf, FileSystem fs, Text tableName) throws IOException { this.conf = conf; @@ -200,7 +198,7 @@ class HMerge implements HConstants { private HScannerInterface metaScanner; private HRegionInfo latestRegion; - OnlineMerger(Configuration conf, FileSystem fs, Text tableName) + OnlineMerger(HBaseConfiguration conf, FileSystem fs, Text tableName) throws IOException { super(conf, fs, tableName); @@ -315,7 +313,7 @@ class HMerge implements HConstants { private TreeSet metaRegions; private TreeMap results; - OfflineMerger(Configuration conf, FileSystem fs, Text tableName) + OfflineMerger(HBaseConfiguration conf, FileSystem fs, Text tableName) throws IOException { super(conf, fs, tableName); diff --git a/src/java/org/apache/hadoop/hbase/HRegion.java b/src/java/org/apache/hadoop/hbase/HRegion.java index 0b00317af54..fb935529857 100644 --- a/src/java/org/apache/hadoop/hbase/HRegion.java +++ b/src/java/org/apache/hadoop/hbase/HRegion.java @@ -111,7 +111,7 @@ public class HRegion implements HConstants { throw new IOException("Cannot merge non-adjacent regions"); } - Configuration conf = a.getConf(); + HBaseConfiguration conf = a.getConf(); HTableDescriptor tabledesc = a.getTableDesc(); HLog log = a.getLog(); Path rootDir = a.getRootDir(); @@ -194,7 +194,7 @@ public class HRegion implements HConstants { Path rootDir; HLog log; FileSystem fs; - Configuration conf; + HBaseConfiguration conf; HRegionInfo regionInfo; Path regiondir; @@ -242,7 +242,7 @@ public class HRegion implements HConstants { * * @throws IOException */ - public HRegion(Path rootDir, HLog log, FileSystem fs, Configuration conf, + public HRegion(Path rootDir, HLog log, FileSystem fs, HBaseConfiguration conf, HRegionInfo regionInfo, Path initialFiles) throws IOException { this.rootDir = rootDir; @@ -559,7 +559,7 @@ public class HRegion implements HConstants { } /** @return Configuration object */ - public Configuration getConf() { + public HBaseConfiguration getConf() { return this.conf; } @@ -1834,7 +1834,8 @@ public class HRegion implements HConstants { * @throws IOException */ static HRegion createHRegion(final HRegionInfo info, final Path rootDir, - final Configuration conf, final Path initialFiles) throws IOException { + final HBaseConfiguration conf, final Path initialFiles) + throws IOException { Path regionDir = HRegion.getRegionDir(rootDir, HRegionInfo.encodeRegionName(info.getRegionName())); FileSystem fs = FileSystem.get(conf); diff --git a/src/java/org/apache/hadoop/hbase/HRegionServer.java b/src/java/org/apache/hadoop/hbase/HRegionServer.java index 6d178063ebc..a1825902f7e 100644 --- a/src/java/org/apache/hadoop/hbase/HRegionServer.java +++ b/src/java/org/apache/hadoop/hbase/HRegionServer.java @@ -85,7 +85,7 @@ public class HRegionServer implements HConstants, HRegionInterface, Runnable { protected volatile boolean fsOk; protected final HServerInfo serverInfo; - protected final Configuration conf; + protected final HBaseConfiguration conf; private final Random rand = new Random(); // region name -> HRegion @@ -373,7 +373,7 @@ public class HRegionServer implements HConstants, HRegionInterface, Runnable { * @param conf * @throws IOException */ - public HRegionServer(Configuration conf) throws IOException { + public HRegionServer(HBaseConfiguration conf) throws IOException { this(new HServerAddress(conf.get(REGIONSERVER_ADDRESS, DEFAULT_REGIONSERVER_ADDRESS)), conf); } @@ -384,7 +384,7 @@ public class HRegionServer implements HConstants, HRegionInterface, Runnable { * @param conf * @throws IOException */ - public HRegionServer(HServerAddress address, Configuration conf) + public HRegionServer(HServerAddress address, HBaseConfiguration conf) throws IOException { this.abortRequested = false; this.fsOk = true; diff --git a/src/java/org/apache/hadoop/hbase/HStore.java b/src/java/org/apache/hadoop/hbase/HStore.java index 31ae274d145..c152b7b8420 100644 --- a/src/java/org/apache/hadoop/hbase/HStore.java +++ b/src/java/org/apache/hadoop/hbase/HStore.java @@ -37,7 +37,6 @@ import java.util.Map.Entry; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FSDataInputStream; import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileSystem; @@ -77,7 +76,7 @@ class HStore implements HConstants { Text familyName; SequenceFile.CompressionType compression; FileSystem fs; - Configuration conf; + HBaseConfiguration conf; Path mapdir; Path loginfodir; Path filterDir; @@ -141,7 +140,7 @@ class HStore implements HConstants { */ HStore(Path dir, Text regionName, String encodedName, HColumnDescriptor family, FileSystem fs, Path reconstructionLog, - Configuration conf) + HBaseConfiguration conf) throws IOException { this.dir = dir; this.compactionDir = new Path(dir, "compaction.dir"); diff --git a/src/java/org/apache/hadoop/hbase/HStoreFile.java b/src/java/org/apache/hadoop/hbase/HStoreFile.java index 3c0b5d6e63b..175312be228 100644 --- a/src/java/org/apache/hadoop/hbase/HStoreFile.java +++ b/src/java/org/apache/hadoop/hbase/HStoreFile.java @@ -122,11 +122,11 @@ public class HStoreFile implements HConstants, WritableComparable { private String encodedRegionName; private Text colFamily; private long fileId; - private final Configuration conf; + private final HBaseConfiguration conf; private Reference reference; /** Shutdown constructor used by Writable */ - HStoreFile(Configuration conf) { + HStoreFile(HBaseConfiguration conf) { this(conf, new Path(Path.CUR_DIR), "", new Text(), 0); } @@ -138,7 +138,7 @@ public class HStoreFile implements HConstants, WritableComparable { * @param colFamily name of the column family * @param fileId file identifier */ - HStoreFile(final Configuration conf, final Path dir, + HStoreFile(final HBaseConfiguration conf, final Path dir, final String encodedRegionName, final Text colFamily, final long fileId) { this(conf, dir, encodedRegionName, colFamily, fileId, null); } @@ -152,7 +152,7 @@ public class HStoreFile implements HConstants, WritableComparable { * @param fileId file identifier * @param ref Reference to another HStoreFile. */ - HStoreFile(Configuration conf, Path dir, String encodedRegionName, + HStoreFile(HBaseConfiguration conf, Path dir, String encodedRegionName, Text colFamily, long fileId, final Reference ref) { this.conf = conf; this.dir = dir; @@ -348,7 +348,7 @@ public class HStoreFile implements HConstants, WritableComparable { * Checks the filesystem to determine if the file already exists. If so, it * will keep generating names until it generates a name that does not exist. */ - static HStoreFile obtainNewHStoreFile(Configuration conf, Path dir, + static HStoreFile obtainNewHStoreFile(HBaseConfiguration conf, Path dir, String encodedRegionName, Text colFamily, FileSystem fs) throws IOException { @@ -378,7 +378,7 @@ public class HStoreFile implements HConstants, WritableComparable { * @return List of store file instances loaded from passed dir. * @throws IOException */ - static List loadHStoreFiles(Configuration conf, Path dir, + static List loadHStoreFiles(HBaseConfiguration conf, Path dir, String encodedRegionName, Text colFamily, FileSystem fs) throws IOException { // Look first at info files. If a reference, these contain info we need diff --git a/src/java/org/apache/hadoop/hbase/HTable.java b/src/java/org/apache/hadoop/hbase/HTable.java index 4a71bf91ebe..697b70e33d2 100644 --- a/src/java/org/apache/hadoop/hbase/HTable.java +++ b/src/java/org/apache/hadoop/hbase/HTable.java @@ -33,7 +33,6 @@ import java.util.concurrent.atomic.AtomicReferenceArray; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.filter.RowFilterInterface; import org.apache.hadoop.hbase.filter.StopRowFilter; import org.apache.hadoop.hbase.filter.WhileMatchRowFilter; @@ -76,7 +75,7 @@ public class HTable implements HConstants { * @param tableName name of the table * @throws IOException */ - public HTable(Configuration conf, Text tableName) throws IOException { + public HTable(HBaseConfiguration conf, Text tableName) throws IOException { closed = true; this.connection = HConnectionManager.getConnection(conf); this.tableName = tableName; diff --git a/src/java/org/apache/hadoop/hbase/LocalHBaseCluster.java b/src/java/org/apache/hadoop/hbase/LocalHBaseCluster.java index 0ed62402d6b..8a2c50f68c5 100644 --- a/src/java/org/apache/hadoop/hbase/LocalHBaseCluster.java +++ b/src/java/org/apache/hadoop/hbase/LocalHBaseCluster.java @@ -55,14 +55,14 @@ public class LocalHBaseCluster implements HConstants { private final static int DEFAULT_NO = 1; public static final String LOCAL = "local"; public static final String LOCAL_COLON = LOCAL + ":"; - private final Configuration conf; + private final HBaseConfiguration conf; /** * Constructor. * @param conf * @throws IOException */ - public LocalHBaseCluster(final Configuration conf) + public LocalHBaseCluster(final HBaseConfiguration conf) throws IOException { this(conf, DEFAULT_NO); } @@ -74,7 +74,8 @@ public class LocalHBaseCluster implements HConstants { * @param noRegionServers Count of regionservers to start. * @throws IOException */ - public LocalHBaseCluster(final Configuration conf, final int noRegionServers) + public LocalHBaseCluster(final HBaseConfiguration conf, + final int noRegionServers) throws IOException { super(); this.conf = conf; @@ -234,7 +235,7 @@ public class LocalHBaseCluster implements HConstants { * @return The passed c configuration modified if hbase.master * value was 'local' otherwise, unaltered. */ - static Configuration doLocal(final Configuration c) { + static HBaseConfiguration doLocal(final HBaseConfiguration c) { if (!isLocal(c)) { return c; } @@ -263,7 +264,7 @@ public class LocalHBaseCluster implements HConstants { * @throws IOException */ public static void main(String[] args) throws IOException { - Configuration conf = new HBaseConfiguration(); + HBaseConfiguration conf = new HBaseConfiguration(); LocalHBaseCluster cluster = new LocalHBaseCluster(conf); cluster.startup(); HBaseAdmin admin = new HBaseAdmin(conf); diff --git a/src/java/org/apache/hadoop/hbase/Shell.java b/src/java/org/apache/hadoop/hbase/Shell.java index 1787ce58cde..ed47f9543f1 100644 --- a/src/java/org/apache/hadoop/hbase/Shell.java +++ b/src/java/org/apache/hadoop/hbase/Shell.java @@ -74,7 +74,7 @@ public class Shell { */ public static void main(@SuppressWarnings("unused") String args[]) throws IOException { - Configuration conf = new HBaseConfiguration(); + HBaseConfiguration conf = new HBaseConfiguration(); ConsoleReader reader = new ConsoleReader(); reader.setBellEnabled(conf.getBoolean("hbaseshell.jline.bell.enabled", DEFAULT_BELL_ENABLED)); diff --git a/src/java/org/apache/hadoop/hbase/mapred/TableInputFormat.java b/src/java/org/apache/hadoop/hbase/mapred/TableInputFormat.java index 12e56d0f89e..24d016b9a8f 100644 --- a/src/java/org/apache/hadoop/hbase/mapred/TableInputFormat.java +++ b/src/java/org/apache/hadoop/hbase/mapred/TableInputFormat.java @@ -36,6 +36,7 @@ import org.apache.hadoop.mapred.JobConfigurable; import org.apache.hadoop.mapred.RecordReader; import org.apache.hadoop.mapred.Reporter; +import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HTable; import org.apache.hadoop.hbase.HScannerInterface; import org.apache.hadoop.hbase.HStoreKey; @@ -195,7 +196,7 @@ implements InputFormat, JobConfigurable { m_cols[i] = new Text(colNames[i]); } try { - m_table = new HTable(job, m_tableName); + m_table = new HTable(new HBaseConfiguration(job), m_tableName); } catch (Exception e) { LOG.error(e); } diff --git a/src/java/org/apache/hadoop/hbase/mapred/TableOutputFormat.java b/src/java/org/apache/hadoop/hbase/mapred/TableOutputFormat.java index 88710029e30..a53f2423881 100644 --- a/src/java/org/apache/hadoop/hbase/mapred/TableOutputFormat.java +++ b/src/java/org/apache/hadoop/hbase/mapred/TableOutputFormat.java @@ -34,6 +34,7 @@ import org.apache.hadoop.mapred.RecordWriter; import org.apache.hadoop.mapred.Reporter; import org.apache.hadoop.util.Progressable; +import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HTable; import org.apache.hadoop.hbase.io.ImmutableBytesWritable; @@ -51,7 +52,9 @@ public class TableOutputFormat static final Logger LOG = Logger.getLogger(TableOutputFormat.class.getName()); /** constructor */ - public TableOutputFormat() {} + public TableOutputFormat() { + super(); + } /** * Convert Reduce output (key, value) to (HStoreKey, KeyedDataArrayWritable) @@ -71,7 +74,9 @@ public class TableOutputFormat } /** {@inheritDoc} */ - public void close(@SuppressWarnings("unused") Reporter reporter) {} + public void close(@SuppressWarnings("unused") Reporter reporter) { + // Nothing to do. + } /** {@inheritDoc} */ public void write(Text key, MapWritable value) throws IOException { @@ -99,7 +104,7 @@ public class TableOutputFormat Text tableName = new Text(job.get(OUTPUT_TABLE)); HTable table = null; try { - table = new HTable(job, tableName); + table = new HTable(new HBaseConfiguration(job), tableName); } catch(IOException e) { LOG.error(e); throw e; diff --git a/src/java/org/apache/hadoop/hbase/shell/AlterCommand.java b/src/java/org/apache/hadoop/hbase/shell/AlterCommand.java index bb74fcfde83..dcfd4385c8c 100644 --- a/src/java/org/apache/hadoop/hbase/shell/AlterCommand.java +++ b/src/java/org/apache/hadoop/hbase/shell/AlterCommand.java @@ -25,8 +25,8 @@ import java.util.HashMap; import java.util.Map; import java.util.Set; -import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseAdmin; +import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.io.Text; @@ -45,7 +45,7 @@ public class AlterCommand extends SchemaModificationCommand { super(o); } - public ReturnMsg execute(Configuration conf) { + public ReturnMsg execute(HBaseConfiguration conf) { try { HBaseAdmin admin = new HBaseAdmin(conf); Set columns = null; diff --git a/src/java/org/apache/hadoop/hbase/shell/ClearCommand.java b/src/java/org/apache/hadoop/hbase/shell/ClearCommand.java index 1fc693e4e00..0d580fe055a 100644 --- a/src/java/org/apache/hadoop/hbase/shell/ClearCommand.java +++ b/src/java/org/apache/hadoop/hbase/shell/ClearCommand.java @@ -22,7 +22,7 @@ package org.apache.hadoop.hbase.shell; import java.io.IOException; import java.io.Writer; -import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.HBaseConfiguration; /** * Clears the console screen. @@ -32,7 +32,7 @@ public class ClearCommand extends BasicCommand { super(o); } - public ReturnMsg execute(@SuppressWarnings("unused") Configuration conf) { + public ReturnMsg execute(@SuppressWarnings("unused") HBaseConfiguration conf) { clear(); return null; } diff --git a/src/java/org/apache/hadoop/hbase/shell/Command.java b/src/java/org/apache/hadoop/hbase/shell/Command.java index d9e8bf6b142..e59631c97ac 100644 --- a/src/java/org/apache/hadoop/hbase/shell/Command.java +++ b/src/java/org/apache/hadoop/hbase/shell/Command.java @@ -19,7 +19,7 @@ */ package org.apache.hadoop.hbase.shell; -import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.HBaseConfiguration; public interface Command { /** family indicator */ @@ -31,7 +31,7 @@ public interface Command { * @param conf Configuration * @return Result of command execution */ - public ReturnMsg execute(final Configuration conf); + public ReturnMsg execute(final HBaseConfiguration conf); /** * @return Type of this command whether DDL, SELECT, INSERT, UPDATE, DELETE, diff --git a/src/java/org/apache/hadoop/hbase/shell/CreateCommand.java b/src/java/org/apache/hadoop/hbase/shell/CreateCommand.java index 683e769e057..ef692732372 100644 --- a/src/java/org/apache/hadoop/hbase/shell/CreateCommand.java +++ b/src/java/org/apache/hadoop/hbase/shell/CreateCommand.java @@ -24,8 +24,8 @@ import java.util.HashMap; import java.util.Map; import java.util.Set; -import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseAdmin; +import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HTableDescriptor; @@ -41,7 +41,7 @@ public class CreateCommand extends SchemaModificationCommand { super(o); } - public ReturnMsg execute(Configuration conf) { + public ReturnMsg execute(HBaseConfiguration conf) { try { HBaseAdmin admin = new HBaseAdmin(conf); HTableDescriptor tableDesc = new HTableDescriptor(tableName); diff --git a/src/java/org/apache/hadoop/hbase/shell/DeleteCommand.java b/src/java/org/apache/hadoop/hbase/shell/DeleteCommand.java index 73544bfa9d5..bcde0a85c7f 100644 --- a/src/java/org/apache/hadoop/hbase/shell/DeleteCommand.java +++ b/src/java/org/apache/hadoop/hbase/shell/DeleteCommand.java @@ -24,8 +24,8 @@ import java.io.Writer; import java.util.ArrayList; import java.util.List; -import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseAdmin; +import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HTable; import org.apache.hadoop.io.Text; @@ -41,7 +41,7 @@ public class DeleteCommand extends BasicCommand { private String rowKey; private List columnList; - public ReturnMsg execute(Configuration conf) { + public ReturnMsg execute(HBaseConfiguration conf) { if (columnList == null) { throw new IllegalArgumentException("Column list is null"); } diff --git a/src/java/org/apache/hadoop/hbase/shell/DescCommand.java b/src/java/org/apache/hadoop/hbase/shell/DescCommand.java index 56e2e053428..7b03a926630 100644 --- a/src/java/org/apache/hadoop/hbase/shell/DescCommand.java +++ b/src/java/org/apache/hadoop/hbase/shell/DescCommand.java @@ -22,7 +22,7 @@ package org.apache.hadoop.hbase.shell; import java.io.IOException; import java.io.Writer; -import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HConnection; import org.apache.hadoop.hbase.HConnectionManager; @@ -49,7 +49,7 @@ public class DescCommand extends BasicCommand { this.formatter = f; } - public ReturnMsg execute(final Configuration conf) { + public ReturnMsg execute(final HBaseConfiguration conf) { if (this.tableName == null) return new ReturnMsg(0, "Syntax error : Please check 'Describe' syntax"); try { diff --git a/src/java/org/apache/hadoop/hbase/shell/DisableCommand.java b/src/java/org/apache/hadoop/hbase/shell/DisableCommand.java index 5cc8aabd577..dec1ff9bb3f 100644 --- a/src/java/org/apache/hadoop/hbase/shell/DisableCommand.java +++ b/src/java/org/apache/hadoop/hbase/shell/DisableCommand.java @@ -22,8 +22,8 @@ package org.apache.hadoop.hbase.shell; import java.io.IOException; import java.io.Writer; -import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseAdmin; +import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.io.Text; /** @@ -36,7 +36,7 @@ public class DisableCommand extends BasicCommand { super(o); } - public ReturnMsg execute(Configuration conf) { + public ReturnMsg execute(HBaseConfiguration conf) { assert tableName != null; try { diff --git a/src/java/org/apache/hadoop/hbase/shell/DropCommand.java b/src/java/org/apache/hadoop/hbase/shell/DropCommand.java index c0efe530853..87266f0f2b1 100644 --- a/src/java/org/apache/hadoop/hbase/shell/DropCommand.java +++ b/src/java/org/apache/hadoop/hbase/shell/DropCommand.java @@ -23,8 +23,8 @@ import java.io.IOException; import java.io.Writer; import java.util.List; -import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseAdmin; +import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.io.Text; /** @@ -37,7 +37,7 @@ public class DropCommand extends BasicCommand { super(o); } - public ReturnMsg execute(Configuration conf) { + public ReturnMsg execute(HBaseConfiguration conf) { if (tableList == null) { throw new IllegalArgumentException("List of tables is null"); } diff --git a/src/java/org/apache/hadoop/hbase/shell/EnableCommand.java b/src/java/org/apache/hadoop/hbase/shell/EnableCommand.java index e58500ec20f..b4c5356f5ff 100644 --- a/src/java/org/apache/hadoop/hbase/shell/EnableCommand.java +++ b/src/java/org/apache/hadoop/hbase/shell/EnableCommand.java @@ -22,8 +22,8 @@ package org.apache.hadoop.hbase.shell; import java.io.IOException; import java.io.Writer; -import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseAdmin; +import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.io.Text; /** @@ -36,7 +36,7 @@ public class EnableCommand extends BasicCommand { super(o); } - public ReturnMsg execute(Configuration conf) { + public ReturnMsg execute(HBaseConfiguration conf) { assert tableName != null; try { HBaseAdmin admin = new HBaseAdmin(conf); diff --git a/src/java/org/apache/hadoop/hbase/shell/ExitCommand.java b/src/java/org/apache/hadoop/hbase/shell/ExitCommand.java index 724830618b9..abd7d7966e6 100644 --- a/src/java/org/apache/hadoop/hbase/shell/ExitCommand.java +++ b/src/java/org/apache/hadoop/hbase/shell/ExitCommand.java @@ -21,14 +21,14 @@ package org.apache.hadoop.hbase.shell; import java.io.Writer; -import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.HBaseConfiguration; public class ExitCommand extends BasicCommand { public ExitCommand(Writer o) { super(o); } - public ReturnMsg execute(@SuppressWarnings("unused") Configuration conf) { + public ReturnMsg execute(@SuppressWarnings("unused") HBaseConfiguration conf) { // TOD: Is this the best way to exit? Would be a problem if shell is run // inside another program -- St.Ack 09/11/2007 System.exit(1); diff --git a/src/java/org/apache/hadoop/hbase/shell/FsCommand.java b/src/java/org/apache/hadoop/hbase/shell/FsCommand.java index 19b04ca86e3..a9fe413dcd6 100644 --- a/src/java/org/apache/hadoop/hbase/shell/FsCommand.java +++ b/src/java/org/apache/hadoop/hbase/shell/FsCommand.java @@ -22,8 +22,8 @@ package org.apache.hadoop.hbase.shell; import java.io.Writer; import java.util.List; -import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FsShell; +import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.util.ToolRunner; /** @@ -36,7 +36,7 @@ public class FsCommand extends BasicCommand { super(o); } - public ReturnMsg execute(@SuppressWarnings("unused") Configuration conf) { + public ReturnMsg execute(@SuppressWarnings("unused") HBaseConfiguration conf) { // This commmand will write the FsShell shell = new FsShell(); try { diff --git a/src/java/org/apache/hadoop/hbase/shell/HelpCommand.java b/src/java/org/apache/hadoop/hbase/shell/HelpCommand.java index a8ba9bb62b5..4ee582f5d45 100644 --- a/src/java/org/apache/hadoop/hbase/shell/HelpCommand.java +++ b/src/java/org/apache/hadoop/hbase/shell/HelpCommand.java @@ -52,7 +52,7 @@ public class HelpCommand extends BasicCommand { this.formatter = f; } - public ReturnMsg execute(@SuppressWarnings("unused") Configuration conf) { + public ReturnMsg execute(@SuppressWarnings("unused") HBaseConfiguration conf) { try { printHelp(this.argument); } catch (IOException e) { diff --git a/src/java/org/apache/hadoop/hbase/shell/InsertCommand.java b/src/java/org/apache/hadoop/hbase/shell/InsertCommand.java index 89d46cf073a..e352f27ad86 100644 --- a/src/java/org/apache/hadoop/hbase/shell/InsertCommand.java +++ b/src/java/org/apache/hadoop/hbase/shell/InsertCommand.java @@ -23,7 +23,7 @@ import java.io.IOException; import java.io.Writer; import java.util.List; -import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HTable; import org.apache.hadoop.io.Text; @@ -40,7 +40,7 @@ public class InsertCommand extends BasicCommand { super(o); } - public ReturnMsg execute(Configuration conf) { + public ReturnMsg execute(HBaseConfiguration conf) { if (this.tableName == null || this.values == null || this.rowKey == null) return new ReturnMsg(0, "Syntax error : Please check 'Insert' syntax."); diff --git a/src/java/org/apache/hadoop/hbase/shell/JarCommand.java b/src/java/org/apache/hadoop/hbase/shell/JarCommand.java index 215cd90e85b..fa621871d3e 100644 --- a/src/java/org/apache/hadoop/hbase/shell/JarCommand.java +++ b/src/java/org/apache/hadoop/hbase/shell/JarCommand.java @@ -35,6 +35,7 @@ import java.util.jar.Manifest; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileUtil; +import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.util.RunJar; /** @@ -48,7 +49,7 @@ public class JarCommand extends BasicCommand { } @SuppressWarnings("deprecation") - public ReturnMsg execute(@SuppressWarnings("unused") Configuration conf) { + public ReturnMsg execute(@SuppressWarnings("unused") HBaseConfiguration conf) { try { String[] args = getQuery(); diff --git a/src/java/org/apache/hadoop/hbase/shell/ReturnMsg.java b/src/java/org/apache/hadoop/hbase/shell/ReturnMsg.java index e3ded5ef528..9465749f67a 100644 --- a/src/java/org/apache/hadoop/hbase/shell/ReturnMsg.java +++ b/src/java/org/apache/hadoop/hbase/shell/ReturnMsg.java @@ -19,9 +19,11 @@ */ package org.apache.hadoop.hbase.shell; +import org.apache.hadoop.hbase.HBaseConfiguration; + /** * Message returned when a {@link Command} is - * {@link Command#execute(org.apache.hadoop.conf.Configuration)}'ed. + * {@link Command#execute(HBaseConfiguration)}'ed. */ public class ReturnMsg { private final String msg; diff --git a/src/java/org/apache/hadoop/hbase/shell/SelectCommand.java b/src/java/org/apache/hadoop/hbase/shell/SelectCommand.java index 06fc4d05821..37558b4234f 100644 --- a/src/java/org/apache/hadoop/hbase/shell/SelectCommand.java +++ b/src/java/org/apache/hadoop/hbase/shell/SelectCommand.java @@ -28,7 +28,6 @@ import java.util.List; import java.util.Map; import java.util.TreeMap; -import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseAdmin; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HConstants; @@ -75,7 +74,7 @@ public class SelectCommand extends BasicCommand { this.formatter = f; } - public ReturnMsg execute(final Configuration conf) { + public ReturnMsg execute(final HBaseConfiguration conf) { if (this.tableName.equals("") || this.rowKey == null || this.columns.size() == 0) { return new ReturnMsg(0, "Syntax error : Please check 'Select' syntax."); diff --git a/src/java/org/apache/hadoop/hbase/shell/ShowCommand.java b/src/java/org/apache/hadoop/hbase/shell/ShowCommand.java index 50a1655218d..b4da0b85549 100644 --- a/src/java/org/apache/hadoop/hbase/shell/ShowCommand.java +++ b/src/java/org/apache/hadoop/hbase/shell/ShowCommand.java @@ -22,8 +22,8 @@ package org.apache.hadoop.hbase.shell; import java.io.IOException; import java.io.Writer; -import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseAdmin; +import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HTableDescriptor; /** @@ -51,7 +51,7 @@ public class ShowCommand extends BasicCommand { this.command = argument; } - public ReturnMsg execute(final Configuration conf) { + public ReturnMsg execute(final HBaseConfiguration conf) { if (this.command == null) { return new ReturnMsg(0, "Syntax error : Please check 'Show' syntax"); } diff --git a/src/test/org/apache/hadoop/hbase/HBaseTestCase.java b/src/test/org/apache/hadoop/hbase/HBaseTestCase.java index bb423ce2d0b..9a263b9ca03 100644 --- a/src/test/org/apache/hadoop/hbase/HBaseTestCase.java +++ b/src/test/org/apache/hadoop/hbase/HBaseTestCase.java @@ -51,7 +51,7 @@ public abstract class HBaseTestCase extends TestCase { StaticTestEnvironment.initialize(); } - protected volatile Configuration conf; + protected volatile HBaseConfiguration conf; /** * constructor diff --git a/src/test/org/apache/hadoop/hbase/MiniHBaseCluster.java b/src/test/org/apache/hadoop/hbase/MiniHBaseCluster.java index 33bbffbdf88..272f12685e2 100644 --- a/src/test/org/apache/hadoop/hbase/MiniHBaseCluster.java +++ b/src/test/org/apache/hadoop/hbase/MiniHBaseCluster.java @@ -23,7 +23,6 @@ import java.io.File; import java.io.IOException; import java.util.List; -import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.dfs.MiniDFSCluster; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; @@ -37,7 +36,7 @@ public class MiniHBaseCluster implements HConstants { static final Logger LOG = Logger.getLogger(MiniHBaseCluster.class.getName()); - private Configuration conf; + private HBaseConfiguration conf; private MiniDFSCluster cluster; private FileSystem fs; private boolean shutdownDFS; @@ -52,7 +51,7 @@ public class MiniHBaseCluster implements HConstants { * @param nRegionNodes * @throws IOException */ - public MiniHBaseCluster(Configuration conf, int nRegionNodes) + public MiniHBaseCluster(HBaseConfiguration conf, int nRegionNodes) throws IOException { this(conf, nRegionNodes, true, true, true); } @@ -66,7 +65,7 @@ public class MiniHBaseCluster implements HConstants { * @param miniHdfsFilesystem * @throws IOException */ - public MiniHBaseCluster(Configuration conf, int nRegionNodes, + public MiniHBaseCluster(HBaseConfiguration conf, int nRegionNodes, final boolean miniHdfsFilesystem) throws IOException { this(conf, nRegionNodes, miniHdfsFilesystem, true, true); } @@ -89,7 +88,7 @@ public class MiniHBaseCluster implements HConstants { * @param dfsCluster * @throws IOException */ - public MiniHBaseCluster(Configuration conf, int nRegionNodes, + public MiniHBaseCluster(HBaseConfiguration conf, int nRegionNodes, MiniDFSCluster dfsCluster) throws IOException { this.conf = conf; @@ -110,7 +109,7 @@ public class MiniHBaseCluster implements HConstants { * @param deleteOnExit clean up mini hdfs files * @throws IOException */ - public MiniHBaseCluster(Configuration conf, int nRegionNodes, + public MiniHBaseCluster(HBaseConfiguration conf, int nRegionNodes, final boolean miniHdfsFilesystem, boolean format, boolean deleteOnExit) throws IOException { diff --git a/src/test/org/apache/hadoop/hbase/MultiRegionTable.java b/src/test/org/apache/hadoop/hbase/MultiRegionTable.java index 1d2d554af60..6e6f2142174 100644 --- a/src/test/org/apache/hadoop/hbase/MultiRegionTable.java +++ b/src/test/org/apache/hadoop/hbase/MultiRegionTable.java @@ -27,7 +27,6 @@ import java.util.TreeMap; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.util.Writables; @@ -52,7 +51,7 @@ public class MultiRegionTable extends HBaseTestCase { * @throws IOException */ @SuppressWarnings("null") - public static void makeMultiRegionTable(Configuration conf, + public static void makeMultiRegionTable(HBaseConfiguration conf, MiniHBaseCluster cluster, FileSystem localFs, String tableName, String columnName) throws IOException { diff --git a/src/test/org/apache/hadoop/hbase/OOMEHMaster.java b/src/test/org/apache/hadoop/hbase/OOMEHMaster.java index ef3016d8137..67bc573ecc4 100644 --- a/src/test/org/apache/hadoop/hbase/OOMEHMaster.java +++ b/src/test/org/apache/hadoop/hbase/OOMEHMaster.java @@ -23,7 +23,6 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; /** @@ -35,11 +34,11 @@ import org.apache.hadoop.fs.Path; public class OOMEHMaster extends HMaster { private List retainer = new ArrayList(); - public OOMEHMaster(Configuration conf) throws IOException { + public OOMEHMaster(HBaseConfiguration conf) throws IOException { super(conf); } - public OOMEHMaster(Path dir, HServerAddress address, Configuration conf) + public OOMEHMaster(Path dir, HServerAddress address, HBaseConfiguration conf) throws IOException { super(dir, address, conf); } diff --git a/src/test/org/apache/hadoop/hbase/OOMERegionServer.java b/src/test/org/apache/hadoop/hbase/OOMERegionServer.java index a8832579f42..638a3beb522 100644 --- a/src/test/org/apache/hadoop/hbase/OOMERegionServer.java +++ b/src/test/org/apache/hadoop/hbase/OOMERegionServer.java @@ -23,7 +23,6 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.io.BatchUpdate; import org.apache.hadoop.io.Text; @@ -37,11 +36,11 @@ import org.apache.hadoop.io.Text; public class OOMERegionServer extends HRegionServer { private List retainer = new ArrayList(); - public OOMERegionServer(Configuration conf) throws IOException { + public OOMERegionServer(HBaseConfiguration conf) throws IOException { super(conf); } - public OOMERegionServer(HServerAddress address, Configuration conf) + public OOMERegionServer(HServerAddress address, HBaseConfiguration conf) throws IOException { super(address, conf); } diff --git a/src/test/org/apache/hadoop/hbase/PerformanceEvaluation.java b/src/test/org/apache/hadoop/hbase/PerformanceEvaluation.java index 73abd9c10ab..4abc871aed1 100644 --- a/src/test/org/apache/hadoop/hbase/PerformanceEvaluation.java +++ b/src/test/org/apache/hadoop/hbase/PerformanceEvaluation.java @@ -103,7 +103,7 @@ public class PerformanceEvaluation implements HConstants { SEQUENTIAL_WRITE, SCAN}); - volatile Configuration conf; + volatile HBaseConfiguration conf; private boolean miniCluster = false; private int N = 1; private int R = ROWS_PER_GB; @@ -131,7 +131,7 @@ public class PerformanceEvaluation implements HConstants { * Constructor * @param c Configuration object */ - public PerformanceEvaluation(final Configuration c) { + public PerformanceEvaluation(final HBaseConfiguration c) { this.conf = c; } @@ -163,7 +163,7 @@ public class PerformanceEvaluation implements HConstants { public void configure(JobConf j) { this.cmd = j.get(CMD_KEY); - this.pe = new PerformanceEvaluation(j); + this.pe = new PerformanceEvaluation(new HBaseConfiguration(j)); } /** {@inheritDoc} */ @@ -292,9 +292,9 @@ public class PerformanceEvaluation implements HConstants { private final Status status; protected HBaseAdmin admin; protected HTable table; - protected volatile Configuration conf; + protected volatile HBaseConfiguration conf; - Test(final Configuration conf, final int startRow, + Test(final HBaseConfiguration conf, final int startRow, final int perClientRunRows, final int totalRows, final Status status) { super(); this.startRow = startRow; @@ -383,7 +383,7 @@ public class PerformanceEvaluation implements HConstants { } class RandomReadTest extends Test { - RandomReadTest(final Configuration conf, final int startRow, + RandomReadTest(final HBaseConfiguration conf, final int startRow, final int perClientRunRows, final int totalRows, final Status status) { super(conf, startRow, perClientRunRows, totalRows, status); } @@ -406,7 +406,7 @@ public class PerformanceEvaluation implements HConstants { } class RandomWriteTest extends Test { - RandomWriteTest(final Configuration conf, final int startRow, + RandomWriteTest(final HBaseConfiguration conf, final int startRow, final int perClientRunRows, final int totalRows, final Status status) { super(conf, startRow, perClientRunRows, totalRows, status); } @@ -430,7 +430,7 @@ public class PerformanceEvaluation implements HConstants { private HStoreKey key = new HStoreKey(); private TreeMap results = new TreeMap(); - ScanTest(final Configuration conf, final int startRow, + ScanTest(final HBaseConfiguration conf, final int startRow, final int perClientRunRows, final int totalRows, final Status status) { super(conf, startRow, perClientRunRows, totalRows, status); } @@ -464,7 +464,7 @@ public class PerformanceEvaluation implements HConstants { } class SequentialReadTest extends Test { - SequentialReadTest(final Configuration conf, final int startRow, + SequentialReadTest(final HBaseConfiguration conf, final int startRow, final int perClientRunRows, final int totalRows, final Status status) { super(conf, startRow, perClientRunRows, totalRows, status); } @@ -481,7 +481,7 @@ public class PerformanceEvaluation implements HConstants { } class SequentialWriteTest extends Test { - SequentialWriteTest(final Configuration conf, final int startRow, + SequentialWriteTest(final HBaseConfiguration conf, final int startRow, final int perClientRunRows, final int totalRows, final Status status) { super(conf, startRow, perClientRunRows, totalRows, status); } diff --git a/src/test/org/apache/hadoop/hbase/TestScanner.java b/src/test/org/apache/hadoop/hbase/TestScanner.java index a9e16bcd596..0fce6de5bcf 100644 --- a/src/test/org/apache/hadoop/hbase/TestScanner.java +++ b/src/test/org/apache/hadoop/hbase/TestScanner.java @@ -24,13 +24,11 @@ import java.io.DataOutputStream; import java.io.IOException; import java.util.TreeMap; -import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.dfs.MiniDFSCluster; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; -import org.apache.hadoop.io.Text; - import org.apache.hadoop.hbase.util.Writables; +import org.apache.hadoop.io.Text; /** * Test of a long-lived scanner validating as we go. @@ -135,7 +133,7 @@ public class TestScanner extends HBaseTestCase { // Initialization - Configuration conf = new HBaseConfiguration(); + HBaseConfiguration conf = new HBaseConfiguration(); cluster = new MiniDFSCluster(conf, 2, true, (String[])null); fs = cluster.getFileSystem(); Path dir = new Path("/hbase"); diff --git a/src/test/org/apache/hadoop/hbase/mapred/TestTableIndex.java b/src/test/org/apache/hadoop/hbase/mapred/TestTableIndex.java index 623cfa91566..b3e8a8ea3c7 100644 --- a/src/test/org/apache/hadoop/hbase/mapred/TestTableIndex.java +++ b/src/test/org/apache/hadoop/hbase/mapred/TestTableIndex.java @@ -30,11 +30,11 @@ import junit.textui.TestRunner; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.dfs.MiniDFSCluster; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseAdmin; +import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseTestCase; import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HConstants; @@ -211,7 +211,8 @@ public class TestTableIndex extends HBaseTestCase { return c.toString(); } - private void scanTable(Configuration c, long firstK) throws IOException { + private void scanTable(HBaseConfiguration c, long firstK) + throws IOException { HTable table = new HTable(c, new Text(TABLE_NAME)); Text[] columns = { TEXT_INPUT_COLUMN, TEXT_OUTPUT_COLUMN }; HScannerInterface scanner = table.obtainScanner(columns, @@ -235,7 +236,7 @@ public class TestTableIndex extends HBaseTestCase { } } - private void verify(Configuration c) throws IOException { + private void verify(HBaseConfiguration c) throws IOException { Path localDir = new Path(this.testDir, "index_" + Integer.toString(new Random().nextInt())); this.fs.copyToLocalFile(new Path(INDEX_DIR), localDir); diff --git a/src/test/org/apache/hadoop/hbase/mapred/TestTableMapReduce.java b/src/test/org/apache/hadoop/hbase/mapred/TestTableMapReduce.java index 40f04ff0392..448d4262796 100644 --- a/src/test/org/apache/hadoop/hbase/mapred/TestTableMapReduce.java +++ b/src/test/org/apache/hadoop/hbase/mapred/TestTableMapReduce.java @@ -26,17 +26,11 @@ import java.util.TreeMap; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.dfs.MiniDFSCluster; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; -import org.apache.hadoop.io.MapWritable; -import org.apache.hadoop.io.Text; -import org.apache.hadoop.mapred.JobClient; -import org.apache.hadoop.mapred.JobConf; -import org.apache.hadoop.mapred.MiniMRCluster; -import org.apache.hadoop.mapred.Reporter; import org.apache.hadoop.hbase.HBaseAdmin; +import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HScannerInterface; @@ -46,10 +40,12 @@ import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.MultiRegionTable; import org.apache.hadoop.hbase.io.ImmutableBytesWritable; -import org.apache.hadoop.hbase.mapred.TableMap; -import org.apache.hadoop.hbase.mapred.TableOutputCollector; -import org.apache.hadoop.hbase.mapred.TableReduce; -import org.apache.hadoop.hbase.mapred.IdentityTableReduce; +import org.apache.hadoop.io.MapWritable; +import org.apache.hadoop.io.Text; +import org.apache.hadoop.mapred.JobClient; +import org.apache.hadoop.mapred.JobConf; +import org.apache.hadoop.mapred.MiniMRCluster; +import org.apache.hadoop.mapred.Reporter; /** * Test Map/Reduce job over HBase tables @@ -314,7 +310,7 @@ public class TestTableMapReduce extends MultiRegionTable { verify(conf, MULTI_REGION_TABLE_NAME); } - private void scanTable(Configuration conf, String tableName) + private void scanTable(HBaseConfiguration conf, String tableName) throws IOException { HTable table = new HTable(conf, new Text(tableName)); @@ -344,7 +340,8 @@ public class TestTableMapReduce extends MultiRegionTable { } @SuppressWarnings("null") - private void verify(Configuration conf, String tableName) throws IOException { + private void verify(HBaseConfiguration conf, String tableName) + throws IOException { HTable table = new HTable(conf, new Text(tableName)); Text[] columns = {