Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

Commit

Permalink
ADd a means to set defaults outside the planner
Browse files Browse the repository at this point in the history
  • Loading branch information
ianoc committed Nov 8, 2013
1 parent b28703d commit deafca3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,10 @@ object Scalding {

private def getOrElse[T: Manifest](options: Map[String, Options], idOpt: Option[String], default: T): T =
(for {
id <- idOpt
id <- idOpt.map(List(_, "DEFAULT")).getOrElse(List("DEFAULT"))
innerOpts <- options.get(id)
option <- innerOpts.get[T]
} yield option).getOrElse(default)
} yield option).headOption.getOrElse(default)

@annotation.tailrec
private def getFirst[T: Manifest](options: Map[String, Options], names: List[String]): Option[T] =
Expand Down

0 comments on commit deafca3

Please sign in to comment.