Skip to content
Snippets Groups Projects
Commit 6402b539 authored by Charles Reiss's avatar Charles Reiss
Browse files

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.
parent f94fc75c
No related branches found
No related tags found
No related merge requests found
...@@ -21,7 +21,7 @@ import java.io._ ...@@ -21,7 +21,7 @@ import java.io._
import org.apache.hadoop.io.ObjectWritable import org.apache.hadoop.io.ObjectWritable
import org.apache.hadoop.io.Writable 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 { class SerializableWritable[T <: Writable](@transient var t: T) extends Serializable {
def value = t def value = t
...@@ -35,7 +35,7 @@ class SerializableWritable[T <: Writable](@transient var t: T) extends Serializa ...@@ -35,7 +35,7 @@ class SerializableWritable[T <: Writable](@transient var t: T) extends Serializa
private def readObject(in: ObjectInputStream) { private def readObject(in: ObjectInputStream) {
in.defaultReadObject() in.defaultReadObject()
val ow = new ObjectWritable() val ow = new ObjectWritable()
ow.setConf(new JobConf()) ow.setConf(new Configuration())
ow.readFields(in) ow.readFields(in)
t = ow.get().asInstanceOf[T] t = ow.get().asInstanceOf[T]
} }
......
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