usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject [35/36] usergrid git commit: Removed all instance of java.util.Optional from selective indexing.
Date Fri, 08 Apr 2016 20:21:22 GMT
Removed all instance of java.util.Optional from selective indexing.


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

Branch: refs/heads/release-2.1.1
Commit: d751ac1fa9ed4dc5eecc915db10d8ca65f0b8548
Parents: 9f3720e
Author: George Reyes <grey@apache.org>
Authored: Mon Apr 4 11:08:16 2016 -0700
Committer: George Reyes <grey@apache.org>
Committed: Mon Apr 4 11:08:16 2016 -0700

----------------------------------------------------------------------
 .../org/apache/usergrid/corepersistence/CpEntityManager.java  | 4 ++--
 .../org/apache/usergrid/corepersistence/ManagerCache.java     | 3 ---
 .../usergrid/corepersistence/index/IndexSchemaCache.java      | 3 ++-
 .../usergrid/corepersistence/index/IndexSchemaCacheImpl.java  | 6 +++---
 .../usergrid/corepersistence/index/IndexServiceImpl.java      | 6 +++---
 .../usergrid/corepersistence/index/ReIndexServiceImpl.java    | 2 +-
 .../apache/usergrid/persistence/index/EntityIndexBatch.java   | 7 +++----
 .../usergrid/persistence/index/impl/EntityToMapConverter.java | 5 +++--
 .../persistence/index/impl/EsEntityIndexBatchImpl.java        | 5 +++--
 .../usergrid/persistence/index/impl/IndexOperation.java       | 4 +---
 10 files changed, 21 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/d751ac1f/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 4ee497c..2e2d9d5 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
