usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [1/5] git commit: Finished EntityVersionCreatedTask and added tests to prove that the issue is fixed.
Date Tue, 04 Nov 2014 16:11:45 GMT
Repository: incubator-usergrid
Updated Branches:
  refs/heads/two-dot-o-events 5c4c24d1a -> 3d3bbedc2


Finished EntityVersionCreatedTask and added tests to prove that the issue is fixed.


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

Branch: refs/heads/two-dot-o-events
Commit: 2c3875c886b550b8c4d8f786877326411272aeb2
Parents: 4a36aa1
Author: grey <greyes@apigee.com>
Authored: Mon Nov 3 09:42:22 2014 -0800
Committer: grey <greyes@apigee.com>
Committed: Mon Nov 3 09:42:22 2014 -0800

----------------------------------------------------------------------
 .../corepersistence/CpEntityManager.java        |  2 +-
 .../usergrid/corepersistence/GuiceModule.java   | 11 ++++
 .../events/EntityVersionCreatedHandler.java     | 31 +++++++++-
 .../corepersistence/StaleIndexCleanupTest.java  | 41 +++++++++---
 .../corepersistence/TestGuiceModule.java        |  5 ++
 .../impl/EntityCollectionManagerImpl.java       |  2 +
 .../impl/EntityVersionCreatedTask.java          |  4 +-
 .../impl/EntityVersionCreatedTaskTest.java      | 65 ++++++++++++--------
 .../index/impl/EsEntityIndexBatchImpl.java      | 30 ++++++---
 .../persistence/index/impl/IndexingUtils.java   |  2 +
 10 files changed, 142 insertions(+), 51 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2c3875c8/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
