HBASE-2140 findbugs issues - 2 performance warnings as suggested by findbugs

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@900208 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2010-01-17 20:08:59 +00:00
parent b2da74b0ac
commit 8bc2888278
3 changed files with 7 additions and 4 deletions

View File

@ -175,6 +175,8 @@ Release 0.21.0 - Unreleased
HBASE-2135 ant javadoc complains about missing classe (Kay Kay via Stack)
HBASE-2130 bin/* scripts - not to include lib/test/**/*.jar
(Kay Kay via Stack)
HBASE-2140 findbugs issues - 2 performance warnings as suggested by findbugs
(Kay Kay via Stack)
IMPROVEMENTS
HBASE-1760 Cleanup TODOs in HTable

View File

@ -136,8 +136,9 @@ public class Scan implements Writable {
TimeRange ctr = scan.getTimeRange();
tr = new TimeRange(ctr.getMin(), ctr.getMax());
Map<byte[], NavigableSet<byte[]>> fams = scan.getFamilyMap();
for (byte[] fam : fams.keySet()) {
NavigableSet<byte[]> cols = fams.get(fam);
for (Map.Entry<byte[],NavigableSet<byte[]>> entry : fams.entrySet()) {
byte [] fam = entry.getKey();
NavigableSet<byte[]> cols = entry.getValue();
if (cols != null && cols.size() > 0) {
for (byte[] col : cols) {
addColumn(fam, col);

View File

@ -446,11 +446,11 @@ public class FSUtils {
}
}
// compute percentage per table and store in result list
frags.put(d.getName(), new Integer(
frags.put(d.getName(), Integer.valueOf(
Math.round((float) cfFrag / cfCount * 100)));
}
// set overall percentage for all tables
frags.put("-TOTAL-", new Integer(
frags.put("-TOTAL-", Integer.valueOf(
Math.round((float) cfFragTotal / cfCountTotal * 100)));
return frags;
}