You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sn...@apache.org on 2014/10/31 21:05:53 UTC

[1/2] git commit: Set shard and replica size at Index creation time and not client creation time.

Repository: incubator-usergrid
Updated Branches:
  refs/heads/two-dot-o b6a8bc624 -> 63fb7df9e


Set shard and replica size at Index creation time and not client creation time.


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

Branch: refs/heads/two-dot-o
Commit: b9a73b705fc94b428f9ee3de1a58a1bed214fe50
Parents: b6a8bc6
Author: Dave Johnson <dm...@apigee.com>
Authored: Fri Oct 31 16:04:36 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Fri Oct 31 16:04:36 2014 -0400

----------------------------------------------------------------------
 .../persistence/index/impl/EsEntityIndexImpl.java     | 13 +++++++++++--
 .../usergrid/persistence/index/impl/EsProvider.java   | 14 ++++++++++----
 2 files changed, 21 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b9a73b70/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 1ff747f..23accdd 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
@@ -64,7 +64,7 @@ import org.apache.usergrid.persistence.model.util.UUIDGenerator;
 import com.google.common.collect.ImmutableMap;
 import com.google.inject.Inject;
 import com.google.inject.assistedinject.Assisted;
-import java.util.concurrent.ExecutionException;
+import java.util.HashMap;
 
 import static org.apache.usergrid.persistence.index.impl.IndexingUtils.BOOLEAN_PREFIX;
 import static org.apache.usergrid.persistence.index.impl.IndexingUtils.DOC_ID_SEPARATOR_SPLITTER;
@@ -131,7 +131,16 @@ public class EsEntityIndexImpl implements EntityIndex {
             }
 
             AdminClient admin = client.admin();
-            CreateIndexResponse cir = admin.indices().prepareCreate( indexName ).execute().actionGet();
+
+            CreateIndexResponse cir = admin.indices()
+                .prepareCreate( indexName )
+                .setSettings( new HashMap<String, Object>() {{
+                    put("index.number_of_shards", config.getNumberOfShards() );
+                    put("index.number_of_replicas", config.numberOfReplicas() );
+                }} )
+                .execute()
+                .actionGet();
+
             logger.info( "Created new Index Name [{}] ACK=[{}]", indexName, cir.isAcknowledged() );
 
             // create the document, this ensures the index is ready

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b9a73b70/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsProvider.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsProvider.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsProvider.java
index a353b43..c99c851 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsProvider.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsProvider.java
@@ -104,8 +104,11 @@ public class EsProvider {
 
                     .put("gateway.type", "none")
                     .put("index.store.type", "memory")
-                    .put("index.number_of_shards", 1)
-                    .put("index.number_of_replicas", 1)
+
+                    // should be set on index creation and not here
+//                    .put("index.number_of_shards", 1)
+//                    .put("index.number_of_replicas", 1)
+
                     .build();
 
                 log.info("-----------------------------------------------------------------------");
@@ -161,12 +164,15 @@ public class EsProvider {
 
                     .put( "client.transport.ping_timeout", 2000 ) // milliseconds
                     .put( "client.transport.nodes_sampler_interval", 100 )
-                    .put("index.number_of_shards", fig.getNumberOfShards() )
-                    .put("index.number_of_replicas", fig.numberOfReplicas() )
+
                     .put( "network.tcp.blocking", true )
                     .put( "node.client", true )
                     .put( "node.name", nodeName )
 
+                    // should be set on index creation and not here
+//                    .put("index.number_of_shards", fig.getNumberOfShards() )
+//                    .put("index.number_of_replicas", fig.numberOfReplicas() )
+
                     .build();
 
                 log.debug("Creating ElasticSearch client with settings: " +  settings.getAsMap());


[2/2] git commit: Oops

Posted by sn...@apache.org.
Oops


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

Branch: refs/heads/two-dot-o
Commit: 63fb7df9ebe2fed9bacb2cdeadc7acc7d13e0f45
Parents: b9a73b7
Author: Dave Johnson <dm...@apigee.com>
Authored: Fri Oct 31 16:05:41 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Fri Oct 31 16:05:41 2014 -0400

----------------------------------------------------------------------
 .../java/org/apache/usergrid/rest/filters/HealthCheckFilter.java   | 2 --
 1 file changed, 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/63fb7df9/stack/rest/src/main/java/org/apache/usergrid/rest/filters/HealthCheckFilter.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/filters/HealthCheckFilter.java b/stack/rest/src/main/java/org/apache/usergrid/rest/filters/HealthCheckFilter.java
index 4ba9b09..be09ef1 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/filters/HealthCheckFilter.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/filters/HealthCheckFilter.java
@@ -56,8 +56,6 @@ public class HealthCheckFilter implements Filter {
         if ( !emf.verifyQueryIndexModuleHealthy() ) {
             throw new RuntimeException("Error connecting to query index");
         }
-
-        throw new RuntimeException("Foo!");
     }
 
     @Override