usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject incubator-usergrid git commit: Added elastic search timeout to search calls.
Date Fri, 17 Apr 2015 21:43:54 GMT
Repository: incubator-usergrid
Updated Branches:
  refs/heads/EsTimeout 2d1c8b8ac -> 8b97a6dbf


Added elastic search timeout to search calls.


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/8b97a6db
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/8b97a6db
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/8b97a6db

Branch: refs/heads/EsTimeout
Commit: 8b97a6dbff5914b94375e2ebf930ba7e14e71631
Parents: 2d1c8b8
Author: GERey <greyes@apigee.com>
Authored: Fri Apr 17 14:43:51 2015 -0700
Committer: GERey <greyes@apigee.com>
Committed: Fri Apr 17 14:43:51 2015 -0700

----------------------------------------------------------------------
 .../org/apache/usergrid/persistence/index/IndexFig.java  | 11 +++++++++++
 .../persistence/index/impl/EsEntityIndexImpl.java        |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/8b97a6db/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/IndexFig.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/IndexFig.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/IndexFig.java
index c7be79d..2539696 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/IndexFig.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/IndexFig.java
@@ -100,6 +100,13 @@ public interface IndexFig extends GuicyFig {
 
     public static final String QUERY_LIMIT_DEFAULT = "index.query.limit.default";
 
+    /**
+     * Timeout calls to elasticsearch.
+     * @return
+     */
+    public static final String ELASTICSEARCH_TIMEOUT = "elasticsearch.timeout";
+
+
     @Default( "127.0.0.1" )
     @Key( ELASTICSEARCH_HOSTS )
     String getHosts();
@@ -209,4 +216,8 @@ public interface IndexFig extends GuicyFig {
     @Default( "1000" )
     @Key( ELASTICSEARCH_QUEUE_OFFER_TIMEOUT )
     long getQueueOfferTimeout();
+
+    @Default( "5000" )
+    @Key( ELASTICSEARCH_TIMEOUT )
+    long getElasticsearchTimeout();
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/8b97a6db/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
index 1838eec..9d8d278 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
@@ -503,7 +503,7 @@ public class EsEntityIndexImpl implements AliasedEntityIndex {
             try {
                 //Added For Graphite Metrics
                 Timer.Context timeSearchCursor = cursorTimer.time();
-                searchResponse = ssrb.execute().actionGet();
+                searchResponse = ssrb.execute().actionGet(config.getElasticsearchTimeout());
                 timeSearchCursor.stop();
             }
             catch ( Throwable t ) {


Mime
View raw message