0
我有這樣的代碼片段:我應該使用咖喱功能嗎?
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
我想將其轉換成作爲參數blob.map(_.id).distinct
和MyDataStore.batchGet("tablez", chunk.asJava, classOf[TableZ], true).asScala
我想,也許咖喱的功能,但不能確定語法的通用方法。
只是爲了澄清,chunks
是Seq[Seq[String]]
,batchGet
返回List[T]
其中T
是tablez
,output
是Seq[TableZ]
。
我不能告訴你指望這些東西有什麼類型。 – 2012-08-13 02:09:04
@KenBloom查看更新的問題 – Bob 2012-08-13 02:20:32