Created
February 26, 2018 18:39
-
-
Save maxpospischil/c40ab7eed821450f344374e9e97245b2 to your computer and use it in GitHub Desktop.
Eventually consistent local secondary index query
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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