You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@carbondata.apache.org by gv...@apache.org on 2016/09/17 21:15:21 UTC

[1/2] incubator-carbondata git commit: if for any reason data load is failed during the dictionary generation then in the finally block trying to write the meta file but as the stream is null, it will throw null pointer.

Repository: incubator-carbondata
Updated Branches:
  refs/heads/master 381b08a01 -> 7147be281


if for any reason data load is failed during the dictionary generation then in the finally block trying to write the meta file but as the stream is null, it will throw null pointer.


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

Branch: refs/heads/master
Commit: ebe987b22a92090a91471534711a63187081f907
Parents: 381b08a
Author: ravikiran <ra...@gmail.com>
Authored: Sat Sep 17 00:04:38 2016 +0530
Committer: Venkata Ramana G <ra...@huawei.com>
Committed: Sun Sep 18 02:37:52 2016 +0530

----------------------------------------------------------------------
 .../core/writer/CarbonDictionaryWriterImpl.java          |  5 +++--
 .../org/apache/carbondata/core/writer/ThriftWriter.java  | 11 +++++++++++
 2 files changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/ebe987b2/core/src/main/java/org/apache/carbondata/core/writer/CarbonDictionaryWriterImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/writer/CarbonDictionaryWriterImpl.java b/core/src/main/java/org/apache/carbondata/core/writer/CarbonDictionaryWriterImpl.java
index 316832d..fab8db4 100644
--- a/core/src/main/java/org/apache/carbondata/core/writer/CarbonDictionaryWriterImpl.java
+++ b/core/src/main/java/org/apache/carbondata/core/writer/CarbonDictionaryWriterImpl.java
@@ -198,7 +198,8 @@ public class CarbonDictionaryWriterImpl implements CarbonDictionaryWriter {
    * @throws IOException if an I/O error occurs
    */
   @Override public void close() throws IOException {
-    if (null != dictionaryThriftWriter) {
+    if (null != dictionaryThriftWriter && dictionaryThriftWriter.isOpen()) {
+      // if stream is open then only need to write dictionary file.
       writeDictionaryFile();
       // close the thrift writer for dictionary file
       closeThriftWriter();
@@ -404,7 +405,7 @@ public class CarbonDictionaryWriterImpl implements CarbonDictionaryWriter {
   }
 
   @Override public void commit() throws IOException {
-    if (null != dictionaryThriftWriter) {
+    if (null != dictionaryThriftWriter && dictionaryThriftWriter.isOpen()) {
       this.chunk_end_offset = CarbonUtil.getFileSize(this.dictionaryFilePath);
       writeDictionaryMetadataFile();
     }

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/ebe987b2/core/src/main/java/org/apache/carbondata/core/writer/ThriftWriter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/writer/ThriftWriter.java b/core/src/main/java/org/apache/carbondata/core/writer/ThriftWriter.java
index c232fb2..93b17f3 100644
--- a/core/src/main/java/org/apache/carbondata/core/writer/ThriftWriter.java
+++ b/core/src/main/java/org/apache/carbondata/core/writer/ThriftWriter.java
@@ -80,6 +80,17 @@ public class ThriftWriter {
   }
 
   /**
+   * This will check whether stream and binary out is open or not.
+   * @return
+   */
+  public boolean isOpen() {
+    if (null != binaryOut && null != dataOutputStream) {
+      return true;
+    }
+    return false;
+  }
+
+  /**
    * Write the object to disk.
    */
   public void write(TBase t) throws IOException {


[2/2] incubator-carbondata git commit: [CARBONDATA-245] Actual Exception is getting lost in case of data dictionary file generation. This closes #160

Posted by gv...@apache.org.
[CARBONDATA-245] Actual Exception is getting lost in case of data dictionary file generation. This closes #160


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

Branch: refs/heads/master
Commit: 7147be281be303c7878904737aca01755398f91d
Parents: 381b08a ebe987b
Author: Venkata Ramana G <ra...@huawei.com>
Authored: Sun Sep 18 02:45:07 2016 +0530
Committer: Venkata Ramana G <ra...@huawei.com>
Committed: Sun Sep 18 02:45:07 2016 +0530

----------------------------------------------------------------------
 .../core/writer/CarbonDictionaryWriterImpl.java          |  5 +++--
 .../org/apache/carbondata/core/writer/ThriftWriter.java  | 11 +++++++++++
 2 files changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------