[ 
https://issues.apache.org/jira/browse/DRILL-4134?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15034138#comment-15034138
 ] 

ASF GitHub Bot commented on DRILL-4134:
---------------------------------------

Github user julienledem commented on a diff in the pull request:

    https://github.com/apache/drill/pull/283#discussion_r46309770
  
    --- Diff: exec/memory/base/src/main/java/io/netty/buffer/DrillBuf.java ---
    @@ -733,17 +790,98 @@ public byte getByte(int index) {
         return PlatformDependent.getByte(addr(index));
       }
     
    -  public static DrillBuf getEmpty(BufferAllocator allocator, Accountor a) {
    -    return new DrillBuf(allocator, a);
    +  @Override
    +  public void close() {
    +    release();
       }
     
    -  public boolean isRootBuffer() {
    -    return rootBuffer;
    +  /**
    +   * Returns the possible memory consumed by this DrillBuf in the worse 
case scenario. (not shared, connected to larger
    +   * underlying buffer of allocated memory)
    +   *
    +   * @return Size in bytes.
    +   */
    +  public int getPossibleMemoryConsumed() {
    +    return ledger.getSize();
       }
     
    -  @Override
    -  public void close() {
    -    release();
    +  /**
    +   * Return that is Accounted for by this buffer (and its potentially 
shared siblings within the context of the
    +   * associated allocator).
    +   *
    +   * @return Size in bytes.
    +   */
    +  public int getActualMemoryConsumed() {
    +    return ledger.getAccountedSize();
    +  }
    +
    +  private final static int LOG_BYTES_PER_ROW = 10;
    +  /**
    +   * Log this buffer's byte contents in the form of a hex dump.
    +   *
    +   * @param logger where to log to
    +   * @param start the starting byte index
    +   * @param length how many bytes to log
    +   */
    +  public void logBytes(final Logger logger, final int start, final int 
length) {
    --- End diff --
    
    should this just be ```toString(start, length)``` leaving logging to the 
caller?


> Incorporate remaining patches from DRILL-1942 Allocator refactor
> ----------------------------------------------------------------
>
>                 Key: DRILL-4134
>                 URL: https://issues.apache.org/jira/browse/DRILL-4134
>             Project: Apache Drill
>          Issue Type: Sub-task
>          Components: Execution - Flow
>            Reporter: Jacques Nadeau
>            Assignee: Jacques Nadeau
>             Fix For: 1.4.0
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to