Skip to content
Snippets Groups Projects
Commit 08dc8936 authored by Victor Chima's avatar Victor Chima Committed by Sean Owen
Browse files

Unintentional white spaces in kryo classes configuration parameters

## What changes were proposed in this pull request?

Pruned off white spaces present in the user provided comma separated list of classes for **spark.kryo.classesToRegister** and **spark.kryo.registrator**.

## How was this patch tested?

Manual tests

Author: Victor Chima <blazy2k9@gmail.com>

Closes #12701 from blazy2k9/master.
parent c5443560
No related branches found
No related tags found
No related merge requests found
......@@ -191,7 +191,8 @@ class SparkConf(loadDefaults: Boolean) extends Cloneable with Logging {
*/
def registerKryoClasses(classes: Array[Class[_]]): SparkConf = {
val allClassNames = new LinkedHashSet[String]()
allClassNames ++= get("spark.kryo.classesToRegister", "").split(',').filter(!_.isEmpty)
allClassNames ++= get("spark.kryo.classesToRegister", "").split(',').map(_.trim)
.filter(!_.isEmpty)
allClassNames ++= classes.map(_.getName)
set("spark.kryo.classesToRegister", allClassNames.mkString(","))
......
......@@ -71,10 +71,10 @@ class KryoSerializer(conf: SparkConf)
private val referenceTracking = conf.getBoolean("spark.kryo.referenceTracking", true)
private val registrationRequired = conf.getBoolean("spark.kryo.registrationRequired", false)
private val userRegistrators = conf.get("spark.kryo.registrator", "")
.split(',')
.split(',').map(_.trim)
.filter(!_.isEmpty)
private val classesToRegister = conf.get("spark.kryo.classesToRegister", "")
.split(',')
.split(',').map(_.trim)
.filter(!_.isEmpty)
private val avroSchemas = conf.getAvroSchema
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment