HBASE-5439 Fix some performance findbugs issues (Gregory Chanan)
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1292141 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
953d89e3a9
commit
0f708f7370
|
@ -111,9 +111,9 @@ public class SlabCache implements SlabItemActionWatcher, BlockCache, HeapSize {
|
|||
// 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(
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -106,7 +106,7 @@ public class DefaultLoadBalancer implements LoadBalancer {
|
|||
* 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();
|
||||
|
|
|
@ -608,7 +608,7 @@ public class SplitLogManager extends ZooKeeperListener {
|
|||
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) {
|
||||
|
|
|
@ -91,13 +91,13 @@ public class SequenceFileLogWriter implements HLog.Writer {
|
|||
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()
|
||||
});
|
||||
|
|
|
@ -743,7 +743,7 @@ public class MasterSchemaChangeTracker extends ZooKeeperNodeTracker {
|
|||
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 = "
|
||||
|
|
Loading…
Reference in New Issue