usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mru...@apache.org
Subject [11/38] usergrid git commit: Fix issues with adding getTables() to Migration interface.
Date Wed, 17 Aug 2016 21:48:18 GMT
Fix issues with adding getTables() to Migration interface.


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

Branch: refs/heads/master
Commit: 29814ef50f47254e45371f355c1c1065ebf1aac4
Parents: df7d2ff
Author: Michael Russo <michaelarusso@gmail.com>
Authored: Fri Feb 12 19:15:33 2016 -0800
Committer: Michael Russo <michaelarusso@gmail.com>
Committed: Fri Feb 12 19:15:33 2016 -0800

----------------------------------------------------------------------
 .../cache/impl/ScopedCacheSerializationImpl.java      | 10 +++++++++-
 .../impl/UniqueValueSerializationStrategyImpl.java    | 14 ++++++++------
 .../core/datastax/impl/DatastaxClusterImpl.java       |  2 --
 .../core/migration/schema/MigrationManagerImpl.java   |  5 +----
 .../impl/EdgeMetadataSerializationProxyImpl.java      |  6 ++++++
 .../impl/EdgeMetadataSerializationV1Impl.java         |  8 ++++++++
 .../impl/EdgeMetadataSerializationV2Impl.java         | 14 ++++++++------
 .../serialization/impl/NodeSerializationImpl.java     |  7 +++++++
 .../impl/shard/impl/EdgeShardSerializationImpl.java   |  7 +++++++
 .../impl/shard/impl/SizebasedEdgeColumnFamilies.java  |  8 ++++++++
 .../usergrid/persistence/map/MapManagerTest.java      |  2 +-
 11 files changed, 63 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/29814ef5/stack/corepersistence/cache/src/main/java/org/apache/usergrid/persistence/cache/impl/ScopedCacheSerializationImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/cache/src/main/java/org/apache/usergrid/persistence/cache/impl/ScopedCacheSerializationImpl.java
b/stack/corepersistence/cache/src/main/java/org/apache/usergrid/persistence/cache/impl/ScopedCacheSerializationImpl.java
index 1f763b2..cf835c8 100644
--- a/stack/corepersistence/cache/src/main/java/org/apache/usergrid/persistence/cache/impl/ScopedCacheSerializationImpl.java
+++ b/stack/corepersistence/cache/src/main/java/org/apache/usergrid/persistence/cache/impl/ScopedCacheSerializationImpl.java
@@ -39,6 +39,7 @@ import com.netflix.astyanax.serializers.StringSerializer;
 import org.apache.cassandra.db.marshal.BytesType;
 import org.apache.usergrid.persistence.cache.CacheScope;
 import org.apache.usergrid.persistence.core.astyanax.*;
+import org.apache.usergrid.persistence.core.datastax.TableDefinition;
 import org.apache.usergrid.persistence.core.shard.ExpandingShardLocator;
 import org.apache.usergrid.persistence.core.shard.StringHashUtils;
 import org.slf4j.Logger;
@@ -47,6 +48,7 @@ import org.slf4j.LoggerFactory;
 import java.io.IOException;
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.concurrent.Callable;
 
 
@@ -284,7 +286,13 @@ public class ScopedCacheSerializationImpl<K,V> implements ScopedCacheSerializati
                 BytesType.class.getSimpleName(),
                 MultiTenantColumnFamilyDefinition.CacheOption.KEYS );
 
-        return Arrays.asList(scopedCache);
+        return Collections.singletonList(scopedCache);
+    }
+
+    @Override
+    public Collection<TableDefinition> getTables() {
+
+        return Collections.emptyList();
     }
 
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/29814ef5/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyImpl.java
b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyImpl.java
index 1795511..197fd4e 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyImpl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/UniqueValueSerializationStrategyImpl.java
@@ -18,13 +18,9 @@
 package org.apache.usergrid.persistence.collection.serialization.impl;
 
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.UUID;
+import java.util.*;
 
+import org.apache.usergrid.persistence.core.datastax.TableDefinition;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -379,6 +375,12 @@ public abstract class UniqueValueSerializationStrategyImpl<FieldKey,
EntityKey>
         return Arrays.asList( uniqueLookupCF, uniqueLogCF );
     }
 
