drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paul-rogers <...@git.apache.org>
Subject [GitHub] drill pull request #611: Drill-4800: Improve parquet reader performance
Date Fri, 04 Nov 2016 17:13:08 GMT
Github user paul-rogers commented on a diff in the pull request:

    https://github.com/apache/drill/pull/611#discussion_r86586981
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/columnreaders/ParquetRecordReader.java
---
    @@ -417,12 +420,37 @@ private void resetBatch() {
       }
     
      public void readAllFixedFields(long recordsToRead) throws IOException {
    -
    -   for (ColumnReader<?> crs : columnStatuses) {
    -     crs.processPages(recordsToRead);
    +   boolean useAsyncColReader =
    +       fragmentContext.getOptions().getOption(ExecConstants.PARQUET_COLUMNREADER_ASYNC).bool_val;
    +   if(useAsyncColReader){
    +    readAllFixedFieldsParallel(recordsToRead) ;
    +   } else {
    +     readAllFixedFieldsiSerial(recordsToRead); ;
        }
      }
     
    +  public void readAllFixedFieldsiSerial(long recordsToRead) throws IOException {
    +    for (ColumnReader<?> crs : columnStatuses) {
    +      crs.processPages(recordsToRead);
    +    }
    +  }
    +
    +  public void readAllFixedFieldsParallel(long recordsToRead) throws IOException {
    +    ArrayList<Future<Long>> futures = Lists.newArrayList();
    +    for (ColumnReader<?> crs : columnStatuses) {
    +      Future<Long> f = crs.processPagesAsync(recordsToRead);
    +      futures.add(f);
    +    }
    +    for(Future f: futures){
    +      try {
    +        f.get();
    +      } catch (Exception e) {
    +        f.cancel(true);
    +        handleAndRaise(null, e);
    --- End diff --
    
    If one future fails, does this mean the parallel reader failed? If we throw an exception
for one future, do the other parallel readers continue? Or, should we cancel all parallel
readers if one fails? At least wait for the others to complete before throwing the exception?


---
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