Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-16709

Remove redundant cast in FSEditLogOp.class

    XMLWordPrintableJSON

Details

    • Reviewed

    Description

      When I read some class about Edits of NameNode, I found that there are much redundant cast inĀ FSEditLogOp.class, I feel that we should remove them.

      Such as:

      static UpdateBlocksOp getInstance(OpInstanceCache cache) {
        return (UpdateBlocksOp)cache.get(OP_UPDATE_BLOCKS);
      } 

      Because cache.get() have cast the response to T, such as:

      @SuppressWarnings("unchecked")
      public <T extends FSEditLogOp> T get(FSEditLogOpCodes opCode) {
        return useCache ? (T)CACHE.get().get(opCode) : (T)newInstance(opCode);
      } 

      Attachments

        Issue Links

          Activity

            People

              xuzq_zander ZanderXu
              xuzq_zander ZanderXu
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m