aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorroot <root@ip-10-110-81-221.ec2.internal>2011-03-09 03:31:50 -0500
committerroot <root@ip-10-110-81-221.ec2.internal>2011-03-09 03:31:50 -0500
commitff5b13799a778953e4fd23b566e46be746102057 (patch)
tree0737ab26f04f0e36ef6507735e81b618a82d9196 /core
parent7febdfbe2952aeef5e5f0a1cdbc95df4a274fd78 (diff)
downloadspark-ff5b13799a778953e4fd23b566e46be746102057.tar.gz
spark-ff5b13799a778953e4fd23b566e46be746102057.tar.bz2
spark-ff5b13799a778953e4fd23b566e46be746102057.zip
Some tweaks to make Kryo cache work better
Diffstat (limited to 'core')
-rw-r--r--core/src/main/scala/spark/Executor.scala4
-rw-r--r--core/src/main/scala/spark/KryoSerialization.scala4
2 files changed, 4 insertions, 4 deletions
diff --git a/core/src/main/scala/spark/Executor.scala b/core/src/main/scala/spark/Executor.scala
index 3d994001f1..45408551b7 100644
--- a/core/src/main/scala/spark/Executor.scala
+++ b/core/src/main/scala/spark/Executor.scala
@@ -2,7 +2,7 @@ package spark
import java.io.{File, FileOutputStream}
import java.net.{URI, URL, URLClassLoader}
-import java.util.concurrent.{Executors, ExecutorService}
+import java.util.concurrent._
import scala.collection.mutable.ArrayBuffer
@@ -32,7 +32,7 @@ class Executor extends mesos.Executor with Logging {
Thread.currentThread.setContextClassLoader(classLoader)
// Start worker thread pool (they will inherit our context ClassLoader)
- threadPool = Executors.newCachedThreadPool()
+ threadPool = new ThreadPoolExecutor(1, 128, 600, TimeUnit.SECONDS, new LinkedBlockingQueue[Runnable])
}
override def launchTask(d: ExecutorDriver, desc: TaskDescription) {
diff --git a/core/src/main/scala/spark/KryoSerialization.scala b/core/src/main/scala/spark/KryoSerialization.scala
index 63e22ae4ae..54427ecf71 100644
--- a/core/src/main/scala/spark/KryoSerialization.scala
+++ b/core/src/main/scala/spark/KryoSerialization.scala
@@ -111,11 +111,11 @@ class KryoSerialization extends SerializationStrategy with Logging {
val kryo = createKryo()
val threadBuf = new ThreadLocal[ObjectBuffer] {
- override def initialValue = new ObjectBuffer(kryo, 128*1024*1024)
+ override def initialValue = new ObjectBuffer(kryo, 257*1024*1024)
}
val threadByteBuf = new ThreadLocal[ByteBuffer] {
- override def initialValue = ByteBuffer.allocate(128*1024*1024)
+ override def initialValue = ByteBuffer.allocate(257*1024*1024)
}
def createKryo(): Kryo = {