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/03/15 01:27:01 UTC
[13/50] [abbrv] git commit: Support for non-embedded ElasticSearch
Support for non-embedded ElasticSearch
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/58df930e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/58df930e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/58df930e
Branch: refs/heads/asyncqueue
Commit: 58df930e7abc71903d89405b3f4e7a68a5dd178a
Parents: da87021
Author: Dave Johnson <dm...@apigee.com>
Authored: Wed Mar 5 17:05:03 2014 -0500
Committer: Dave Johnson <dm...@apigee.com>
Committed: Wed Mar 5 17:05:03 2014 -0500
----------------------------------------------------------------------
.../usergrid/persistence/index/IndexFig.java | 31 +++++---
.../persistence/index/impl/EsProvider.java | 20 ++++-
.../persistence/index/impl/CollectionIT.java | 3 +
.../index/impl/ElasticSearchRule.java | 59 +++++++++++++++
.../index/impl/ElasticSearchTest.java | 1 -
.../index/impl/EntityCollectionIndexST.java | 78 --------------------
.../impl/EntityCollectionIndexStressTest.java | 78 ++++++++++++++++++++
.../usergrid/persistence/index/impl/GeoIT.java | 8 +-
.../persistence/index/impl/IndexIT.java | 5 +-
.../index/legacy/CoreApplication.java | 1 -
.../index/utils/ElasticSearchRule.java | 65 ----------------
.../src/test/resources/log4j.properties | 8 +-
12 files changed, 194 insertions(+), 163 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/58df930e/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 8b9b7d3..3140142 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
@@ -25,32 +25,45 @@ import org.safehaus.guicyfig.Key;
public interface IndexFig extends GuicyFig {
- public static final String QUERY_LIMIT_DEFAULT = "index.query.limit.default";
+ public static final String ELASTICSEARCH_HOSTS = "elasticsearch.hosts";
+
+ public static final String ELASTICSEARCH_PORT = "elasticsearch.port";
public static final String ELASTICSEARCH_INDEXNAME = "elasticsearch.indexname";
public static final String ELASTICSEARCH_EMBEDDED = "elasticsearch.embedded";
- public static final String ELASTICSEARCH_FORCE_REFRESH = "elasticsearch.force-refresh";
-
public static final String QUERY_CURSOR_TIMEOUT_MINUTES = "elasticsearch.cursor-timeout.minutes";
- @Default( "100" )
- @Key( QUERY_LIMIT_DEFAULT )
- int getQueryLimitDefault();
+ public static final String QUERY_LIMIT_DEFAULT = "index.query.limit.default";
- @Default( "1" )
- @Key( QUERY_CURSOR_TIMEOUT_MINUTES )
- int getQueryCursorTimeout();
+ public static final String ELASTICSEARCH_FORCE_REFRESH = "elasticsearch.force-refresh";
+
+
+ @Default( "127.0.0.1" )
+ @Key( ELASTICSEARCH_HOSTS )
+ String getHosts();
+
+ @Default( "9200" )
+ @Key( ELASTICSEARCH_PORT )
+ int getPort();
@Default( "usergrid" )
@Key( ELASTICSEARCH_INDEXNAME )
String getIndexName();
+
+ @Default( "1" )
+ @Key( QUERY_CURSOR_TIMEOUT_MINUTES )
+ int getQueryCursorTimeout();
@Default( "false" )
@Key( ELASTICSEARCH_EMBEDDED )
boolean isEmbedded();
+ @Default( "100" )
+ @Key( QUERY_LIMIT_DEFAULT )
+ int getQueryLimitDefault();
+
@Default( "false" )
@Key( ELASTICSEARCH_FORCE_REFRESH )
public boolean isForcedRefresh();
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/58df930e/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 878b60c..44dd9e6 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
@@ -23,10 +23,14 @@ import com.google.inject.Singleton;
import org.apache.usergrid.persistence.collection.util.AvailablePortFinder;
import org.apache.usergrid.persistence.index.IndexFig;
import org.elasticsearch.client.Client;
+import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.common.settings.ImmutableSettings;
import org.elasticsearch.common.settings.Settings;
+import org.elasticsearch.common.transport.InetSocketTransportAddress;
import org.elasticsearch.node.Node;
import org.elasticsearch.node.NodeBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
@@ -34,6 +38,7 @@ import org.elasticsearch.node.NodeBuilder;
*/
@Singleton
public class EsProvider {
+ private static final Logger log = LoggerFactory.getLogger( EsProvider.class );
private final IndexFig indexFig;
private Client client;
@@ -44,9 +49,13 @@ public class EsProvider {
}
public synchronized Client getClient() {
+
if ( client == null ) {
+
if ( indexFig.isEmbedded() ) {
- // unique port and directory names so multiple instances of ES can run concurrently.
+
+ log.info("Starting ElasticSearch");
+
int port = AvailablePortFinder.getNextAvailable( 2000 );
Settings settings = ImmutableSettings.settingsBuilder()
.put( "node.http.enabled", true )
@@ -61,8 +70,13 @@ public class EsProvider {
Node node = NodeBuilder.nodeBuilder().local( true ).settings( settings ).node();
client = node.client();
- } else {
- throw new UnsupportedOperationException("Non-embedded ElasticSearch not yet supported");
+ } else { // build client that connects to all hosts
+
+ TransportClient tclient = new TransportClient();
+ for ( String host : indexFig.getHosts().split(",") ) {
+ tclient.addTransportAddress(new InetSocketTransportAddress( host, indexFig.getPort() ));
+ }
+ client = tclient;
}
}
return client;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/58df930e/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/CollectionIT.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/CollectionIT.java b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/CollectionIT.java
index f8736de..c4b5102 100644
--- a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/CollectionIT.java
+++ b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/CollectionIT.java
@@ -63,6 +63,9 @@ public class CollectionIT {
private static final Logger LOG = LoggerFactory.getLogger( CollectionIT.class );
@ClassRule
+ public static ElasticSearchRule es = new ElasticSearchRule();
+
+ @ClassRule
public static CassandraRule cass = new CassandraRule();
@Inject
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/58df930e/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/ElasticSearchRule.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/ElasticSearchRule.java b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/ElasticSearchRule.java
new file mode 100644
index 0000000..5ffeecb
--- /dev/null
+++ b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/ElasticSearchRule.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License. For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+
+package org.apache.usergrid.persistence.index.impl;
+
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+import org.apache.usergrid.persistence.index.IndexFig;
+import org.elasticsearch.client.Client;
+import org.junit.rules.ExternalResource;
+import org.safehaus.guicyfig.GuicyFigModule;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+public class ElasticSearchRule extends ExternalResource {
+ private static final Logger log = LoggerFactory.getLogger( ElasticSearchRule.class );
+
+ private Client client;
+
+ private final IndexFig indexFig;
+
+ private EsProvider esProvider;
+
+ public ElasticSearchRule() {
+ Injector injector = Guice.createInjector( new GuicyFigModule( IndexFig.class ) );
+ indexFig = injector.getInstance( IndexFig.class );
+ esProvider = injector.getInstance( EsProvider.class );
+ }
+
+ @Override
+ protected void after() {
+ log.info("Stopping ElasticSearch");
+ }
+
+ @Override
+ protected void before() throws Throwable {
+ client = esProvider.getClient();
+ }
+
+ public Client getClient() {
+ return client;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/58df930e/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/ElasticSearchTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/ElasticSearchTest.java b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/ElasticSearchTest.java
index f5d294a..9ae3534 100644
--- a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/ElasticSearchTest.java
+++ b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/ElasticSearchTest.java
@@ -27,7 +27,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.RandomStringUtils;
-import org.apache.usergrid.persistence.index.utils.ElasticSearchRule;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingResponse;
import org.elasticsearch.action.get.GetResponse;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/58df930e/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityCollectionIndexST.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityCollectionIndexST.java b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityCollectionIndexST.java
deleted file mode 100644
index c2e693c..0000000
--- a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityCollectionIndexST.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. The ASF licenses this file to You
- * under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License. For additional information regarding
- * copyright in this work, please see the NOTICE file in the top level
- * directory of this distribution.
- */
-package org.apache.usergrid.persistence.index.impl;
-
-import com.google.inject.Inject;
-import java.io.IOException;
-import org.apache.commons.lang3.RandomStringUtils;
-import org.apache.commons.lang3.time.StopWatch;
-import org.apache.usergrid.persistence.collection.CollectionScope;
-import org.apache.usergrid.persistence.collection.impl.CollectionScopeImpl;
-import org.apache.usergrid.persistence.collection.util.EntityUtils;
-import org.apache.usergrid.persistence.index.EntityCollectionIndex;
-import org.apache.usergrid.persistence.index.EntityCollectionIndexFactory;
-import org.apache.usergrid.persistence.index.guice.TestIndexModule;
-import org.apache.usergrid.persistence.model.entity.Entity;
-import org.apache.usergrid.persistence.model.entity.Id;
-import org.apache.usergrid.persistence.model.entity.SimpleId;
-import org.apache.usergrid.persistence.model.field.StringField;
-import org.apache.usergrid.persistence.model.util.UUIDGenerator;
-import org.jukito.JukitoRunner;
-import org.jukito.UseModules;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-@RunWith(JukitoRunner.class)
-@UseModules(TestIndexModule.class)
-public class EntityCollectionIndexST {
- private static final Logger log = LoggerFactory.getLogger( EntityCollectionIndexST.class );
-
- @Inject
- public EntityCollectionIndexFactory collectionIndexFactory;
-
- @Test
- public void indexThousands() throws IOException {
-
- Id appId = new SimpleId("application");
- Id orgId = new SimpleId("organization");
- CollectionScope scope = new CollectionScopeImpl( appId, orgId, "contacts" );
- EntityCollectionIndex index = collectionIndexFactory.createCollectionIndex( scope );
-
- int limit = 10000;
- StopWatch timer = new StopWatch();
- timer.start();
- for ( int i = 0; i < limit; i++ ) {
-
- Entity entity = new Entity(new SimpleId(UUIDGenerator.newTimeUUID(), scope.getName()));
- EntityUtils.setVersion( entity, UUIDGenerator.newTimeUUID() );
- entity.setField( new StringField( "name", RandomStringUtils.randomAlphabetic(20)) );
-
- index.index( entity );
-
- if ( i % 1000 == 0 ) {
- log.info(" Indexed: " + i);
- }
- }
- timer.stop();
- log.info( "Total time to index {} entries {}ms, average {}ms/entry",
- limit, timer.getTime(), timer.getTime() / limit );
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/58df930e/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityCollectionIndexStressTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityCollectionIndexStressTest.java b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityCollectionIndexStressTest.java
new file mode 100644
index 0000000..48a9bbf
--- /dev/null
+++ b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityCollectionIndexStressTest.java
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License. For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.usergrid.persistence.index.impl;
+
+import com.google.inject.Inject;
+import java.io.IOException;
+import org.apache.commons.lang3.RandomStringUtils;
+import org.apache.commons.lang3.time.StopWatch;
+import org.apache.usergrid.persistence.collection.CollectionScope;
+import org.apache.usergrid.persistence.collection.impl.CollectionScopeImpl;
+import org.apache.usergrid.persistence.collection.util.EntityUtils;
+import org.apache.usergrid.persistence.index.EntityCollectionIndex;
+import org.apache.usergrid.persistence.index.EntityCollectionIndexFactory;
+import org.apache.usergrid.persistence.index.guice.TestIndexModule;
+import org.apache.usergrid.persistence.model.entity.Entity;
+import org.apache.usergrid.persistence.model.entity.Id;
+import org.apache.usergrid.persistence.model.entity.SimpleId;
+import org.apache.usergrid.persistence.model.field.StringField;
+import org.apache.usergrid.persistence.model.util.UUIDGenerator;
+import org.jukito.JukitoRunner;
+import org.jukito.UseModules;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+@RunWith(JukitoRunner.class)
+@UseModules(TestIndexModule.class)
+public class EntityCollectionIndexStressTest {
+ private static final Logger log = LoggerFactory.getLogger( EntityCollectionIndexStressTest.class );
+
+ @Inject
+ public EntityCollectionIndexFactory collectionIndexFactory;
+
+ @Test
+ public void indexThousands() throws IOException {
+
+ Id appId = new SimpleId("application");
+ Id orgId = new SimpleId("organization");
+ CollectionScope scope = new CollectionScopeImpl( appId, orgId, "contacts" );
+ EntityCollectionIndex index = collectionIndexFactory.createCollectionIndex( scope );
+
+ int limit = 10000;
+ StopWatch timer = new StopWatch();
+ timer.start();
+ for ( int i = 0; i < limit; i++ ) {
+
+ Entity entity = new Entity(new SimpleId(UUIDGenerator.newTimeUUID(), scope.getName()));
+ EntityUtils.setVersion( entity, UUIDGenerator.newTimeUUID() );
+ entity.setField( new StringField( "name", RandomStringUtils.randomAlphabetic(20)) );
+
+ index.index( entity );
+
+ if ( i % 1000 == 0 ) {
+ log.info(" Indexed: " + i);
+ }
+ }
+ timer.stop();
+ log.info( "Total time to index {} entries {}ms, average {}ms/entry",
+ limit, timer.getTime(), timer.getTime() / limit );
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/58df930e/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/GeoIT.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/GeoIT.java b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/GeoIT.java
index 5580dbe..c18b0f9 100644
--- a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/GeoIT.java
+++ b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/GeoIT.java
@@ -60,6 +60,9 @@ public class GeoIT {
private static final Logger LOG = LoggerFactory.getLogger( GeoIT.class );
@ClassRule
+ public static ElasticSearchRule es = new ElasticSearchRule();
+
+ @ClassRule
public static CassandraRule cass = new CassandraRule();
@Inject
@@ -78,6 +81,7 @@ public class GeoIT {
@Inject
public EntityCollectionIndexFactory collectionIndexFactory;
+
public GeoIT() {
super();
}
@@ -237,7 +241,7 @@ public class GeoIT {
// save objects in a diagonal line from -90 -180 to 90 180
- int numEntities = 50;
+ int numEntities = 10;
float minLattitude = -90;
float maxLattitude = 90;
@@ -400,7 +404,7 @@ public class GeoIT {
collectionManagerFactory, collectionIndexFactory );
assertNotNull( em );
- int size = 10;
+ int size = 100;
int min = 50;
int max = 90;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/58df930e/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/IndexIT.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/IndexIT.java b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/IndexIT.java
index ce3a9ae..d51db78 100644
--- a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/IndexIT.java
+++ b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/IndexIT.java
@@ -54,6 +54,9 @@ public class IndexIT {
private static final Logger LOG = LoggerFactory.getLogger( IndexIT.class );
@ClassRule
+ public static ElasticSearchRule es = new ElasticSearchRule();
+
+ @ClassRule
public static CassandraRule cass = new CassandraRule();
@Inject
@@ -92,7 +95,7 @@ public class IndexIT {
Map<String, Object> properties = new LinkedHashMap<String, Object>();
properties.put( "name", name );
- em.create( "items", properties );
+ em.create( "item", properties );
}
int i = 0;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/58df930e/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/legacy/CoreApplication.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/legacy/CoreApplication.java b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/legacy/CoreApplication.java
index ab099da..fdb23c7 100644
--- a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/legacy/CoreApplication.java
+++ b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/legacy/CoreApplication.java
@@ -133,7 +133,6 @@ public class CoreApplication implements Application, TestRule {
protected void after( Description description ) {
- LOG.info( "Test {}: finish with application", description.getDisplayName() );
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/58df930e/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/utils/ElasticSearchRule.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/utils/ElasticSearchRule.java b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/utils/ElasticSearchRule.java
deleted file mode 100644
index d3eccff..0000000
--- a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/utils/ElasticSearchRule.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. The ASF licenses this file to You
- * under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License. For additional information regarding
- * copyright in this work, please see the NOTICE file in the top level
- * directory of this distribution.
- */
-
-package org.apache.usergrid.persistence.index.utils;
-
-import org.apache.usergrid.persistence.collection.util.AvailablePortFinder;
-import org.elasticsearch.client.Client;
-import org.elasticsearch.common.settings.ImmutableSettings;
-import org.elasticsearch.common.settings.Settings;
-import org.elasticsearch.node.Node;
-import org.elasticsearch.node.NodeBuilder;
-import org.junit.rules.ExternalResource;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-public class ElasticSearchRule extends ExternalResource {
- private static final Logger log = LoggerFactory.getLogger( ElasticSearchRule.class );
-
- private Client client;
-
- @Override
- protected void after() {
- client.close();
- }
-
- @Override
- protected void before() throws Throwable {
-
- // use unique port and directory names so multiple instances of ES can run concurrently.
- int port = AvailablePortFinder.getNextAvailable(2000);
- Settings settings = ImmutableSettings.settingsBuilder()
- .put("node.http.enabled", true)
- .put("transport.tcp.port", port )
- .put("path.logs","target/elasticsearch/logs_" + port )
- .put("path.data","target/elasticsearch/data_" + port )
- .put("gateway.type", "none" )
- .put("index.store.type", "memory" )
- .put("index.number_of_shards", 1 )
- .put("index.number_of_replicas", 1).build();
-
- Node node = NodeBuilder.nodeBuilder().local(true).settings(settings).node();
- client = node.client();
- }
-
- public Client getClient() {
- return client;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/58df930e/stack/corepersistence/queryindex/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/resources/log4j.properties b/stack/corepersistence/queryindex/src/test/resources/log4j.properties
index d52f157..cc51888 100644
--- a/stack/corepersistence/queryindex/src/test/resources/log4j.properties
+++ b/stack/corepersistence/queryindex/src/test/resources/log4j.properties
@@ -1,4 +1,4 @@
-log4j.rootLogger=ERROR,stdout
+log4j.rootLogger=INFO,stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
@@ -8,8 +8,10 @@ log4j.logger.org.safehaus.guicyfig=ERROR
log4j.logger.org.safehaus.chop.plugin=INFO
log4j.logger.org.safehaus.chop.api.store.amazon=DEBUG
-log4j.logger.org.apache.http=ERROR
-log4j.logger.com.amazonaws.request=ERROR
+log4j.logger.connectionpool.impl=ERROR
+
+log4j.logger.org.apache=INFO
+log4j.logger.com.amazonaws=ERROR
log4j.logger.org.apache.usergrid.persistence.query=DEBUG
log4j.logger.org.apache.usergrid.persistence.index=DEBUG