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 19:15:00 UTC
[1/8] git commit: add variable check
Repository: incubator-usergrid
Updated Branches:
refs/heads/two-dot-o-events 7dec37b61 -> 4a36aa16c
add variable check
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/e79fec00
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/e79fec00
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/e79fec00
Branch: refs/heads/two-dot-o-events
Commit: e79fec001c86d95678cc116bfbee1831c563c732
Parents: 0bfca7e
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Oct 30 09:37:11 2014 -0600
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Oct 30 09:37:11 2014 -0600
----------------------------------------------------------------------
stack/loadtests/src/main/scripts/gatling-mvn.sh | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e79fec00/stack/loadtests/src/main/scripts/gatling-mvn.sh
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scripts/gatling-mvn.sh b/stack/loadtests/src/main/scripts/gatling-mvn.sh
index 531a638..e9087d5 100644
--- a/stack/loadtests/src/main/scripts/gatling-mvn.sh
+++ b/stack/loadtests/src/main/scripts/gatling-mvn.sh
@@ -12,6 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
+
+[ "$#" -eq 6 ] || die "6 arguments required, $# provided. Arguments are URL ORG APP NOTIFIERNAME NUM_USERS RAMP_TIME"
+
URL="$1"
ORG="$2"
APP="$3"
[3/8] git commit: Merge branch 'two-dot-o' of
https://git-wip-us.apache.org/repos/asf/incubator-usergrid into two-dot-o
Posted by sn...@apache.org.
Merge branch 'two-dot-o' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into two-dot-o
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/aba51211
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/aba51211
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/aba51211
Branch: refs/heads/two-dot-o-events
Commit: aba512115139e94df7c78a19a70f5f2a8647b5ca
Parents: b787a49 e79fec0
Author: Todd Nine <to...@apache.org>
Authored: Thu Oct 30 17:07:06 2014 +0000
Committer: Todd Nine <to...@apache.org>
Committed: Thu Oct 30 17:07:06 2014 +0000
----------------------------------------------------------------------
portal/js/push/push-config.html | 89 +--
.../main/resources/usergrid-default.properties | 3 +
.../corepersistence/CpEntityDeleteListener.java | 45 +-
.../corepersistence/CpEntityManager.java | 73 ++-
.../corepersistence/CpEntityManagerFactory.java | 53 +-
.../corepersistence/CpManagerCache.java | 117 ++--
.../corepersistence/CpRelationManager.java | 31 +-
.../usergrid/corepersistence/CpSetup.java | 1 -
.../usergrid/corepersistence/CpWalker.java | 44 +-
.../results/FilteringLoader.java | 63 +-
.../results/ResultsLoaderFactory.java | 5 +-
.../results/ResultsLoaderFactoryImpl.java | 4 -
.../results/ResultsVerifier.java | 6 +-
.../results/VersionVerifier.java | 8 +-
.../corepersistence/util/CpEntityMapUtils.java | 5 +-
.../usergrid/persistence/entities/Notifier.java | 2 -
.../usergrid/persistence/index/EntityIndex.java | 4 +-
.../persistence/index/EntityIndexBatch.java | 6 -
.../persistence/index/EntityIndexFactory.java | 2 -
.../usergrid/persistence/index/IndexScope.java | 9 +-
.../persistence/index/guice/IndexModule.java | 1 -
.../index/impl/EsEntityIndexBatchImpl.java | 3 +-
.../index/impl/EsEntityIndexImpl.java | 71 ++-
.../persistence/index/impl/EsProvider.java | 11 +-
.../index/query/CandidateResults.java | 7 +-
.../persistence/index/query/EntityResults.java | 6 +-
.../persistence/index/query/Identifier.java | 3 +-
.../usergrid/persistence/index/query/Query.java | 27 +-
.../persistence/index/query/Results.java | 4 +-
.../queue/impl/QueueScopeFactoryImpl.java | 2 +-
.../queue/impl/SQSQueueManagerImpl.java | 6 +-
stack/loadtests/src/main/scripts/gatling-mvn.sh | 16 +
.../_maven.repositories | 8 -
...14c97c6e3ef40c88590e1b196d3ec55b-javadoc.jar | Bin 160201 -> 0 bytes
...14c97c6e3ef40c88590e1b196d3ec55b-sources.jar | Bin 59744 -> 0 bytes
...63dec68314c97c6e3ef40c88590e1b196d3ec55b.jar | Bin 67751 -> 0 bytes
...7c6e3ef40c88590e1b196d3ec55b.jar.lastUpdated | 13 -
...63dec68314c97c6e3ef40c88590e1b196d3ec55b.pom | 166 ------
...7c6e3ef40c88590e1b196d3ec55b.pom.lastUpdated | 13 -
.../pushy-0.4-apigee.pom | 166 ------
stack/pom.xml | 2 +-
stack/services/pom.xml | 2 +-
.../notifications/ApplicationQueueManager.java | 585 ++-----------------
.../notifications/InactiveDeviceManager.java | 79 +++
.../notifications/NotificationsService.java | 35 +-
.../services/notifications/ProviderAdapter.java | 42 +-
.../notifications/ProviderAdapterFactory.java | 49 ++
.../services/notifications/QueueListener.java | 84 ++-
.../services/notifications/TaskManager.java | 17 +-
.../services/notifications/TestAdapter.java | 23 +-
.../notifications/apns/APNsAdapter.java | 200 +++----
.../notifications/apns/EntityPushManager.java | 75 +++
.../apns/ExpiredTokenListener.java | 52 ++
.../services/notifications/gcm/GCMAdapter.java | 142 +++--
.../impl/ApplicationQueueManagerImpl.java | 523 +++++++++++++++++
.../services/notifiers/NotifiersService.java | 30 +-
.../notifications/NotifiersServiceIT.java | 33 +-
.../apns/MockSuccessfulProviderAdapter.java | 38 +-
.../apns/NotificationsServiceIT.java | 67 +--
.../gcm/MockSuccessfulProviderAdapter.java | 33 +-
.../gcm/NotificationsServiceIT.java | 81 +--
61 files changed, 1586 insertions(+), 1699 deletions(-)
----------------------------------------------------------------------
[8/8] git commit: Merge branch 'two-dot-o' of
https://git-wip-us.apache.org/repos/asf/incubator-usergrid into
two-dot-o-events
Posted by sn...@apache.org.
Merge branch 'two-dot-o' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into two-dot-o-events
Conflicts:
stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerImpl.java
stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/EntityIndex.java
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/4a36aa16
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/4a36aa16
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/4a36aa16
Branch: refs/heads/two-dot-o-events
Commit: 4a36aa16ccdb7b60122bcf32522788706beff806
Parents: 7000bd9 b6a8bc6
Author: Dave Johnson <dm...@apigee.com>
Authored: Fri Oct 31 14:09:36 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Fri Oct 31 14:09:36 2014 -0400
----------------------------------------------------------------------
.../main/resources/usergrid-default.properties | 2 +
.../corepersistence/CpEntityManagerFactory.java | 20 ++++
.../HybridEntityManagerFactory.java | 10 ++
.../persistence/EntityManagerFactory.java | 4 +
.../cassandra/EntityManagerFactoryImpl.java | 10 ++
.../collection/EntityCollectionManager.java | 9 +-
.../impl/EntityCollectionManagerImpl.java | 110 ++++++++++++-------
.../serialization/SerializationFig.java | 4 -
.../collection/EntityCollectionManagerIT.java | 12 ++
.../usergrid/persistence/index/EntityIndex.java | 11 +-
.../usergrid/persistence/index/IndexFig.java | 12 ++
.../index/impl/EsEntityIndexImpl.java | 76 ++++++++-----
.../persistence/index/impl/EsProvider.java | 2 +
.../impl/EntityConnectionIndexImplTest.java | 22 +++-
stack/loadtests/src/main/scripts/gatling-mvn.sh | 3 +
.../src/test/resources/logback-test.xml | 41 +++++++
stack/loadtests/src/test/resources/logback.xml | 3 +-
.../apache/usergrid/rest/SwaggerServlet.java | 5 +-
.../rest/filters/HealthCheckFilter.java | 68 ++++++++++++
stack/rest/src/main/webapp/WEB-INF/web.xml | 10 ++
20 files changed, 351 insertions(+), 83 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4a36aa16/stack/core/src/main/java/org/apache/usergrid/corepersistence/HybridEntityManagerFactory.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4a36aa16/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityCollectionManager.java
----------------------------------------------------------------------
diff --cc stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityCollectionManager.java
index 5b75f22,360d8e0..0205824
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityCollectionManager.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityCollectionManager.java
@@@ -70,10 -68,21 +67,16 @@@ public interface EntityCollectionManage
*/
public Observable<EntitySet> load(Collection<Id> entityIds);
-
/**
* Takes the change and reloads an entity with all changes applied in this entity applied.
- * The resulting entity from calling load will be the previous version of this entity + the entity
- * in this object applied to it.
- * @param entity
- * @return
+ * The resulting entity from calling load will be the previous version of this entity plus
+ * the entity in this object applied to it.
*/
public Observable<Entity> update ( Entity entity );
+
+ /**
+ * Return true if connection query index system (Cassandra) is healthy.
+ */
+ public boolean isHealthy();
+
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4a36aa16/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerImpl.java
----------------------------------------------------------------------
diff --cc stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerImpl.java
index 5b6265c,f24334e..26ab6aa
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerImpl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerImpl.java
@@@ -34,7 -31,10 +34,6 @@@ import org.apache.usergrid.persistence.
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
- import org.apache.usergrid.persistence.collection.guice.CollectionTaskExecutor;
-import org.apache.usergrid.persistence.collection.CollectionScope;
-import org.apache.usergrid.persistence.collection.EntityCollectionManager;
-import org.apache.usergrid.persistence.collection.EntitySet;
-import org.apache.usergrid.persistence.collection.VersionSet;
import org.apache.usergrid.persistence.collection.guice.Write;
import org.apache.usergrid.persistence.collection.guice.WriteUpdate;
import org.apache.usergrid.persistence.collection.mvcc.MvccEntitySerializationStrategy;
@@@ -58,6 -57,12 +55,14 @@@ import org.apache.usergrid.persistence.
import com.google.common.base.Preconditions;
import com.google.inject.Inject;
import com.google.inject.assistedinject.Assisted;
+ import com.netflix.astyanax.Keyspace;
+ import com.netflix.astyanax.connectionpool.OperationResult;
+ import com.netflix.astyanax.model.ColumnFamily;
+ import com.netflix.astyanax.model.CqlResult;
+ import com.netflix.astyanax.serializers.StringSerializer;
++import org.apache.usergrid.persistence.collection.guice.CollectionTaskExecutor;
+ import org.apache.usergrid.persistence.collection.serialization.SerializationFig;
++import org.apache.usergrid.persistence.core.task.TaskExecutor;
import rx.Observable;
import rx.Subscriber;
@@@ -73,11 -78,11 +78,10 @@@ import rx.schedulers.Schedulers
*/
public class EntityCollectionManagerImpl implements EntityCollectionManager {
- private static final Logger log = LoggerFactory.getLogger(EntityCollectionManagerImpl.class);
+ private static final Logger logger = LoggerFactory.getLogger(EntityCollectionManagerImpl.class);
private final CollectionScope collectionScope;
- private final UUIDService uuidService;
-
//start stages
private final WriteStart writeStart;
private final WriteStart writeUpdate;
@@@ -90,37 -96,28 +94,37 @@@
private final MarkStart markStart;
private final MarkCommit markCommit;
- private final TaskExecutor taskExecutor;
-
- private EntityVersionCleanupFactory entityVersionCleanupFactory;
- private EntityVersionCreatedFactory entityVersionCreatedFactory;
-
private final MvccLogEntrySerializationStrategy mvccLogEntrySerializationStrategy;
private final MvccEntitySerializationStrategy entitySerializationStrategy;
- private final EntityDeletedFactory entityDeletedFactory;
private final UniqueValueSerializationStrategy uniqueValueSerializationStrategy;
++ private final EntityVersionCleanupFactory entityVersionCleanupFactory;
++ private final EntityVersionCreatedFactory entityVersionCreatedFactory;
++ private final EntityDeletedFactory entityDeletedFactory;
++ private final TaskExecutor taskExecutor;
++
+ private final Keyspace keyspace;
+ private SerializationFig config;
+
@Inject
- public EntityCollectionManagerImpl(
- final UUIDService uuidService,
- @Write final WriteStart writeStart,
- @WriteUpdate final WriteStart writeUpdate,
- final WriteUniqueVerify writeVerifyUnique,
- final WriteOptimisticVerify writeOptimisticVerify,
- final WriteCommit writeCommit,
- final RollbackAction rollback,
- final MarkStart markStart,
- final MarkCommit markCommit,
- final EntityVersionCleanupFactory entityVersionCleanupFactory,
- final EntityVersionCreatedFactory entityVersionCreatedFactory,
- final MvccEntitySerializationStrategy entitySerializationStrategy,
- final UniqueValueSerializationStrategy uniqueValueSerializationStrategy,
- final MvccLogEntrySerializationStrategy mvccLogEntrySerializationStrategy,
- final EntityDeletedFactory entityDeletedFactory,
+ public EntityCollectionManagerImpl(
+ @Write final WriteStart writeStart,
+ @WriteUpdate final WriteStart writeUpdate,
+ final WriteUniqueVerify writeVerifyUnique,
+ final WriteOptimisticVerify writeOptimisticVerify,
+ final WriteCommit writeCommit, final RollbackAction rollback,
+ final MarkStart markStart, final MarkCommit markCommit,
+ final MvccEntitySerializationStrategy entitySerializationStrategy,
+ final UniqueValueSerializationStrategy uniqueValueSerializationStrategy,
+ final MvccLogEntrySerializationStrategy mvccLogEntrySerializationStrategy,
+ final Keyspace keyspace,
+ final SerializationFig config,
++ final EntityVersionCleanupFactory entityVersionCleanupFactory,
++ final EntityVersionCreatedFactory entityVersionCreatedFactory,
++ final EntityDeletedFactory entityDeletedFactory,
+ @CollectionTaskExecutor final TaskExecutor taskExecutor,
- @Assisted final CollectionScope collectionScope
-
+ @Assisted final CollectionScope collectionScope
) {
this.uniqueValueSerializationStrategy = uniqueValueSerializationStrategy;
this.entitySerializationStrategy = entitySerializationStrategy;
@@@ -141,10 -134,11 +141,15 @@@
this.markStart = markStart;
this.markCommit = markCommit;
- this.uuidService = uuidService;
- this.collectionScope = collectionScope;
- this.taskExecutor = taskExecutor;
+ this.keyspace = keyspace;
+ this.config = config;
+
+ this.entityVersionCleanupFactory = entityVersionCleanupFactory;
++ this.entityVersionCreatedFactory = entityVersionCreatedFactory;
++ this.entityDeletedFactory = entityDeletedFactory;
++ this.taskExecutor = taskExecutor;
++
+ this.collectionScope = collectionScope;
this.mvccLogEntrySerializationStrategy = mvccLogEntrySerializationStrategy;
}
[4/8] git commit: Make number of ElasticSearch shards and replicas
configurable via usergrid props.
Posted by sn...@apache.org.
Make number of ElasticSearch shards and replicas configurable via usergrid props.
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/cb848d81
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/cb848d81
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/cb848d81
Branch: refs/heads/two-dot-o-events
Commit: cb848d810d1bf095bb7108965b969c49a03cbfdd
Parents: 0bfca7e
Author: Dave Johnson <dm...@apigee.com>
Authored: Thu Oct 30 14:02:58 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Thu Oct 30 14:02:58 2014 -0400
----------------------------------------------------------------------
.../src/main/resources/usergrid-default.properties | 2 ++
.../org/apache/usergrid/persistence/index/IndexFig.java | 12 ++++++++++++
.../usergrid/persistence/index/impl/EsProvider.java | 2 ++
3 files changed, 16 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cb848d81/stack/config/src/main/resources/usergrid-default.properties
----------------------------------------------------------------------
diff --git a/stack/config/src/main/resources/usergrid-default.properties b/stack/config/src/main/resources/usergrid-default.properties
index fb043d4..43e3920 100644
--- a/stack/config/src/main/resources/usergrid-default.properties
+++ b/stack/config/src/main/resources/usergrid-default.properties
@@ -59,6 +59,8 @@ elasticsearch.cluster_name=elasticsearch
elasticsearch.index_prefix=usergrid
elasticsearch.hosts=127.0.0.1
elasticsearch.port=9300
+elasticsearch.number_shards=1
+elasticsearch.number_replicas=1
index.query.limit.default=1000
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cb848d81/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 142c48a..e2ab857 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
@@ -39,6 +39,10 @@ public interface IndexFig extends GuicyFig {
public static final String ELASTICSEARCH_STARTUP = "elasticsearch.startup";
+ public static final String ELASTICSEARCH_NUMBER_OF_SHARDS = "elasticsearch.number_shards";
+
+ public static final String ELASTICSEARCH_NUMBER_OF_REPLICAS = "elasticsearch.number_replicas";
+
public static final String QUERY_CURSOR_TIMEOUT_MINUTES = "elasticsearch.cursor_timeout.minutes";
public static final String ELASTICSEARCH_FORCE_REFRESH = "elasticsearch.force_refresh";
@@ -82,4 +86,12 @@ public interface IndexFig extends GuicyFig {
@Default("default")
@Key( ELASTICSEARCH_NODENAME )
public String getNodeName();
+
+ @Default("1")
+ @Key( ELASTICSEARCH_NUMBER_OF_SHARDS )
+ public int getNumberOfShards();
+
+ @Default("1")
+ @Key( ELASTICSEARCH_NUMBER_OF_REPLICAS )
+ public int numberOfReplicas();
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cb848d81/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 efc61a9..a353b43 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
@@ -161,6 +161,8 @@ 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 )
[2/8] git commit: added additional logging for tests
Posted by sn...@apache.org.
added additional logging for tests
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/b787a49b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/b787a49b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/b787a49b
Branch: refs/heads/two-dot-o-events
Commit: b787a49bebbfb78ef3df992b522217c9253ff16f
Parents: 8df2185
Author: Todd Nine <to...@apache.org>
Authored: Thu Oct 30 17:05:32 2014 +0000
Committer: Todd Nine <to...@apache.org>
Committed: Thu Oct 30 17:05:32 2014 +0000
----------------------------------------------------------------------
.../src/test/resources/logback-test.xml | 22 ++++++++++++++++++++
1 file changed, 22 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b787a49b/stack/loadtests/src/test/resources/logback-test.xml
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/test/resources/logback-test.xml b/stack/loadtests/src/test/resources/logback-test.xml
new file mode 100644
index 0000000..d15f9f4
--- /dev/null
+++ b/stack/loadtests/src/test/resources/logback-test.xml
@@ -0,0 +1,22 @@
+<configuration>
+
+ <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%-5level] %logger{15} - %msg%n%rEx</pattern>
+ <immediateFlush>false</immediateFlush>
+ </encoder>
+ </appender>
+
+ <!-- Uncomment for logging ALL HTTP request and responses -->
+ <!-- <logger name="io.gatling.http.ahc.AsyncHandlerActor" level="TRACE" /> -->
+ <!-- Uncomment for logging ONLY FAILED HTTP request and responses -->
+ <logger name="io.gatling.http.ahc.AsyncHandlerActor" level="DEBUG" />
+
+<logger name="io.gatling.http" level="TRACE" />
+ <!-- Uncomment for logging ONLY FAILED HTTP request and responses -->
+
+ <root level="WARN">
+ <appender-ref ref="CONSOLE" />
+ </root>
+
+</configuration>
[6/8] git commit: Add new isHealthy() methods to
EntityCollectionManager and EntityIndex,
and add new HealthCheckFilter that calls them so we can fail fast when ES or
C* not available.
Posted by sn...@apache.org.
Add new isHealthy() methods to EntityCollectionManager and EntityIndex, and add new HealthCheckFilter that calls them so we can fail fast when ES or C* not available.
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/b6a8bc62
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/b6a8bc62
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/b6a8bc62
Branch: refs/heads/two-dot-o-events
Commit: b6a8bc6248dfaebec33d7842feace04a0dfaf5c6
Parents: 5570b9d
Author: Dave Johnson <dm...@apigee.com>
Authored: Fri Oct 31 11:31:32 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Fri Oct 31 11:31:32 2014 -0400
----------------------------------------------------------------------
.../corepersistence/CpEntityManagerFactory.java | 20 ++++
.../HybridEntityManagerFactory.java | 10 ++
.../persistence/EntityManagerFactory.java | 4 +
.../cassandra/EntityManagerFactoryImpl.java | 10 ++
.../collection/EntityCollectionManager.java | 10 +-
.../impl/EntityCollectionManagerImpl.java | 107 ++++++++++++-------
.../serialization/SerializationFig.java | 4 -
.../collection/EntityCollectionManagerIT.java | 12 +++
.../usergrid/persistence/index/EntityIndex.java | 14 +--
.../index/impl/EsEntityIndexImpl.java | 76 ++++++++-----
.../impl/EntityConnectionIndexImplTest.java | 22 +++-
.../src/test/resources/logback-test.xml | 19 ++++
stack/loadtests/src/test/resources/logback.xml | 3 +-
.../apache/usergrid/rest/SwaggerServlet.java | 5 +-
.../rest/filters/HealthCheckFilter.java | 68 ++++++++++++
stack/rest/src/main/webapp/WEB-INF/web.xml | 10 ++
16 files changed, 306 insertions(+), 88 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b6a8bc62/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
index 6e6b461..cf9207a 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
@@ -50,6 +50,7 @@ import org.apache.usergrid.persistence.cassandra.CassandraService;
import org.apache.usergrid.persistence.cassandra.CounterUtils;
import org.apache.usergrid.persistence.cassandra.Setup;
import org.apache.usergrid.persistence.collection.CollectionScope;
+import org.apache.usergrid.persistence.collection.EntityCollectionManager;
import org.apache.usergrid.persistence.collection.EntityCollectionManagerFactory;
import org.apache.usergrid.persistence.collection.impl.CollectionScopeImpl;
import org.apache.usergrid.persistence.core.scope.ApplicationScope;
@@ -719,4 +720,23 @@ public class CpEntityManagerFactory implements EntityManagerFactory, Application
public void rebuildCollectionIndex(UUID appId, String collection, ProgressObserver po ) {
throw new UnsupportedOperationException( "Not supported yet." );
}
+
+ @Override
+ public boolean verifyCollectionsModuleHealthy() {
+
+ CollectionScope collScope = new CollectionScopeImpl(
+ getApplicationScope(SYSTEM_APP_ID).getApplication(),
+ getApplicationScope(SYSTEM_APP_ID).getApplication(),
+ CpNamingUtils.getCollectionScopeNameFromCollectionName( "appinfos" ));
+
+ EntityCollectionManager ecm = managerCache.getEntityCollectionManager( collScope );
+ return ecm.isHealthy();
+ }
+
+ @Override
+ public boolean verifyQueryIndexModuleHealthy() {
+
+ EntityIndex ei = managerCache.getEntityIndex( getApplicationScope( SYSTEM_APP_ID ));
+ return ei.isHealthy();
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b6a8bc62/stack/core/src/main/java/org/apache/usergrid/corepersistence/HybridEntityManagerFactory.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/HybridEntityManagerFactory.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/HybridEntityManagerFactory.java
index 54a5dee..79c3d7d 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/HybridEntityManagerFactory.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/HybridEntityManagerFactory.java
@@ -163,4 +163,14 @@ public class HybridEntityManagerFactory implements EntityManagerFactory, Applica
public void rebuildCollectionIndex(UUID appId, String collection, ProgressObserver po) {
factory.rebuildCollectionIndex(appId, collection, po);
}
+
+ @Override
+ public boolean verifyCollectionsModuleHealthy() {
+ return factory.verifyCollectionsModuleHealthy();
+ }
+
+ @Override
+ public boolean verifyQueryIndexModuleHealthy() {
+ return factory.verifyQueryIndexModuleHealthy();
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b6a8bc62/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManagerFactory.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManagerFactory.java b/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManagerFactory.java
index e57aa69..e1a22c8 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManagerFactory.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManagerFactory.java
@@ -130,6 +130,10 @@ public interface EntityManagerFactory {
public void rebuildCollectionIndex(UUID appId, String collection, ProgressObserver object);
+ public boolean verifyCollectionsModuleHealthy();
+
+ public boolean verifyQueryIndexModuleHealthy();
+
public interface ProgressObserver {
public void onProgress( EntityRef entity);
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b6a8bc62/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImpl.java b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImpl.java
index 399bccd..2654d29 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImpl.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImpl.java
@@ -438,4 +438,14 @@ public class EntityManagerFactoryImpl implements EntityManagerFactory, Applicati
public void rebuildCollectionIndex(UUID appId, String collection, ProgressObserver po) {
throw new UnsupportedOperationException("Not supported.");
}
+
+ @Override
+ public boolean verifyCollectionsModuleHealthy() {
+ return true;
+ }
+
+ @Override
+ public boolean verifyQueryIndexModuleHealthy() {
+ return true;
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b6a8bc62/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityCollectionManager.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityCollectionManager.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityCollectionManager.java
index f976cb5..360d8e0 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityCollectionManager.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityCollectionManager.java
@@ -21,18 +21,14 @@ package org.apache.usergrid.persistence.collection;
import java.util.Collection;
-import java.util.UUID;
import org.apache.usergrid.persistence.model.entity.Entity;
import org.apache.usergrid.persistence.model.entity.Id;
-
import org.apache.usergrid.persistence.model.field.Field;
import rx.Observable;
/**
- *
* The operations for performing changes on an entity
- *
*/
public interface EntityCollectionManager {
@@ -83,4 +79,10 @@ public interface EntityCollectionManager {
* @return
*/
public Observable<Entity> update ( Entity entity );
+
+ /**
+ * Return true if connection query index system (Cassandra) is healthy.
+ */
+ public boolean isHealthy();
+
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b6a8bc62/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerImpl.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerImpl.java
index 9f3c1ea..f24334e 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerImpl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerImpl.java
@@ -19,8 +19,6 @@
package org.apache.usergrid.persistence.collection.impl;
-import java.net.ConnectException;
-import java.util.*;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
@@ -29,7 +27,6 @@ import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
import org.apache.usergrid.persistence.collection.serialization.UniqueValue;
import org.apache.usergrid.persistence.collection.serialization.UniqueValueSerializationStrategy;
import org.apache.usergrid.persistence.collection.serialization.UniqueValueSet;
-import org.apache.usergrid.persistence.model.entity.SimpleId;
import org.apache.usergrid.persistence.model.field.Field;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -38,7 +35,6 @@ import org.apache.usergrid.persistence.collection.CollectionScope;
import org.apache.usergrid.persistence.collection.EntityCollectionManager;
import org.apache.usergrid.persistence.collection.EntitySet;
import org.apache.usergrid.persistence.collection.VersionSet;
-import org.apache.usergrid.persistence.collection.guice.CollectionTaskExecutor;
import org.apache.usergrid.persistence.collection.guice.Write;
import org.apache.usergrid.persistence.collection.guice.WriteUpdate;
import org.apache.usergrid.persistence.collection.mvcc.MvccEntitySerializationStrategy;
@@ -53,8 +49,6 @@ import org.apache.usergrid.persistence.collection.mvcc.stage.write.WriteCommit;
import org.apache.usergrid.persistence.collection.mvcc.stage.write.WriteOptimisticVerify;
import org.apache.usergrid.persistence.collection.mvcc.stage.write.WriteStart;
import org.apache.usergrid.persistence.collection.mvcc.stage.write.WriteUniqueVerify;
-import org.apache.usergrid.persistence.collection.service.UUIDService;
-import org.apache.usergrid.persistence.core.task.TaskExecutor;
import org.apache.usergrid.persistence.core.util.ValidationUtils;
import org.apache.usergrid.persistence.model.entity.Entity;
import org.apache.usergrid.persistence.model.entity.Id;
@@ -63,6 +57,12 @@ import org.apache.usergrid.persistence.model.util.UUIDGenerator;
import com.google.common.base.Preconditions;
import com.google.inject.Inject;
import com.google.inject.assistedinject.Assisted;
+import com.netflix.astyanax.Keyspace;
+import com.netflix.astyanax.connectionpool.OperationResult;
+import com.netflix.astyanax.model.ColumnFamily;
+import com.netflix.astyanax.model.CqlResult;
+import com.netflix.astyanax.serializers.StringSerializer;
+import org.apache.usergrid.persistence.collection.serialization.SerializationFig;
import rx.Observable;
import rx.Subscriber;
@@ -78,10 +78,9 @@ import rx.schedulers.Schedulers;
*/
public class EntityCollectionManagerImpl implements EntityCollectionManager {
- private static final Logger log = LoggerFactory.getLogger(EntityCollectionManagerImpl.class);
+ private static final Logger logger = LoggerFactory.getLogger(EntityCollectionManagerImpl.class);
private final CollectionScope collectionScope;
- private final UUIDService uuidService;
//start stages
@@ -97,32 +96,32 @@ public class EntityCollectionManagerImpl implements EntityCollectionManager {
private final MarkStart markStart;
private final MarkCommit markCommit;
- private final TaskExecutor taskExecutor;
-
private final MvccLogEntrySerializationStrategy mvccLogEntrySerializationStrategy;
private final MvccEntitySerializationStrategy entitySerializationStrategy;
- private UniqueValueSerializationStrategy uniqueValueSerializationStrategy;
+ private final UniqueValueSerializationStrategy uniqueValueSerializationStrategy;
+
+ private final Keyspace keyspace;
+ private SerializationFig config;
@Inject
- public EntityCollectionManagerImpl(final UUIDService uuidService, @Write final WriteStart writeStart,
- @WriteUpdate final WriteStart writeUpdate,
- final WriteUniqueVerify writeVerifyUnique,
- final WriteOptimisticVerify writeOptimisticVerify,
- final WriteCommit writeCommit, final RollbackAction rollback,
- final MarkStart markStart, final MarkCommit markCommit,
- final MvccEntitySerializationStrategy entitySerializationStrategy,
- final UniqueValueSerializationStrategy uniqueValueSerializationStrategy,
- final MvccLogEntrySerializationStrategy mvccLogEntrySerializationStrategy,
- @CollectionTaskExecutor final TaskExecutor taskExecutor,
- @Assisted final CollectionScope collectionScope
+ public EntityCollectionManagerImpl(
+ @Write final WriteStart writeStart,
+ @WriteUpdate final WriteStart writeUpdate,
+ final WriteUniqueVerify writeVerifyUnique,
+ final WriteOptimisticVerify writeOptimisticVerify,
+ final WriteCommit writeCommit, final RollbackAction rollback,
+ final MarkStart markStart, final MarkCommit markCommit,
+ final MvccEntitySerializationStrategy entitySerializationStrategy,
+ final UniqueValueSerializationStrategy uniqueValueSerializationStrategy,
+ final MvccLogEntrySerializationStrategy mvccLogEntrySerializationStrategy,
+ final Keyspace keyspace,
+ final SerializationFig config,
+ @Assisted final CollectionScope collectionScope
) {
this.uniqueValueSerializationStrategy = uniqueValueSerializationStrategy;
this.entitySerializationStrategy = entitySerializationStrategy;
-
- Preconditions.checkNotNull(uuidService, "uuidService must be defined");
-
MvccValidationUtils.validateCollectionScope(collectionScope);
this.writeStart = writeStart;
@@ -136,9 +135,10 @@ public class EntityCollectionManagerImpl implements EntityCollectionManager {
this.markStart = markStart;
this.markCommit = markCommit;
- this.uuidService = uuidService;
+ this.keyspace = keyspace;
+ this.config = config;
+
this.collectionScope = collectionScope;
- this.taskExecutor = taskExecutor;
this.mvccLogEntrySerializationStrategy = mvccLogEntrySerializationStrategy;
}
@@ -187,12 +187,12 @@ public class EntityCollectionManagerImpl implements EntityCollectionManager {
Preconditions.checkNotNull(entityId.getType(), "Entity type is required in this stage");
return Observable.from(new CollectionIoEvent<Id>(collectionScope, entityId)).map(markStart)
- .doOnNext(markCommit).map(new Func1<CollectionIoEvent<MvccEntity>, Void>() {
- @Override
- public Void call(final CollectionIoEvent<MvccEntity> mvccEntityCollectionIoEvent) {
- return null;
- }
- });
+ .doOnNext(markCommit).map(new Func1<CollectionIoEvent<MvccEntity>, Void>() {
+ @Override
+ public Void call(final CollectionIoEvent<MvccEntity> mvccEntityCollectionIoEvent) {
+ return null;
+ }
+ });
}
@@ -229,8 +229,8 @@ public class EntityCollectionManagerImpl implements EntityCollectionManager {
@Override
public void call(final Subscriber<? super EntitySet> subscriber) {
try {
- final EntitySet results =
- entitySerializationStrategy.load(collectionScope, entityIds, UUIDGenerator.newTimeUUID());
+ final EntitySet results = entitySerializationStrategy.load(
+ collectionScope, entityIds, UUIDGenerator.newTimeUUID());
subscriber.onNext(results);
subscriber.onCompleted();
@@ -253,7 +253,7 @@ public class EntityCollectionManagerImpl implements EntityCollectionManager {
Id id = value == null ? null : value.getEntityId();
return id;
} catch (ConnectionException e) {
- log.error("Failed to getIdField", e);
+ logger.error("Failed to getIdField", e);
throw new RuntimeException(e);
}
}
@@ -263,7 +263,7 @@ public class EntityCollectionManagerImpl implements EntityCollectionManager {
@Override
public Observable<Entity> update(final Entity entity) {
- log.debug("Starting update process");
+ logger.debug("Starting update process");
//do our input validation
Preconditions.checkNotNull(entity, "Entity is required in the new stage of the mvcc write");
@@ -283,7 +283,7 @@ public class EntityCollectionManagerImpl implements EntityCollectionManager {
return observable.map(writeCommit).doOnNext(new Action1<Entity>() {
@Override
public void call(final Entity entity) {
- log.debug("sending entity to the queue");
+ logger.debug("sending entity to the queue");
//we an update, signal the fix
@@ -301,7 +301,8 @@ public class EntityCollectionManagerImpl implements EntityCollectionManager {
public Observable<CollectionIoEvent<MvccEntity>> stageRunner(CollectionIoEvent<Entity> writeData,
WriteStart writeState) {
- return Observable.from(writeData).map(writeState).doOnNext(new Action1<CollectionIoEvent<MvccEntity>>() {
+ return Observable.from(writeData).map(writeState).doOnNext(
+ new Action1<CollectionIoEvent<MvccEntity>>() {
@Override
public void call(final CollectionIoEvent<MvccEntity> mvccEntityCollectionIoEvent) {
@@ -325,7 +326,6 @@ public class EntityCollectionManagerImpl implements EntityCollectionManager {
@Override
-
public Observable<VersionSet> getLatestVersion(final Collection<Id> entityIds) {
return Observable.create(new Observable.OnSubscribe<VersionSet>() {
@@ -345,4 +345,31 @@ public class EntityCollectionManagerImpl implements EntityCollectionManager {
}
});
}
+
+
+ @Override
+ public boolean isHealthy() {
+
+ try {
+ ColumnFamily<String, String> CF_SYSTEM_LOCAL = new ColumnFamily<String, String>(
+ "system.local",
+ StringSerializer.get(),
+ StringSerializer.get(),
+ StringSerializer.get());
+
+ OperationResult<CqlResult<String, String>> result = keyspace.prepareQuery(CF_SYSTEM_LOCAL)
+ .withCql("SELECT now() FROM system.local;")
+ .execute();
+
+ if ( result.getResult().getRows().size() == 1 ) {
+ return true;
+ }
+
+ } catch ( ConnectionException ex ) {
+ logger.error("Error connecting to Cassandra", ex);
+ }
+
+ return false;
+ }
+
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b6a8bc62/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/SerializationFig.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/SerializationFig.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/SerializationFig.java
index 15bae5c..294c7ab 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/SerializationFig.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/SerializationFig.java
@@ -59,20 +59,16 @@ public interface SerializationFig extends GuicyFig {
/**
* The maximum amount of entites we can load at any one time
- * @return
*/
@Key( "collection.max.load.size" )
@Default( "1000" )
int getMaxLoadSize();
-
/**
* The maximum number of bytes a serialized entity can be. Any thing beyond this is rejected
- * @return
*/
@Key( "collection.max.entry.size" )
@Default( "512" )
int getMaxEntrySize();
-
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b6a8bc62/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/EntityCollectionManagerIT.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/EntityCollectionManagerIT.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/EntityCollectionManagerIT.java
index 93f4a7d..763d00a 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/EntityCollectionManagerIT.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/EntityCollectionManagerIT.java
@@ -694,4 +694,16 @@ public class EntityCollectionManagerIT {
assertEquals( MvccLogEntry.State.COMPLETE, version2Log.getState() );
assertEquals( Stage.COMMITTED, version2Log.getStage() );
}
+
+
+ @Test
+ public void healthTest() {
+
+ CollectionScope context = new CollectionScopeImpl(
+ new SimpleId( "organization" ), new SimpleId( "test" ), "test" );
+
+ final EntityCollectionManager manager = factory.createCollectionManager( context );
+
+ assertTrue( manager.isHealthy() );
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b6a8bc62/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/EntityIndex.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/EntityIndex.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/EntityIndex.java
index 5f4606c..fda3a53 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/EntityIndex.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/EntityIndex.java
@@ -36,27 +36,27 @@ public interface EntityIndex {
public void initializeIndex();
/**
- * Create the index batch
- * @return
+ * Create the index batch.
*/
public EntityIndexBatch createBatch();
/**
* Execute query in Usergrid syntax.
*/
-
public CandidateResults search(final IndexScope indexScope, Query query );
/**
- * Get the candidate results of all versions of the entity for this id
- * @param id
- * @return
+ * Get the candidate results of all versions of the entity for this id.
*/
public CandidateResults getEntityVersions(final IndexScope indexScope, Id id);
/**
- * Refresh the index
+ * Refresh the index.
*/
public void refresh();
+ /**
+ * Return true if connection query index system (ElasticSearch) is healthy.
+ */
+ public boolean isHealthy();
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b6a8bc62/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 fc09b5a..1ff747f 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,12 +64,16 @@ 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 static org.apache.usergrid.persistence.index.impl.IndexingUtils.BOOLEAN_PREFIX;
import static org.apache.usergrid.persistence.index.impl.IndexingUtils.DOC_ID_SEPARATOR_SPLITTER;
import static org.apache.usergrid.persistence.index.impl.IndexingUtils.ENTITYID_FIELDNAME;
import static org.apache.usergrid.persistence.index.impl.IndexingUtils.NUMBER_PREFIX;
import static org.apache.usergrid.persistence.index.impl.IndexingUtils.STRING_PREFIX;
+import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest;
+import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
+import org.elasticsearch.action.admin.cluster.health.ClusterHealthStatus;
/**
@@ -77,7 +81,7 @@ import static org.apache.usergrid.persistence.index.impl.IndexingUtils.STRING_PR
*/
public class EsEntityIndexImpl implements EntityIndex {
- private static final Logger log = LoggerFactory.getLogger( EsEntityIndexImpl.class );
+ private static final Logger logger = LoggerFactory.getLogger( EsEntityIndexImpl.class );
private static final AtomicBoolean mappingsCreated = new AtomicBoolean( false );
@@ -128,13 +132,13 @@ public class EsEntityIndexImpl implements EntityIndex {
AdminClient admin = client.admin();
CreateIndexResponse cir = admin.indices().prepareCreate( indexName ).execute().actionGet();
- log.info( "Created new Index Name [{}] ACK=[{}]", indexName, cir.isAcknowledged() );
+ logger.info( "Created new Index Name [{}] ACK=[{}]", indexName, cir.isAcknowledged() );
// create the document, this ensures the index is ready
// Immediately create a document and remove it to ensure the entire cluster is ready
- // to receive documents. Occasionally we see errors. See this post:
- // http://elasticsearch-users.115913.n3.nabble.com/IndexMissingException-on-create-index-followed-by-refresh-td1832793.html
+ // to receive documents. Occasionally we see errors.
+ // See this post: http://s.apache.org/index-missing-exception
testNewIndex();
}
@@ -148,16 +152,13 @@ public class EsEntityIndexImpl implements EntityIndex {
/**
- * Tests writing a document to a new index to ensure it's working correctly. Comes from email
- *
- * http://elasticsearch-users.115913.n3.nabble
- * .com/IndexMissingException-on-create-index-followed-by-refresh-td1832793.html
+ * Tests writing a document to a new index to ensure it's working correctly.
+ * See this post: http://s.apache.org/index-missing-exception
*/
-
private void testNewIndex() {
- log.info( "Refreshing Created new Index Name [{}]", indexName );
+ logger.info( "Refreshing Created new Index Name [{}]", indexName );
final RetryOperation retryOperation = new RetryOperation() {
@Override
@@ -167,14 +168,14 @@ public class EsEntityIndexImpl implements EntityIndex {
client.prepareIndex( indexName, VERIFY_TYPE, tempId )
.setSource( DEFAULT_PAYLOAD ).get();
- log.info( "Successfully created new document with docId {} in index {} and type {}",
+ logger.info( "Successfully created new document with docId {} in index {} and type {}",
tempId, indexName, VERIFY_TYPE );
// delete all types, this way if we miss one it will get cleaned up
client.prepareDeleteByQuery( indexName ).setTypes( VERIFY_TYPE )
.setQuery( MATCH_ALL_QUERY_BUILDER ).get();
- log.info( "Successfully deleted all documents in index {} and type {}",
+ logger.info( "Successfully deleted all documents in index {} and type {}",
indexName, VERIFY_TYPE );
return true;
@@ -215,8 +216,8 @@ public class EsEntityIndexImpl implements EntityIndex {
QueryBuilder qb = query.createQueryBuilder();
- if ( log.isDebugEnabled() ) {
- log.debug( "Searching index {}\n type {}\n query {} limit {}", new Object[] {
+ if ( logger.isDebugEnabled() ) {
+ logger.debug( "Searching index {}\n type {}\n query {} limit {}", new Object[] {
this.indexName, indexType, qb.toString().replace( "\n", " " ), query.getLimit()
} );
}
@@ -229,7 +230,7 @@ public class EsEntityIndexImpl implements EntityIndex {
FilterBuilder fb = query.createFilterBuilder();
if ( fb != null ) {
- log.debug( " Filter: {} ", fb.toString() );
+ logger.debug( " Filter: {} ", fb.toString() );
srb = srb.setPostFilter( fb );
}
@@ -254,19 +255,19 @@ public class EsEntityIndexImpl implements EntityIndex {
final FieldSortBuilder stringSort = SortBuilders.fieldSort( stringFieldName )
.order( order ).ignoreUnmapped( true );
srb.addSort( stringSort );
- log.debug( " Sort: {} order by {}", stringFieldName, order.toString() );
+ logger.debug( " Sort: {} order by {}", stringFieldName, order.toString() );
final String numberFieldName = NUMBER_PREFIX + sp.getPropertyName();
final FieldSortBuilder numberSort = SortBuilders.fieldSort( numberFieldName )
.order( order ).ignoreUnmapped( true );
srb.addSort( numberSort );
- log.debug( " Sort: {} order by {}", numberFieldName, order.toString() );
+ logger.debug( " Sort: {} order by {}", numberFieldName, order.toString() );
final String booleanFieldName = BOOLEAN_PREFIX + sp.getPropertyName();
final FieldSortBuilder booleanSort = SortBuilders.fieldSort( booleanFieldName )
.order( order ).ignoreUnmapped( true );
srb.addSort( booleanSort );
- log.debug( " Sort: {} order by {}", booleanFieldName, order.toString() );
+ logger.debug( " Sort: {} order by {}", booleanFieldName, order.toString() );
}
searchResponse = srb.execute().actionGet();
@@ -279,7 +280,7 @@ public class EsEntityIndexImpl implements EntityIndex {
if ( scrollId.endsWith( "\"" ) ) {
scrollId = scrollId.substring( 0, scrollId.length() - 1 );
}
- log.debug( "Executing query with cursor: {} ", scrollId );
+ logger.debug( "Executing query with cursor: {} ", scrollId );
SearchScrollRequestBuilder ssrb = client.prepareSearchScroll( scrollId )
.setScroll( cursorTimeout + "m" );
@@ -287,7 +288,7 @@ public class EsEntityIndexImpl implements EntityIndex {
}
SearchHits hits = searchResponse.getHits();
- log.debug( " Hit count: {} Total hits: {}", hits.getHits().length, hits.getTotalHits() );
+ logger.debug( " Hit count: {} Total hits: {}", hits.getHits().length, hits.getTotalHits() );
List<CandidateResult> candidates = new ArrayList<CandidateResult>();
@@ -307,7 +308,7 @@ public class EsEntityIndexImpl implements EntityIndex {
if ( candidates.size() >= query.getLimit() ) {
candidateResults.setCursor( searchResponse.getScrollId() );
- log.debug( " Cursor = " + searchResponse.getScrollId() );
+ logger.debug( " Cursor = " + searchResponse.getScrollId() );
}
return candidateResults;
@@ -317,18 +318,18 @@ public class EsEntityIndexImpl implements EntityIndex {
public void refresh() {
- log.info( "Refreshing Created new Index Name [{}]", indexName );
+ logger.info( "Refreshing Created new Index Name [{}]", indexName );
final RetryOperation retryOperation = new RetryOperation() {
@Override
public boolean doOp() {
try {
client.admin().indices().prepareRefresh( indexName ).execute().actionGet();
- log.debug( "Refreshed index: " + indexName );
+ logger.debug( "Refreshed index: " + indexName );
return true;
}
catch ( IndexMissingException e ) {
- log.error( "Unable to refresh index after create. Waiting before sleeping.", e);
+ logger.error( "Unable to refresh index after create. Waiting before sleeping.", e);
throw e;
}
}
@@ -336,7 +337,7 @@ public class EsEntityIndexImpl implements EntityIndex {
doInRetry( retryOperation );
- log.debug( "Refreshed index: " + indexName );
+ logger.debug( "Refreshed index: " + indexName );
}
@@ -356,10 +357,10 @@ public class EsEntityIndexImpl implements EntityIndex {
AdminClient adminClient = client.admin();
DeleteIndexResponse response = adminClient.indices().prepareDelete( indexName ).get();
if ( response.isAcknowledged() ) {
- log.info( "Deleted index: " + indexName );
+ logger.info( "Deleted index: " + indexName );
}
else {
- log.info( "Failed to delete index " + indexName );
+ logger.info( "Failed to delete index " + indexName );
}
}
@@ -377,7 +378,7 @@ public class EsEntityIndexImpl implements EntityIndex {
}
}
catch ( Exception e ) {
- log.error( "Unable to execute operation, retrying", e );
+ logger.error( "Unable to execute operation, retrying", e );
}
@@ -391,6 +392,25 @@ public class EsEntityIndexImpl implements EntityIndex {
}
+ @Override
+ public boolean isHealthy() {
+
+ try {
+ ClusterHealthResponse health =
+ client.admin().cluster().health( new ClusterHealthRequest() ).get();
+
+ if ( health.getStatus().equals( ClusterHealthStatus.GREEN ) ) {
+ return true;
+ }
+ }
+ catch (Exception ex) {
+ logger.error("Error connecting to ElasticSearch", ex);
+ }
+
+ return false ;
+ }
+
+
/**
* Interface for operations
*/
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b6a8bc62/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityConnectionIndexImplTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityConnectionIndexImplTest.java b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityConnectionIndexImplTest.java
index 62910bc..28b3bfb 100644
--- a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityConnectionIndexImplTest.java
+++ b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityConnectionIndexImplTest.java
@@ -50,9 +50,11 @@ import org.apache.usergrid.persistence.model.entity.SimpleId;
import org.apache.usergrid.persistence.model.util.UUIDGenerator;
import com.google.inject.Inject;
+import org.apache.usergrid.persistence.collection.EntityCollectionManager;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
@RunWith( ITRunner.class )
@@ -82,7 +84,8 @@ public class EntityConnectionIndexImplTest extends BaseIT {
// create a muffin
CollectionScope muffinScope = new CollectionScopeImpl( appId, appId, "muffins" );
- Entity muffin = new Entity( new SimpleId( UUIDGenerator.newTimeUUID(), muffinScope.getName() ) );
+ Entity muffin = new Entity(
+ new SimpleId( UUIDGenerator.newTimeUUID(), muffinScope.getName() ) );
muffin = EntityIndexMapUtils.fromMap( muffin, new HashMap<String, Object>() {{
put( "size", "Large" );
@@ -93,7 +96,8 @@ public class EntityConnectionIndexImplTest extends BaseIT {
// create a person who likes muffins
CollectionScope peopleScope = new CollectionScopeImpl( appId, appId, "people" );
- Entity person = new Entity( new SimpleId( UUIDGenerator.newTimeUUID(), peopleScope.getName() ) );
+ Entity person = new Entity( new SimpleId(
+ UUIDGenerator.newTimeUUID(), peopleScope.getName() ) );
person = EntityIndexMapUtils.fromMap( person, new HashMap<String, Object>() {{
put( "name", "Dave" );
put( "hometown", "Chapel Hill" );
@@ -121,4 +125,18 @@ public class EntityConnectionIndexImplTest extends BaseIT {
assertEquals(muffin.getId(), likes.get(0).getId());
}
+
+
+
+ @Test
+ public void healthTest() {
+
+ Id appId = new SimpleId( "application" );
+ ApplicationScope applicationScope = new ApplicationScopeImpl( appId );
+
+ EntityIndex ei = ecif.createEntityIndex( applicationScope );
+
+ assertTrue( ei.isHealthy() );
+ }
+
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b6a8bc62/stack/loadtests/src/test/resources/logback-test.xml
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/test/resources/logback-test.xml b/stack/loadtests/src/test/resources/logback-test.xml
index d15f9f4..f3f0607 100644
--- a/stack/loadtests/src/test/resources/logback-test.xml
+++ b/stack/loadtests/src/test/resources/logback-test.xml
@@ -1,3 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ */
+-->
<configuration>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b6a8bc62/stack/loadtests/src/test/resources/logback.xml
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/test/resources/logback.xml b/stack/loadtests/src/test/resources/logback.xml
index 1d512d6..6ba218c 100644
--- a/stack/loadtests/src/test/resources/logback.xml
+++ b/stack/loadtests/src/test/resources/logback.xml
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
-<configuration>
<!--
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -18,6 +17,8 @@
* limitations under the License.
*/
-->
+<configuration>
+
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%-5level] %logger{15} - %msg%n%rEx</pattern>
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b6a8bc62/stack/rest/src/main/java/org/apache/usergrid/rest/SwaggerServlet.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/SwaggerServlet.java b/stack/rest/src/main/java/org/apache/usergrid/rest/SwaggerServlet.java
index 576063e..9db6ff4 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/SwaggerServlet.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/SwaggerServlet.java
@@ -41,9 +41,9 @@ import org.springframework.context.ApplicationContext;
import org.apache.commons.lang.text.StrSubstitutor;
import static org.apache.commons.lang.StringUtils.isEmpty;
-import static org.springframework.web.context.support.WebApplicationContextUtils.getRequiredWebApplicationContext;
import static org.apache.usergrid.rest.utils.CORSUtils.allowAllOrigins;
import static org.apache.usergrid.utils.StringUtils.readClasspathFileAsString;
+import org.springframework.web.context.support.WebApplicationContextUtils;
public class SwaggerServlet extends HttpServlet implements Filter {
@@ -85,7 +85,8 @@ public class SwaggerServlet extends HttpServlet implements Filter {
if ( sc == null ) {
return null;
}
- ApplicationContext appContext = getRequiredWebApplicationContext( sc );
+ ApplicationContext appContext =
+ WebApplicationContextUtils.getRequiredWebApplicationContext( sc );
return appContext.getBean( beanName );
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b6a8bc62/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
new file mode 100644
index 0000000..4ba9b09
--- /dev/null
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/filters/HealthCheckFilter.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2014 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+package org.apache.usergrid.rest.filters;
+
+import java.io.IOException;
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import org.apache.usergrid.persistence.EntityManagerFactory;
+import org.springframework.web.context.WebApplicationContext;
+import org.springframework.web.context.support.WebApplicationContextUtils;
+
+
+/**
+ * Fail fast if connection to database or query index not healthy.
+ */
+public class HealthCheckFilter implements Filter {
+
+ ServletContext sc;
+
+ @Override
+ public void init(FilterConfig fc) throws ServletException {
+ if ( sc == null ) {
+ sc = fc.getServletContext();
+ }
+ }
+
+ @Override
+ public void doFilter(ServletRequest sr, ServletResponse sr1, FilterChain fc)
+ throws IOException, ServletException {
+
+
+ WebApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(sc);
+ EntityManagerFactory emf = (EntityManagerFactory)ctx.getBean("entityManagerFactory");
+
+ if ( !emf.verifyCollectionsModuleHealthy() ) {
+ throw new RuntimeException("Error connecting to datastore");
+ }
+ if ( !emf.verifyQueryIndexModuleHealthy() ) {
+ throw new RuntimeException("Error connecting to query index");
+ }
+
+ throw new RuntimeException("Foo!");
+ }
+
+ @Override
+ public void destroy() {
+ // no op
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b6a8bc62/stack/rest/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/webapp/WEB-INF/web.xml b/stack/rest/src/main/webapp/WEB-INF/web.xml
index 24a82ca..c50251b 100644
--- a/stack/rest/src/main/webapp/WEB-INF/web.xml
+++ b/stack/rest/src/main/webapp/WEB-INF/web.xml
@@ -33,6 +33,16 @@
</listener>
<filter>
+ <filter-name>healthCheckFilter</filter-name>
+ <filter-class>org.apache.usergrid.rest.filters.HealthCheckFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>healthCheckFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <filter>
<filter-name>swaggerFilter</filter-name>
<filter-class>org.apache.usergrid.rest.SwaggerServlet</filter-class>
</filter>
[7/8] git commit: Use correct index name
Posted by sn...@apache.org.
Use correct index name
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/7000bd9c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/7000bd9c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/7000bd9c
Branch: refs/heads/two-dot-o-events
Commit: 7000bd9c424a0ada98b03d0564385ae0b6933daf
Parents: 7dec37b
Author: Dave Johnson <dm...@apigee.com>
Authored: Fri Oct 31 14:00:44 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Fri Oct 31 14:00:44 2014 -0400
----------------------------------------------------------------------
.../usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7000bd9c/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java
index ca7f666..aedee2b 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java
@@ -203,7 +203,7 @@ public class EsEntityIndexBatchImpl implements EntityIndexBatch {
TermQueryBuilder tqb = QueryBuilders.termQuery(
STRING_PREFIX + ENTITYID_FIELDNAME, entityId.getUuid().toString().toLowerCase());
- DeleteByQueryResponse response = client.prepareDeleteByQuery("test")
+ DeleteByQueryResponse response = client.prepareDeleteByQuery( indexName )
.setQuery( tqb ).execute().actionGet();
logger.debug("Deleted entity {}:{} from all index scopes with response status = {}",
@@ -222,7 +222,7 @@ public class EsEntityIndexBatchImpl implements EntityIndexBatch {
( STRING_PREFIX + ENTITYID_FIELDNAME,entity.getId().getUuid().toString().toLowerCase() ),
FilterBuilders.rangeFilter("version").lt( entity.getId().getUuid().timestamp() ));
- DeleteByQueryResponse response = client.prepareDeleteByQuery("test")
+ DeleteByQueryResponse response = client.prepareDeleteByQuery( indexName )
.setQuery( fqb ).execute().actionGet();
logger.debug("Deleted entity {}:{} from all index scopes with response status = {}",
[5/8] git commit: Merge branch 'two-dot-o' of
https://git-wip-us.apache.org/repos/asf/incubator-usergrid into two-dot-o
Posted by sn...@apache.org.
Merge branch 'two-dot-o' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into two-dot-o
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/5570b9d3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/5570b9d3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/5570b9d3
Branch: refs/heads/two-dot-o-events
Commit: 5570b9d37298942515c88b69a7ba124c6b1373d7
Parents: cb848d8 aba5121
Author: Dave Johnson <dm...@apigee.com>
Authored: Thu Oct 30 15:29:25 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Thu Oct 30 15:29:25 2014 -0400
----------------------------------------------------------------------
stack/loadtests/src/main/scripts/gatling-mvn.sh | 3 +++
.../src/test/resources/logback-test.xml | 22 ++++++++++++++++++++
2 files changed, 25 insertions(+)
----------------------------------------------------------------------