hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From la...@apache.org
Subject svn commit: r1292141 - in /hbase/trunk/src/main/java/org/apache/hadoop/hbase: io/hfile/slab/ mapreduce/ master/ regionserver/wal/ zookeeper/
Date Wed, 22 Feb 2012 07:00:45 GMT
Author: larsh
Date: Wed Feb 22 07:00:44 2012
New Revision: 1292141

URL: http://svn.apache.org/viewvc?rev=1292141&view=rev
Log:
HBASE-5439 Fix some performance findbugs issues (Gregory Chanan)

Modified:
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/io/hfile/slab/SlabCache.java
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/mapreduce/ImportTsv.java
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/DefaultLoadBalancer.java
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/wal/SequenceFileLogWriter.java
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/zookeeper/MasterSchemaChangeTracker.java

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/io/hfile/slab/SlabCache.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/io/hfile/slab/SlabCache.java?rev=1292141&r1=1292140&r2=1292141&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/io/hfile/slab/SlabCache.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/io/hfile/slab/SlabCache.java Wed Feb
22 07:00:44 2012
@@ -111,9 +111,9 @@ public class SlabCache implements SlabIt
     // Proportions we allocate to each slab of the total size.
     String[] porportions = conf.getStrings(
         "hbase.offheapcache.slab.proportions", "0.80", "0.20");
-    String[] sizes = conf.getStrings("hbase.offheapcache.slab.sizes", new Long(
-        avgBlockSize * 11 / 10).toString(), new Long(avgBlockSize * 21 / 10)
-        .toString());
+    String[] sizes = conf.getStrings("hbase.offheapcache.slab.sizes",
+        Long.valueOf(avgBlockSize * 11 / 10).toString(),
+        Long.valueOf(avgBlockSize * 21 / 10).toString());
 
     if (porportions.length != sizes.length) {
       throw new IllegalArgumentException(

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/mapreduce/ImportTsv.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/mapreduce/ImportTsv.java?rev=1292141&r1=1292140&r2=1292141&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/mapreduce/ImportTsv.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/mapreduce/ImportTsv.java Wed Feb 22
07:00:44 2012
@@ -198,8 +198,8 @@ public class ImportTsv {
     // by re-encoding the passed separator as a Base64 string.
     String actualSeparator = conf.get(SEPARATOR_CONF_KEY);
     if (actualSeparator != null) {
-      conf.set(SEPARATOR_CONF_KEY, new String(
-      Base64.encodeBytes(actualSeparator.getBytes())));
+      conf.set(SEPARATOR_CONF_KEY,
+               Base64.encodeBytes(actualSeparator.getBytes()));
     }
 
     // See if a non-default Mapper was set

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/DefaultLoadBalancer.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/DefaultLoadBalancer.java?rev=1292141&r1=1292140&r2=1292141&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/DefaultLoadBalancer.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/DefaultLoadBalancer.java Wed
Feb 22 07:00:44 2012
@@ -106,7 +106,7 @@ public class DefaultLoadBalancer impleme
   * regions which were assigned to the server after some other region server
   * crashed.
   */
-   private class RegionInfoComparator implements Comparator<HRegionInfo> {
+   private static class RegionInfoComparator implements Comparator<HRegionInfo> {
        @Override
        public int compare(HRegionInfo l, HRegionInfo r) {
           long diff = r.getRegionId() - l.getRegionId();

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java?rev=1292141&r1=1292140&r2=1292141&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java Wed Feb
22 07:00:44 2012
@@ -608,7 +608,7 @@ public class SplitLogManager extends Zoo
       create(ZKSplitLog.getRescanNode(watcher),
         TaskState.TASK_DONE.get(serverName), Ids.OPEN_ACL_UNSAFE,
         CreateMode.EPHEMERAL_SEQUENTIAL,
-        new CreateRescanAsyncCallback(), new Long(retries));
+        new CreateRescanAsyncCallback(), Long.valueOf(retries));
   }
 
   private void createRescanSuccess(String path) {

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/wal/SequenceFileLogWriter.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/wal/SequenceFileLogWriter.java?rev=1292141&r1=1292140&r2=1292141&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/wal/SequenceFileLogWriter.java
(original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/wal/SequenceFileLogWriter.java
Wed Feb 22 07:00:44 2012
@@ -91,13 +91,13 @@ public class SequenceFileLogWriter imple
             CompressionType.class, CompressionCodec.class, Metadata.class})
         .invoke(null, new Object[] {fs, conf, path, HLog.getKeyClass(conf),
             WALEdit.class,
-            new Integer(fs.getConf().getInt("io.file.buffer.size", 4096)),
-            new Short((short)
+            Integer.valueOf(fs.getConf().getInt("io.file.buffer.size", 4096)),
+            Short.valueOf((short)
               conf.getInt("hbase.regionserver.hlog.replication",
               fs.getDefaultReplication())),
-            new Long(conf.getLong("hbase.regionserver.hlog.blocksize",
+            Long.valueOf(conf.getLong("hbase.regionserver.hlog.blocksize",
                 fs.getDefaultBlockSize())),
-            new Boolean(false) /*createParent*/,
+            Boolean.valueOf(false) /*createParent*/,
             SequenceFile.CompressionType.NONE, new DefaultCodec(),
             new Metadata()
             });

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/zookeeper/MasterSchemaChangeTracker.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/zookeeper/MasterSchemaChangeTracker.java?rev=1292141&r1=1292140&r2=1292141&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/zookeeper/MasterSchemaChangeTracker.java
(original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/zookeeper/MasterSchemaChangeTracker.java
Wed Feb 22 07:00:44 2012
@@ -743,7 +743,7 @@ public class MasterSchemaChangeTracker e
       LOG.debug("Removing RS " + schemaAlterStatus.getHostName()
           + " from schema change process.");
       hostsToProcess =
-          new String(hostsToProcess).replaceAll(schemaAlterStatus.getHostName(), "");
+          hostsToProcess.replaceAll(schemaAlterStatus.getHostName(), "");
       int ignoreRegionsCount = schemaAlterStatus.getNumberOfOnlineRegions();
       LOG.debug("Current number of regions processed = "
           + this.numberOfRegionsProcessed + " deducting ignored = "



Mime
View raw message