HBASE-14152 Fix the warnings in Checkstyle and FindBugs brought in by merging hbase-11339 (Jingcheng Du)

Signed-off-by: Sean Busbey <busbey@cloudera.com>
This commit is contained in:
ramkrishna 2015-07-28 11:41:41 +05:30 committed by Sean Busbey
parent e36af70835
commit 6b9b7cb8c7
5 changed files with 15 additions and 10 deletions

View File

@ -4217,8 +4217,8 @@ public class HBaseAdmin implements Admin {
HTableDescriptor htd = getTableDescriptor(tableName);
HColumnDescriptor family = htd.getFamily(columnFamily);
if (family == null || !family.isMobEnabled()) {
throw new IllegalArgumentException("Column family " + columnFamily
+ " is not a mob column family");
throw new IllegalArgumentException("Column family " + Bytes.toString(columnFamily)
+ " is not a mob column family");
}
}

View File

@ -3013,9 +3013,7 @@ public final class ProtobufUtil {
// This used to be builder.mergeDelimitedFrom(in);
// but is replaced to allow us to bump the protobuf size limit.
final int firstByte = in.read();
if (firstByte == -1) {
// bail out. (was return false;)
} else {
if (firstByte != -1) {
final int size = CodedInputStream.readRawVarint32(firstByte, in);
final InputStream limitedInput = new LimitInputStream(in, size);
final CodedInputStream codedInput = CodedInputStream.newInstance(limitedInput);

View File

@ -35,6 +35,8 @@ import org.apache.hadoop.hbase.mob.ExpiredMobFileCleaner;
import org.apache.hadoop.hbase.mob.MobConstants;
import org.apache.hadoop.hbase.mob.MobUtils;
import com.google.protobuf.ServiceException;
/**
* The Class ExpiredMobFileCleanerChore for running cleaner regularly to remove the expired
* mob files.
@ -81,8 +83,12 @@ public class ExpiredMobFileCleanerChore extends ScheduledChore {
cleaner.cleanExpiredMobFiles(htd.getTableName().getNameAsString(), hcd);
} catch (LockTimeoutException e) {
LOG.info("Fail to acquire the lock because of timeout, maybe a"
+ " MobFileCompactor is running", e);
} catch (Exception e) {
+ " MobCompactor is running", e);
} catch (ServiceException e) {
LOG.error(
"Fail to clean the expired mob files for the column " + hcd.getNameAsString()
+ " in the table " + htd.getNameAsString(), e);
} catch (IOException e) {
LOG.error(
"Fail to clean the expired mob files for the column " + hcd.getNameAsString()
+ " in the table " + htd.getNameAsString(), e);

View File

@ -96,7 +96,7 @@ public class SweepJob {
public static final String WORKING_FILES_DIR_KEY = "mob.sweep.job.files.dir";
//the MOB_SWEEP_JOB_DELAY is ONE_DAY by default. Its value is only changed when testing.
public static final String MOB_SWEEP_JOB_DELAY = "hbase.mob.sweep.job.delay";
protected static long ONE_DAY = 24 * 60 * 60 * 1000;
protected static final long ONE_DAY = 24 * 60 * 60 * 1000;
private long compactionStartTime = EnvironmentEdgeManager.currentTime();
public final static String CREDENTIALS_LOCATION = "credentials_location";
private CacheConfig cacheConfig;
@ -461,7 +461,7 @@ public class SweepJob {
/**
* A result with index.
*/
private class IndexedResult implements Comparable<IndexedResult> {
private static class IndexedResult implements Comparable<IndexedResult> {
private int index;
private String value;
@ -516,7 +516,7 @@ public class SweepJob {
* It merges and sort the readers in different sequence files as one where
* the results are read in order.
*/
private class MergeSortReader {
private static class MergeSortReader {
private List<SequenceFile.Reader> readers = new ArrayList<SequenceFile.Reader>();
private PriorityQueue<IndexedResult> results = new PriorityQueue<IndexedResult>();

View File

@ -543,6 +543,7 @@ public class HMobStore extends HStore {
return cellsSizeCompactedFromMob;
}
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "VO_VOLATILE_INCREMENT")
public void updateMobFlushCount() {
mobFlushCount++;
}