Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-25850

Fix spotbugs warnings on branch-2

Log workAgile BoardRank to TopRank to BottomAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Reviewed

    Description

      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]
      

      https://github.com/apache/hbase/blob/afa9836b87f9c909ac4fc18d904a5b5b0a3dfff6/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/DefaultMobStoreCompactor.java#L211

            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);
              }
            }
      

      The 'major ? majorCompactionCompression : minorCompactionCompression' is useless as we have a 'if (major)' test above.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            xiaozhang Xiao Zhang Assign to me
            zhangduo Duo Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment