Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-9540

Inconsistent BlockManager.putBlock() API definition

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 1.4.0
    • None

    Description

      The BlockManager interface defines API :

        /**
         * Puts or overwrites a block.
         *
         * @param container - Container for which block need to be added.
         * @param data     - Block Data.
         * @param incrKeyCount - Whether to increase container key count.
         * @return length of the Block.
         * @throws IOException
         */
        long putBlock(Container container, BlockData data, boolean incrKeyCount)
            throws IOException;
      

      whereas BlockManagerImpl has:

        /**
         * Puts or overwrites a block.
         *
         * @param container - Container for which block need to be added.
         * @param data - BlockData.
         * @param endOfBlock - The last putBlock call for this block (when
         *                   all the chunks are written and stream is closed)
         * @return length of the block.
         * @throws IOException
         */
        @Override
        public long putBlock(Container container, BlockData data,
            boolean endOfBlock) throws IOException {
      

      That is, the last parameter is inconsistent (incrKeyCount vs. endOfBlock)

      IMO the javadoc in BlockManagerImpl more accurately reflects what it's supposed to do.

      Attachments

        Issue Links

          Activity

            People

              tejaskriya09 Tejaskriya Madhan
              weichiu Wei-Chiu Chuang
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: