This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 23462ec Set exclusive start key only once.
23462ec is described below
commit 23462eca70857b27854d17b23a89f5febbc5465e
Author: Scalzi, Daniel D (US) <[email protected]>
AuthorDate: Thu Jun 24 11:25:34 2021 -0400
Set exclusive start key only once.
---
.../org/apache/camel/component/aws2/ddb/QueryCommand.java | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git
a/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/QueryCommand.java
b/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/QueryCommand.java
index 4100b9a..fb98d71 100644
---
a/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/QueryCommand.java
+++
b/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/QueryCommand.java
@@ -21,7 +21,6 @@ import java.util.Map;
import org.apache.camel.Exchange;
import software.amazon.awssdk.services.dynamodb.DynamoDbClient;
-import software.amazon.awssdk.services.dynamodb.model.AttributeValue;
import software.amazon.awssdk.services.dynamodb.model.Condition;
import software.amazon.awssdk.services.dynamodb.model.QueryRequest;
import software.amazon.awssdk.services.dynamodb.model.QueryResponse;
@@ -36,9 +35,8 @@ public class QueryCommand extends AbstractDdbCommand {
public void execute() {
QueryRequest.Builder query =
QueryRequest.builder().tableName(determineTableName())
.attributesToGet(determineAttributeNames()).consistentRead(determineConsistentRead())
-
.exclusiveStartKey(determineStartKey()).keyConditions(determineKeyConditions())
- .exclusiveStartKey(determineStartKey()).limit(determineLimit())
- .scanIndexForward(determineScanIndexForward());
+
.keyConditions(determineKeyConditions()).exclusiveStartKey(determineExclusiveStartKey())
+
.limit(determineLimit()).scanIndexForward(determineScanIndexForward());
// Check if we have set an Index Name
if (exchange.getIn().getHeader(Ddb2Constants.INDEX_NAME, String.class)
!= null) {
@@ -55,11 +53,6 @@ public class QueryCommand extends AbstractDdbCommand {
addToResults(tmp);
}
- @SuppressWarnings("unchecked")
- private Map<String, AttributeValue> determineStartKey() {
- return exchange.getIn().getHeader(Ddb2Constants.START_KEY, Map.class);
- }
-
private Boolean determineScanIndexForward() {
return exchange.getIn().getHeader(Ddb2Constants.SCAN_INDEX_FORWARD,
Boolean.class);
}