drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jaltekruse <...@git.apache.org>
Subject [GitHub] drill pull request: DRILL-3313: Eliminate redundant #load methods ...
Date Wed, 29 Jul 2015 20:49:59 GMT
Github user jaltekruse commented on a diff in the pull request:

    https://github.com/apache/drill/pull/81#discussion_r35810016
  
    --- Diff: exec/java-exec/src/main/codegen/templates/NullableValueVectors.java ---
    @@ -239,37 +183,30 @@ public void allocateNew(int valueCount) {
         accessor.reset();
       }
     
    -  /**
    -   * {@inheritDoc}
    -   */
    +  @Override
       public void zeroVector() {
    -    this.values.zeroVector();
    -    this.bits.zeroVector();
    +    bits.zeroVector();
    +    values.zeroVector();
       }
    +  </#if>
     
    -  @Override
    -  public int load(int valueCount, DrillBuf buf){
    -    clear();
    -    int loaded = bits.load(valueCount, buf);
    -
    -    // remove bits part of buffer.
    -    buf = buf.slice(loaded, buf.capacity() - loaded);
    -    loaded += values.load(valueCount, buf);
    -    return loaded;
    -  }
     
       @Override
       public void load(SerializedField metadata, DrillBuf buffer) {
    -    assert this.field.matches(metadata);
    -    int loaded = load(metadata.getValueCount(), buffer);
    -    assert metadata.getBufferLength() == loaded;
    -  }
    +    clear();
    +    final SerializedField bitsField = metadata.getChild(0);
    --- End diff --
    
    I understand previously we weren't storing any metadata for the bit vector, but I think
this addition could be a little clearer by at least commenting that these indexes are based
on the order of the calls in getMetadataBuilder(). It would probably be worth it to add a
comment up on the method itself that these additions are order sensitive.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message