carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ravipesala <...@git.apache.org>
Subject [GitHub] carbondata pull request #1019: [CARBONDATA-1156]Improve IUD performance and ...
Date Mon, 12 Jun 2017 13:25:32 GMT
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1019#discussion_r121390830
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/reader/CarbonDeleteFilesDataReader.java
---
    @@ -120,7 +122,53 @@ private void initThreadPoolSize() {
           }
         }
         return pageIdDeleteRowsMap;
    +  }
     
    +  /**
    +   * Below method will be used to read the delete delta files
    +   * and get the map of blockletid and page id mapping to deleted
    +   * rows
    +   *
    +   * @param deltaFiles delete delta files array
    +   * @return map of blockletid_pageid to deleted rows
    +   */
    +  public Map<String, DeleteDeltaVo> getDeletedRowsDataVo(String[] deltaFiles) {
    +    List<Future<DeleteDeltaBlockDetails>> taskSubmitList = new ArrayList<>();
    +    ExecutorService executorService = Executors.newFixedThreadPool(thread_pool_size);
    +    for (final String deltaFile : deltaFiles) {
    +      taskSubmitList.add(executorService.submit(new Callable<DeleteDeltaBlockDetails>()
{
    +        @Override public DeleteDeltaBlockDetails call() throws IOException {
    +          CarbonDeleteDeltaFileReaderImpl deltaFileReader =
    +              new CarbonDeleteDeltaFileReaderImpl(deltaFile, FileFactory.getFileType(deltaFile));
    +          return deltaFileReader.readJson();
    +        }
    +      }));
    +    }
    +    try {
    +      executorService.shutdown();
    +      executorService.awaitTermination(30, TimeUnit.MINUTES);
    +    } catch (InterruptedException e) {
    +      LOGGER.error("Error while reading the delete delta files : " + e.getMessage());
    +    }
    +    Map<String, DeleteDeltaVo> pageIdToBlockLetVo = new HashMap<>();
    +    List<DeleteDeltaBlockletDetails> blockletDetails = null;
    +    for (int i = 0; i < taskSubmitList.size(); i++) {
    +      try {
    +        blockletDetails = taskSubmitList.get(i).get().getBlockletDetails();
    +      } catch (InterruptedException | ExecutionException e) {
    +        throw new RuntimeException(e);
    +      }
    +      for (DeleteDeltaBlockletDetails blockletDetail : blockletDetails) {
    +        DeleteDeltaVo deleteDeltaVo = pageIdToBlockLetVo.get(blockletDetail.getBlockletKey());
    +        if (null == deleteDeltaVo) {
    +          deleteDeltaVo = new DeleteDeltaVo();
    +          pageIdToBlockLetVo.put(blockletDetail.getBlockletKey(), deleteDeltaVo);
    +        }
    +        deleteDeltaVo.insertData(blockletDetail.getDeletedRows());
    +        ;
    --- End diff --
    
    remove semicolon


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