You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2018/01/03 14:30:16 UTC

[camel] branch master updated (f2e72e7 -> 155023f)

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from f2e72e7  Upgrade Hazelcast to version 3.9.2
     new d959460  CAMEL-12118: DynamoDB: Execute query using secondary indexes
     new 155023f  Fixed CS

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 components/camel-aws/src/main/docs/aws-ddb-component.adoc     |  2 ++
 .../java/org/apache/camel/component/aws/ddb/DdbConstants.java |  2 ++
 .../java/org/apache/camel/component/aws/ddb/QueryCommand.java | 11 +++++++++--
 3 files changed, 13 insertions(+), 2 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
['"commits@camel.apache.org" <co...@camel.apache.org>'].

[camel] 02/02: Fixed CS

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 155023fcc27e15a9f593da66ccd10abc7c70d6c2
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Jan 3 15:29:55 2018 +0100

    Fixed CS
---
 .../src/main/java/org/apache/camel/component/aws/ddb/QueryCommand.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/ddb/QueryCommand.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/ddb/QueryCommand.java
index d64e9ee..0ea1c52 100644
--- a/components/camel-aws/src/main/java/org/apache/camel/component/aws/ddb/QueryCommand.java
+++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/ddb/QueryCommand.java
@@ -45,7 +45,7 @@ public class QueryCommand extends AbstractDdbCommand {
                 .withScanIndexForward(determineScanIndexForward());
         
         // Check if we have set an Index Name
-        if(exchange.getIn().getHeader(DdbConstants.INDEX_NAME, String.class) != null) {
+        if (exchange.getIn().getHeader(DdbConstants.INDEX_NAME, String.class) != null) {
             query.withIndexName(exchange.getIn().getHeader(DdbConstants.INDEX_NAME, String.class));
         }
         

-- 
To stop receiving notification emails like this one, please contact
"commits@camel.apache.org" <co...@camel.apache.org>.

[camel] 01/02: CAMEL-12118: DynamoDB: Execute query using secondary indexes

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit d9594601010c2fb7a8e1f2fadf463624001c84f5
Author: Fabrizio Spataro <fa...@bizmate.it>
AuthorDate: Wed Jan 3 15:18:27 2018 +0100

    CAMEL-12118: DynamoDB: Execute query using secondary indexes
---
 components/camel-aws/src/main/docs/aws-ddb-component.adoc     |  2 ++
 .../java/org/apache/camel/component/aws/ddb/DdbConstants.java |  2 ++
 .../java/org/apache/camel/component/aws/ddb/QueryCommand.java | 11 +++++++++--
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/components/camel-aws/src/main/docs/aws-ddb-component.adoc b/components/camel-aws/src/main/docs/aws-ddb-component.adoc
index 19544e9..cc3145b 100644
--- a/components/camel-aws/src/main/docs/aws-ddb-component.adoc
+++ b/components/camel-aws/src/main/docs/aws-ddb-component.adoc
@@ -105,6 +105,8 @@ returned.
 |`CamelAwsDdbConsistentRead` |`Boolean` |If set to true, then a consistent read is issued, otherwise eventually
 consistent is used.
 
+|`CamelAwsDdbIndexName` |`String` |If set will be used as Secondary Index for Query operation.
+
 |`CamelAwsDdbItem` |`Map<String, AttributeValue>` |A map of the attributes for the item, and must include the primary key
 values that define the item.
 
diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/ddb/DdbConstants.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/ddb/DdbConstants.java
index 6c2dbae..6ababab 100644
--- a/components/camel-aws/src/main/java/org/apache/camel/component/aws/ddb/DdbConstants.java
+++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/ddb/DdbConstants.java
@@ -32,6 +32,8 @@ public interface DdbConstants {
     // String EXACT_COUNT = "CamelAwsDdbExactCount";
     // Removed from DynamoDB v1 to v2
     // String HASH_KEY_VALUE = "CamelAwsDdbHashKeyValue";
+    // Added INDEX_NAME for querying secondary indexes
+    String INDEX_NAME = "CamelAwsDdbIndexName";
     String ITEM = "CamelAwsDdbItem";
     String ITEMS = "CamelAwsDdbItems";
     String ITEM_COUNT = "CamelAwsDdbTableItemCount";
diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/ddb/QueryCommand.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/ddb/QueryCommand.java
index 8719bfe..d64e9ee 100644
--- a/components/camel-aws/src/main/java/org/apache/camel/component/aws/ddb/QueryCommand.java
+++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/ddb/QueryCommand.java
@@ -34,7 +34,7 @@ public class QueryCommand extends AbstractDdbCommand {
 
     @Override
     public void execute() {
-        QueryResult result = ddbClient.query(new QueryRequest()
+        QueryRequest query = new QueryRequest()
                 .withTableName(determineTableName())
                 .withAttributesToGet(determineAttributeNames())
                 .withConsistentRead(determineConsistentRead())
@@ -42,7 +42,14 @@ public class QueryCommand extends AbstractDdbCommand {
                 .withKeyConditions(determineKeyConditions())
                 .withExclusiveStartKey(determineStartKey())
                 .withLimit(determineLimit())
-                .withScanIndexForward(determineScanIndexForward()));
+                .withScanIndexForward(determineScanIndexForward());
+        
+        // Check if we have set an Index Name
+        if(exchange.getIn().getHeader(DdbConstants.INDEX_NAME, String.class) != null) {
+            query.withIndexName(exchange.getIn().getHeader(DdbConstants.INDEX_NAME, String.class));
+        }
+        
+        QueryResult result = ddbClient.query(query);
         
         Map tmp = new HashMap<>();
         tmp.put(DdbConstants.ITEMS, result.getItems());

-- 
To stop receiving notification emails like this one, please contact
"commits@camel.apache.org" <co...@camel.apache.org>.