Skip to content
Snippets Groups Projects
Commit f36e6431 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

No private mutable

(cherry picked from commit 9e6a44e1)
parent 60472a15
No related branches found
No related tags found
No related merge requests found
......@@ -30,18 +30,16 @@ import scala.collection.mutable.ListBuffer
*/
object WriteDependencies extends Logging with Configurable {
val root: Configurable = null
private val functionNames: mutable.Map[QFunction, String] = mutable.Map()
private def createFunctionNames(functions: Seq[QFunction]): Unit = {
private def createFunctionNames(functions: Seq[QFunction]): Map[QFunction, String] = {
val cache: mutable.Map[String, Int] = mutable.Map()
for (function <- functions) {
(for (function <- functions) yield {
val baseName = function match {
case f: Configurable => f.configNamespace
case f => f.getClass.getSimpleName
}
cache += baseName -> (cache.getOrElse(baseName, 0) + 1)
functionNames += function -> s"$baseName-${cache(baseName)}"
}
function -> s"$baseName-${cache(baseName)}"
}).toMap
}
/**
......@@ -55,7 +53,7 @@ object WriteDependencies extends Logging with Configurable {
val errorOnMissingInput: Boolean = config("error_on_missing_input", false)
createFunctionNames(functions)
val functionNames = createFunctionNames(functions)
case class QueueFile(file: File) {
private val inputJobs: ListBuffer[QFunction] = ListBuffer()
......
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