diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/JMXListener.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/JMXListener.java index 7a1ea11..6a115ba 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/JMXListener.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/JMXListener.java @@ -51,7 +51,7 @@ public class JMXListener implements Coprocessor { public static final Log LOG = LogFactory.getLog(JMXListener.class); public static final String RMI_REGISTRY_PORT_CONF_KEY = ".rmi.registry.port"; public static final String RMI_CONNECTOR_PORT_CONF_KEY = ".rmi.connector.port"; - public static int defRMIRegistryPort = 10102; + public static final int defRMIRegistryPort = 10102; /** * workaround for HBASE-11146 diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/coordination/ZKSplitLogManagerCoordination.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/coordination/ZKSplitLogManagerCoordination.java index 0fb5c59..0f8baa3 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/coordination/ZKSplitLogManagerCoordination.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/coordination/ZKSplitLogManagerCoordination.java @@ -98,8 +98,6 @@ public class ZKSplitLogManagerCoordination extends ZooKeeperListener implements SplitLogManagerDetails details; - private final Stoppable stopper = null; - // When lastRecoveringNodeCreationTime is older than the following threshold, we'll check // whether to GC stale recovering znodes private volatile long lastRecoveringNodeCreationTime = 0; @@ -669,7 +667,7 @@ public class ZKSplitLogManagerCoordination extends ZooKeeperListener implements } catch (InterruptedException e) { throw new InterruptedIOException(); } - } while ((--retries) > 0 && (!this.stopper.isStopped())); + } while ((--retries) > 0); } } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java index 7f3d80f..cd3d78f 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java @@ -84,6 +84,8 @@ import com.google.common.base.Preconditions; * */ @InterfaceAudience.Private +@edu.umd.cs.findbugs.annotations.SuppressWarnings(value="HE_EQUALS_USE_HASHCODE", + justification="Not enough info in this context to come up with a good hashcode -- FIX") public class HFileBlock implements Cacheable { /** diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java index e3654cb..8128580 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java @@ -146,7 +146,7 @@ import com.google.protobuf.TextFormat; * and keep taking while the server is up. * * CallRunner#run executes the call. When done, asks the included Call to put itself on new - * queue for {@link Responder} to pull from and return result to client. + * queue for Responder to pull from and return result to client. * * @see RpcClient */ @@ -292,11 +292,10 @@ public class RpcServer implements RpcServerInterface { protected boolean isError; protected TraceInfo tinfo; - Call(int id, final BlockingService service, final MethodDescriptor md, RequestHeader header, + Call(int id, final MethodDescriptor md, RequestHeader header, Message param, CellScanner cellScanner, Connection connection, Responder responder, long size, TraceInfo tinfo) { this.id = id; - this.service = service; this.md = md; this.header = header; this.param = param; @@ -1160,13 +1159,13 @@ public class RpcServer implements RpcServerInterface { // Fake 'call' for failed authorization response private static final int AUTHORIZATION_FAILED_CALLID = -1; private final Call authFailedCall = - new Call(AUTHORIZATION_FAILED_CALLID, null, null, null, null, null, this, null, 0, null); + new Call(AUTHORIZATION_FAILED_CALLID, null, null, null, null, this, null, 0, null); private ByteArrayOutputStream authFailedResponse = new ByteArrayOutputStream(); // Fake 'call' for SASL context setup private static final int SASL_CALLID = -33; private final Call saslCall = - new Call(SASL_CALLID, this.service, null, null, null, null, this, null, 0, null); + new Call(SASL_CALLID, null, null, null, null, this, null, 0, null); public UserGroupInformation attemptingUser = null; // user name before auth @@ -1555,7 +1554,7 @@ public class RpcServer implements RpcServerInterface { private int doBadPreambleHandling(final String msg, final Exception e) throws IOException { LOG.warn(msg); - Call fakeCall = new Call(-1, null, null, null, null, null, this, responder, -1, null); + Call fakeCall = new Call(-1, null, null, null, null, this, responder, -1, null); setupResponse(null, fakeCall, e, msg); responder.doRespond(fakeCall); // Returning -1 closes out the connection. @@ -1705,8 +1704,7 @@ public class RpcServer implements RpcServerInterface { // This is a bit late to be doing this check - we have already read in the total request. if ((totalRequestSize + callQueueSize.get()) > maxQueueSize) { final Call callTooBig = - new Call(id, this.service, null, null, null, null, this, - responder, totalRequestSize, null); + new Call(id, null, null, null, null, this, responder, totalRequestSize, null); ByteArrayOutputStream responseBuffer = new ByteArrayOutputStream(); setupResponse(responseBuffer, callTooBig, new CallQueueTooBigException(), "Call queue is full, is hbase.ipc.server.max.callqueue.size too small?"); @@ -1748,8 +1746,7 @@ public class RpcServer implements RpcServerInterface { } final Call readParamsFailedCall = - new Call(id, this.service, null, null, null, null, this, - responder, totalRequestSize, null); + new Call(id, null, null, null, null, this, responder, totalRequestSize, null); ByteArrayOutputStream responseBuffer = new ByteArrayOutputStream(); setupResponse(responseBuffer, readParamsFailedCall, t, msg + "; " + t.getMessage()); @@ -1760,7 +1757,7 @@ public class RpcServer implements RpcServerInterface { TraceInfo traceInfo = header.hasTraceInfo() ? new TraceInfo(header.getTraceInfo().getTraceId(), header.getTraceInfo().getParentId()) : null; - Call call = new Call(id, this.service, md, header, param, cellScanner, this, responder, + Call call = new Call(id, md, header, param, cellScanner, this, responder, totalRequestSize, traceInfo); scheduler.dispatch(new CallRunner(RpcServer.this, call, userProvider)); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java index a5e110b..0a2d7b0 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java @@ -526,7 +526,7 @@ public abstract class BaseLoadBalancer implements LoadBalancer { @edu.umd.cs.findbugs.annotations.SuppressWarnings(value="NM_FIELD_NAMING_CONVENTION", justification="Mistake. Too disruptive to change now") - public static Action NullAction = new Action(Type.NULL); + public static final Action NullAction = new Action(Type.NULL); public void doAction(Action action) { switch (action.type) { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaCache.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaCache.java index b67dc68..c44a737 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaCache.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaCache.java @@ -209,6 +209,8 @@ public class QuotaCache implements Stoppable { } @Override + @edu.umd.cs.findbugs.annotations.SuppressWarnings(value="GC_UNRELATED_TYPES", + justification="I do not understand why the complaints, it looks good to me -- FIX") protected void chore() { // Prefetch online tables/namespaces for (TableName table: QuotaCache.this.rsServices.getOnlineTables()) { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DelimitedKeyPrefixRegionSplitPolicy.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DelimitedKeyPrefixRegionSplitPolicy.java index da3056c..36e7929 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DelimitedKeyPrefixRegionSplitPolicy.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DelimitedKeyPrefixRegionSplitPolicy.java @@ -50,20 +50,14 @@ public class DelimitedKeyPrefixRegionSplitPolicy extends IncreasingToUpperBoundR @Override protected void configureForRegion(HRegion region) { super.configureForRegion(region); - if (region != null) { - - // read the prefix length from the table descriptor - String delimiterString = region.getTableDesc().getValue( - DELIMITER_KEY); - if (delimiterString == null || delimiterString.length() == 0) { - LOG.error(DELIMITER_KEY + " not specified for table " - + region.getTableDesc().getTableName() - + ". Using default RegionSplitPolicy"); - return; - } - - delimiter = Bytes.toBytes(delimiterString); + // read the prefix length from the table descriptor + String delimiterString = region.getTableDesc().getValue(DELIMITER_KEY); + if (delimiterString == null || delimiterString.length() == 0) { + LOG.error(DELIMITER_KEY + " not specified for table " + region.getTableDesc().getTableName() + + ". Using default RegionSplitPolicy"); + return; } + delimiter = Bytes.toBytes(delimiterString); } @Override @@ -85,4 +79,4 @@ public class DelimitedKeyPrefixRegionSplitPolicy extends IncreasingToUpperBoundR return splitPoint; } } -} +} \ No newline at end of file diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyPrefixRegionSplitPolicy.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyPrefixRegionSplitPolicy.java index dd6afd2..b987a88 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyPrefixRegionSplitPolicy.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyPrefixRegionSplitPolicy.java @@ -43,36 +43,34 @@ public class KeyPrefixRegionSplitPolicy extends IncreasingToUpperBoundRegionSpli @Override protected void configureForRegion(HRegion region) { super.configureForRegion(region); - if (region != null) { - prefixLength = 0; + prefixLength = 0; - // read the prefix length from the table descriptor - String prefixLengthString = region.getTableDesc().getValue( - PREFIX_LENGTH_KEY); + // read the prefix length from the table descriptor + String prefixLengthString = region.getTableDesc().getValue( + PREFIX_LENGTH_KEY); + if (prefixLengthString == null) { + //read the deprecated value + prefixLengthString = region.getTableDesc().getValue(PREFIX_LENGTH_KEY_DEPRECATED); if (prefixLengthString == null) { - //read the deprecated value - prefixLengthString = region.getTableDesc().getValue(PREFIX_LENGTH_KEY_DEPRECATED); - if (prefixLengthString == null) { - LOG.error(PREFIX_LENGTH_KEY + " not specified for table " - + region.getTableDesc().getTableName() - + ". Using default RegionSplitPolicy"); - return; - } - } - try { - prefixLength = Integer.parseInt(prefixLengthString); - } catch (NumberFormatException nfe) { - /* Differentiate NumberFormatException from an invalid value range reported below. */ - LOG.error("Number format exception when parsing " + PREFIX_LENGTH_KEY + " for table " - + region.getTableDesc().getTableName() + ":" - + prefixLengthString + ". " + nfe); + LOG.error(PREFIX_LENGTH_KEY + " not specified for table " + + region.getTableDesc().getTableName() + + ". Using default RegionSplitPolicy"); return; } - if (prefixLength <= 0) { - LOG.error("Invalid value for " + PREFIX_LENGTH_KEY + " for table " - + region.getTableDesc().getTableName() + ":" - + prefixLengthString + ". Using default RegionSplitPolicy"); - } + } + try { + prefixLength = Integer.parseInt(prefixLengthString); + } catch (NumberFormatException nfe) { + /* Differentiate NumberFormatException from an invalid value range reported below. */ + LOG.error("Number format exception when parsing " + PREFIX_LENGTH_KEY + " for table " + + region.getTableDesc().getTableName() + ":" + + prefixLengthString + ". " + nfe); + return; + } + if (prefixLength <= 0) { + LOG.error("Invalid value for " + PREFIX_LENGTH_KEY + " for table " + + region.getTableDesc().getTableName() + ":" + + prefixLengthString + ". Using default RegionSplitPolicy"); } } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLogSplitter.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLogSplitter.java index dc46ff1..1f81874 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLogSplitter.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLogSplitter.java @@ -2048,9 +2048,7 @@ public class HLogSplitter { } ((Put) m).add(tmpNewCell); } - if (m != null) { - m.setDurability(durability); - } + m.setDurability(durability); previousCell = cell; } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/MultiHConnection.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/MultiHConnection.java index 1dc9c31..81678aa 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/MultiHConnection.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/MultiHConnection.java @@ -77,20 +77,18 @@ public class MultiHConnection { public void close() { synchronized (hConnectionsLock) { if (hConnections != null) { - if (hConnections != null) { - for (Connection conn : hConnections) { - if (conn != null) { - try { - conn.close(); - } catch (IOException e) { - LOG.info("Got exception in closing connection", e); - } finally { - conn = null; - } + for (Connection conn : hConnections) { + if (conn != null) { + try { + conn.close(); + } catch (IOException e) { + LOG.info("Got exception in closing connection", e); + } finally { + conn = null; } } - hConnections = null; } + hConnections = null; } } if (this.batchPool != null && !this.batchPool.isShutdown()) { diff --git a/pom.xml b/pom.xml index c4e5b66..071b41c 100644 --- a/pom.xml +++ b/pom.xml @@ -416,16 +416,6 @@ org.apache.maven.plugins maven-release-plugin - 2.4.1 - + org.apache.maven.plugins maven-surefire-plugin ${surefire.version} @@ -514,10 +506,12 @@ + org.apache.maven.plugins maven-surefire-report-plugin ${surefire.version} + org.apache.maven.plugins maven-clean-plugin @@ -532,7 +526,6 @@ org.codehaus.mojo findbugs-maven-plugin - ${findbugs-maven-plugin.version} ${project.basedir}/../dev-support/findbugs-exclude.xml true @@ -543,7 +536,6 @@ org.codehaus.mojo build-helper-maven-plugin - 1.5 maven-antrun-plugin @@ -599,7 +591,6 @@ org.apache.maven.plugins maven-eclipse-plugin - 2.8 org.apache.rat apache-rat-plugin - 0.8 + 0.11 **/*.versionsBackup @@ -843,7 +834,6 @@ org.apache.maven.plugins maven-resources-plugin - ${maven.resources.plugin.version} false @@ -891,7 +881,6 @@ org.apache.maven.plugins maven-site-plugin - ${maven.site.version} false @@ -983,11 +972,8 @@ 2.4 1.6 2.3.4 - 2.5.2 1.3.9-1 - 3.3 2.9 - 2.6 /usr /etc/hbase