You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2009/12/31 21:44:36 UTC
svn commit: r894934 [2/2] - in /hadoop/hbase/trunk: ./
src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/
src/contrib/transactional/src/java/org/apache/hadoop/hbase/regionserver/tableindexed/
src/contrib/transactional/src/java/org/apache/h...
Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/util/MetaUtils.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/util/MetaUtils.java?rev=894934&r1=894933&r2=894934&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/util/MetaUtils.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/util/MetaUtils.java Thu Dec 31 20:44:31 2009
@@ -29,6 +29,7 @@
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.HBaseConfiguration;
@@ -42,10 +43,10 @@
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.client.Scan;
-import org.apache.hadoop.hbase.regionserver.wal.HLog;
import org.apache.hadoop.hbase.regionserver.HRegion;
import org.apache.hadoop.hbase.regionserver.InternalScanner;
import org.apache.hadoop.hbase.regionserver.Store;
+import org.apache.hadoop.hbase.regionserver.wal.HLog;
/**
* Contains utility methods for manipulating HBase meta tables.
@@ -56,7 +57,7 @@
*/
public class MetaUtils {
private static final Log LOG = LogFactory.getLog(MetaUtils.class);
- private final HBaseConfiguration conf;
+ private final Configuration conf;
private FileSystem fs;
private Path rootdir;
private HLog log;
@@ -67,12 +68,12 @@
/** Default constructor
* @throws IOException */
public MetaUtils() throws IOException {
- this(new HBaseConfiguration());
+ this(HBaseConfiguration.create());
}
- /** @param conf HBaseConfiguration
+ /** @param conf Configuration
* @throws IOException */
- public MetaUtils(HBaseConfiguration conf) throws IOException {
+ public MetaUtils(Configuration conf) throws IOException {
this.conf = conf;
conf.setInt("hbase.client.retries.number", 1);
this.rootRegion = null;
@@ -284,7 +285,7 @@
* @param onlineOffline Pass <code>true</code> to OFFLINE the region.
* @throws IOException
*/
- public static void changeOnlineStatus (final HBaseConfiguration c,
+ public static void changeOnlineStatus (final Configuration c,
final byte [] row, final boolean onlineOffline)
throws IOException {
HTable t = new HTable(c, HConstants.META_TABLE_NAME);
Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/zookeeper/HQuorumPeer.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/zookeeper/HQuorumPeer.java?rev=894934&r1=894933&r2=894934&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/zookeeper/HQuorumPeer.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/zookeeper/HQuorumPeer.java Thu Dec 31 20:44:31 2009
@@ -23,17 +23,18 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
-import java.net.UnknownHostException;
import java.net.InetAddress;
import java.net.NetworkInterface;
-import java.util.Properties;
-import java.util.List;
+import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Enumeration;
+import java.util.List;
+import java.util.Properties;
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.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.net.DNS;
@@ -66,7 +67,7 @@
* @param args String[] of command line arguments. Not used.
*/
public static void main(String[] args) {
- HBaseConfiguration conf = new HBaseConfiguration();
+ Configuration conf = HBaseConfiguration.create();
try {
Properties zkProperties = makeZKProps(conf);
writeMyID(zkProperties);
@@ -98,7 +99,7 @@
private static void writeMyID(Properties properties) throws IOException {
long myId = -1;
- HBaseConfiguration conf = new HBaseConfiguration();
+ Configuration conf = HBaseConfiguration.create();
String myAddress = DNS.getDefaultHost(
conf.get("hbase.zookeeper.dns.interface","default"),
conf.get("hbase.zookeeper.dns.nameserver","default"));
@@ -161,10 +162,10 @@
* If there is a zoo.cfg in the classpath, simply read it in. Otherwise parse
* the corresponding config options from the HBase XML configs and generate
* the appropriate ZooKeeper properties.
- * @param conf HBaseConfiguration to read from.
+ * @param conf Configuration to read from.
* @return Properties holding mappings representing ZooKeeper zoo.cfg file.
*/
- public static Properties makeZKProps(HBaseConfiguration conf) {
+ public static Properties makeZKProps(Configuration conf) {
// First check if there is a zoo.cfg in the CLASSPATH. If so, simply read
// it and grab its configuration properties.
ClassLoader cl = HQuorumPeer.class.getClassLoader();
@@ -218,7 +219,7 @@
* @return Properties parsed from config stream with variables substituted.
* @throws IOException if anything goes wrong parsing config
*/
- public static Properties parseZooCfg(HBaseConfiguration conf,
+ public static Properties parseZooCfg(Configuration conf,
InputStream inputStream) throws IOException {
Properties properties = new Properties();
try {
Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/zookeeper/ZKServerTool.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/zookeeper/ZKServerTool.java?rev=894934&r1=894933&r2=894934&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/zookeeper/ZKServerTool.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/zookeeper/ZKServerTool.java Thu Dec 31 20:44:31 2009
@@ -3,6 +3,7 @@
import java.util.Properties;
import java.util.Map.Entry;
+import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HConstants;
@@ -16,7 +17,7 @@
* @param args Command line arguments. First arg is path to zookeepers file.
*/
public static void main(String args[]) {
- HBaseConfiguration conf = new HBaseConfiguration();
+ Configuration conf = HBaseConfiguration.create();
// Note that we do not simply grab the property ZOOKEEPER_QUORUM from
// the HBaseConfiguration because the user may be using a zoo.cfg file.
Properties zkProps = HQuorumPeer.makeZKProps(conf);
Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java?rev=894934&r1=894933&r2=894934&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java Thu Dec 31 20:44:31 2009
@@ -33,7 +33,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.hbase.HBaseConfiguration;
+import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.HServerAddress;
import org.apache.hadoop.hbase.HServerInfo;
@@ -42,8 +42,8 @@
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.Watcher;
-import org.apache.zookeeper.ZooDefs.Ids;
import org.apache.zookeeper.ZooKeeper;
+import org.apache.zookeeper.ZooDefs.Ids;
import org.apache.zookeeper.ZooKeeper.States;
import org.apache.zookeeper.data.Stat;
@@ -72,11 +72,11 @@
/**
* Create a ZooKeeperWrapper.
- * @param conf HBaseConfiguration to read settings from.
+ * @param conf Configuration to read settings from.
* @param watcher ZooKeeper watcher to register.
* @throws IOException If a connection error occurs.
*/
- public ZooKeeperWrapper(HBaseConfiguration conf, Watcher watcher)
+ public ZooKeeperWrapper(Configuration conf, Watcher watcher)
throws IOException {
Properties properties = HQuorumPeer.makeZKProps(conf);
setQuorumServers(properties);
Modified: hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/util/TestMergeTool.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/util/TestMergeTool.java?rev=894934&r1=894933&r2=894934&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/util/TestMergeTool.java (original)
+++ hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/util/TestMergeTool.java Thu Dec 31 20:44:31 2009
@@ -112,7 +112,8 @@
// Start up dfs
this.dfsCluster = new MiniDFSCluster(conf, 2, true, (String[])null);
this.fs = this.dfsCluster.getFileSystem();
- conf.set("fs.defaultFS", fs.getUri().toString());
+ System.out.println("fs=" + this.fs);
+ this.conf.set("fs.defaultFS", fs.getUri().toString());
Path parentdir = fs.getHomeDirectory();
conf.set(HConstants.HBASE_DIR, parentdir.toString());
fs.mkdirs(parentdir);
@@ -171,7 +172,8 @@
throws Exception {
Merge merger = new Merge(this.conf);
LOG.info(msg);
- int errCode = ToolRunner.run(merger,
+ System.out.println("fs2=" + this.conf.get("fs.defaultFS"));
+ int errCode = ToolRunner.run(this.conf, merger,
new String[] {this.desc.getNameAsString(), regionName1, regionName2}
);
assertTrue("'" + msg + "' failed", errCode == 0);
@@ -271,4 +273,4 @@
log.closeAndDelete();
}
}
-}
\ No newline at end of file
+}
Modified: hadoop/hbase/trunk/src/webapps/master/master.jsp
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/webapps/master/master.jsp?rev=894934&r1=894933&r2=894934&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/webapps/master/master.jsp (original)
+++ hadoop/hbase/trunk/src/webapps/master/master.jsp Thu Dec 31 20:44:31 2009
@@ -1,6 +1,7 @@
<%@ page contentType="text/html;charset=UTF-8"
import="java.util.*"
import="java.net.URLEncoder"
+ import="org.apache.hadoop.conf.Configuration"
import="org.apache.hadoop.io.Text"
import="org.apache.hadoop.hbase.util.Bytes"
import="org.apache.hadoop.hbase.master.HMaster"
@@ -14,7 +15,7 @@
import="org.apache.hadoop.hbase.HColumnDescriptor"
import="org.apache.hadoop.hbase.HTableDescriptor" %><%
HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER);
- HBaseConfiguration conf = master.getConfiguration();
+ Configuration conf = master.getConfiguration();
HServerAddress rootLocation = master.getRegionManager().getRootRegionLocation();
Map<byte [], MetaRegion> onlineRegions = master.getRegionManager().getOnlineMetaRegions();
Map<String, HServerInfo> serverToServerInfos =
Modified: hadoop/hbase/trunk/src/webapps/master/table.jsp
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/webapps/master/table.jsp?rev=894934&r1=894933&r2=894934&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/webapps/master/table.jsp (original)
+++ hadoop/hbase/trunk/src/webapps/master/table.jsp Thu Dec 31 20:44:31 2009
@@ -4,6 +4,7 @@
import="java.net.URLEncoder"
import="org.apache.hadoop.io.Text"
import="org.apache.hadoop.io.Writable"
+ import="org.apache.hadoop.conf.Configuration"
import="org.apache.hadoop.hbase.HTableDescriptor"
import="org.apache.hadoop.hbase.client.HTable"
import="org.apache.hadoop.hbase.client.HBaseAdmin"
@@ -19,7 +20,7 @@
import="java.util.Map"
import="org.apache.hadoop.hbase.HConstants"%><%
HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER);
- HBaseConfiguration conf = master.getConfiguration();
+ Configuration conf = master.getConfiguration();
HBaseAdmin hbadmin = new HBaseAdmin(conf);
String tableName = request.getParameter("name");
HTable table = new HTable(conf, tableName);
Modified: hadoop/hbase/trunk/src/webapps/master/zk.jsp
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/webapps/master/zk.jsp?rev=894934&r1=894933&r2=894934&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/webapps/master/zk.jsp (original)
+++ hadoop/hbase/trunk/src/webapps/master/zk.jsp Thu Dec 31 20:44:31 2009
@@ -1,5 +1,6 @@
<%@ page contentType="text/html;charset=UTF-8"
import="java.io.IOException"
+ import="org.apache.hadoop.conf.Configuration"
import="org.apache.hadoop.hbase.client.HBaseAdmin"
import="org.apache.hadoop.hbase.client.HConnection"
import="org.apache.hadoop.hbase.HRegionInfo"
@@ -8,7 +9,7 @@
import="org.apache.hadoop.hbase.master.HMaster"
import="org.apache.hadoop.hbase.HConstants"%><%
HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER);
- HBaseConfiguration conf = master.getConfiguration();
+ Configuration conf = master.getConfiguration();
HBaseAdmin hbadmin = new HBaseAdmin(conf);
HConnection connection = hbadmin.getConnection();
ZooKeeperWrapper wrapper = connection.getZooKeeperWrapper();