Fix a bug in JAR fetcher that made it always fetch the JAR

This commit is contained in:
Matei Zaharia 2012-09-27 21:32:06 -07:00
Родитель 009b0e37e7
Коммит 4a138403ef
3 изменённых файлов: 9 добавлений и 13 удалений

Просмотреть файл

@ -161,7 +161,7 @@ trait KryoRegistrator {
}
class KryoSerializer extends Serializer with Logging {
val kryo = createKryo()
lazy val kryo = createKryo()
val bufferSize = System.getProperty("spark.kryoserializer.buffer.mb", "32").toInt * 1024 * 1024

Просмотреть файл

@ -83,16 +83,12 @@ object SizeEstimator extends Logging {
hotSpotMBeanName, classOf[HotSpotDiagnosticMXBean]);
return bean.getVMOption("UseCompressedOops").getValue.toBoolean
} catch {
case e: IllegalArgumentException => {
logWarning("Exception while trying to check if compressed oops is enabled", e)
// Fall back to checking if maxMemory < 32GB
return Runtime.getRuntime.maxMemory < (32L*1024*1024*1024)
}
case e: SecurityException => {
logWarning("No permission to create MBeanServer", e)
// Fall back to checking if maxMemory < 32GB
return Runtime.getRuntime.maxMemory < (32L*1024*1024*1024)
case e: Exception => {
// Guess whether they've enabled UseCompressedOops based on whether maxMemory < 32 GB
val guess = Runtime.getRuntime.maxMemory < (32L*1024*1024*1024)
val guessInWords = if (guess) "yes" else "not"
logWarning("Failed to check whether UseCompressedOops is set; assuming " + guessInWords)
return guess
}
}
}

Просмотреть файл

@ -24,14 +24,14 @@ abstract class Task[T](val stageId: Int) extends Serializable {
// Fetch missing file dependencies
fileSet.filter { case(k,v) =>
!currentFileSet.contains(k) || currentFileSet(k) <= v
!currentFileSet.contains(k) || currentFileSet(k) < v
}.foreach { case (k,v) =>
Utils.fetchFile(k, new File(System.getProperty("user.dir")))
currentFileSet(k) = v
}
// Fetch missing jar dependencies
jarSet.filter { case(k,v) =>
!currentJarSet.contains(k) || currentJarSet(k) <= v
!currentJarSet.contains(k) || currentJarSet(k) < v
}.foreach { case (k,v) =>
Utils.fetchFile(k, new File(System.getProperty("user.dir")))
currentJarSet(k) = v