carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ravipes...@apache.org
Subject [03/20] incubator-carbondata git commit: [CARBONDATA-129]Added null check before adding to carbonproperties. (#895)
Date Sat, 06 Aug 2016 10:00:20 GMT
[CARBONDATA-129]Added null check before adding to carbonproperties. (#895)

Added null check before adding to carbonproperties inorder to avoid npe if lock type is either
local/zookeeper/hdfs .

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

Branch: refs/heads/master
Commit: c44bfd36fc875ebb5bb71ec28f8f423002767158
Parents: 1695d60
Author: ashokblend <ashok.blend@gmail.com>
Authored: Mon Aug 1 19:22:52 2016 +0530
Committer: sujith71955 <sujithchacko.2010@gmail.com>
Committed: Mon Aug 1 19:22:52 2016 +0530

----------------------------------------------------------------------
 .../spark/rdd/CarbonGlobalDictionaryRDD.scala     | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/c44bfd36/integration/spark/src/main/scala/org/carbondata/spark/rdd/CarbonGlobalDictionaryRDD.scala
----------------------------------------------------------------------
diff --git a/integration/spark/src/main/scala/org/carbondata/spark/rdd/CarbonGlobalDictionaryRDD.scala
b/integration/spark/src/main/scala/org/carbondata/spark/rdd/CarbonGlobalDictionaryRDD.scala
index 70d0cb1..6768320 100644
--- a/integration/spark/src/main/scala/org/carbondata/spark/rdd/CarbonGlobalDictionaryRDD.scala
+++ b/integration/spark/src/main/scala/org/carbondata/spark/rdd/CarbonGlobalDictionaryRDD.scala
@@ -300,12 +300,18 @@ class CarbonGlobalDictionaryGenerateRDD(
       val pathService = CarbonCommonFactory.getPathService
       val carbonTablePath = pathService.getCarbonTablePath(model.columnIdentifier(split.index),
           model.hdfsLocation, model.table)
-      CarbonProperties.getInstance.addProperty(CarbonCommonConstants.HDFS_TEMP_LOCATION,
-        model.hdfsTempLocation)
-      CarbonProperties.getInstance.addProperty(CarbonCommonConstants.LOCK_TYPE,
-        model.lockType)
-      CarbonProperties.getInstance.addProperty(CarbonCommonConstants.ZOOKEEPER_URL,
-        model.zooKeeperUrl)
+      if (null != model.hdfsTempLocation) {
+         CarbonProperties.getInstance.addProperty(CarbonCommonConstants.HDFS_TEMP_LOCATION,
+           model.hdfsTempLocation)
+      }
+      if (null != model.lockType) {
+         CarbonProperties.getInstance.addProperty(CarbonCommonConstants.LOCK_TYPE,
+           model.lockType)
+      }
+      if (null != model.zooKeeperUrl) {
+         CarbonProperties.getInstance.addProperty(CarbonCommonConstants.ZOOKEEPER_URL,
+          model.zooKeeperUrl)
+      }
       val dictLock = CarbonLockFactory
         .getCarbonLockObj(carbonTablePath.getRelativeDictionaryDirectory,
           model.columnIdentifier(split.index).getColumnId + LockUsage.LOCK)


Mime
View raw message