carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kumarvishal09 <...@git.apache.org>
Subject [GitHub] incubator-carbondata pull request #454: [CARBONDATA-484] Implement LRU cache...
Date Fri, 23 Dec 2016 03:54:05 GMT
Github user kumarvishal09 commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/454#discussion_r93727727
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/carbon/datastore/BlockIndexStore.java
---
    @@ -244,124 +222,96 @@ public static BlockIndexStore getInstance() {
        *
        * @param loadedBlockArray array of blocks which will be filled
        * @param blocksList       blocks loaded in thread
    -   * @throws IndexBuilderException in case of any failure
    +   * @throws CarbonUtilException in case of any failure
        */
    -  private void fillLoadedBlocks(AbstractIndex[] loadedBlockArray, List<BlockInfo>
blockInfos)
    -      throws IndexBuilderException {
    +  private void fillLoadedBlocks(AbstractIndex[] loadedBlockArray,
    +      List<Future<AbstractIndex>> blocksList) throws CarbonUtilException
{
    +    int blockCounter = 0;
    +    boolean exceptionOccurred = false;
    +    Throwable exceptionRef = null;
         for (int i = 0; i < loadedBlockArray.length; i++) {
    -      if (null == loadedBlockArray[i]) {
    -        try {
    -          loadedBlockArray[i] = mapOfBlockInfoToFuture.get(blockInfos.get(i)).get();
    -        } catch (InterruptedException | ExecutionException e) {
    -          throw new IndexBuilderException(e);
    -        }
    +      try {
    +        loadedBlockArray[i] = blocksList.get(blockCounter++).get();
    +      } catch (Throwable e) {
    +        exceptionOccurred = true;
    +        exceptionRef = e;
           }
    -
    +    }
    +    if (exceptionOccurred) {
    --- End diff --
    
    I think this if check is not required we can move this part of the code to catch block.


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