You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Duo Zhang (Jira)" <ji...@apache.org> on 2021/05/07 01:29:00 UTC
[jira] [Commented] (HBASE-25850) Fix spotbugs warnings on branch-2
[ https://issues.apache.org/jira/browse/HBASE-25850?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17340497#comment-17340497 ]
Duo Zhang commented on HBASE-25850:
-----------------------------------
Any updates here?
Thanks.
> Fix spotbugs warnings on branch-2
> ---------------------------------
>
> Key: HBASE-25850
> URL: https://issues.apache.org/jira/browse/HBASE-25850
> Project: HBase
> Issue Type: Bug
> Components: Compaction, findbugs, mob
> Reporter: Duo Zhang
> Assignee: Xiao Zhang
> Priority: Major
> Labels: beginner, trivial
>
> {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)