usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject [3/4] incubator-usergrid git commit: Refactored timeouts for clarity. Added search timeout I missed. Added write timeout to EsIndexBufferConsumer for sending requests.
Date Mon, 20 Apr 2015 16:27:32 GMT
Refactored timeouts for clarity.
Added search timeout I missed.
Added write timeout to EsIndexBufferConsumer for sending requests.


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

Branch: refs/heads/two-dot-o
Commit: 74f66848484bfa372aef9e343ebb6445d45e72ae
Parents: 14c1f36
Author: GERey <greyes@apigee.com>
Authored: Fri Apr 17 15:10:05 2015 -0700
Committer: GERey <greyes@apigee.com>
Committed: Fri Apr 17 15:10:05 2015 -0700

----------------------------------------------------------------------
 .../java/org/apache/usergrid/persistence/index/IndexFig.java | 8 +++++++-
 .../usergrid/persistence/index/impl/EsEntityIndexImpl.java   | 4 ++--
 .../persistence/index/impl/EsIndexBufferConsumerImpl.java    | 2 +-
 3 files changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/74f66848/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 3890ff8..fcab21f 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
@@ -106,6 +106,8 @@ public interface IndexFig extends GuicyFig {
      */
     public static final String ELASTICSEARCH_QUERY_TIMEOUT = "elasticsearch.query.timeout";
 
+    public static final String ELASTICSEARCH_WRITE_TIMEOUT= "elasticsearch.write.timeout";
+
 
     @Default( "127.0.0.1" )
     @Key( ELASTICSEARCH_HOSTS )
@@ -219,5 +221,9 @@ public interface IndexFig extends GuicyFig {
 
     @Default( "5000" )
     @Key( ELASTICSEARCH_QUERY_TIMEOUT )
-    long getElasticsearchQueryTimeout();
+    long getQueryTimeout();
+
+    @Default( "5000" )
+    @Key( ELASTICSEARCH_WRITE_TIMEOUT )
+    long getWriteTimeout();
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/74f66848/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 f17fd58..9add426 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
@@ -452,7 +452,7 @@ public class EsEntityIndexImpl implements AliasedEntityIndex {
             try {
                 //Added For Graphite Metrics
                 Timer.Context timeSearch = searchTimer.time();
-                searchResponse = srb.execute().actionGet();
+                searchResponse = srb.execute().actionGet(config.getQueryTimeout());
                 timeSearch.stop();
             }
             catch ( Throwable t ) {
@@ -489,7 +489,7 @@ public class EsEntityIndexImpl implements AliasedEntityIndex {
             try {
                 //Added For Graphite Metrics
                 Timer.Context timeSearchCursor = cursorTimer.time();
-                searchResponse = ssrb.execute().actionGet(config.getElasticsearchQueryTimeout());
+                searchResponse = ssrb.execute().actionGet(config.getQueryTimeout());
                 timeSearchCursor.stop();
             }
             catch ( Throwable t ) {

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/74f66848/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexBufferConsumerImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexBufferConsumerImpl.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexBufferConsumerImpl.java
index d064b97..f0f6427 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexBufferConsumerImpl.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexBufferConsumerImpl.java
@@ -315,7 +315,7 @@ public class EsIndexBufferConsumerImpl implements IndexBufferConsumer
{
         final BulkResponse responses;
 
         try {
-            responses = bulkRequest.execute().actionGet();
+            responses = bulkRequest.execute().actionGet(config.getWriteTimeout());
         } catch (Throwable t) {
             log.error("Unable to communicate with elasticsearch");
             failureMonitor.fail("Unable to execute batch", t);


Mime
View raw message