usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [2/5] git commit: Pruning old code and reformatting
Date Tue, 04 Nov 2014 16:11:46 GMT
Pruning old code and reformatting


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

Branch: refs/heads/two-dot-o-events
Commit: 54a64e6d0cdf21a2f0199c266a3fe8a512442ccb
Parents: 2c3875c
Author: grey <greyes@apigee.com>
Authored: Mon Nov 3 09:52:59 2014 -0800
Committer: grey <greyes@apigee.com>
Committed: Mon Nov 3 09:52:59 2014 -0800

----------------------------------------------------------------------
 .../usergrid/corepersistence/GuiceModule.java   |  2 --
 .../events/EntityVersionCreatedHandler.java     | 14 -----------
 .../impl/EntityCollectionManagerImpl.java       |  9 -------
 .../impl/EntityVersionCreatedTaskTest.java      |  5 ----
 .../index/impl/EsEntityIndexBatchImpl.java      | 25 +++++++++-----------
 5 files changed, 11 insertions(+), 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/54a64e6d/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 e723a35..3b868b3 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
@@ -64,8 +64,6 @@ public class GuiceModule extends AbstractModule {
                 = 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/54a64e6d/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 6f3c507..ff09119 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
@@ -45,10 +45,6 @@ import com.google.inject.name.Named;
  */
 public class EntityVersionCreatedHandler implements EntityVersionCreated {
 
-    @Inject
-    @Named( "defaultConfig" )
-    private Boolean defaultConfig;
-
     private static final Logger logger = LoggerFactory.getLogger(EntityVersionCreatedHandler.class
);
 
     public EntityVersionCreatedHandler() {
@@ -69,16 +65,6 @@ public class EntityVersionCreatedHandler implements EntityVersionCreated
{
 
         EntityIndexBatch batch = ei.createBatch();
 
-        //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/54a64e6d/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 323b838..16046b3 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
@@ -288,29 +288,20 @@ public class EntityCollectionManagerImpl implements EntityCollectionManager
{
 
         final Id entityId = entity.getId();
 
-
         ValidationUtils.verifyIdentity(entityId);
 
         // create our observable and start the write
         CollectionIoEvent<Entity> writeData = new CollectionIoEvent<Entity>(collectionScope,
entity);
 
-
         Observable<CollectionIoEvent<MvccEntity>> observable = stageRunner(writeData,
writeUpdate);
 
-
         return observable.map(writeCommit).doOnNext(new Action1<Entity>() {
             @Override
             public void call(final Entity entity) {
                 logger.debug("sending entity to the queue");
 
                 //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();
-
 
             }
         }).doOnError(rollback);

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/54a64e6d/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 3326856..b25b5b4 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
@@ -58,12 +58,7 @@ public class EntityVersionCreatedTaskTest {
 
         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 );
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/54a64e6d/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 e8ee96f..7f6cf70 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
@@ -222,25 +222,22 @@ public class EsEntityIndexBatchImpl implements EntityIndexBatch {
         return this;
     }
 
+
     @Override
-    public EntityIndexBatch deindexPreviousVersions(Entity entity){
+    public EntityIndexBatch deindexPreviousVersions( Entity entity ) {
 
-            //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()
) );
+        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();
 
-            //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()
} );
+        //error message needs to be retooled so that it describes the entity more throughly
+        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;
     }


Mime
View raw message