Skip to content

Commit

Permalink
Fix the warnings in Checkstyle and FindBugs brought in by merging
Browse files Browse the repository at this point in the history
hbase-11339 (Jingcheng Du)
  • Loading branch information
ramkrish86 committed Jul 28, 2015
1 parent 1566ec5 commit 89d0409
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4217,8 +4217,8 @@ private void validateMobColumnFamily(TableName tableName, byte[] columnFamily)
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");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3013,9 +3013,7 @@ public static void mergeDelimitedFrom(Message.Builder builder, InputStream in)
// 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
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.
Expand Down Expand Up @@ -81,8 +83,12 @@ protected void chore() {
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -461,7 +461,7 @@ private void cleanup(Job job, TableName tn, String familyName) {
/**
* A result with index.
*/
private class IndexedResult implements Comparable<IndexedResult> {
private static class IndexedResult implements Comparable<IndexedResult> {
private int index;
private String value;

Expand Down Expand Up @@ -516,7 +516,7 @@ public int hashCode() {
* 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>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ public long getCellsSizeCompactedFromMob() {
return cellsSizeCompactedFromMob;
}

@edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "VO_VOLATILE_INCREMENT")
public void updateMobFlushCount() {
mobFlushCount++;
}
Expand Down

0 comments on commit 89d0409

Please sign in to comment.