HBASE-9371 Eliminate log spam when tailing files

HBASE-9326 ServerName is created using getLocalSocketAddress, breaks binding to the wildcard
           address. Revert HBASE-8640


git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1518430 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jean-Daniel Cryans 2013-08-29 00:36:28 +00:00
parent 950a552f77
commit fa40ff3566
3 changed files with 19 additions and 9 deletions

View File

@ -324,7 +324,10 @@ public class HFileSystem extends FilterFileSystem {
// Ok, so it's an HLog
String hostName = sn.getHostname();
LOG.debug(src + " is an HLog file, so reordering blocks, last hostname will be:" + hostName);
if (LOG.isTraceEnabled()) {
LOG.trace(src +
" is an HLog file, so reordering blocks, last hostname will be:" + hostName);
}
// Just check for all blocks
for (LocatedBlock lb : lbs.getLocatedBlocks()) {

View File

@ -400,16 +400,23 @@ MasterServices, Server {
// Disable the block cache on the master
this.conf.setFloat(HConstants.HFILE_BLOCK_CACHE_SIZE_KEY, 0.0f);
// Server to handle client requests.
String hostname = conf.get("hbase.master.ipc.address",
Strings.domainNamePointerToHostName(DNS.getDefaultHost(
conf.get("hbase.master.dns.interface", "default"),
conf.get("hbase.master.dns.nameserver", "default"))));
String hostname = Strings.domainNamePointerToHostName(DNS.getDefaultHost(
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);
// Test that the hostname is reachable
InetSocketAddress initialIsa = new InetSocketAddress(hostname, port);
if (initialIsa.getAddress() == null) {
throw new IllegalArgumentException("Failed resolve of hostname " + initialIsa);
}
// Verify that the bind address is reachable if set
String bindAddress = conf.get("hbase.master.ipc.address");
if (bindAddress != null) {
initialIsa = new InetSocketAddress(bindAddress, port);
if (initialIsa.getAddress() == null) {
throw new IllegalArgumentException("Failed resolve of bind address " + initialIsa);
}
}
String name = "master/" + initialIsa.toString();
// Set how many times to retry talking to another server over HConnection.
HConnectionManager.setServerSideHConnectionRetries(this.conf, name, LOG);
@ -428,8 +435,8 @@ MasterServices, Server {
scheduler);
// Set our address.
this.isa = this.rpcServer.getListenerAddress();
this.serverName =
new ServerName(this.isa.getHostName(), this.isa.getPort(), System.currentTimeMillis());
// We don't want to pass isa's hostname here since it could be 0.0.0.0
this.serverName = new ServerName(hostname, this.isa.getPort(), System.currentTimeMillis());
this.rsFatals = new MemoryBoundedLogMessageBuffer(
conf.getLong("hbase.master.buffer.for.rs.fatals", 1*1024*1024));

View File

@ -114,8 +114,8 @@ public class ProtobufLogReader extends ReaderBase {
long currentPosition = stream.getPos();
trailerPresent = setTrailerIfPresent();
this.seekOnFs(currentPosition);
if (LOG.isDebugEnabled()) {
LOG.debug("After reading the trailer: walEditsStopOffset: " + this.walEditsStopOffset
if (LOG.isTraceEnabled()) {
LOG.trace("After reading the trailer: walEditsStopOffset: " + this.walEditsStopOffset
+ ", fileLength: " + this.fileLength + ", " + "trailerPresent: " + trailerPresent);
}
}