in storehaus-algebra/src/main/scala/com/twitter/storehaus/algebra/query/QueryStrategy.scala [35:47]
def query(q: Q): Set[X]
/** Used in your summingbird job to flatmap your keys, increment all these X with the value */
def index(key: L): Set[X]
def withOption: QueryStrategy[Option[Q], L, Option[X]] =
new AbstractQueryStrategy[Option[Q], L, Option[X]] {
def query(q: Option[Q]) = q match {
case Some(innerQ) => self.query(innerQ).map(Some(_))
case None => Set(None)
}
def index(key: L) = self.index(key).map[Option[X], Set[Option[X]]](Some(_)) + None
}