@@ -1767,7 +1767,7 @@ public class CpEntityManager implements EntityManager {
 
         IndexSchemaCache indexSchemaCache = indexSchemaCacheFactory.getInstance( mm );
 
-        java.util.Optional<Map> collectionIndexingSchema = indexSchemaCache.getCollectionSchema(
collectionName );
+        Optional<Map> collectionIndexingSchema = indexSchemaCache.getCollectionSchema(
collectionName );
 
 
         //If there is an existing schema then take the lastReindexed time and keep it around.Otherwise
initialize to 0.
@@ -1815,7 +1815,7 @@ public class CpEntityManager implements EntityManager {
 
         IndexSchemaCache indexSchemaCache = indexSchemaCacheFactory.getInstance( mm ); //managerCache.getIndexSchema(
mm );
 
-        java.util.Optional<Map> collectionIndexingSchema =  indexSchemaCache.getCollectionSchema(
collectionName );
+        Optional<Map> collectionIndexingSchema =  indexSchemaCache.getCollectionSchema(
collectionName );
 
         if(collectionIndexingSchema.isPresent()){
             return collectionIndexingSchema.get();

http://git-wip-us.apache.org/repos/asf/usergrid/blob/d751ac1f/stack/core/src/main/java/org/apache/usergrid/corepersistence/ManagerCache.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/ManagerCache.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/ManagerCache.java
index ebfd5a4..60212df 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/ManagerCache.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/ManagerCache.java
@@ -20,14 +20,11 @@
 package org.apache.usergrid.corepersistence;
 
 
-import java.util.Optional;
 
-import org.apache.usergrid.corepersistence.index.IndexSchemaCache;
 import org.apache.usergrid.persistence.collection.EntityCollectionManager;
 import org.apache.usergrid.persistence.core.scope.ApplicationScope;
 import org.apache.usergrid.persistence.graph.GraphManager;
 import org.apache.usergrid.persistence.index.EntityIndex;
-import org.apache.usergrid.persistence.index.IndexLocationStrategy;
 import org.apache.usergrid.persistence.index.impl.IndexProducer;
 import org.apache.usergrid.persistence.map.MapManager;
 import org.apache.usergrid.persistence.map.MapScope;

http://git-wip-us.apache.org/repos/asf/usergrid/blob/d751ac1f/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexSchemaCache.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexSchemaCache.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexSchemaCache.java
index a56ffd6..0ef92e9 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexSchemaCache.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexSchemaCache.java
@@ -18,7 +18,8 @@ package org.apache.usergrid.corepersistence.index;
 
 
 import java.util.Map;
-import java.util.Optional;
+
+import com.google.common.base.Optional;
 
 
 public interface IndexSchemaCache {

http://git-wip-us.apache.org/repos/asf/usergrid/blob/d751ac1f/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexSchemaCacheImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexSchemaCacheImpl.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexSchemaCacheImpl.java
index 3df31cc..fd0b676 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexSchemaCacheImpl.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexSchemaCacheImpl.java
@@ -19,7 +19,6 @@ package org.apache.usergrid.corepersistence.index;
 
 
 import java.util.Map;
-import java.util.Optional;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -27,6 +26,7 @@ import org.slf4j.LoggerFactory;
 import org.apache.usergrid.persistence.map.MapManager;
 import org.apache.usergrid.utils.JsonUtils;
 
+import com.google.common.base.Optional;
 import com.google.common.cache.CacheBuilder;
 import com.google.common.cache.CacheLoader;
 import com.google.common.cache.LoadingCache;
@@ -53,7 +53,7 @@ public class IndexSchemaCacheImpl implements IndexSchemaCache {
             .build( new CacheLoader<String, Optional<Map>>() {
                 @Override
                 public Optional<Map> load( final String collectionName ) throws Exception
{
-                    return Optional.ofNullable( retrieveCollectionSchema( collectionName
) );
+                    return Optional.fromNullable( retrieveCollectionSchema( collectionName
) );
                 }
             } );
     }
@@ -75,7 +75,7 @@ public class IndexSchemaCacheImpl implements IndexSchemaCache {
             Optional<Map> optionalCollectionSchema = indexSchemaCache.get( collectionName
);
             if(!optionalCollectionSchema.isPresent()){
                 indexSchemaCache.invalidate( collectionName );
-                return Optional.empty();
+                return Optional.absent();
             }
             return optionalCollectionSchema;
         }catch(Exception e){

http://git-wip-us.apache.org/repos/asf/usergrid/blob/d751ac1f/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexServiceImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexServiceImpl.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexServiceImpl.java
index c81c4ef..f3f48cc 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexServiceImpl.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexServiceImpl.java
@@ -23,7 +23,6 @@ package org.apache.usergrid.corepersistence.index;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.Map;
-import java.util.Optional;
 import java.util.Set;
 import java.util.UUID;
 import java.util.concurrent.TimeUnit;
@@ -61,6 +60,7 @@ import org.apache.usergrid.utils.JsonUtils;
 import org.apache.usergrid.utils.UUIDUtils;
 
 import com.codahale.metrics.Timer;
+import com.google.common.base.Optional;
 import com.google.inject.Inject;
 import com.google.inject.Singleton;
 
@@ -223,13 +223,13 @@ public class IndexServiceImpl implements IndexService {
             fieldsToKeep = ( ArrayList ) jsonMapData.get( "fields" );
 
             if(fieldsToKeep.contains( "*" )){
-                return Optional.empty();
+                return Optional.absent();
             }
 
             defaultProperties.addAll( fieldsToKeep );
         }
         else {
-            return Optional.empty();
+            return Optional.absent();
         }
 
         return Optional.of(defaultProperties);

http://git-wip-us.apache.org/repos/asf/usergrid/blob/d751ac1f/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/ReIndexServiceImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/ReIndexServiceImpl.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/ReIndexServiceImpl.java
index 0aa0f60..250e7fc 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/ReIndexServiceImpl.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/ReIndexServiceImpl.java
@@ -141,7 +141,7 @@ public class ReIndexServiceImpl implements ReIndexService {
             MapManager collectionMapStorage = mapManagerFactory.createMapManager( CpNamingUtils.getEntityTypeMapScope(
appId.get().getApplication()  ) );
             IndexSchemaCache indexSchemaCache = indexSchemaCacheFactory.getInstance( collectionMapStorage
);
 
-            java.util.Optional<Map> collectionIndexingSchema =  indexSchemaCache.getCollectionSchema(
collectionName );
+            Optional<Map> collectionIndexingSchema =  indexSchemaCache.getCollectionSchema(
collectionName );
 
             //If we do have a schema then parse it and add it to a list of properties we
want to keep.Otherwise return.
             if ( collectionIndexingSchema.isPresent() ) {

http://git-wip-us.apache.org/repos/asf/usergrid/blob/d751ac1f/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/EntityIndexBatch.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/EntityIndexBatch.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/EntityIndexBatch.java
index 274aea5..c551083 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/EntityIndexBatch.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/EntityIndexBatch.java
@@ -18,16 +18,15 @@ package org.apache.usergrid.persistence.index;/*
  */
 
 
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
+
 import java.util.Set;
 import java.util.UUID;
 
 import org.apache.usergrid.persistence.index.impl.IndexOperationMessage;
 import org.apache.usergrid.persistence.model.entity.Entity;
 import org.apache.usergrid.persistence.model.entity.Id;
-import rx.Observable;
+
+import com.google.common.base.Optional;
 
 
 public interface EntityIndexBatch {

http://git-wip-us.apache.org/repos/asf/usergrid/blob/d751ac1f/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EntityToMapConverter.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EntityToMapConverter.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EntityToMapConverter.java
index 8eb9f48..bc26ae9 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EntityToMapConverter.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EntityToMapConverter.java
@@ -21,7 +21,6 @@ import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Map;
-import java.util.Optional;
 import java.util.Set;
 
 import org.apache.usergrid.persistence.core.scope.ApplicationScope;
@@ -30,6 +29,8 @@ import org.apache.usergrid.persistence.model.entity.Entity;
 import org.apache.usergrid.persistence.model.entity.EntityMap;
 import org.apache.usergrid.persistence.model.entity.Id;
 
+import com.google.common.base.Optional;
+
 import static org.apache.usergrid.persistence.index.impl.IndexingUtils.APPLICATION_ID_FIELDNAME;
 import static org.apache.usergrid.persistence.index.impl.IndexingUtils.EDGE_NAME_FIELDNAME;
 import static org.apache.usergrid.persistence.index.impl.IndexingUtils.EDGE_NODE_ID_FIELDNAME;
@@ -56,7 +57,7 @@ public class EntityToMapConverter {
     public static Map<String, Object> convert(ApplicationScope applicationScope, final
IndexEdge indexEdge,
                                               final Entity entity) {
 
-        return convert( applicationScope, indexEdge, entity, Optional.empty() );
+        return convert( applicationScope, indexEdge, entity, Optional.absent() );
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/usergrid/blob/d751ac1f/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 0375841..1bb97b3 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
@@ -19,7 +19,6 @@
 package org.apache.usergrid.persistence.index.impl;
 
 
-import java.util.Optional;
 import java.util.Set;
 import java.util.UUID;
 
@@ -39,6 +38,8 @@ import org.apache.usergrid.persistence.index.utils.IndexValidationUtils;
 import org.apache.usergrid.persistence.model.entity.Entity;
 import org.apache.usergrid.persistence.model.entity.Id;
 
+import com.google.common.base.Optional;
+
 
 public class EsEntityIndexBatchImpl implements EntityIndexBatch {
 
@@ -70,7 +71,7 @@ public class EsEntityIndexBatchImpl implements EntityIndexBatch {
 
     @Override
     public EntityIndexBatch index( final IndexEdge indexEdge, final Entity entity ) {
-        return index( indexEdge,entity, Optional.empty() );
+        return index( indexEdge,entity, Optional.absent() );
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/usergrid/blob/d751ac1f/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexOperation.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexOperation.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexOperation.java
index 8f925ed..f8560ba 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexOperation.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexOperation.java
@@ -21,20 +21,18 @@ package org.apache.usergrid.persistence.index.impl;
 
 
 import java.util.Map;
-import java.util.Optional;
 import java.util.Set;
-import java.util.UUID;
 
 import org.apache.usergrid.persistence.core.scope.ApplicationScope;
 import org.apache.usergrid.persistence.index.IndexEdge;
 import org.apache.usergrid.persistence.model.entity.Entity;
-import org.apache.usergrid.persistence.model.entity.Id;
 
 import org.elasticsearch.action.bulk.BulkRequestBuilder;
 import org.elasticsearch.action.index.IndexRequestBuilder;
 import org.elasticsearch.client.Client;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.common.base.Optional;
 
 
 /**


Mime
View raw message