You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by td...@apache.org on 2019/02/16 01:42:10 UTC

[phoenix] branch 4.x-HBase-1.4 updated: PHOENIX-5141 Use HBaseFactoryProvider.getConfigurationFactory to get the config in PhoenixRDD

This is an automated email from the ASF dual-hosted git repository.

tdsilva pushed a commit to branch 4.x-HBase-1.4
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/4.x-HBase-1.4 by this push:
     new 0a8bf0f  PHOENIX-5141 Use HBaseFactoryProvider.getConfigurationFactory to get the config in PhoenixRDD
0a8bf0f is described below

commit 0a8bf0f1ca39fbfd3a2d56b4e96b4182b6d2cb65
Author: Thomas D'Silva <td...@apache.org>
AuthorDate: Fri Feb 15 16:44:02 2019 -0800

    PHOENIX-5141 Use HBaseFactoryProvider.getConfigurationFactory to get the config in PhoenixRDD
---
 .../src/main/scala/org/apache/phoenix/spark/PhoenixRDD.scala         | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/phoenix-spark/src/main/scala/org/apache/phoenix/spark/PhoenixRDD.scala b/phoenix-spark/src/main/scala/org/apache/phoenix/spark/PhoenixRDD.scala
index cca2e6d..34033b7 100644
--- a/phoenix-spark/src/main/scala/org/apache/phoenix/spark/PhoenixRDD.scala
+++ b/phoenix-spark/src/main/scala/org/apache/phoenix/spark/PhoenixRDD.scala
@@ -21,6 +21,7 @@ import org.apache.hadoop.io.NullWritable
 import org.apache.phoenix.jdbc.PhoenixDriver
 import org.apache.phoenix.mapreduce.PhoenixInputFormat
 import org.apache.phoenix.mapreduce.util.PhoenixConfigurationUtil
+import org.apache.phoenix.query.HBaseFactoryProvider
 import org.apache.spark._
 import org.apache.spark.annotation.DeveloperApi
 import org.apache.spark.rdd.RDD
@@ -76,9 +77,7 @@ class PhoenixRDD(sc: SparkContext, table: String, columns: Seq[String],
 
   def getPhoenixConfiguration: Configuration = {
 
-    // This is just simply not serializable, so don't try, but clone it because
-    // PhoenixConfigurationUtil mutates it.
-    val config = HBaseConfiguration.create(conf)
+    val config = HBaseFactoryProvider.getConfigurationFactory.getConfiguration(conf);
 
     PhoenixConfigurationUtil.setInputClass(config, classOf[PhoenixRecordWritable])
     PhoenixConfigurationUtil.setInputTableName(config, table)