Skip to content

Instantly share code, notes, and snippets.

@maxpospischil
Created February 26, 2018 18:39
Show Gist options
  • Save maxpospischil/c40ab7eed821450f344374e9e97245b2 to your computer and use it in GitHub Desktop.
Save maxpospischil/c40ab7eed821450f344374e9e97245b2 to your computer and use it in GitHub Desktop.
Eventually consistent local secondary index query
val incompleteIndexTable: SecondaryIndex[BatchRecord] = BatchWorker.getIncompleteIndexTable(tableName)
private def recordsQuery =
incompleteIndexTable
.limit(concurrencyLimit)
.query('pkey -> s"$uuid.${dp.id}")
.map(_.toSet)
def nextRecords: Task[Set[BatchRecord]] = Task {
Scanamo.exec(client)(recordsQuery).collect {
case Right(r) => r
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment