usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toddn...@apache.org
Subject incubator-usergrid git commit: Indexing complete
Date Fri, 03 Apr 2015 20:44:52 GMT
Repository: incubator-usergrid
Updated Branches:
  refs/heads/USERGRID-536 0fa30b9e1 -> ba41bd27c


Indexing complete


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

Branch: refs/heads/USERGRID-536
Commit: ba41bd27c80daaa612cfac6e1bc2965cdc58b626
Parents: 0fa30b9
Author: Todd Nine <tnine@apigee.com>
Authored: Fri Apr 3 14:44:51 2015 -0600
Committer: Todd Nine <tnine@apigee.com>
Committed: Fri Apr 3 14:44:51 2015 -0600

----------------------------------------------------------------------
 .../persistence/index/guice/IndexModule.java    |   9 +-
 .../persistence/index/impl/DeIndexRequest.java  |  50 +++------
 .../index/impl/EntityMappingParser.java         |  10 +-
 .../index/impl/EsEntityIndexImpl.java           |   6 +-
 .../persistence/index/impl/IndexRequest.java    |  28 +----
 .../persistence/index/impl/IndexingUtils.java   |   5 +
 .../migration/EsIndexDataMigrationImpl.java     | 105 -------------------
 .../persistence/index/usergrid-mappings.json    |   7 +-
 .../index/guice/TestIndexModule.java            |  16 +--
 .../index/impl/IndexMigrationTest.java          | 100 ------------------
 10 files changed, 42 insertions(+), 294 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ba41bd27/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/guice/IndexModule.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/guice/IndexModule.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/guice/IndexModule.java
index a68d312..9ec5228 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/guice/IndexModule.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/guice/IndexModule.java
@@ -28,7 +28,6 @@ import org.apache.usergrid.persistence.index.*;
 import com.google.inject.AbstractModule;
 
 import org.apache.usergrid.persistence.index.impl.*;
-import org.apache.usergrid.persistence.index.migration.EsIndexDataMigrationImpl;
 import org.apache.usergrid.persistence.index.migration.EsIndexMigrationPlugin;
 import org.apache.usergrid.persistence.index.migration.IndexMigration;
 import org.apache.usergrid.persistence.map.guice.MapModule;
@@ -48,9 +47,9 @@ public abstract class IndexModule extends AbstractModule {
         install(new MapModule());
         install(new QueueModule());
 
-        bind(EntityIndexFactory.class).to(EsEntityIndexFactoryImpl.class);
+        bind( EntityIndexFactory.class ).to( EsEntityIndexFactoryImpl.class );
         bind(AliasedEntityIndex.class).to(EsEntityIndexImpl.class);
-        bind(EntityIndex.class).to(EsEntityIndexImpl.class);
+        bind(EntityIndex.class).to(EsEntityIndexImpl.class).asEagerSingleton();
         bind(IndexCache.class).to(EsIndexCacheImpl.class);
 
         bind(FailureMonitorImpl.IndexIdentifier.class).to(IndexIdentifierImpl.class);
@@ -62,13 +61,11 @@ public abstract class IndexModule extends AbstractModule {
 
         bind( BufferQueue.class).toProvider( QueueProvider.class );
 
-        //wire up the edg migration
+        //wire up the edg migration. A no-op ATM, but retained for future development
         Multibinder<DataMigration<ApplicationScope>> dataMigrationMultibinder
=
                 Multibinder.newSetBinder( binder(), new TypeLiteral<DataMigration<ApplicationScope>>()
{}, IndexMigration.class );
 
 
-        dataMigrationMultibinder.addBinding().to(EsIndexDataMigrationImpl.class);
-
 
         //wire up the collection migration plugin
         Multibinder.newSetBinder( binder(), MigrationPlugin.class ).addBinding().to(EsIndexMigrationPlugin.class);

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ba41bd27/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/DeIndexRequest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/DeIndexRequest.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/DeIndexRequest.java
index b1fec73..3f0dc23 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/DeIndexRequest.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/DeIndexRequest.java
@@ -23,70 +23,53 @@ package org.apache.usergrid.persistence.index.impl;
 import java.util.Arrays;
 import java.util.UUID;
 
-import org.apache.usergrid.persistence.core.scope.ApplicationScope;
-import org.apache.usergrid.persistence.index.IndexEdge;
-import org.apache.usergrid.persistence.index.SearchEdge;
-import org.apache.usergrid.persistence.index.SearchType;
-import org.apache.usergrid.persistence.model.entity.Id;
 import org.elasticsearch.action.bulk.BulkRequestBuilder;
 import org.elasticsearch.action.delete.DeleteRequestBuilder;
 import org.elasticsearch.client.Client;
 
+import org.apache.usergrid.persistence.core.scope.ApplicationScope;
+import org.apache.usergrid.persistence.index.SearchEdge;
+import org.apache.usergrid.persistence.model.entity.Id;
+
 import com.fasterxml.jackson.annotation.JsonTypeInfo;
 
-import static org.apache.usergrid.persistence.index.impl.IndexingUtils.createContextName;
 import static org.apache.usergrid.persistence.index.impl.IndexingUtils.createIndexDocId;
 
 
 /**
  * Represent the properties required to build an index request
  */
-@JsonTypeInfo(use=JsonTypeInfo.Id.CLASS, include=JsonTypeInfo.As.PROPERTY, property="@class")
+@JsonTypeInfo( use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property
= "@class" )
 public class DeIndexRequest implements BatchRequest {
 
-    private String[] entityTypes;
     private String[] indexes;
     private String documentId;
 
 
-    public DeIndexRequest( ) {
+    public DeIndexRequest() {
 
     }
 
 
-    public DeIndexRequest(String[] indexes, ApplicationScope applicationScope, SearchEdge
searchEdge, Id id, UUID version) {
+    public DeIndexRequest( String[] indexes, ApplicationScope applicationScope, SearchEdge
searchEdge, Id id,
+                           UUID version ) {
         this.indexes = indexes;
-        this.entityTypes = SearchType.fromId(id).getTypeNames(applicationScope);
-        this.documentId =  createIndexDocId(applicationScope, id, version,searchEdge);
+        this.documentId = createIndexDocId( applicationScope, id, version, searchEdge );
     }
 
 
     @Override
-    public void doOperation(final Client client, final BulkRequestBuilder bulkRequest ){
+    public void doOperation( final Client client, final BulkRequestBuilder bulkRequest )
{
 
 
-        for(final String index: indexes) {
-            for(String entityType : entityTypes) {
-                final DeleteRequestBuilder builder = client.prepareDelete(index, entityType,
documentId);
-                bulkRequest.add(builder);
-            }
+        for ( final String index : indexes ) {
+            final DeleteRequestBuilder builder =
+                    client.prepareDelete( index, IndexingUtils.ES_ENTITY_TYPE, documentId
);
+            bulkRequest.add( builder );
         }
     }
 
 
-    public String[] getIndexes() {
-        return indexes;
-    }
-
-
-    public String[] getEntityTypes() {
-        return entityTypes;
-    }
-
-
-    public String getDocumentId() {
-        return documentId;
-    }
 
 
     @Override
@@ -103,9 +86,7 @@ public class DeIndexRequest implements BatchRequest {
         if ( !documentId.equals( that.documentId ) ) {
             return false;
         }
-        if ( !entityTypes.equals( that.entityTypes ) ) {
-            return false;
-        }
+
         if ( !Arrays.equals( indexes, that.indexes ) ) {
             return false;
         }
@@ -117,7 +98,6 @@ public class DeIndexRequest implements BatchRequest {
     @Override
     public int hashCode() {
         int result = Arrays.hashCode( indexes );
-        result = 31 * result + entityTypes.hashCode();
         result = 31 * result + documentId.hashCode();
         return result;
     }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ba41bd27/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EntityMappingParser.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EntityMappingParser.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EntityMappingParser.java
index db4853e..eac4376 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EntityMappingParser.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EntityMappingParser.java
@@ -63,6 +63,9 @@ public class EntityMappingParser implements FieldParser {
     private List<EntityField> fields = new ArrayList<>();
 
 
+    /**
+     * Visit al the primitive values
+     */
     private void visit( final String value ) {
         fields.add( EntityField.create( fieldStack.peek(), value ) );
     }
@@ -181,9 +184,10 @@ public class EntityMappingParser implements FieldParser {
     }
 
 
-
-
-
+    /**
+     * Iterate all entries in a map and map them
+     * @param map
+     */
     private void iterate( final Map<String, ?> map ) {
 
         for ( final Map.Entry<String, ?> jsonField : map.entrySet() ) {

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ba41bd27/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 7110a22..4d0abab 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
@@ -122,9 +122,7 @@ public class EsEntityIndexImpl implements AliasedEntityIndex,VersionedData
{
             .getTimer(EsEntityIndexImpl.class, "refresh.timer");
         this.refreshIndexMeter = metricsFactory.getMeter(EsEntityIndexImpl.class,"refresh.meter");
 
-        if(shouldInitialize()){
-            initialize();
-        }
+        initialize();
 
     }
 
@@ -193,6 +191,8 @@ public class EsEntityIndexImpl implements AliasedEntityIndex,VersionedData
{
 
             addAlias(indexSuffix);
 
+
+
             testNewIndex();
 
         } catch (IndexAlreadyExistsException expected) {

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ba41bd27/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexRequest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexRequest.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexRequest.java
index f82bc16..8894197 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexRequest.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexRequest.java
@@ -45,7 +45,6 @@ import static org.apache.usergrid.persistence.index.impl.IndexingUtils.idString;
 public class IndexRequest implements BatchRequest {
 
     public String writeAlias;
-    public String entityType;
     public String documentId;
 
     public Map<String, Object> data;
@@ -57,7 +56,6 @@ public class IndexRequest implements BatchRequest {
 
     public IndexRequest( final String writeAlias, final ApplicationScope applicationScope,
SearchType searchType, String documentId,  Map<String, Object> data) {
         this.writeAlias = writeAlias;
-        this.entityType = searchType.getTypeName(applicationScope);
         this.data = data;
         this.documentId = documentId;
     }
@@ -70,32 +68,13 @@ public class IndexRequest implements BatchRequest {
 
 
     public void doOperation( final Client client, final BulkRequestBuilder bulkRequest )
{
-        IndexRequestBuilder builder = client.prepareIndex( writeAlias, entityType, documentId
).setSource( data );
+        IndexRequestBuilder builder = client.prepareIndex( writeAlias, IndexingUtils.ES_ENTITY_TYPE,
documentId ).setSource( data );
 
 
         bulkRequest.add( builder );
     }
 
 
-    public String getWriteAlias() {
-        return writeAlias;
-    }
-
-
-    public String getEntityType() {
-        return entityType;
-    }
-
-
-    public String getDocumentId() {
-        return documentId;
-    }
-
-
-    public Map<String, Object> getData() {
-        return data;
-    }
-
 
     @Override
     public boolean equals( final Object o ) {
@@ -114,9 +93,7 @@ public class IndexRequest implements BatchRequest {
         if ( !documentId.equals( that.documentId ) ) {
             return false;
         }
-        if ( !entityType.equals( that.entityType ) ) {
-            return false;
-        }
+
         if ( !writeAlias.equals( that.writeAlias ) ) {
             return false;
         }
@@ -128,7 +105,6 @@ public class IndexRequest implements BatchRequest {
     @Override
     public int hashCode() {
         int result = writeAlias.hashCode();
-        result = 31 * result + entityType.hashCode();
         result = 31 * result + documentId.hashCode();
         result = 31 * result + data.hashCode();
         return result;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ba41bd27/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 d1a030f..0b88dc5 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,11 @@ public class IndexingUtils {
 
 
     /**
+     * Entity type in ES we put everything into
+     */
+    public static final String ES_ENTITY_TYPE = "entity";
+
+    /**
      *  Reserved UG fields in the document
      */
     public static final String APPLICATION_ID_FIELDNAME = "applicationId";

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ba41bd27/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/migration/EsIndexDataMigrationImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/migration/EsIndexDataMigrationImpl.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/migration/EsIndexDataMigrationImpl.java
deleted file mode 100644
index 458ad01..0000000
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/migration/EsIndexDataMigrationImpl.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * 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.
- */
-package org.apache.usergrid.persistence.index.migration;
-
-import com.google.inject.Inject;
-import org.apache.usergrid.persistence.core.migration.data.DataMigration;
-import org.apache.usergrid.persistence.core.migration.data.MigrationDataProvider;
-import org.apache.usergrid.persistence.core.migration.data.ProgressObserver;
-import org.apache.usergrid.persistence.core.migration.data.VersionedData;
-import org.apache.usergrid.persistence.core.scope.ApplicationScope;
-import org.apache.usergrid.persistence.index.AliasedEntityIndex;
-import org.apache.usergrid.persistence.index.IndexFig;
-import org.apache.usergrid.persistence.index.impl.FailureMonitorImpl;
-import org.apache.usergrid.persistence.index.impl.IndexCache;
-import org.apache.usergrid.persistence.index.impl.EsProvider;
-import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequestBuilder;
-import org.elasticsearch.client.AdminClient;
-import org.elasticsearch.indices.InvalidAliasNameException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import rx.Observable;
-
-/**
- * Classy class class.
- */
-public class EsIndexDataMigrationImpl implements DataMigration<ApplicationScope> {
-
-    private final AliasedEntityIndex entityIndex;
-    private final EsProvider provider;
-    private final IndexFig indexFig;
-    private final FailureMonitorImpl.IndexIdentifier indexIdentifier;
-    private final IndexCache indexCache;
-    private final VersionedData dataVersion;
-    private static final Logger log = LoggerFactory.getLogger(EsIndexDataMigrationImpl.class);
-
-    @Inject
-    public EsIndexDataMigrationImpl(AliasedEntityIndex entityIndex, EsProvider provider,
IndexFig indexFig, FailureMonitorImpl.IndexIdentifier indexIdentifier, IndexCache indexCache){
-        this.entityIndex = entityIndex;
-        this.provider = provider;
-        this.indexFig = indexFig;
-        this.indexIdentifier = indexIdentifier;
-        this.indexCache = indexCache;
-        this.dataVersion = (VersionedData) entityIndex;
-    }
-
-    @Override
-    public int migrate(int currentVersion, MigrationDataProvider<ApplicationScope>
migrationDataProvider, ProgressObserver observer) {
-        final AdminClient adminClient = provider.getClient().admin();
-        final int latestVersion = dataVersion.getImplementationVersion();
-
-        entityIndex.initialize();
-
-        observer.start();
-        try {
-            migrationDataProvider.getData().flatMap(applicationScope -> {
-                LegacyIndexIdentifier legacyIndexIdentifier = new LegacyIndexIdentifier(indexFig,
applicationScope);
-                String[] indexes = indexCache.getIndexes(legacyIndexIdentifier.getAlias(),
AliasedEntityIndex.AliasType.Read);
-                return Observable.from(indexes);
-            })
-                .doOnNext(index -> {
-                    IndicesAliasesRequestBuilder aliasesRequestBuilder = adminClient.indices().prepareAliases();
-                    aliasesRequestBuilder = adminClient.indices().prepareAliases();
-                    // add read alias
-                    try {
-                        aliasesRequestBuilder.addAlias(index, indexIdentifier.getAlias().getReadAlias()).get();
-                    } catch (InvalidAliasNameException e) {
-                        log.debug("Failed to add alias due to name conflict",e);
-                    }
-                    observer.update(latestVersion, "EsIndexDataMigrationImpl: fixed index:
" + index);
-                })
-                .doOnCompleted(() -> observer.complete())
-                .toBlocking().lastOrDefault(null);
-        }catch (Exception e){
-            log.error("Failed to migrate index", e);
-            throw e;
-        }
-
-        return latestVersion;
-    }
-
-    @Override
-    public boolean supports(int currentVersion) {
-        return currentVersion < dataVersion.getImplementationVersion();
-    }
-
-    @Override
-    public int getMaxVersion() {
-        return dataVersion.getImplementationVersion();
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ba41bd27/stack/corepersistence/queryindex/src/main/resources/org/apache/usergrid/persistence/index/usergrid-mappings.json
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/resources/org/apache/usergrid/persistence/index/usergrid-mappings.json
b/stack/corepersistence/queryindex/src/main/resources/org/apache/usergrid/persistence/index/usergrid-mappings.json
index 7b13b66..aac82b8 100644
--- a/stack/corepersistence/queryindex/src/main/resources/org/apache/usergrid/persistence/index/usergrid-mappings.json
+++ b/stack/corepersistence/queryindex/src/main/resources/org/apache/usergrid/persistence/index/usergrid-mappings.json
@@ -84,9 +84,10 @@
             "fields": {
               "exact": {
                 "type": "string",
-                "index": "not_analyzed"
-              },
-              "doc_values": true
+                "index": "not_analyzed",
+                "doc_values": true
+              }
+
             }
           }
         }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ba41bd27/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/guice/TestIndexModule.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/guice/TestIndexModule.java
b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/guice/TestIndexModule.java
index a918003..20daf82 100644
--- a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/guice/TestIndexModule.java
+++ b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/guice/TestIndexModule.java
@@ -63,25 +63,15 @@ public class TestIndexModule extends TestModule {
 
     public static class TestAllApplicationsObservable implements MigrationDataProvider<ApplicationScope>{
 
-        final ApplicationScope appScope =  new ApplicationScopeImpl(new SimpleId(UUID.randomUUID(),"application"));
-
         @Inject
-        public TestAllApplicationsObservable(
-                                             final IndexBufferProducer indexBatchBufferProducer,
final EsProvider provider,
-                                             final IndexCache indexCache, final MetricsFactory
metricsFactory,
-                                             final IndexFig indexFig){
-            LegacyIndexIdentifier legacyIndexIdentifier = new  LegacyIndexIdentifier(indexFig,appScope);
-            EntityIndex entityIndex = new EsEntityIndexImpl(indexBatchBufferProducer,provider,indexCache,metricsFactory,indexFig,legacyIndexIdentifier);
-            entityIndex.addIndex(null, 1, 0, indexFig.getWriteConsistencyLevel());
+        public TestAllApplicationsObservable(){
+
         }
 
 
         @Override
         public Observable<ApplicationScope> getData() {
-            ApplicationScope[] scopes = new ApplicationScope[]{
-               appScope
-            };
-            return Observable.from(scopes);
+          return Observable.empty();
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ba41bd27/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/IndexMigrationTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/IndexMigrationTest.java
b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/IndexMigrationTest.java
deleted file mode 100644
index 6ce6459..0000000
--- a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/IndexMigrationTest.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- *
- *  * Licensed to the Apache Software Foundation (ASF) under one or more
- *  *  contributor license agreements.  The ASF licenses this file to You
- *  * under the Apache License, Version 2.0 (the "License"); you may not
- *  * use this file except in compliance with the License.
- *  * You may obtain a copy of the License at
- *  *
- *  *     http://www.apache.org/licenses/LICENSE-2.0
- *  *
- *  * Unless required by applicable law or agreed to in writing, software
- *  * distributed under the License is distributed on an "AS IS" BASIS,
- *  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  * See the License for the specific language governing permissions and
- *  * limitations under the License.  For additional information regarding
- *  * copyright in this work, please see the NOTICE file in the top level
- *  * directory of this distribution.
- *
- */
-package org.apache.usergrid.persistence.index.impl;
-
-import com.google.inject.Inject;
-import org.apache.usergrid.persistence.core.metrics.MetricsFactory;
-import org.apache.usergrid.persistence.core.migration.data.ProgressObserver;
-import org.apache.usergrid.persistence.core.test.UseModules;
-import org.apache.usergrid.persistence.index.*;
-import org.apache.usergrid.persistence.index.guice.TestIndexModule;
-import org.apache.usergrid.persistence.index.migration.EsIndexDataMigrationImpl;
-import org.apache.usergrid.persistence.index.migration.IndexDataVersions;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import static junit.framework.Assert.fail;
-import static junit.framework.TestCase.assertEquals;
-
-/**
- * Classy class class.
- */
-@RunWith(EsRunner.class)
-@UseModules({ TestIndexModule.class })
-public class IndexMigrationTest extends BaseIT{
-
-
-    @Inject
-    public IndexFig fig;
-    @Inject
-    public FailureMonitorImpl.IndexIdentifier indexIdentifier;
-
-    @Inject
-    public IndexCache indexCache;
-
-    @Inject
-    public EsProvider provider;
-
-    @Inject
-    public AliasedEntityIndex ei;
-    @Inject
-    public IndexBufferProducer indexBatchBufferProducer;
-    @Inject
-    public MetricsFactory metricsFactory;
-
-    @Test
-    public void TestMigrate(){
-        EsIndexDataMigrationImpl indexDataMigration = new EsIndexDataMigrationImpl(ei,provider,
fig, indexIdentifier,indexCache);
-        ProgressObserver po = new ProgressObserver() {
-            @Override
-            public void start() {
-
-            }
-
-            @Override
-            public void complete() {
-
-            }
-
-            @Override
-            public void failed(int migrationVersion, String reason) {
-                fail(reason);
-            }
-
-            @Override
-            public void failed(int migrationVersion, String reason, Throwable throwable)
{
-                fail(reason);
-            }
-
-            @Override
-            public void update(int migrationVersion, String message) {
-
-            }
-        };
-
-        TestIndexModule.TestAllApplicationsObservable obs = new TestIndexModule.TestAllApplicationsObservable(indexBatchBufferProducer,provider,indexCache,metricsFactory,fig);
-        int version = indexDataMigration.migrate(0, obs, po );
-        assertEquals(version, IndexDataVersions.SINGLE_INDEX.getVersion());
-    }
-}
-
-
-


Mime
View raw message