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:41:56 UTC

[phoenix] branch 4.x-HBase-1.2 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.2
in repository https://gitbox.apache.org/repos/asf/phoenix.git


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

commit 6b1e2136631b36e4d43cdf5b52d21ce867bd812a
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)