Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add setSelect(ALL_ATTRIBUTES) to retrieve snapshots #12

Merged
merged 2 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,14 @@ trait CreatePersistenceIdsIndex {

object CreatePersistenceIdsIndex {

/** required by [[DynamoDBCurrentPersistenceIdsQuery.currentPersistenceIdsByPageQuery]] */
/**
* required by [[DynamoDBCurrentPersistenceIdsQuery.currentPersistenceIdsByPageQuery]]
*
* Since v1.1.0, when requesting snapshots by timestamp, select ALL_ATTRIBUTES is used. Thus, a
* duplicate of the payload doesn't need to be stored in the index, which is more space efficient.
* This allows to make the choice between time and space efficiency by selecting the projection
* strategy for the created index.
pjfanning marked this conversation as resolved.
Show resolved Hide resolved
*/
def createPersistenceIdsIndexRequest(
indexName: String,
tableName: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package org.apache.pekko.persistence.dynamodb.snapshot

import com.amazonaws.services.dynamodbv2.model._
import com.amazonaws.services.dynamodbv2.model.Select.ALL_ATTRIBUTES
import org.apache.pekko
import pekko.actor.ExtendedActorSystem
import pekko.persistence.dynamodb._
Expand Down Expand Up @@ -107,6 +108,8 @@ trait DynamoDBSnapshotRequests extends DynamoDBRequests {
.withConsistentRead(true)
limit.foreach(request.setLimit(_))

request.setSelect(ALL_ATTRIBUTES)

dynamo.query(request)
}

Expand Down