Duo Zhang created HBASE-25850: --------------------------------- Summary: Fix spotbugs warnings on branch-2 Key: HBASE-25850 URL: https://issues.apache.org/jira/browse/HBASE-25850 Project: HBase Issue Type: Bug Reporter: Duo Zhang
{noformat} Dodgy code Warnings Code Warning UC Useless condition: it's known that major == true at this point Bug type UC_USELESS_CONDITION (click for details) In class org.apache.hadoop.hbase.mob.DefaultMobStoreCompactor In method org.apache.hadoop.hbase.mob.DefaultMobStoreCompactor.performCompaction(Compactor$FileDetails, InternalScanner, CellSink, long, boolean, ThroughputController, boolean, int) Value major == true Unreachable code at DefaultMobStoreCompactor.java:[line 210] At DefaultMobStoreCompactor.java:[line 210] {noformat} https://github.com/apache/hbase/blob/afa9836b87f9c909ac4fc18d904a5b5b0a3dfff6/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/DefaultMobStoreCompactor.java#L211 {code} if (major) { try { delFileWriter = mobStore.createDelFileWriterInTmp(new Date(fd.latestPutTs), fd.maxKeyCount, major ? majorCompactionCompression : minorCompactionCompression, store.getRegionInfo().getStartKey()); } catch (IOException e) { LOG.warn( "Failed to create del writer, " + "we will continue the compaction by writing delete markers directly in store files", e); } } {code} The 'major ? majorCompactionCompression : minorCompactionCompression' is useless as we have a 'if (major)' test above. -- This message was sent by Atlassian Jira (v8.3.4#803005)