HBASE-9282 Minor logging cleanup; shorten logs, remove redundant info

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1516267 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2013-08-21 19:25:21 +00:00
parent 627493d222
commit 41db4e539f
8 changed files with 34 additions and 43 deletions

View File

@ -534,9 +534,9 @@ class AsyncProcess<CResult> {
} }
if (toReplay.isEmpty()) { if (toReplay.isEmpty()) {
LOG.warn("Attempt #" + numAttempt + "/" + numTries + " failed for all (" + LOG.warn("Attempt #" + numAttempt + "/" + numTries + " failed for all " +
initialActions.size() + ") operations on server " + location.getServerName() + initialActions.size() + "ops, NOT resubmitting,
" NOT resubmitting, tableName=" + tableName + ", location=" + location); tableName=" + tableName + ", location=" + location);
} else { } else {
submit(initialActions, toReplay, numAttempt, true, errorsByServer); submit(initialActions, toReplay, numAttempt, true, errorsByServer);
} }
@ -557,8 +557,7 @@ class AsyncProcess<CResult> {
HConnectionManager.ServerErrorTracker errorsByServer) { HConnectionManager.ServerErrorTracker errorsByServer) {
if (responses == null) { if (responses == null) {
LOG.info("Attempt #" + numAttempt + "/" + numTries + " failed for all operations" + LOG.info("Attempt #" + numAttempt + "/" + numTries + " failed all ops, trying resubmit," +
" on server " + location.getServerName() + " , trying to resubmit," +
" tableName=" + tableName + ", location=" + location); " tableName=" + tableName + ", location=" + location);
resubmitAll(initialActions, rsActions, location, numAttempt + 1, null, errorsByServer); resubmitAll(initialActions, rsActions, location, numAttempt + 1, null, errorsByServer);
return; return;
@ -618,10 +617,9 @@ class AsyncProcess<CResult> {
if (numAttempt > 3 && LOG.isDebugEnabled()) { if (numAttempt > 3 && LOG.isDebugEnabled()) {
// We use this value to have some logs when we have multiple failures, but not too many // We use this value to have some logs when we have multiple failures, but not too many
// logs as errors are to be expected wehn region moves, split and so on // logs as errors are to be expected wehn region moves, split and so on
LOG.debug("Attempt #" + numAttempt + "/" + numTries + " failed for " + failureCount + LOG.debug("Attempt #" + numAttempt + "/" + numTries + " failed " + failureCount +
" operations on server " + location.getServerName() + ", resubmitting " + " ops , resubmitting " + toReplay.size() + ", tableName=" + tableName + ", location=" +
toReplay.size() + ", tableName=" + tableName + ", location=" + location + ", last exception was: " + throwable.getMessage() +
location + ", last exception was: " + throwable +
" - sleeping " + backOffTime + " ms."); " - sleeping " + backOffTime + " ms.");
} }
try { try {
@ -636,7 +634,7 @@ class AsyncProcess<CResult> {
submit(initialActions, toReplay, numAttempt + 1, true, errorsByServer); submit(initialActions, toReplay, numAttempt + 1, true, errorsByServer);
} else if (failureCount != 0) { } else if (failureCount != 0) {
LOG.warn("Attempt #" + numAttempt + "/" + numTries + " failed for " + failureCount + LOG.warn("Attempt #" + numAttempt + "/" + numTries + " failed for " + failureCount +
" operations on server " + location.getServerName() + " NOT resubmitting." + " ops on " + location.getServerName() + " NOT resubmitting." +
", tableName=" + tableName + ", location=" + location); ", tableName=" + tableName + ", location=" + location);
} }
} }

View File

@ -202,7 +202,7 @@ public class HTable implements HTableInterface {
// we only create as many Runnables as there are region servers. It means // we only create as many Runnables as there are region servers. It means
// it also scales when new region servers are added. // it also scales when new region servers are added.
this.pool = new ThreadPoolExecutor(1, maxThreads, keepAliveTime, TimeUnit.SECONDS, this.pool = new ThreadPoolExecutor(1, maxThreads, keepAliveTime, TimeUnit.SECONDS,
new SynchronousQueue<Runnable>(), Threads.newDaemonThreadFactory("hbase-table")); new SynchronousQueue<Runnable>(), Threads.newDaemonThreadFactory("htable"));
((ThreadPoolExecutor) this.pool).allowCoreThreadTimeOut(true); ((ThreadPoolExecutor) this.pool).allowCoreThreadTimeOut(true);
this.finishSetup(); this.finishSetup();

View File

@ -147,7 +147,7 @@ public class ZKAssign {
public static void createNodeOffline(ZooKeeperWatcher zkw, HRegionInfo region, public static void createNodeOffline(ZooKeeperWatcher zkw, HRegionInfo region,
ServerName serverName, final EventType event) ServerName serverName, final EventType event)
throws KeeperException, KeeperException.NodeExistsException { throws KeeperException, KeeperException.NodeExistsException {
LOG.debug(zkw.prefix("Creating unassigned node for " + LOG.debug(zkw.prefix("Creating unassigned node " +
region.getEncodedName() + " in OFFLINE state")); region.getEncodedName() + " in OFFLINE state"));
RegionTransition rt = RegionTransition rt =
RegionTransition.createRegionTransition(event, region.getRegionName(), serverName); RegionTransition.createRegionTransition(event, region.getRegionName(), serverName);
@ -174,7 +174,7 @@ public class ZKAssign {
HRegionInfo region, ServerName serverName, HRegionInfo region, ServerName serverName,
final AsyncCallback.StringCallback cb, final Object ctx) final AsyncCallback.StringCallback cb, final Object ctx)
throws KeeperException { throws KeeperException {
LOG.debug(zkw.prefix("Async create of unassigned node for " + LOG.debug(zkw.prefix("Async create of unassigned node " +
region.getEncodedName() + " with OFFLINE state")); region.getEncodedName() + " with OFFLINE state"));
RegionTransition rt = RegionTransition rt =
RegionTransition.createRegionTransition( RegionTransition.createRegionTransition(
@ -205,7 +205,7 @@ public class ZKAssign {
*/ */
public static int createOrForceNodeOffline(ZooKeeperWatcher zkw, public static int createOrForceNodeOffline(ZooKeeperWatcher zkw,
HRegionInfo region, ServerName serverName) throws KeeperException { HRegionInfo region, ServerName serverName) throws KeeperException {
LOG.debug(zkw.prefix("Creating (or updating) unassigned node for " + LOG.debug(zkw.prefix("Creating (or updating) unassigned node " +
region.getEncodedName() + " with OFFLINE state")); region.getEncodedName() + " with OFFLINE state"));
RegionTransition rt = RegionTransition.createRegionTransition(EventType.M_ZK_REGION_OFFLINE, RegionTransition rt = RegionTransition.createRegionTransition(EventType.M_ZK_REGION_OFFLINE,
region.getRegionName(), serverName, HConstants.EMPTY_BYTE_ARRAY); region.getRegionName(), serverName, HConstants.EMPTY_BYTE_ARRAY);
@ -403,7 +403,7 @@ public class ZKAssign {
EventType expectedState, int expectedVersion) EventType expectedState, int expectedVersion)
throws KeeperException, KeeperException.NoNodeException { throws KeeperException, KeeperException.NoNodeException {
LOG.debug(zkw.prefix("Deleting existing unassigned " + LOG.debug(zkw.prefix("Deleting existing unassigned " +
"node for " + encodedRegionName + " that is in expected state " + expectedState)); "node " + encodedRegionName + " in expected state " + expectedState));
String node = getNodeName(zkw, encodedRegionName); String node = getNodeName(zkw, encodedRegionName);
zkw.sync(node); zkw.sync(node);
Stat stat = new Stat(); Stat stat = new Stat();
@ -431,7 +431,7 @@ public class ZKAssign {
" state but after verifying state, we got a version mismatch")); " state but after verifying state, we got a version mismatch"));
return false; return false;
} }
LOG.debug(zkw.prefix("Successfully deleted unassigned node for region " + LOG.debug(zkw.prefix("Deleted unassigned node " +
encodedRegionName + " in expected state " + expectedState)); encodedRegionName + " in expected state " + expectedState));
return true; return true;
} }
@ -478,7 +478,7 @@ public class ZKAssign {
public static int createNodeClosing(ZooKeeperWatcher zkw, HRegionInfo region, public static int createNodeClosing(ZooKeeperWatcher zkw, HRegionInfo region,
ServerName serverName) ServerName serverName)
throws KeeperException, KeeperException.NodeExistsException { throws KeeperException, KeeperException.NodeExistsException {
LOG.debug(zkw.prefix("Creating unassigned node for " + LOG.debug(zkw.prefix("Creating unassigned node " +
region.getEncodedName() + " in a CLOSING state")); region.getEncodedName() + " in a CLOSING state"));
RegionTransition rt = RegionTransition.createRegionTransition(EventType.M_ZK_REGION_CLOSING, RegionTransition rt = RegionTransition.createRegionTransition(EventType.M_ZK_REGION_CLOSING,
region.getRegionName(), serverName, HConstants.EMPTY_BYTE_ARRAY); region.getRegionName(), serverName, HConstants.EMPTY_BYTE_ARRAY);
@ -595,7 +595,7 @@ public class ZKAssign {
String encoded = region.getEncodedName(); String encoded = region.getEncodedName();
if(LOG.isDebugEnabled()) { if(LOG.isDebugEnabled()) {
LOG.debug(zkw.prefix("Attempting to retransition the opening state of node " + LOG.debug(zkw.prefix("Attempting to retransition opening state of node " +
HRegionInfo.prettyPrint(encoded))); HRegionInfo.prettyPrint(encoded)));
} }
@ -648,7 +648,7 @@ public class ZKAssign {
return -1; return -1;
} }
if(LOG.isDebugEnabled()) { if(LOG.isDebugEnabled()) {
LOG.debug(zkw.prefix("Successfully retransition the opening state of node " + encoded)); LOG.debug(zkw.prefix("Retransition opening state of node " + encoded));
} }
return stat.getVersion() + 1; return stat.getVersion() + 1;
} catch (KeeperException.NoNodeException nne) { } catch (KeeperException.NoNodeException nne) {
@ -858,7 +858,7 @@ public class ZKAssign {
return -1; return -1;
} }
if(LOG.isDebugEnabled()) { if(LOG.isDebugEnabled()) {
LOG.debug(zkw.prefix("Successfully transitioned node " + encoded + LOG.debug(zkw.prefix("Transitioned node " + encoded +
" from " + beginState + " to " + endState)); " from " + beginState + " to " + endState));
} }
return stat.getVersion() + 1; return stat.getVersion() + 1;

View File

@ -203,8 +203,7 @@ public class Threads {
@Override @Override
public Thread newThread(Runnable r) { public Thread newThread(Runnable r) {
final String name = prefix + "-pool-" + poolNumber + "-thread-" final String name = prefix + "-pool" + poolNumber + "-t" + threadNumber.getAndIncrement();
+ threadNumber.getAndIncrement();
return new Thread(group, r, name); return new Thread(group, r, name);
} }
}; };

View File

@ -136,7 +136,7 @@ public class LruBlockCache implements BlockCache, HeapSize {
private final ScheduledExecutorService scheduleThreadPool = private final ScheduledExecutorService scheduleThreadPool =
Executors.newScheduledThreadPool(1, Executors.newScheduledThreadPool(1,
new ThreadFactoryBuilder() new ThreadFactoryBuilder()
.setNameFormat("LRU Statistics #%d") .setNameFormat("LruStats #%d")
.setDaemon(true) .setDaemon(true)
.build()); .build());
@ -725,8 +725,7 @@ public class LruBlockCache implements BlockCache, HeapSize {
// Log size // Log size
long totalSize = heapSize(); long totalSize = heapSize();
long freeSize = maxSize - totalSize; long freeSize = maxSize - totalSize;
LruBlockCache.LOG.debug("Stats: " + LruBlockCache.LOG.debug("Total=" + StringUtils.byteDesc(totalSize) + ", " +
"total=" + StringUtils.byteDesc(totalSize) + ", " +
"free=" + StringUtils.byteDesc(freeSize) + ", " + "free=" + StringUtils.byteDesc(freeSize) + ", " +
"max=" + StringUtils.byteDesc(this.maxSize) + ", " + "max=" + StringUtils.byteDesc(this.maxSize) + ", " +
"blocks=" + size() +", " + "blocks=" + size() +", " +

View File

@ -1712,8 +1712,7 @@ public class HRegionServer implements ClientProtos.ClientService.BlockingInterfa
MetaEditor.updateRegionLocation(ct, r.getRegionInfo(), MetaEditor.updateRegionLocation(ct, r.getRegionInfo(),
this.serverNameFromMasterPOV, openSeqNum); this.serverNameFromMasterPOV, openSeqNum);
} }
LOG.info("Done with post open deploy task for region=" + LOG.info("Finished post open deploy task for " + r.getRegionNameAsString());
r.getRegionNameAsString());
} }
@ -3628,10 +3627,8 @@ public class HRegionServer implements ClientProtos.ClientService.BlockingInterfa
} }
requestCount.increment(); requestCount.increment();
LOG.info("Received close region: " + encodedRegionName + LOG.info("Close " + encodedRegionName + ", via zk=" + (zk ? "yes" : "no") +
"Transitioning in ZK: " + (zk ? "yes" : "no") + ", znode version=" + versionOfClosingNode + ", on " + sn);
". Version of ZK closing node:" + versionOfClosingNode +
". Destination server:" + sn);
boolean closed = closeRegion(encodedRegionName, false, zk, versionOfClosingNode, sn); boolean closed = closeRegion(encodedRegionName, false, zk, versionOfClosingNode, sn);
CloseRegionResponse.Builder builder = CloseRegionResponse.newBuilder().setClosed(closed); CloseRegionResponse.Builder builder = CloseRegionResponse.newBuilder().setClosed(closed);

View File

@ -165,16 +165,15 @@ public class CloseRegionHandler extends EventHandler {
if (this.zk) { if (this.zk) {
if (setClosedState(this.expectedVersion, region)) { if (setClosedState(this.expectedVersion, region)) {
LOG.debug("set region closed state in zk successfully for region " + LOG.debug("Set closed state in zk for " + name + " on " + this.server.getServerName());
name + " sn name: " + this.server.getServerName());
} else { } else {
LOG.debug("set region closed state in zk unsuccessfully for region " + LOG.debug("Set closed state in zk UNSUCCESSFUL for " + name + " on " +
name + " sn name: " + this.server.getServerName()); this.server.getServerName());
} }
} }
// Done! Region is closed on this RS // Done! Region is closed on this RS
LOG.debug("Closed region " + region.getRegionNameAsString()); LOG.debug("Closed " + region.getRegionNameAsString());
} finally { } finally {
this.rsServices.getRegionsInTransitionInRS(). this.rsServices.getRegionsInTransitionInRS().
remove(this.regionInfo.getEncodedNameAsBytes()); remove(this.regionInfo.getEncodedNameAsBytes());

View File

@ -183,7 +183,7 @@ public class OpenRegionHandler extends EventHandler {
openSuccessful = true; openSuccessful = true;
// Done! Successful region open // Done! Successful region open
LOG.debug("Opened " + regionName + " on server:" + LOG.debug("Opened " + regionName + " on " +
this.server.getServerName()); this.server.getServerName());
@ -370,8 +370,7 @@ public class OpenRegionHandler extends EventHandler {
"so now unassigning -- closing region on server: " + "so now unassigning -- closing region on server: " +
this.server.getServerName()); this.server.getServerName());
} else { } else {
LOG.debug("region transitioned to opened in zookeeper: " + LOG.debug("Transitioned " + r.getEncodedName() + " to OPENED in zk on " + this.server.getServerName());
r.getRegionInfo() + ", server: " + this.server.getServerName());
result = true; result = true;
} }
} catch (KeeperException e) { } catch (KeeperException e) {