Github user mohammadshahidkhan commented on a diff in the pull request: https://github.com/apache/incubator-carbondata/pull/454#discussion_r94018535 --- 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 -- if we move to the catch block then we will not be able decrement the access count of all the loaded objects
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---