I have this code snippet:
val chunks = blob.map(_.id).distinct.grouped(100).toSeq
val output = (for (chunk <- chunks) yield {
MyDataStore.batchGet("tablez", chunk.asJava, classOf[TableZ], true).asScala }).flatten
I would like to convert this into a general purpose method which takes as parameters blob.map(_.id).distinct and MyDataStore.batchGet("tablez", chunk.asJava, classOf[TableZ], true).asScala
I am thinking maybe curried function but unsure about syntax.
Just to clarify, chunks is a Seq[Seq[String]], batchGet returns a List[T] where T is tablez, output is Seq[TableZ].
I think the following will work:
Call it as