From b5cf874819894985f3ea0cdb6ec4db00f7b61404 Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Thu, 27 Sep 2012 05:40:09 +0000 Subject: [PATCH] HBASE-6876 Clean up WARNs and log messages around startup; REAPPLY git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1390848 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/hadoop/hbase/client/HConnectionManager.java | 2 +- .../org/apache/hadoop/hbase/ipc/HBaseRpcMetrics.java | 4 ++-- .../java/org/apache/hadoop/hbase/ipc/HBaseServer.java | 2 +- .../main/java/org/apache/hadoop/hbase/ipc/RpcEngine.java | 6 ++---- .../apache/hadoop/hbase/master/ActiveMasterManager.java | 9 +++++---- .../java/org/apache/hadoop/hbase/master/HMaster.java | 7 +++++-- .../hadoop/hbase/zookeeper/RecoverableZooKeeper.java | 5 ++--- 7 files changed, 18 insertions(+), 17 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java index 1665e5db6bf..ab2ab19416c 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java @@ -2450,7 +2450,7 @@ public class HConnectionManager { c.getInt("hbase.client.serverside.retries.multiplier", 10); int retries = hcRetries * serversideMultiplier; c.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, retries); - log.debug("Set serverside HConnection retries=" + retries); + log.debug("HConnection retries=" + retries); } } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/HBaseRpcMetrics.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/HBaseRpcMetrics.java index b6c315fb09d..119907df375 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/HBaseRpcMetrics.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/HBaseRpcMetrics.java @@ -62,8 +62,8 @@ public class HBaseRpcMetrics implements Updater { metricsRecord.setTag("port", port); - LOG.info("Initializing RPC Metrics with hostName=" - + hostName + ", port=" + port); + LOG.info("Initializing RPC Metrics for className=" + + hostName + " on port=" + port); context.registerUpdater(this); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/HBaseServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/HBaseServer.java index 0bb1f8af39a..8f0cef1d4c7 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/HBaseServer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/HBaseServer.java @@ -525,6 +525,7 @@ public abstract class HBaseServer implements RpcServer { readers[i] = reader; readPool.execute(reader); } + LOG.info("Started " + readThreads + " reader(s) in Listener."); // Register accepts on the server socket with the selector. acceptChannel.register(selector, SelectionKey.OP_ACCEPT); @@ -541,7 +542,6 @@ public abstract class HBaseServer implements RpcServer { this.readSelector = Selector.open(); } public void run() { - LOG.info("Starting " + getName()); try { doRunLoop(); } finally { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcEngine.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcEngine.java index 7c7cb25a7a2..68038556e43 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcEngine.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcEngine.java @@ -20,14 +20,12 @@ package org.apache.hadoop.hbase.ipc; import java.io.IOException; import java.net.InetSocketAddress; + import javax.net.SocketFactory; -import org.apache.hadoop.hbase.ipc.VersionedProtocol; -import org.apache.hadoop.hbase.security.User; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.conf.Configuration; - -import com.google.protobuf.ServiceException; +import org.apache.hadoop.hbase.security.User; /** An RPC implementation. */ @InterfaceAudience.Private diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/ActiveMasterManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/ActiveMasterManager.java index 025dd3fdbcc..062f7dfefd8 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/ActiveMasterManager.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/ActiveMasterManager.java @@ -145,10 +145,11 @@ class ActiveMasterManager extends ZooKeeperListener { this.watcher.getMasterAddressZNode(), this.sn)) { // If we were a backup master before, delete our ZNode from the backup - // master directory since we are the active now - LOG.info("Deleting ZNode for " + backupZNode + " from backup master directory"); - ZKUtil.deleteNodeFailSilent(this.watcher, backupZNode); - + // master directory since we are the active now) + if (ZKUtil.checkExists(this.watcher, backupZNode) != -1) { + LOG.info("Deleting ZNode for " + backupZNode + " from backup master directory"); + ZKUtil.deleteNodeFailSilent(this.watcher, backupZNode); + } // Save the znode in a file, this will allow to check if we crash in the launch scripts ZNodeClearer.writeMyEphemeralNodeOnDisk(this.sn.toString()); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java index 1387f17a8a8..2d271117d2d 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java @@ -185,6 +185,7 @@ import org.apache.hadoop.net.DNS; import org.apache.zookeeper.KeeperException; import org.apache.zookeeper.Watcher; import org.apache.hadoop.hbase.trace.SpanReceiverHost; +import org.apache.hadoop.hbase.util.FSUtils; import com.google.protobuf.RpcController; import com.google.protobuf.ServiceException; @@ -324,6 +325,8 @@ Server { public HMaster(final Configuration conf) throws IOException, KeeperException, InterruptedException { this.conf = new Configuration(conf); + LOG.info("hbase.rootdir=" + FSUtils.getRootDir(this.conf) + + ", hbase.cluster.distributed=" + this.conf.getBoolean("hbase.cluster.distributed", false)); // Disable the block cache on the master this.conf.setFloat(HConstants.HFILE_BLOCK_CACHE_SIZE_KEY, 0.0f); // Set how many times to retry talking to another server over HConnection. @@ -333,7 +336,7 @@ Server { conf.get("hbase.master.dns.interface", "default"), conf.get("hbase.master.dns.nameserver", "default"))); int port = conf.getInt(HConstants.MASTER_PORT, HConstants.DEFAULT_MASTER_PORT); - // Creation of a HSA will force a resolve. + // Creation of a ISA will force a resolve. InetSocketAddress initialIsa = new InetSocketAddress(hostname, port); if (initialIsa.getAddress() == null) { throw new IllegalArgumentException("Failed resolve of " + initialIsa); @@ -2291,7 +2294,7 @@ Server { * @see org.apache.hadoop.hbase.master.HMasterCommandLine */ public static void main(String [] args) throws Exception { - VersionInfo.logVersion(); + VersionInfo.logVersion(); new HMasterCommandLine(HMaster.class).doMain(args); } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java index 2b71860e3d4..c740689015d 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java @@ -134,12 +134,11 @@ public class RecoverableZooKeeper { switch (e.code()) { case NONODE: if (isRetry) { - LOG.info("Node " + path + " already deleted. Assuming that a " + + LOG.info("Node " + path + " already deleted. Assuming a " + "previous attempt succeeded."); return; } - LOG.warn("Node " + path + " already deleted, and this is not a " + - "retry"); + LOG.warn("Node " + path + " already deleted, retry=" + isRetry); throw e; case CONNECTIONLOSS: