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: Removed unused CFs
Date Tue, 21 Apr 2015 20:35:04 GMT
Repository: incubator-usergrid
Updated Branches:
  refs/heads/two-dot-o-dev a58ccfa03 -> 2a582700b


Removed unused CFs


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

Branch: refs/heads/two-dot-o-dev
Commit: 2a582700b1f8bf68b3773a91a101c88de9db2b87
Parents: a58ccfa
Author: Todd Nine <tnine@apigee.com>
Authored: Tue Apr 21 14:35:02 2015 -0600
Committer: Todd Nine <tnine@apigee.com>
Committed: Tue Apr 21 14:35:02 2015 -0600

----------------------------------------------------------------------
 .../apache/usergrid/mq/cassandra/QueuesCF.java  |   5 -
 .../persistence/cassandra/ApplicationCF.java    |  37 ------
 .../cassandra/CassandraPersistenceUtils.java    | 122 +------------------
 3 files changed, 1 insertion(+), 163 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2a582700/stack/core/src/main/java/org/apache/usergrid/mq/cassandra/QueuesCF.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/mq/cassandra/QueuesCF.java b/stack/core/src/main/java/org/apache/usergrid/mq/cassandra/QueuesCF.java
index a8b1166..b0f6906 100644
--- a/stack/core/src/main/java/org/apache/usergrid/mq/cassandra/QueuesCF.java
+++ b/stack/core/src/main/java/org/apache/usergrid/mq/cassandra/QueuesCF.java
@@ -51,8 +51,6 @@ public enum QueuesCF implements CFEnum {
 
     CONSUMERS( "MQ_Consumers", "BytesType" ),
 
-    CONSUMER_QUEUE_MESSAGES_PROPERTIES( "Consumer_Queue_Messages_Properties", "BytesType"
),
-
     COUNTERS( "MQ_Counters", "BytesType", COUNTERTYPE.getClassName() ),
 
     PROPERTY_INDEX( "MQ_Property_Index",
@@ -67,9 +65,6 @@ public enum QueuesCF implements CFEnum {
                     "I=>IntegerType(reversed=true),X=>LexicalUUIDType(reversed=true),L=>LongType(reversed=true),"
+
                     "T=>TimeUUIDType(reversed=true),S=>UTF8Type(reversed=true),U=>UUIDType(reversed=true))"
),;
 
-    public final static String STATIC_MESSAGES_KEYSPACE = "Usergrid_Messages";
-    public final static String APPLICATION_MESSAGES_KEYSPACE_SUFFIX = "_messages";
-
     private final String cf;
     private final String comparator;
     private final String validator;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2a582700/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/ApplicationCF.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/ApplicationCF.java
b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/ApplicationCF.java
index 653c546..5dbe4b5 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/ApplicationCF.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/ApplicationCF.java
@@ -27,19 +27,10 @@ import static org.apache.usergrid.persistence.cassandra.CassandraPersistenceUtil
 
 public enum ApplicationCF implements CFEnum {
 
-    /** This is where the entity objects are stored */
-    ENTITY_PROPERTIES( "Entity_Properties", "BytesType" ),
-
     /** each row models name:value pairs. {@see org.apache.usergrid.persistence.Schema} for
the list of dictionary types */
     ENTITY_DICTIONARIES( "Entity_Dictionaries", "BytesType" ),
 
     /**
-     * Rows that are full of UUIDs. Used when we want to have a row full of references to
other entities. Mainly, this
-     * is for collections. Collections are represented by this CF.
-     */
-    ENTITY_ID_SETS( "Entity_Id_Sets", "UUIDType" ),
-
-    /**
      * Typed vs. untyped dictionary. Dynamic entity dictionaries end up here. {@link
      * EntityManagerImpl#getDictionaryAsMap(org.apache.usergrid.persistence.EntityRef, String)}
      */
@@ -49,39 +40,11 @@ public enum ApplicationCF implements CFEnum {
                     "I=>IntegerType(reversed=true),X=>LexicalUUIDType(reversed=true),L=>LongType(reversed=true),"
+
                     "T=>TimeUUIDType(reversed=true),S=>UTF8Type(reversed=true),U=>UUIDType(reversed=true))"
),
 
-    /** No longer used? */
-    ENTITY_METADATA( "Entity_Metadata", "BytesType" ),
-
-    /** Contains all secondary indexes for entities */
-    ENTITY_INDEX( "Entity_Index",
-            "DynamicCompositeType(a=>AsciiType,b=>BytesType,i=>IntegerType,x=>LexicalUUIDType,l=>LongType,"
+
-                    "t=>TimeUUIDType,s=>UTF8Type,u=>UUIDType,A=>AsciiType(reversed=true),B=>BytesType(reversed=true),"
+
-                    "I=>IntegerType(reversed=true),X=>LexicalUUIDType(reversed=true),L=>LongType(reversed=true),"
+
-                    "T=>TimeUUIDType(reversed=true),S=>UTF8Type(reversed=true),U=>UUIDType(reversed=true))"
),
-
-    /** Unique index for properties that must remain the same */
-    ENTITY_UNIQUE( "Entity_Unique", "UUIDType" ),
-
-    /** Contains all properties that have ever been indexed for an entity */
-    ENTITY_INDEX_ENTRIES( "Entity_Index_Entries",
-            "DynamicCompositeType(a=>AsciiType,b=>BytesType,i=>IntegerType,x=>LexicalUUIDType,l=>LongType,"
+
-                    "t=>TimeUUIDType,s=>UTF8Type,u=>UUIDType,A=>AsciiType(reversed=true),B=>BytesType(reversed=true),"
+
-                    "I=>IntegerType(reversed=true),X=>LexicalUUIDType(reversed=true),L=>LongType(reversed=true),"
+
-                    "T=>TimeUUIDType(reversed=true),S=>UTF8Type(reversed=true),U=>UUIDType(reversed=true))"
),
-
-    /** All roles that exist within an application */
-    APPLICATION_ROLES( "Application_Roles", "BytesType" ),
-
     /** Application counters */
     APPLICATION_AGGREGATE_COUNTERS( "Application_Aggregate_Counters", "LongType", COUNTERTYPE.getClassName()
),
 
     /** Entity counters */
     ENTITY_COUNTERS( "Entity_Counters", "BytesType", COUNTERTYPE.getClassName() ),;
-    public final static String DEFAULT_DYNAMIC_COMPOSITE_ALIASES =
-            "(a=>AsciiType,b=>BytesType,i=>IntegerType,x=>LexicalUUIDType,l=>LongType,t=>TimeUUIDType,s=>UTF8Type,"
+
-                    "u=>UUIDType,A=>AsciiType(reversed=true),B=>BytesType(reversed=true),"
+
-                    "I=>IntegerType(reversed=true),X=>LexicalUUIDType(reversed=true),L=>LongType(reversed=true),"
+
-                    "T=>TimeUUIDType(reversed=true),S=>UTF8Type(reversed=true),U=>UUIDType(reversed=true))";
 
     private final String cf;
     private final String comparator;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2a582700/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/CassandraPersistenceUtils.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/CassandraPersistenceUtils.java
b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/CassandraPersistenceUtils.java
index 174e0a4..bbf844b 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/CassandraPersistenceUtils.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/CassandraPersistenceUtils.java
@@ -83,16 +83,6 @@ public class CassandraPersistenceUtils {
     /**
      *
      */
-    public static final ByteBuffer PROPERTY_TYPE_AS_BYTES = bytebuffer( PROPERTY_TYPE );
-
-    /**
-     *
-     */
-    public static final ByteBuffer PROPERTY_ID_AS_BYTES = bytebuffer( PROPERTY_UUID );
-
-    /**
-     *
-     */
     public static final char KEY_DELIM = ':';
 
     /**
@@ -145,34 +135,6 @@ public class CassandraPersistenceUtils {
     }
 
 
-    public static void addPropertyToMutator( Mutator<ByteBuffer> m, Object key, String
entityType, String propertyName,
-                                             Object propertyValue, long timestamp ) {
-
-        logBatchOperation( "Insert", ApplicationCF.ENTITY_PROPERTIES, key, propertyName,
propertyValue, timestamp );
-
-        HColumn<ByteBuffer, ByteBuffer> column = createColumn( bytebuffer( propertyName
),
-                serializeEntityProperty( entityType, propertyName, propertyValue ), timestamp,
be, be );
-        m.addInsertion( bytebuffer( key ), ApplicationCF.ENTITY_PROPERTIES.toString(), column
);
-    }
-
-
-    public static void addPropertyToMutator( Mutator<ByteBuffer> m, Object key, String
entityType,
-                                             Map<String, ?> columns, long timestamp
) throws Exception {
-
-        for ( Entry<String, ?> entry : columns.entrySet() ) {
-            addPropertyToMutator( m, key, entityType, entry.getKey(), entry.getValue(), timestamp
);
-        }
-    }
-
-
-    /** Delete the row */
-    public static void addDeleteToMutator( Mutator<ByteBuffer> m, Object columnFamily,
Object key, long timestamp )
-            throws Exception {
-
-        logBatchOperation( "Delete", columnFamily, key, null, null, timestamp );
-
-        m.addDeletion( bytebuffer( key ), columnFamily.toString(), timestamp );
-    }
 
 
     public static void addDeleteToMutator( Mutator<ByteBuffer> m, Object columnFamily,
Object key, Object columnName,
@@ -188,20 +150,6 @@ public class CassandraPersistenceUtils {
     }
 
 
-    public static void addDeleteToMutator( Mutator<ByteBuffer> m, Object columnFamily,
Object key, long timestamp,
-                                           Object... columnNames ) throws Exception {
-
-        for ( Object columnName : columnNames ) {
-            logBatchOperation( "Delete", columnFamily, key, columnName, null, timestamp );
-
-            if ( columnName instanceof List<?> ) {
-                columnName = DynamicComposite.toByteBuffer( ( List<?> ) columnName
);
-            }
-
-            m.addDeletion( bytebuffer( key ), columnFamily.toString(), bytebuffer( columnName
), be, timestamp );
-        }
-    }
-
 
     public static Map<String, ByteBuffer> getColumnMap( List<HColumn<String,
ByteBuffer>> columns ) {
         Map<String, ByteBuffer> column_map = new TreeMap<String, ByteBuffer>(
String.CASE_INSENSITIVE_ORDER );
@@ -228,30 +176,6 @@ public class CassandraPersistenceUtils {
     }
 
 
-    public static List<ByteBuffer> getAsByteKeys( List<UUID> ids ) {
-        List<ByteBuffer> keys = new ArrayList<ByteBuffer>();
-        for ( UUID id : ids ) {
-            keys.add( bytebuffer( key( id ) ) );
-        }
-        return keys;
-    }
-
-
-    /** @return timestamp value for current time */
-    public static long createTimestamp() {
-        return createClockResolution( ClockResolution.MICROSECONDS ).createClock();
-    }
-
-
-    /** @return normalized group path */
-    public static String normalizeGroupPath( String path ) {
-        path = replaceAll( path.toLowerCase().trim(), "//", "/" );
-        path = removeStart( path, "/" );
-        path = removeEnd( path, "/" );
-        return path;
-    }
-
-
     /** @return a composite key */
     public static Object key( Object... objects ) {
         if ( objects.length == 1 ) {
@@ -304,30 +228,7 @@ public class CassandraPersistenceUtils {
         return uuid;
     }
 
-
-    /** @return UUID for entity alias */
-    public static UUID aliasID( UUID ownerId, String aliasType, String alias ) {
-        return keyID( ownerId, aliasType, alias );
-    }
-
-
-    public static Mutator<ByteBuffer> buildSetIdListMutator( Mutator<ByteBuffer>
batch, UUID targetId,
-                                                             String columnFamily, String
keyPrefix, String keySuffix,
-                                                             List<UUID> keyIds, long
timestamp ) throws Exception {
-        for ( UUID keyId : keyIds ) {
-            ByteBuffer key = null;
-            if ( ( StringUtils.isNotEmpty( keyPrefix ) ) || ( StringUtils.isNotEmpty( keySuffix
) ) ) {
-                key = bytebuffer( keyPrefix + keyId.toString() + keySuffix );
-            }
-            else {
-                key = bytebuffer( keyId );
-            }
-            addInsertToMutator( batch, columnFamily, key, targetId, ByteBuffer.allocate(
0 ), timestamp );
-        }
-        return batch;
-    }
-
-    //No longer does retries
+  //No longer does retries
     public static MutationResult batchExecute( Mutator<?> m, int retries ) {
         return m.execute();
 
@@ -371,16 +272,6 @@ public class CassandraPersistenceUtils {
     }
 
 
-    public static ByteBuffer toStorableBinaryValue( Object obj ) {
-        obj = toStorableValue( obj );
-        if ( obj instanceof JsonNode ) {
-            return JsonUtils.toByteBuffer( obj );
-        }
-        else {
-            return bytebuffer( obj );
-        }
-    }
-
 
     public static ByteBuffer toStorableBinaryValue( Object obj, boolean forceJson ) {
         obj = toStorableValue( obj );
@@ -460,15 +351,4 @@ public class CassandraPersistenceUtils {
     }
 
 
-    public static void validateKeyspace( CFEnum[] cf_enums, KeyspaceDefinition ksDef ) {
-        Map<String, ColumnFamilyDefinition> cfs = new HashMap<String, ColumnFamilyDefinition>();
-        for ( ColumnFamilyDefinition cf : ksDef.getCfDefs() ) {
-            cfs.put( cf.getName(), cf );
-        }
-        for ( CFEnum c : cf_enums ) {
-            if ( !cfs.keySet().contains( c.getColumnFamily() ) ) {
-
-            }
-        }
-    }
 }


Mime
View raw message