carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ravipes...@apache.org
Subject [06/50] [abbrv] carbondata git commit: [HOTFIX] Fix exception handling in PartitionMapFileStore
Date Sun, 28 Jan 2018 06:45:35 GMT
[HOTFIX] Fix exception handling in PartitionMapFileStore

Exception should not be ignored in PartitionMapFileStore.java, it should be thrown instead.

This closes #1771


Project: http://git-wip-us.apache.org/repos/asf/carbondata/repo
Commit: http://git-wip-us.apache.org/repos/asf/carbondata/commit/ed2c01f5
Tree: http://git-wip-us.apache.org/repos/asf/carbondata/tree/ed2c01f5
Diff: http://git-wip-us.apache.org/repos/asf/carbondata/diff/ed2c01f5

Branch: refs/heads/fgdatamap
Commit: ed2c01f5d4d2da07449046271933f47e76b430af
Parents: 11353e2
Author: Jacky Li <jacky.likun@qq.com>
Authored: Sun Jan 7 10:58:54 2018 +0800
Committer: ravipesala <ravi.pesala@gmail.com>
Committed: Mon Jan 8 15:24:52 2018 +0530

----------------------------------------------------------------------
 .../carbondata/core/metadata/PartitionMapFileStore.java   | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/carbondata/blob/ed2c01f5/core/src/main/java/org/apache/carbondata/core/metadata/PartitionMapFileStore.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/metadata/PartitionMapFileStore.java
b/core/src/main/java/org/apache/carbondata/core/metadata/PartitionMapFileStore.java
index f7074c4..3068cd9 100644
--- a/core/src/main/java/org/apache/carbondata/core/metadata/PartitionMapFileStore.java
+++ b/core/src/main/java/org/apache/carbondata/core/metadata/PartitionMapFileStore.java
@@ -188,7 +188,7 @@ public class PartitionMapFileStore {
    * @param partitionMapPath
    * @return
    */
-  private PartitionMapper readPartitionMap(String partitionMapPath) {
+  private PartitionMapper readPartitionMap(String partitionMapPath) throws IOException {
     Gson gsonObjectToRead = new Gson();
     DataInputStream dataInputStream = null;
     BufferedReader buffReader = null;
@@ -206,10 +206,10 @@ public class PartitionMapFileStore {
           Charset.forName(CarbonCommonConstants.DEFAULT_CHARSET));
       buffReader = new BufferedReader(inStream);
       partitionMapper = gsonObjectToRead.fromJson(buffReader, PartitionMapper.class);
-    } catch (IOException e) {
-      return null;
     } finally {
-      CarbonUtil.closeStreams(buffReader, inStream, dataInputStream);
+      if (inStream != null) {
+        CarbonUtil.closeStreams(buffReader, inStream, dataInputStream);
+      }
     }
 
     return partitionMapper;
@@ -219,7 +219,7 @@ public class PartitionMapFileStore {
    * Reads all partitions which existed inside the passed segment path
    * @param segmentPath
    */
-  public void readAllPartitionsOfSegment(String segmentPath) {
+  public void readAllPartitionsOfSegment(String segmentPath) throws IOException {
     String partitionFilePath = getPartitionFilePath(segmentPath);
     if (partitionFilePath != null) {
       partionedSegment = true;


Mime
View raw message