wgtmac commented on code in PR #1916:
URL: https://github.com/apache/orc/pull/1916#discussion_r1582575405


##########
c++/src/BlockBuffer.hh:
##########
@@ -106,18 +106,39 @@ namespace orc {
     }
 
     void resize(uint64_t size);
+
+    uint64_t getBlockSize(uint64_t blockId) const;

Review Comment:
   Please add some comments



##########
c++/src/BlockBuffer.hh:
##########
@@ -106,18 +106,39 @@ namespace orc {
     }
 
     void resize(uint64_t size);
+
+    uint64_t getBlockSize(uint64_t blockId) const;
+
     /**
      * Requests the BlockBuffer to contain at least newCapacity bytes.
      * Reallocation happens if there is need of more space.
      * @param newCapacity new capacity of BlockBuffer
      */
     void reserve(uint64_t newCapacity);
+
     /**
      * Write the BlockBuffer content into OutputStream
      * @param output the output stream to write to
      * @param metrics the metrics of the writer
      */
     void writeTo(OutputStream* output, WriterMetrics* metrics);
+
+    /**
+     * Get the block data by block index
+     * @param blockIndex the index of blocks
+     * @param data the pointer to the block data
+     * @param size the size of the block data
+     * @return true if the block data is successfully retrieved
+     */
+    bool getBlockData(uint64_t blockIndex, void** data, uint64_t* size) const; 
 // add ut
+
+    /**
+     * Get next availiable memory block
+     * @param data the pointer to the block data
+     * @param size the size of the block data
+     * @return true if the block data is successfully retrieved
+     */
+    bool requestBuffer(void** buffer, int* size);  // add ut

Review Comment:
   Isn't `Block getNextBlock();` at line 91 doing the same thing?



##########
c++/src/BlockBuffer.hh:
##########
@@ -106,18 +106,39 @@ namespace orc {
     }
 
     void resize(uint64_t size);
+
+    uint64_t getBlockSize(uint64_t blockId) const;
+
     /**
      * Requests the BlockBuffer to contain at least newCapacity bytes.
      * Reallocation happens if there is need of more space.
      * @param newCapacity new capacity of BlockBuffer
      */
     void reserve(uint64_t newCapacity);
+
     /**
      * Write the BlockBuffer content into OutputStream
      * @param output the output stream to write to
      * @param metrics the metrics of the writer
      */
     void writeTo(OutputStream* output, WriterMetrics* metrics);
+
+    /**
+     * Get the block data by block index
+     * @param blockIndex the index of blocks
+     * @param data the pointer to the block data
+     * @param size the size of the block data
+     * @return true if the block data is successfully retrieved
+     */
+    bool getBlockData(uint64_t blockIndex, void** data, uint64_t* size) const; 
 // add ut

Review Comment:
   Isn't `Block getBlock(uint64_t blockIndex) const;` at line 81 doing the same 
job?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to