index 83729f1..3c8b0cb 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
@@ -2640,7 +2640,7 @@ public class CpEntityManager implements EntityManager {
             logger.debug("About to Write {}:{} version {}", new Object[] { 
                 cpEntity.getId().getType(), cpEntity.getId().getUuid(), cpEntity.getVersion()
});
 
-             cpEntity = ecm .write( cpEntity ).toBlocking().last();
+             cpEntity = ecm.write( cpEntity ).toBlocking().last();
 
             logger.debug("Wrote {}:{} version {}", new Object[] { 
                 cpEntity.getId().getType(), cpEntity.getId().getUuid(), cpEntity.getVersion()
});

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2c3875c8/stack/core/src/main/java/org/apache/usergrid/corepersistence/GuiceModule.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/GuiceModule.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/GuiceModule.java
index 21eba41..e723a35 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/GuiceModule.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/GuiceModule.java
@@ -17,9 +17,13 @@ package org.apache.usergrid.corepersistence;
 
 import com.google.inject.AbstractModule;
 import com.google.inject.multibindings.Multibinder;
+import com.google.inject.name.Names;
+
 import org.apache.usergrid.corepersistence.events.EntityDeletedHandler;
+import org.apache.usergrid.corepersistence.events.EntityVersionCreatedHandler;
 import org.apache.usergrid.corepersistence.events.EntityVersionDeletedHandler;
 import org.apache.usergrid.persistence.collection.event.EntityDeleted;
+import org.apache.usergrid.persistence.collection.event.EntityVersionCreated;
 import org.apache.usergrid.persistence.collection.event.EntityVersionDeleted;
 import org.apache.usergrid.persistence.collection.guice.CollectionModule;
 import org.apache.usergrid.persistence.core.guice.CommonModule;
@@ -55,6 +59,13 @@ public class GuiceModule extends AbstractModule {
         Multibinder<EntityVersionDeleted> versionBinder
                 = Multibinder.newSetBinder(binder(), EntityVersionDeleted.class);
         versionBinder.addBinding().to(EntityVersionDeletedHandler.class);
+
+        Multibinder<EntityVersionCreated> versionCreatedMultibinder
+                = Multibinder.newSetBinder( binder(),EntityVersionCreated.class );
+        versionCreatedMultibinder.addBinding().to(EntityVersionCreatedHandler.class);
+
+        bind( Boolean.class ).annotatedWith( Names.named( "defaultConfig" ) ).toInstance(
false );
+
     }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2c3875c8/stack/core/src/main/java/org/apache/usergrid/corepersistence/events/EntityVersionCreatedHandler.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/events/EntityVersionCreatedHandler.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/events/EntityVersionCreatedHandler.java
index 64d1125..6f3c507 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/events/EntityVersionCreatedHandler.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/events/EntityVersionCreatedHandler.java
@@ -17,8 +17,14 @@
  */
 package org.apache.usergrid.corepersistence.events;
 
+import java.util.Properties;
+
+import org.elasticsearch.common.inject.Guice;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
 import org.apache.usergrid.corepersistence.CpEntityManagerFactory;
 import org.apache.usergrid.corepersistence.CpSetup;
 import org.apache.usergrid.corepersistence.HybridEntityManagerFactory;
@@ -28,13 +34,20 @@ import org.apache.usergrid.persistence.index.EntityIndex;
 import org.apache.usergrid.persistence.index.EntityIndexBatch;
 import org.apache.usergrid.persistence.model.entity.Entity;
 
+import com.google.inject.Inject;
+import com.google.inject.name.Named;
+
 
 /**
  * Clean up stale entity indexes when new version of Entity created. Called when an Entity
is 
  * updated by the Collections module and we react by calling the Query Index module and removing

  * any indexes that exist for previous versions of the the Entity. 
  */
-public class EntityVersionCreatedHandler implements EntityVersionCreated { 
+public class EntityVersionCreatedHandler implements EntityVersionCreated {
+
+    @Inject
+    @Named( "defaultConfig" )
+    private Boolean defaultConfig;
 
     private static final Logger logger = LoggerFactory.getLogger(EntityVersionCreatedHandler.class
);
 
@@ -56,7 +69,19 @@ public class EntityVersionCreatedHandler implements EntityVersionCreated
{
 
         EntityIndexBatch batch = ei.createBatch();
 
-        batch.deindexPreviousVersions( entity );
-        batch.execute();
+        //loads test properties, if not found then remove stale entities
+//        String[] locations = { "usergrid-properties-context.xml" };
+//        ConfigurableApplicationContext appContext =
+//                new ClassPathXmlApplicationContext( locations );
+//
+//        Properties properties = (Properties)appContext.getBean("properties");
+//        String staleString = properties.getProperty("allow.stale.entities","false");
+
+        //if(!staleString.contains( "true" ))
+
+        if(System.getProperty( "allow.stale.entities","false" ).equals( "false" )) {
+            batch.deindexPreviousVersions( entity );
+            batch.execute();
+        }
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2c3875c8/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
b/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
index ff740af..1e64502 100644
--- a/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
+++ b/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
@@ -18,13 +18,20 @@
 package org.apache.usergrid.corepersistence;
 
 import com.fasterxml.uuid.UUIDComparator;
+import com.google.inject.Guice;
+import com.google.inject.Inject;
+import com.google.inject.name.Named;
+
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
+import java.util.Properties;
 import java.util.UUID;
 import org.apache.commons.lang3.RandomStringUtils;
 import org.apache.usergrid.AbstractCoreIT;
+import org.apache.usergrid.CoreITSuite;
 import org.apache.usergrid.corepersistence.util.CpNamingUtils;
+import org.apache.usergrid.count.SimpleBatcher;
 import org.apache.usergrid.persistence.Entity;
 import org.apache.usergrid.persistence.EntityManager;
 import org.apache.usergrid.persistence.EntityRef;
@@ -43,14 +50,21 @@ import org.apache.usergrid.persistence.index.impl.IndexScopeImpl;
 import org.apache.usergrid.persistence.index.query.CandidateResults;
 import org.apache.usergrid.persistence.index.query.Query;
 import org.apache.usergrid.persistence.model.entity.SimpleId;
+
 import org.junit.Assert;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
+
+import org.junit.Before;
+import org.junit.After;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
 
 
+//need to create system properties in test that can get applied
 /**
  * Test on read style clean-up of stale ElasticSearch indexes.
  */
@@ -61,6 +75,18 @@ public class StaleIndexCleanupTest extends AbstractCoreIT {
     private static final long writeDelayMs = 50;
     private static final long readDelayMs = 50;
 
+    @Before
+    public void before() {
+        //set the batcher to block the submit so we wait for results when testing
+        System.setProperty( "allow.stale.entities","true" );
+
+    }
+
+    @After
+    public void after() {
+        System.clearProperty( "allow.stale.entities" );
+
+    }
 
     /**
      * Test that updating an entity causes the entity's version number to change.
@@ -287,7 +313,9 @@ public class StaleIndexCleanupTest extends AbstractCoreIT {
     @Test
     public void testCleanupOnUpdate() throws Exception {
 
-        logger.info("Started testCleanupOnUpdate()");
+        System.setProperty( "allow.stale.entities","false" );
+
+        logger.info( "Started testCleanupOnUpdate()" );
 
         // TODO: turn off index cleanup on read
 
@@ -337,16 +365,9 @@ public class StaleIndexCleanupTest extends AbstractCoreIT {
 
         // query Core Persistence directly for total number of result candidates
         crs = queryCollectionCp("things", "select *");
-        Assert.assertEquals( "Expect stale candidates", numEntities * (numUpdates + 1), crs.size());
+        Assert.assertEquals( "Expect candidates without earlier stale entities", numEntities,
crs.size() );
 
-        // wait for indexes to be cleared for the deleted entities
-        count = 0;
-        do {
-            Thread.sleep(100);
-            crs = queryCollectionCp("things", "select *");
-        } while ( crs.size() > 0 || count++ < 14 );
-
-        Assert.assertEquals( "Expect no candidates", 0, crs.size() );
+        System.clearProperty( "allow.stale.entities" );
     }
 
     

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2c3875c8/stack/core/src/test/java/org/apache/usergrid/corepersistence/TestGuiceModule.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/corepersistence/TestGuiceModule.java
b/stack/core/src/test/java/org/apache/usergrid/corepersistence/TestGuiceModule.java
index 6fce1dd..cdf4c01 100644
--- a/stack/core/src/test/java/org/apache/usergrid/corepersistence/TestGuiceModule.java
+++ b/stack/core/src/test/java/org/apache/usergrid/corepersistence/TestGuiceModule.java
@@ -19,12 +19,17 @@
 package org.apache.usergrid.corepersistence;
 
 import com.google.inject.AbstractModule;
+import com.google.inject.Provides;
+import com.google.inject.name.Names;
 
 
 public class TestGuiceModule extends AbstractModule {
 
     @Override
     protected void configure() {
+
         install( new GuiceModule() );
     }
+
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2c3875c8/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 26ab6aa..323b838 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
@@ -305,6 +305,8 @@ public class EntityCollectionManagerImpl implements EntityCollectionManager
{
 
                 //we an update, signal the fix
 
+                taskExecutor.submit(entityVersionCreatedFactory.getTask(collectionScope,entity));
+                //taskExecutor.submit(entityVersionCleanupFactory.getTask(collectionScope,
entityId,entity.getVersion()));
                 //TODO T.N Change this to fire a task
                 //                Observable.from( new CollectionIoEvent<Id>(collectionScope,
                 // entityId ) ).map( load ).subscribeOn( Schedulers.io() ).subscribe();

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2c3875c8/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityVersionCreatedTask.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityVersionCreatedTask.java
b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityVersionCreatedTask.java
index 5846c89..7d3beb1 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityVersionCreatedTask.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityVersionCreatedTask.java
@@ -36,9 +36,9 @@ import rx.schedulers.Schedulers;
  * Fires events so that all EntityVersionCreated handlers area called.
  */
 public class EntityVersionCreatedTask implements Task<Void> {
-    private static final Logger logger = LoggerFactory.getLogger( EntityVersionCleanupTask.class
);
+    private static final Logger logger = LoggerFactory.getLogger( EntityVersionCreatedTask.class
);
 
-    private final Set<EntityVersionCreated> listeners;
+    private Set<EntityVersionCreated> listeners;
     private final CollectionScope collectionScope;
     private final Entity entity;
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2c3875c8/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/impl/EntityVersionCreatedTaskTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/impl/EntityVersionCreatedTaskTest.java
b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/impl/EntityVersionCreatedTaskTest.java
index 3526fe9..3326856 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/impl/EntityVersionCreatedTaskTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/impl/EntityVersionCreatedTaskTest.java
@@ -51,6 +51,45 @@ public class EntityVersionCreatedTaskTest {
 
 
     @Test(timeout=10000)
+    public void noListener()
+            throws ExecutionException, InterruptedException, ConnectionException {
+
+        // create a latch for the event listener, and add it to the list of events
+
+        final int sizeToReturn = 0;
+
+        final CountDownLatch latch = new CountDownLatch( sizeToReturn );
+
+        final EntityVersionCreatedTest eventListener = new EntityVersionCreatedTest(latch);
+
+        final Set<EntityVersionCreated> listeners = mock( Set.class );
+        final Iterator<EntityVersionCreated> helper = mock(Iterator.class);
+
+        when ( listeners.size()).thenReturn( 0 );
+
+        final Id applicationId = new SimpleId( "application" );
+
+        final CollectionScope appScope = new CollectionScopeImpl(
+                applicationId, applicationId, "users" );
+
+        final Id entityId = new SimpleId( "user" );
+        final Entity entity = new Entity( entityId );
+
+        // start the task
+
+        EntityVersionCreatedTask entityVersionCreatedTask =
+                new EntityVersionCreatedTask( appScope, listeners, entity);
+
+        ListenableFuture<Void> future = taskExecutor.submit( entityVersionCreatedTask
);
+
+        // wait for the task
+        future.get();
+
+        //mocked listener makes sure that the task is called
+        verify( listeners ).size();
+
+    }
+    @Test(timeout=10000)
     public void oneListener()
             throws ExecutionException, InterruptedException, ConnectionException {
 
@@ -106,30 +145,4 @@ public class EntityVersionCreatedTaskTest {
             invocationLatch.countDown();
         }
     }
-
-
-//    private static class SlowListener extends EntityVersionCreatedTest {
-//        final Semaphore blockLatch;
-//
-//        private SlowListener( final CountDownLatch invocationLatch, final Semaphore blockLatch
) {
-//            super( invocationLatch );
-//            this.blockLatch = blockLatch;
-//        }
-//
-//
-//        @Override
-//        public void versionDeleted( final CollectionScope scope, final Id entityId,
-//                                    final List<MvccEntity> entityVersion ) {
-//
-//            //wait for unblock to happen before counting down invocation latches
-//            try {
-//                blockLatch.acquire();
-//            }
-//            catch ( InterruptedException e ) {
-//                throw new RuntimeException( e );
-//            }
-//            super.versionDeleted( scope, entityId, entityVersion );
-//        }
-//    }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2c3875c8/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 aedee2b..e8ee96f 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
@@ -23,12 +23,16 @@ import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Properties;
 import java.util.Set;
 import java.util.UUID;
 
+import org.elasticsearch.action.ActionFuture;
 import org.elasticsearch.action.bulk.BulkItemResponse;
 import org.elasticsearch.action.bulk.BulkRequestBuilder;
 import org.elasticsearch.action.bulk.BulkResponse;
+import org.elasticsearch.action.get.GetRequest;
+import org.elasticsearch.action.get.GetResponse;
 import org.elasticsearch.client.Client;
 import org.elasticsearch.index.query.FilterBuilders;
 import org.elasticsearch.index.query.FilteredQueryBuilder;
@@ -65,6 +69,7 @@ import com.google.common.base.Joiner;
 import static org.apache.usergrid.persistence.index.impl.IndexingUtils.ANALYZED_STRING_PREFIX;
 import static org.apache.usergrid.persistence.index.impl.IndexingUtils.BOOLEAN_PREFIX;
 import static org.apache.usergrid.persistence.index.impl.IndexingUtils.ENTITYID_FIELDNAME;
+import static org.apache.usergrid.persistence.index.impl.IndexingUtils.ENTITYVERSION_FIELDNAME;
 import static org.apache.usergrid.persistence.index.impl.IndexingUtils.GEO_PREFIX;
 import static org.apache.usergrid.persistence.index.impl.IndexingUtils.NUMBER_PREFIX;
 import static org.apache.usergrid.persistence.index.impl.IndexingUtils.STRING_PREFIX;
@@ -135,6 +140,9 @@ public class EsEntityIndexBatchImpl implements EntityIndexBatch {
         // need prefix here becuase we index UUIDs as strings
         entityAsMap.put( STRING_PREFIX + ENTITYID_FIELDNAME, 
                 entity.getId().getUuid().toString().toLowerCase() );
+        //index entity as a long ENTITYVERSION_FIELDNAME
+        //puts it in the index
+        entityAsMap.put( ENTITYVERSION_FIELDNAME, entity.getVersion().timestamp());
 
         // let caller add these fields if needed
         // entityAsMap.put("created", entity.getId().getUuid().timestamp();
@@ -217,18 +225,22 @@ public class EsEntityIndexBatchImpl implements EntityIndexBatch {
     @Override
     public EntityIndexBatch deindexPreviousVersions(Entity entity){
 
-         FilteredQueryBuilder fqb = QueryBuilders.filteredQuery
-                 (QueryBuilders.termQuery
-                         ( STRING_PREFIX + ENTITYID_FIELDNAME,entity.getId().getUuid().toString().toLowerCase()
),
-                         FilterBuilders.rangeFilter("version").lt( entity.getId().getUuid().timestamp()
));
+            //String helper = System.getProperty( "allow.stale.entities","false" );
+        //"false" gets returned if there is no allow.stale.entities process
+            FilteredQueryBuilder fqb = QueryBuilders.filteredQuery( QueryBuilders
+                            .termQuery( STRING_PREFIX + ENTITYID_FIELDNAME,
+                                    entity.getId().getUuid().toString().toLowerCase() ),
+                    FilterBuilders.rangeFilter( ENTITYVERSION_FIELDNAME ).lt( entity.getVersion().timestamp()
) );
 
-        DeleteByQueryResponse response = client.prepareDeleteByQuery( indexName )
-                                               .setQuery( fqb ).execute().actionGet();
+            DeleteByQueryResponse response =
+                    client.prepareDeleteByQuery( indexName ).setQuery( fqb ).execute().actionGet();
 
-        logger.debug("Deleted entity {}:{} from all index scopes with response status = {}",
-                new Object[] { entity.getId().getType(), entity.getId().getUuid(), response.status().toString()
});
+            //error message needs to be retooled so that it describes the entity more througly
+            logger.debug( "Deleted entity {}:{} from all index scopes with response status
= {}",
+                    new Object[] { entity.getId().getType(), entity.getId().getUuid(), response.status().toString()
} );
 
-        maybeFlush();
+            maybeFlush();
+       // }
 
         return this;
     }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2c3875c8/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexingUtils.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexingUtils.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexingUtils.java
index f3e1ba2..8ebcbf3 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexingUtils.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexingUtils.java
@@ -39,6 +39,8 @@ public class IndexingUtils {
 
     public static final String ENTITYID_FIELDNAME = "zzz_entityid_zzz";
 
+    public static final String ENTITYVERSION_FIELDNAME = "zzz_entityversion_zzz";
+
     public static final String DOC_ID_SEPARATOR = "|";
     public static final String DOC_ID_SEPARATOR_SPLITTER = "\\|";
 


Mime
View raw message