+    @Override
+    public Collection<TableDefinition> getTables() {
+
+        return Collections.emptyList();
+    }
+
 
     /**
      * Get the column family for the unique fields

http://git-wip-us.apache.org/repos/asf/usergrid/blob/29814ef5/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/impl/DatastaxClusterImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/impl/DatastaxClusterImpl.java
b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/impl/DatastaxClusterImpl.java
index 5fc804b..43e2eb2 100644
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/impl/DatastaxClusterImpl.java
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/impl/DatastaxClusterImpl.java
@@ -150,8 +150,6 @@ public class DataStaxClusterImpl implements DataStaxCluster {
         logger.info("Updating application keyspace with the following CQL: {}", updateApplicationKeyspace);
         clusterSession.executeAsync(updateApplicationKeyspace);
 
-        // this session pool is only used when running database setup so close it when finished
to clear resources
-        clusterSession.close();
 
         waitForSchemaAgreement();
     }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/29814ef5/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/MigrationManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/MigrationManagerImpl.java
b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/MigrationManagerImpl.java
index 39a78b7..d746482 100644
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/MigrationManagerImpl.java
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/schema/MigrationManagerImpl.java
@@ -91,7 +91,7 @@ public class MigrationManagerImpl implements MigrationManager {
                     continue;
                 }
 
-                if (columnFamilies != null && columnFamilies.isEmpty()) {
+                if (columnFamilies != null && !columnFamilies.isEmpty()) {
                     for (MultiTenantColumnFamilyDefinition cf : columnFamilies) {
                         testAndCreateColumnFamilyDef(cf);
                     }
@@ -182,9 +182,6 @@ public class MigrationManagerImpl implements MigrationManager {
         logger.info("Updating application keyspace with the following CQL: {}", updateApplicationKeyspace);
         clusterSession.executeAsync(updateApplicationKeyspace);
 
-        // this session pool is only used when running database setup so close it when finished
to clear resources
-        clusterSession.close();
-
         waitForSchemaAgreement();
     }
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/29814ef5/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationProxyImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationProxyImpl.java
b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationProxyImpl.java
index 44d0b73..46acd1c 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationProxyImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationProxyImpl.java
@@ -26,6 +26,7 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.Iterator;
 
+import org.apache.usergrid.persistence.core.datastax.TableDefinition;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -288,6 +289,11 @@ public class EdgeMetadataSerializationProxyImpl implements EdgeMetadataSerializa
         return Collections.EMPTY_LIST;
     }
 
+    @Override
+    public Collection<TableDefinition> getTables() {
+
+        return Collections.emptyList();
+    }
 
 
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/29814ef5/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationV1Impl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationV1Impl.java
b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationV1Impl.java
index da4d044..870ba16 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationV1Impl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationV1Impl.java
@@ -22,6 +22,7 @@ package org.apache.usergrid.persistence.graph.serialization.impl;
 
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Iterator;
 
 import org.apache.cassandra.db.marshal.BytesType;
@@ -36,6 +37,7 @@ import org.apache.usergrid.persistence.core.astyanax.MultiTenantColumnFamilyDefi
 import org.apache.usergrid.persistence.core.astyanax.ScopedRowKeySerializer;
 import org.apache.usergrid.persistence.core.astyanax.ScopedRowKey;
 import org.apache.usergrid.persistence.core.astyanax.StringColumnParser;
+import org.apache.usergrid.persistence.core.datastax.TableDefinition;
 import org.apache.usergrid.persistence.core.migration.schema.Migration;
 import org.apache.usergrid.persistence.core.scope.ApplicationScope;
 import org.apache.usergrid.persistence.core.util.ValidationUtils;
@@ -376,6 +378,12 @@ public class EdgeMetadataSerializationV1Impl implements EdgeMetadataSerializatio
                 graphCf( CF_SOURCE_EDGE_ID_TYPES ), graphCf( CF_TARGET_EDGE_ID_TYPES ) );
     }
 
+    @Override
+    public Collection<TableDefinition> getTables() {
+
+        return Collections.emptyList();
+    }
+
 
     /**
      * Helper to generate an edge definition by the type

http://git-wip-us.apache.org/repos/asf/usergrid/blob/29814ef5/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationV2Impl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationV2Impl.java
b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationV2Impl.java
index 2af62a8..1aa86cc 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationV2Impl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationV2Impl.java
@@ -22,12 +22,7 @@
 package org.apache.usergrid.persistence.graph.serialization.impl;
 
 
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.UUID;
+import java.util.*;
 
 import org.apache.cassandra.db.marshal.BytesType;
 import org.apache.cassandra.db.marshal.UTF8Type;
@@ -42,6 +37,7 @@ import org.apache.usergrid.persistence.core.astyanax.MultiRowColumnIterator;
 import org.apache.usergrid.persistence.core.astyanax.MultiTenantColumnFamily;
 import org.apache.usergrid.persistence.core.astyanax.MultiTenantColumnFamilyDefinition;
 import org.apache.usergrid.persistence.core.astyanax.StringColumnParser;
+import org.apache.usergrid.persistence.core.datastax.TableDefinition;
 import org.apache.usergrid.persistence.core.migration.schema.Migration;
 import org.apache.usergrid.persistence.core.scope.ApplicationScope;
 import org.apache.usergrid.persistence.core.shard.ExpandingShardLocator;
@@ -470,6 +466,12 @@ public class EdgeMetadataSerializationV2Impl implements EdgeMetadataSerializatio
                 graphCf( CF_SOURCE_EDGE_ID_TYPES ), graphCf( CF_TARGET_EDGE_ID_TYPES ) );
     }
 
+    @Override
+    public Collection<TableDefinition> getTables() {
+
+        return Collections.emptyList();
+    }
+
 
     /**
      * Helper to generate an edge definition by the type

http://git-wip-us.apache.org/repos/asf/usergrid/blob/29814ef5/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/NodeSerializationImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/NodeSerializationImpl.java
b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/NodeSerializationImpl.java
index cd803e8..8a2da54 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/NodeSerializationImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/NodeSerializationImpl.java
@@ -38,6 +38,7 @@ import org.apache.usergrid.persistence.core.astyanax.MultiTenantColumnFamily;
 import org.apache.usergrid.persistence.core.astyanax.MultiTenantColumnFamilyDefinition;
 import org.apache.usergrid.persistence.core.astyanax.ScopedRowKeySerializer;
 import org.apache.usergrid.persistence.core.astyanax.ScopedRowKey;
+import org.apache.usergrid.persistence.core.datastax.TableDefinition;
 import org.apache.usergrid.persistence.core.migration.schema.Migration;
 import org.apache.usergrid.persistence.core.scope.ApplicationScope;
 import org.apache.usergrid.persistence.core.util.ValidationUtils;
@@ -110,6 +111,12 @@ public class NodeSerializationImpl implements NodeSerialization, Migration
{
                         MultiTenantColumnFamilyDefinition.CacheOption.ALL ) );
     }
 
+    @Override
+    public Collection<TableDefinition> getTables() {
+
+        return Collections.emptyList();
+    }
+
 
     @Override
     public MutationBatch mark( final ApplicationScope scope, final Id node, final long timestamp
) {

http://git-wip-us.apache.org/repos/asf/usergrid/blob/29814ef5/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/EdgeShardSerializationImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/EdgeShardSerializationImpl.java
b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/EdgeShardSerializationImpl.java
index 120a15c..8730950 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/EdgeShardSerializationImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/EdgeShardSerializationImpl.java
@@ -34,6 +34,7 @@ import org.apache.usergrid.persistence.core.astyanax.MultiTenantColumnFamily;
 import org.apache.usergrid.persistence.core.astyanax.MultiTenantColumnFamilyDefinition;
 import org.apache.usergrid.persistence.core.astyanax.ScopedRowKeySerializer;
 import org.apache.usergrid.persistence.core.astyanax.ScopedRowKey;
+import org.apache.usergrid.persistence.core.datastax.TableDefinition;
 import org.apache.usergrid.persistence.core.scope.ApplicationScope;
 import org.apache.usergrid.persistence.core.util.ValidationUtils;
 import org.apache.usergrid.persistence.graph.GraphFig;
@@ -173,6 +174,12 @@ public class EdgeShardSerializationImpl implements EdgeShardSerialization
{
                         MultiTenantColumnFamilyDefinition.CacheOption.KEYS ) );
     }
 
+    @Override
+    public Collection<TableDefinition> getTables() {
+
+        return Collections.emptyList();
+    }
+
 
 
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/29814ef5/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/SizebasedEdgeColumnFamilies.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/SizebasedEdgeColumnFamilies.java
b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/SizebasedEdgeColumnFamilies.java
index 9185ac8..f4e19d6 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/SizebasedEdgeColumnFamilies.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/SizebasedEdgeColumnFamilies.java
@@ -23,6 +23,7 @@ package org.apache.usergrid.persistence.graph.serialization.impl.shard.impl;
 
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 
 import org.apache.cassandra.db.marshal.BytesType;
 import org.apache.cassandra.db.marshal.DynamicCompositeType;
@@ -32,6 +33,7 @@ import org.apache.usergrid.persistence.core.astyanax.MultiTenantColumnFamily;
 import org.apache.usergrid.persistence.core.astyanax.MultiTenantColumnFamilyDefinition;
 import org.apache.usergrid.persistence.core.astyanax.ScopedRowKeySerializer;
 import org.apache.usergrid.persistence.core.astyanax.ScopedRowKey;
+import org.apache.usergrid.persistence.core.datastax.TableDefinition;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.DirectedEdge;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.EdgeColumnFamilies;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.EdgeRowKey;
@@ -143,6 +145,12 @@ public class SizebasedEdgeColumnFamilies implements EdgeColumnFamilies
{
                                 MultiTenantColumnFamilyDefinition.CacheOption.ALL ) );
     }
 
+    @Override
+    public Collection<TableDefinition> getTables() {
+
+        return Collections.emptyList();
+    }
+
 
     /**
      * Helper to generate an edge definition by the type

http://git-wip-us.apache.org/repos/asf/usergrid/blob/29814ef5/stack/corepersistence/map/src/test/java/org/apache/usergrid/persistence/map/MapManagerTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/map/src/test/java/org/apache/usergrid/persistence/map/MapManagerTest.java
b/stack/corepersistence/map/src/test/java/org/apache/usergrid/persistence/map/MapManagerTest.java
index 1ce0a40..2a68247 100644
--- a/stack/corepersistence/map/src/test/java/org/apache/usergrid/persistence/map/MapManagerTest.java
+++ b/stack/corepersistence/map/src/test/java/org/apache/usergrid/persistence/map/MapManagerTest.java
@@ -27,7 +27,7 @@ import java.util.UUID;
 import java.util.concurrent.TimeUnit;
 
 import org.junit.Before;
-\import org.junit.Rule;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 


Mime
View raw message