diff options
author | Charles Reiss <woggle@apache.org> | 2013-08-10 21:27:40 -0700 |
---|---|---|
committer | Charles Reiss <woggle@apache.org> | 2013-08-10 21:31:05 -0700 |
commit | 6402b539d0058bd2cfc600f348801e7279acadab (patch) | |
tree | af77524e4837cfb7eb240f70cf19a20a8d5c9d11 | |
parent | f94fc75c3f3b8b1337fe3f849c2cba119eaa9bc7 (diff) | |
download | spark-6402b539d0058bd2cfc600f348801e7279acadab.tar.gz spark-6402b539d0058bd2cfc600f348801e7279acadab.tar.bz2 spark-6402b539d0058bd2cfc600f348801e7279acadab.zip |
Use new Configuration() instead of new JobConf() for ObjectWritable.
JobConf's constructor loads default config files in some verisons of
Hadoop, which is quite slow, and we only need the Configuration object
to pass the correct ClassLoader.
-rw-r--r-- | core/src/main/scala/spark/SerializableWritable.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/src/main/scala/spark/SerializableWritable.scala b/core/src/main/scala/spark/SerializableWritable.scala index 0236611ef9..936d8e6241 100644 --- a/core/src/main/scala/spark/SerializableWritable.scala +++ b/core/src/main/scala/spark/SerializableWritable.scala @@ -21,7 +21,7 @@ import java.io._ import org.apache.hadoop.io.ObjectWritable import org.apache.hadoop.io.Writable -import org.apache.hadoop.mapred.JobConf +import org.apache.hadoop.conf.Configuration class SerializableWritable[T <: Writable](@transient var t: T) extends Serializable { def value = t @@ -35,7 +35,7 @@ class SerializableWritable[T <: Writable](@transient var t: T) extends Serializa private def readObject(in: ObjectInputStream) { in.defaultReadObject() val ow = new ObjectWritable() - ow.setConf(new JobConf()) + ow.setConf(new Configuration()) ow.readFields(in) t = ow.get().asInstanceOf[T] } |