You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by gr...@apache.org on 2014/09/04 00:10:56 UTC

[01/52] [abbrv] Fix for the way that arrays are serialized by JSON and a test to verify that arrays work as expected.

Repository: incubator-usergrid
Updated Branches:
  refs/heads/two-dot-o-push-notifications ddc219c63 -> cb668d2a2


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4e428e36/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/tree/CpQueryFilterParser.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/tree/CpQueryFilterParser.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/tree/CpQueryFilterParser.java
deleted file mode 100644
index 4693754..0000000
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/tree/CpQueryFilterParser.java
+++ /dev/null
@@ -1,2501 +0,0 @@
-// $ANTLR 3.4 org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g 2014-08-25 10:56:14
-
-/*
- * 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.query.tree;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.usergrid.persistence.index.query.Query;
-import org.apache.usergrid.persistence.index.query.Query.SortPredicate;
-
-
-
-import org.antlr.runtime.*;
-import java.util.Stack;
-import java.util.List;
-import java.util.ArrayList;
-
-import org.antlr.runtime.tree.*;
-
-
-@SuppressWarnings({"all", "warnings", "unchecked"})
-public class CpQueryFilterParser extends Parser {
-    public static final String[] tokenNames = new String[] {
-        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "AND", "ASC", "BOOLEAN", "CONTAINS", "DESC", "EQ", "ESC_SEQ", "EXPONENT", "FALSE", "FLOAT", "GT", "GTE", "HEX_DIGIT", "ID", "LONG", "LT", "LTE", "NOT", "OCTAL_ESC", "OF", "OR", "STRING", "TRUE", "UNICODE_ESC", "UUID", "WITHIN", "WS", "'('", "')'", "'*'", "','", "':'", "'order by'", "'select'", "'where'", "'{'", "'}'"
-    };
-
-    public static final int EOF=-1;
-    public static final int T__31=31;
-    public static final int T__32=32;
-    public static final int T__33=33;
-    public static final int T__34=34;
-    public static final int T__35=35;
-    public static final int T__36=36;
-    public static final int T__37=37;
-    public static final int T__38=38;
-    public static final int T__39=39;
-    public static final int T__40=40;
-    public static final int AND=4;
-    public static final int ASC=5;
-    public static final int BOOLEAN=6;
-    public static final int CONTAINS=7;
-    public static final int DESC=8;
-    public static final int EQ=9;
-    public static final int ESC_SEQ=10;
-    public static final int EXPONENT=11;
-    public static final int FALSE=12;
-    public static final int FLOAT=13;
-    public static final int GT=14;
-    public static final int GTE=15;
-    public static final int HEX_DIGIT=16;
-    public static final int ID=17;
-    public static final int LONG=18;
-    public static final int LT=19;
-    public static final int LTE=20;
-    public static final int NOT=21;
-    public static final int OCTAL_ESC=22;
-    public static final int OF=23;
-    public static final int OR=24;
-    public static final int STRING=25;
-    public static final int TRUE=26;
-    public static final int UNICODE_ESC=27;
-    public static final int UUID=28;
-    public static final int WITHIN=29;
-    public static final int WS=30;
-
-    // delegates
-    public Parser[] getDelegates() {
-        return new Parser[] {};
-    }
-
-    // delegators
-
-
-    public CpQueryFilterParser(TokenStream input) {
-        this(input, new RecognizerSharedState());
-    }
-    public CpQueryFilterParser(TokenStream input, RecognizerSharedState state) {
-        super(input, state);
-    }
-
-protected TreeAdaptor adaptor = new CommonTreeAdaptor();
-
-public void setTreeAdaptor(TreeAdaptor adaptor) {
-    this.adaptor = adaptor;
-}
-public TreeAdaptor getTreeAdaptor() {
-    return adaptor;
-}
-    public String[] getTokenNames() { return CpQueryFilterParser.tokenNames; }
-    public String getGrammarFileName() { return "org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g"; }
-
-
-    	Query query = new Query();
-
-      private static final Logger logger = LoggerFactory
-          .getLogger(CpQueryFilterLexer.class);
-
-    	@Override
-    	public void emitErrorMessage(String msg) {
-    		logger.info(msg);
-    	}
-
-
-    public static class property_return extends ParserRuleReturnScope {
-        Object tree;
-        public Object getTree() { return tree; }
-    };
-
-
-    // $ANTLR start "property"
-    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:209:1: property : ID ;
-    public final CpQueryFilterParser.property_return property() throws RecognitionException {
-        CpQueryFilterParser.property_return retval = new CpQueryFilterParser.property_return();
-        retval.start = input.LT(1);
-
-
-        Object root_0 = null;
-
-        Token ID1=null;
-
-        Object ID1_tree=null;
-
-        try {
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:209:10: ( ID )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:209:12: ID
-            {
-            root_0 = (Object)adaptor.nil();
-
-
-            ID1=(Token)match(input,ID,FOLLOW_ID_in_property991); 
-            ID1_tree = 
-            new Property(ID1) 
-            ;
-            adaptor.addChild(root_0, ID1_tree);
-
-
-            }
-
-            retval.stop = input.LT(-1);
-
-
-            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
-            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
-        }
-         
-        finally {
-        	// do for sure before leaving
-        }
-        return retval;
-    }
-    // $ANTLR end "property"
-
-
-    public static class containsproperty_return extends ParserRuleReturnScope {
-        Object tree;
-        public Object getTree() { return tree; }
-    };
-
-
-    // $ANTLR start "containsproperty"
-    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:211:1: containsproperty : ID ;
-    public final CpQueryFilterParser.containsproperty_return containsproperty() throws RecognitionException {
-        CpQueryFilterParser.containsproperty_return retval = new CpQueryFilterParser.containsproperty_return();
-        retval.start = input.LT(1);
-
-
-        Object root_0 = null;
-
-        Token ID2=null;
-
-        Object ID2_tree=null;
-
-        try {
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:211:18: ( ID )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:211:20: ID
-            {
-            root_0 = (Object)adaptor.nil();
-
-
-            ID2=(Token)match(input,ID,FOLLOW_ID_in_containsproperty1002); 
-            ID2_tree = 
-            new ContainsProperty(ID2) 
-            ;
-            adaptor.addChild(root_0, ID2_tree);
-
-
-            }
-
-            retval.stop = input.LT(-1);
-
-
-            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
-            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
-        }
-         
-        finally {
-        	// do for sure before leaving
-        }
-        return retval;
-    }
-    // $ANTLR end "containsproperty"
-
-
-    public static class withinproperty_return extends ParserRuleReturnScope {
-        Object tree;
-        public Object getTree() { return tree; }
-    };
-
-
-    // $ANTLR start "withinproperty"
-    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:213:1: withinproperty : ID ;
-    public final CpQueryFilterParser.withinproperty_return withinproperty() throws RecognitionException {
-        CpQueryFilterParser.withinproperty_return retval = new CpQueryFilterParser.withinproperty_return();
-        retval.start = input.LT(1);
-
-
-        Object root_0 = null;
-
-        Token ID3=null;
-
-        Object ID3_tree=null;
-
-        try {
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:213:16: ( ID )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:213:18: ID
-            {
-            root_0 = (Object)adaptor.nil();
-
-
-            ID3=(Token)match(input,ID,FOLLOW_ID_in_withinproperty1013); 
-            ID3_tree = 
-            new WithinProperty(ID3) 
-            ;
-            adaptor.addChild(root_0, ID3_tree);
-
-
-            }
-
-            retval.stop = input.LT(-1);
-
-
-            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
-            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
-        }
-         
-        finally {
-        	// do for sure before leaving
-        }
-        return retval;
-    }
-    // $ANTLR end "withinproperty"
-
-
-    public static class booleanliteral_return extends ParserRuleReturnScope {
-        Object tree;
-        public Object getTree() { return tree; }
-    };
-
-
-    // $ANTLR start "booleanliteral"
-    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:215:1: booleanliteral : BOOLEAN ;
-    public final CpQueryFilterParser.booleanliteral_return booleanliteral() throws RecognitionException {
-        CpQueryFilterParser.booleanliteral_return retval = new CpQueryFilterParser.booleanliteral_return();
-        retval.start = input.LT(1);
-
-
-        Object root_0 = null;
-
-        Token BOOLEAN4=null;
-
-        Object BOOLEAN4_tree=null;
-
-        try {
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:215:15: ( BOOLEAN )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:215:17: BOOLEAN
-            {
-            root_0 = (Object)adaptor.nil();
-
-
-            BOOLEAN4=(Token)match(input,BOOLEAN,FOLLOW_BOOLEAN_in_booleanliteral1024); 
-            BOOLEAN4_tree = 
-            new BooleanLiteral(BOOLEAN4) 
-            ;
-            adaptor.addChild(root_0, BOOLEAN4_tree);
-
-
-            }
-
-            retval.stop = input.LT(-1);
-
-
-            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
-            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
-        }
-         
-        finally {
-        	// do for sure before leaving
-        }
-        return retval;
-    }
-    // $ANTLR end "booleanliteral"
-
-
-    public static class longliteral_return extends ParserRuleReturnScope {
-        Object tree;
-        public Object getTree() { return tree; }
-    };
-
-
-    // $ANTLR start "longliteral"
-    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:218:1: longliteral : LONG ;
-    public final CpQueryFilterParser.longliteral_return longliteral() throws RecognitionException {
-        CpQueryFilterParser.longliteral_return retval = new CpQueryFilterParser.longliteral_return();
-        retval.start = input.LT(1);
-
-
-        Object root_0 = null;
-
-        Token LONG5=null;
-
-        Object LONG5_tree=null;
-
-        try {
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:218:13: ( LONG )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:219:3: LONG
-            {
-            root_0 = (Object)adaptor.nil();
-
-
-            LONG5=(Token)match(input,LONG,FOLLOW_LONG_in_longliteral1038); 
-            LONG5_tree = 
-            new LongLiteral(LONG5) 
-            ;
-            adaptor.addChild(root_0, LONG5_tree);
-
-
-            }
-
-            retval.stop = input.LT(-1);
-
-
-            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
-            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
-        }
-         
-        finally {
-        	// do for sure before leaving
-        }
-        return retval;
-    }
-    // $ANTLR end "longliteral"
-
-
-    public static class uuidliteral_return extends ParserRuleReturnScope {
-        Object tree;
-        public Object getTree() { return tree; }
-    };
-
-
-    // $ANTLR start "uuidliteral"
-    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:221:1: uuidliteral : UUID ;
-    public final CpQueryFilterParser.uuidliteral_return uuidliteral() throws RecognitionException {
-        CpQueryFilterParser.uuidliteral_return retval = new CpQueryFilterParser.uuidliteral_return();
-        retval.start = input.LT(1);
-
-
-        Object root_0 = null;
-
-        Token UUID6=null;
-
-        Object UUID6_tree=null;
-
-        try {
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:221:13: ( UUID )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:222:3: UUID
-            {
-            root_0 = (Object)adaptor.nil();
-
-
-            UUID6=(Token)match(input,UUID,FOLLOW_UUID_in_uuidliteral1052); 
-            UUID6_tree = 
-            new UUIDLiteral(UUID6) 
-            ;
-            adaptor.addChild(root_0, UUID6_tree);
-
-
-            }
-
-            retval.stop = input.LT(-1);
-
-
-            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
-            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
-        }
-         
-        finally {
-        	// do for sure before leaving
-        }
-        return retval;
-    }
-    // $ANTLR end "uuidliteral"
-
-
-    public static class stringliteral_return extends ParserRuleReturnScope {
-        Object tree;
-        public Object getTree() { return tree; }
-    };
-
-
-    // $ANTLR start "stringliteral"
-    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:224:1: stringliteral : STRING ;
-    public final CpQueryFilterParser.stringliteral_return stringliteral() throws RecognitionException {
-        CpQueryFilterParser.stringliteral_return retval = new CpQueryFilterParser.stringliteral_return();
-        retval.start = input.LT(1);
-
-
-        Object root_0 = null;
-
-        Token STRING7=null;
-
-        Object STRING7_tree=null;
-
-        try {
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:224:15: ( STRING )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:225:3: STRING
-            {
-            root_0 = (Object)adaptor.nil();
-
-
-            STRING7=(Token)match(input,STRING,FOLLOW_STRING_in_stringliteral1065); 
-            STRING7_tree = 
-            new StringLiteral(STRING7) 
-            ;
-            adaptor.addChild(root_0, STRING7_tree);
-
-
-            }
-
-            retval.stop = input.LT(-1);
-
-
-            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
-            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
-        }
-         
-        finally {
-        	// do for sure before leaving
-        }
-        return retval;
-    }
-    // $ANTLR end "stringliteral"
-
-
-    public static class floatliteral_return extends ParserRuleReturnScope {
-        Object tree;
-        public Object getTree() { return tree; }
-    };
-
-
-    // $ANTLR start "floatliteral"
-    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:227:1: floatliteral : FLOAT ;
-    public final CpQueryFilterParser.floatliteral_return floatliteral() throws RecognitionException {
-        CpQueryFilterParser.floatliteral_return retval = new CpQueryFilterParser.floatliteral_return();
-        retval.start = input.LT(1);
-
-
-        Object root_0 = null;
-
-        Token FLOAT8=null;
-
-        Object FLOAT8_tree=null;
-
-        try {
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:227:14: ( FLOAT )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:228:3: FLOAT
-            {
-            root_0 = (Object)adaptor.nil();
-
-
-            FLOAT8=(Token)match(input,FLOAT,FOLLOW_FLOAT_in_floatliteral1080); 
-            FLOAT8_tree = 
-            new FloatLiteral(FLOAT8) 
-            ;
-            adaptor.addChild(root_0, FLOAT8_tree);
-
-
-            }
-
-            retval.stop = input.LT(-1);
-
-
-            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
-            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
-        }
-         
-        finally {
-        	// do for sure before leaving
-        }
-        return retval;
-    }
-    // $ANTLR end "floatliteral"
-
-
-    public static class value_return extends ParserRuleReturnScope {
-        Object tree;
-        public Object getTree() { return tree; }
-    };
-
-
-    // $ANTLR start "value"
-    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:231:1: value : ( booleanliteral | longliteral | uuidliteral | stringliteral | floatliteral );
-    public final CpQueryFilterParser.value_return value() throws RecognitionException {
-        CpQueryFilterParser.value_return retval = new CpQueryFilterParser.value_return();
-        retval.start = input.LT(1);
-
-
-        Object root_0 = null;
-
-        CpQueryFilterParser.booleanliteral_return booleanliteral9 =null;
-
-        CpQueryFilterParser.longliteral_return longliteral10 =null;
-
-        CpQueryFilterParser.uuidliteral_return uuidliteral11 =null;
-
-        CpQueryFilterParser.stringliteral_return stringliteral12 =null;
-
-        CpQueryFilterParser.floatliteral_return floatliteral13 =null;
-
-
-
-        try {
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:231:7: ( booleanliteral | longliteral | uuidliteral | stringliteral | floatliteral )
-            int alt1=5;
-            switch ( input.LA(1) ) {
-            case BOOLEAN:
-                {
-                alt1=1;
-                }
-                break;
-            case LONG:
-                {
-                alt1=2;
-                }
-                break;
-            case UUID:
-                {
-                alt1=3;
-                }
-                break;
-            case STRING:
-                {
-                alt1=4;
-                }
-                break;
-            case FLOAT:
-                {
-                alt1=5;
-                }
-                break;
-            default:
-                NoViableAltException nvae =
-                    new NoViableAltException("", 1, 0, input);
-
-                throw nvae;
-
-            }
-
-            switch (alt1) {
-                case 1 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:232:3: booleanliteral
-                    {
-                    root_0 = (Object)adaptor.nil();
-
-
-                    pushFollow(FOLLOW_booleanliteral_in_value1096);
-                    booleanliteral9=booleanliteral();
-
-                    state._fsp--;
-
-                    adaptor.addChild(root_0, booleanliteral9.getTree());
-
-                    }
-                    break;
-                case 2 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:233:5: longliteral
-                    {
-                    root_0 = (Object)adaptor.nil();
-
-
-                    pushFollow(FOLLOW_longliteral_in_value1102);
-                    longliteral10=longliteral();
-
-                    state._fsp--;
-
-                    adaptor.addChild(root_0, longliteral10.getTree());
-
-                    }
-                    break;
-                case 3 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:234:5: uuidliteral
-                    {
-                    root_0 = (Object)adaptor.nil();
-
-
-                    pushFollow(FOLLOW_uuidliteral_in_value1108);
-                    uuidliteral11=uuidliteral();
-
-                    state._fsp--;
-
-                    adaptor.addChild(root_0, uuidliteral11.getTree());
-
-                    }
-                    break;
-                case 4 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:235:5: stringliteral
-                    {
-                    root_0 = (Object)adaptor.nil();
-
-
-                    pushFollow(FOLLOW_stringliteral_in_value1114);
-                    stringliteral12=stringliteral();
-
-                    state._fsp--;
-
-                    adaptor.addChild(root_0, stringliteral12.getTree());
-
-                    }
-                    break;
-                case 5 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:236:5: floatliteral
-                    {
-                    root_0 = (Object)adaptor.nil();
-
-
-                    pushFollow(FOLLOW_floatliteral_in_value1120);
-                    floatliteral13=floatliteral();
-
-                    state._fsp--;
-
-                    adaptor.addChild(root_0, floatliteral13.getTree());
-
-                    }
-                    break;
-
-            }
-            retval.stop = input.LT(-1);
-
-
-            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
-            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
-        }
-         
-        finally {
-        	// do for sure before leaving
-        }
-        return retval;
-    }
-    // $ANTLR end "value"
-
-
-    public static class equalityop_return extends ParserRuleReturnScope {
-        Object tree;
-        public Object getTree() { return tree; }
-    };
-
-
-    // $ANTLR start "equalityop"
-    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:247:1: equalityop : ( property LT ^ value | property LTE ^ value | property EQ ^ value | property GT ^ value | property GTE ^ value );
-    public final CpQueryFilterParser.equalityop_return equalityop() throws RecognitionException {
-        CpQueryFilterParser.equalityop_return retval = new CpQueryFilterParser.equalityop_return();
-        retval.start = input.LT(1);
-
-
-        Object root_0 = null;
-
-        Token LT15=null;
-        Token LTE18=null;
-        Token EQ21=null;
-        Token GT24=null;
-        Token GTE27=null;
-        CpQueryFilterParser.property_return property14 =null;
-
-        CpQueryFilterParser.value_return value16 =null;
-
-        CpQueryFilterParser.property_return property17 =null;
-
-        CpQueryFilterParser.value_return value19 =null;
-
-        CpQueryFilterParser.property_return property20 =null;
-
-        CpQueryFilterParser.value_return value22 =null;
-
-        CpQueryFilterParser.property_return property23 =null;
-
-        CpQueryFilterParser.value_return value25 =null;
-
-        CpQueryFilterParser.property_return property26 =null;
-
-        CpQueryFilterParser.value_return value28 =null;
-
-
-        Object LT15_tree=null;
-        Object LTE18_tree=null;
-        Object EQ21_tree=null;
-        Object GT24_tree=null;
-        Object GTE27_tree=null;
-
-        try {
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:247:12: ( property LT ^ value | property LTE ^ value | property EQ ^ value | property GT ^ value | property GTE ^ value )
-            int alt2=5;
-            switch ( input.LA(1) ) {
-            case ID:
-                {
-                switch ( input.LA(2) ) {
-                case LT:
-                    {
-                    alt2=1;
-                    }
-                    break;
-                case LTE:
-                    {
-                    alt2=2;
-                    }
-                    break;
-                case EQ:
-                    {
-                    alt2=3;
-                    }
-                    break;
-                case GT:
-                    {
-                    alt2=4;
-                    }
-                    break;
-                case GTE:
-                    {
-                    alt2=5;
-                    }
-                    break;
-                default:
-                    NoViableAltException nvae =
-                        new NoViableAltException("", 2, 1, input);
-
-                    throw nvae;
-
-                }
-
-                }
-                break;
-            default:
-                NoViableAltException nvae =
-                    new NoViableAltException("", 2, 0, input);
-
-                throw nvae;
-
-            }
-
-            switch (alt2) {
-                case 1 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:248:3: property LT ^ value
-                    {
-                    root_0 = (Object)adaptor.nil();
-
-
-                    pushFollow(FOLLOW_property_in_equalityop1145);
-                    property14=property();
-
-                    state._fsp--;
-
-                    adaptor.addChild(root_0, property14.getTree());
-
-                    LT15=(Token)match(input,LT,FOLLOW_LT_in_equalityop1147); 
-                    LT15_tree = 
-                    new LessThan(LT15) 
-                    ;
-                    root_0 = (Object)adaptor.becomeRoot(LT15_tree, root_0);
-
-
-                    pushFollow(FOLLOW_value_in_equalityop1153);
-                    value16=value();
-
-                    state._fsp--;
-
-                    adaptor.addChild(root_0, value16.getTree());
-
-                    }
-                    break;
-                case 2 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:249:4: property LTE ^ value
-                    {
-                    root_0 = (Object)adaptor.nil();
-
-
-                    pushFollow(FOLLOW_property_in_equalityop1158);
-                    property17=property();
-
-                    state._fsp--;
-
-                    adaptor.addChild(root_0, property17.getTree());
-
-                    LTE18=(Token)match(input,LTE,FOLLOW_LTE_in_equalityop1160); 
-                    LTE18_tree = 
-                    new LessThanEqual(LTE18) 
-                    ;
-                    root_0 = (Object)adaptor.becomeRoot(LTE18_tree, root_0);
-
-
-                    pushFollow(FOLLOW_value_in_equalityop1166);
-                    value19=value();
-
-                    state._fsp--;
-
-                    adaptor.addChild(root_0, value19.getTree());
-
-                    }
-                    break;
-                case 3 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:250:4: property EQ ^ value
-                    {
-                    root_0 = (Object)adaptor.nil();
-
-
-                    pushFollow(FOLLOW_property_in_equalityop1171);
-                    property20=property();
-
-                    state._fsp--;
-
-                    adaptor.addChild(root_0, property20.getTree());
-
-                    EQ21=(Token)match(input,EQ,FOLLOW_EQ_in_equalityop1173); 
-                    EQ21_tree = 
-                    new Equal(EQ21) 
-                    ;
-                    root_0 = (Object)adaptor.becomeRoot(EQ21_tree, root_0);
-
-
-                    pushFollow(FOLLOW_value_in_equalityop1179);
-                    value22=value();
-
-                    state._fsp--;
-
-                    adaptor.addChild(root_0, value22.getTree());
-
-                    }
-                    break;
-                case 4 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:251:4: property GT ^ value
-                    {
-                    root_0 = (Object)adaptor.nil();
-
-
-                    pushFollow(FOLLOW_property_in_equalityop1184);
-                    property23=property();
-
-                    state._fsp--;
-
-                    adaptor.addChild(root_0, property23.getTree());
-
-                    GT24=(Token)match(input,GT,FOLLOW_GT_in_equalityop1186); 
-                    GT24_tree = 
-                    new GreaterThan(GT24) 
-                    ;
-                    root_0 = (Object)adaptor.becomeRoot(GT24_tree, root_0);
-
-
-                    pushFollow(FOLLOW_value_in_equalityop1192);
-                    value25=value();
-
-                    state._fsp--;
-
-                    adaptor.addChild(root_0, value25.getTree());
-
-                    }
-                    break;
-                case 5 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:252:4: property GTE ^ value
-                    {
-                    root_0 = (Object)adaptor.nil();
-
-
-                    pushFollow(FOLLOW_property_in_equalityop1197);
-                    property26=property();
-
-                    state._fsp--;
-
-                    adaptor.addChild(root_0, property26.getTree());
-
-                    GTE27=(Token)match(input,GTE,FOLLOW_GTE_in_equalityop1199); 
-                    GTE27_tree = 
-                    new GreaterThanEqual(GTE27) 
-                    ;
-                    root_0 = (Object)adaptor.becomeRoot(GTE27_tree, root_0);
-
-
-                    pushFollow(FOLLOW_value_in_equalityop1205);
-                    value28=value();
-
-                    state._fsp--;
-
-                    adaptor.addChild(root_0, value28.getTree());
-
-                    }
-                    break;
-
-            }
-            retval.stop = input.LT(-1);
-
-
-            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
-            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
-        }
-         
-        finally {
-        	// do for sure before leaving
-        }
-        return retval;
-    }
-    // $ANTLR end "equalityop"
-
-
-    public static class locationop_return extends ParserRuleReturnScope {
-        Object tree;
-        public Object getTree() { return tree; }
-    };
-
-
-    // $ANTLR start "locationop"
-    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:256:1: locationop : withinproperty WITHIN ^ ( floatliteral | longliteral ) OF ! ( floatliteral | longliteral ) ',' ! ( floatliteral | longliteral ) ;
-    public final CpQueryFilterParser.locationop_return locationop() throws RecognitionException {
-        CpQueryFilterParser.locationop_return retval = new CpQueryFilterParser.locationop_return();
-        retval.start = input.LT(1);
-
-
-        Object root_0 = null;
-
-        Token WITHIN30=null;
-        Token OF33=null;
-        Token char_literal36=null;
-        CpQueryFilterParser.withinproperty_return withinproperty29 =null;
-
-        CpQueryFilterParser.floatliteral_return floatliteral31 =null;
-
-        CpQueryFilterParser.longliteral_return longliteral32 =null;
-
-        CpQueryFilterParser.floatliteral_return floatliteral34 =null;
-
-        CpQueryFilterParser.longliteral_return longliteral35 =null;
-
-        CpQueryFilterParser.floatliteral_return floatliteral37 =null;
-
-        CpQueryFilterParser.longliteral_return longliteral38 =null;
-
-
-        Object WITHIN30_tree=null;
-        Object OF33_tree=null;
-        Object char_literal36_tree=null;
-
-        try {
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:256:12: ( withinproperty WITHIN ^ ( floatliteral | longliteral ) OF ! ( floatliteral | longliteral ) ',' ! ( floatliteral | longliteral ) )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:257:3: withinproperty WITHIN ^ ( floatliteral | longliteral ) OF ! ( floatliteral | longliteral ) ',' ! ( floatliteral | longliteral )
-            {
-            root_0 = (Object)adaptor.nil();
-
-
-            pushFollow(FOLLOW_withinproperty_in_locationop1220);
-            withinproperty29=withinproperty();
-
-            state._fsp--;
-
-            adaptor.addChild(root_0, withinproperty29.getTree());
-
-            WITHIN30=(Token)match(input,WITHIN,FOLLOW_WITHIN_in_locationop1222); 
-            WITHIN30_tree = 
-            new WithinOperand(WITHIN30) 
-            ;
-            root_0 = (Object)adaptor.becomeRoot(WITHIN30_tree, root_0);
-
-
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:257:41: ( floatliteral | longliteral )
-            int alt3=2;
-            switch ( input.LA(1) ) {
-            case FLOAT:
-                {
-                alt3=1;
-                }
-                break;
-            case LONG:
-                {
-                alt3=2;
-                }
-                break;
-            default:
-                NoViableAltException nvae =
-                    new NoViableAltException("", 3, 0, input);
-
-                throw nvae;
-
-            }
-
-            switch (alt3) {
-                case 1 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:257:42: floatliteral
-                    {
-                    pushFollow(FOLLOW_floatliteral_in_locationop1229);
-                    floatliteral31=floatliteral();
-
-                    state._fsp--;
-
-                    adaptor.addChild(root_0, floatliteral31.getTree());
-
-                    }
-                    break;
-                case 2 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:257:55: longliteral
-                    {
-                    pushFollow(FOLLOW_longliteral_in_locationop1231);
-                    longliteral32=longliteral();
-
-                    state._fsp--;
-
-                    adaptor.addChild(root_0, longliteral32.getTree());
-
-                    }
-                    break;
-
-            }
-
-
-            OF33=(Token)match(input,OF,FOLLOW_OF_in_locationop1234); 
-
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:257:72: ( floatliteral | longliteral )
-            int alt4=2;
-            switch ( input.LA(1) ) {
-            case FLOAT:
-                {
-                alt4=1;
-                }
-                break;
-            case LONG:
-                {
-                alt4=2;
-                }
-                break;
-            default:
-                NoViableAltException nvae =
-                    new NoViableAltException("", 4, 0, input);
-
-                throw nvae;
-
-            }
-
-            switch (alt4) {
-                case 1 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:257:73: floatliteral
-                    {
-                    pushFollow(FOLLOW_floatliteral_in_locationop1238);
-                    floatliteral34=floatliteral();
-
-                    state._fsp--;
-
-                    adaptor.addChild(root_0, floatliteral34.getTree());
-
-                    }
-                    break;
-                case 2 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:257:86: longliteral
-                    {
-                    pushFollow(FOLLOW_longliteral_in_locationop1240);
-                    longliteral35=longliteral();
-
-                    state._fsp--;
-
-                    adaptor.addChild(root_0, longliteral35.getTree());
-
-                    }
-                    break;
-
-            }
-
-
-            char_literal36=(Token)match(input,34,FOLLOW_34_in_locationop1243); 
-
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:257:104: ( floatliteral | longliteral )
-            int alt5=2;
-            switch ( input.LA(1) ) {
-            case FLOAT:
-                {
-                alt5=1;
-                }
-                break;
-            case LONG:
-                {
-                alt5=2;
-                }
-                break;
-            default:
-                NoViableAltException nvae =
-                    new NoViableAltException("", 5, 0, input);
-
-                throw nvae;
-
-            }
-
-            switch (alt5) {
-                case 1 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:257:105: floatliteral
-                    {
-                    pushFollow(FOLLOW_floatliteral_in_locationop1247);
-                    floatliteral37=floatliteral();
-
-                    state._fsp--;
-
-                    adaptor.addChild(root_0, floatliteral37.getTree());
-
-                    }
-                    break;
-                case 2 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:257:118: longliteral
-                    {
-                    pushFollow(FOLLOW_longliteral_in_locationop1249);
-                    longliteral38=longliteral();
-
-                    state._fsp--;
-
-                    adaptor.addChild(root_0, longliteral38.getTree());
-
-                    }
-                    break;
-
-            }
-
-
-            }
-
-            retval.stop = input.LT(-1);
-
-
-            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
-            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
-        }
-         
-        finally {
-        	// do for sure before leaving
-        }
-        return retval;
-    }
-    // $ANTLR end "locationop"
-
-
-    public static class containsop_return extends ParserRuleReturnScope {
-        Object tree;
-        public Object getTree() { return tree; }
-    };
-
-
-    // $ANTLR start "containsop"
-    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:260:1: containsop : containsproperty CONTAINS ^ stringliteral ;
-    public final CpQueryFilterParser.containsop_return containsop() throws RecognitionException {
-        CpQueryFilterParser.containsop_return retval = new CpQueryFilterParser.containsop_return();
-        retval.start = input.LT(1);
-
-
-        Object root_0 = null;
-
-        Token CONTAINS40=null;
-        CpQueryFilterParser.containsproperty_return containsproperty39 =null;
-
-        CpQueryFilterParser.stringliteral_return stringliteral41 =null;
-
-
-        Object CONTAINS40_tree=null;
-
-        try {
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:260:12: ( containsproperty CONTAINS ^ stringliteral )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:261:3: containsproperty CONTAINS ^ stringliteral
-            {
-            root_0 = (Object)adaptor.nil();
-
-
-            pushFollow(FOLLOW_containsproperty_in_containsop1263);
-            containsproperty39=containsproperty();
-
-            state._fsp--;
-
-            adaptor.addChild(root_0, containsproperty39.getTree());
-
-            CONTAINS40=(Token)match(input,CONTAINS,FOLLOW_CONTAINS_in_containsop1265); 
-            CONTAINS40_tree = 
-            new ContainsOperand(CONTAINS40) 
-            ;
-            root_0 = (Object)adaptor.becomeRoot(CONTAINS40_tree, root_0);
-
-
-            pushFollow(FOLLOW_stringliteral_in_containsop1271);
-            stringliteral41=stringliteral();
-
-            state._fsp--;
-
-            adaptor.addChild(root_0, stringliteral41.getTree());
-
-            }
-
-            retval.stop = input.LT(-1);
-
-
-            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
-            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
-        }
-         
-        finally {
-        	// do for sure before leaving
-        }
-        return retval;
-    }
-    // $ANTLR end "containsop"
-
-
-    public static class operation_return extends ParserRuleReturnScope {
-        Object tree;
-        public Object getTree() { return tree; }
-    };
-
-
-    // $ANTLR start "operation"
-    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:264:1: operation : ( '(' ! expression ')' !| equalityop | locationop | containsop );
-    public final CpQueryFilterParser.operation_return operation() throws RecognitionException {
-        CpQueryFilterParser.operation_return retval = new CpQueryFilterParser.operation_return();
-        retval.start = input.LT(1);
-
-
-        Object root_0 = null;
-
-        Token char_literal42=null;
-        Token char_literal44=null;
-        CpQueryFilterParser.expression_return expression43 =null;
-
-        CpQueryFilterParser.equalityop_return equalityop45 =null;
-
-        CpQueryFilterParser.locationop_return locationop46 =null;
-
-        CpQueryFilterParser.containsop_return containsop47 =null;
-
-
-        Object char_literal42_tree=null;
-        Object char_literal44_tree=null;
-
-        try {
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:264:11: ( '(' ! expression ')' !| equalityop | locationop | containsop )
-            int alt6=4;
-            switch ( input.LA(1) ) {
-            case 31:
-                {
-                alt6=1;
-                }
-                break;
-            case ID:
-                {
-                switch ( input.LA(2) ) {
-                case EQ:
-                case GT:
-                case GTE:
-                case LT:
-                case LTE:
-                    {
-                    alt6=2;
-                    }
-                    break;
-                case WITHIN:
-                    {
-                    alt6=3;
-                    }
-                    break;
-                case CONTAINS:
-                    {
-                    alt6=4;
-                    }
-                    break;
-                default:
-                    NoViableAltException nvae =
-                        new NoViableAltException("", 6, 2, input);
-
-                    throw nvae;
-
-                }
-
-                }
-                break;
-            default:
-                NoViableAltException nvae =
-                    new NoViableAltException("", 6, 0, input);
-
-                throw nvae;
-
-            }
-
-            switch (alt6) {
-                case 1 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:265:2: '(' ! expression ')' !
-                    {
-                    root_0 = (Object)adaptor.nil();
-
-
-                    char_literal42=(Token)match(input,31,FOLLOW_31_in_operation1281); 
-
-                    pushFollow(FOLLOW_expression_in_operation1284);
-                    expression43=expression();
-
-                    state._fsp--;
-
-                    adaptor.addChild(root_0, expression43.getTree());
-
-                    char_literal44=(Token)match(input,32,FOLLOW_32_in_operation1286); 
-
-                    }
-                    break;
-                case 2 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:266:6: equalityop
-                    {
-                    root_0 = (Object)adaptor.nil();
-
-
-                    pushFollow(FOLLOW_equalityop_in_operation1294);
-                    equalityop45=equalityop();
-
-                    state._fsp--;
-
-                    adaptor.addChild(root_0, equalityop45.getTree());
-
-                    }
-                    break;
-                case 3 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:267:6: locationop
-                    {
-                    root_0 = (Object)adaptor.nil();
-
-
-                    pushFollow(FOLLOW_locationop_in_operation1302);
-                    locationop46=locationop();
-
-                    state._fsp--;
-
-                    adaptor.addChild(root_0, locationop46.getTree());
-
-                    }
-                    break;
-                case 4 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:268:6: containsop
-                    {
-                    root_0 = (Object)adaptor.nil();
-
-
-                    pushFollow(FOLLOW_containsop_in_operation1310);
-                    containsop47=containsop();
-
-                    state._fsp--;
-
-                    adaptor.addChild(root_0, containsop47.getTree());
-
-                    }
-                    break;
-
-            }
-            retval.stop = input.LT(-1);
-
-
-            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
-            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
-        }
-         
-        finally {
-        	// do for sure before leaving
-        }
-        return retval;
-    }
-    // $ANTLR end "operation"
-
-
-    public static class notexp_return extends ParserRuleReturnScope {
-        Object tree;
-        public Object getTree() { return tree; }
-    };
-
-
-    // $ANTLR start "notexp"
-    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:272:1: notexp : ( NOT ^ operation | operation );
-    public final CpQueryFilterParser.notexp_return notexp() throws RecognitionException {
-        CpQueryFilterParser.notexp_return retval = new CpQueryFilterParser.notexp_return();
-        retval.start = input.LT(1);
-
-
-        Object root_0 = null;
-
-        Token NOT48=null;
-        CpQueryFilterParser.operation_return operation49 =null;
-
-        CpQueryFilterParser.operation_return operation50 =null;
-
-
-        Object NOT48_tree=null;
-
-        try {
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:272:8: ( NOT ^ operation | operation )
-            int alt7=2;
-            switch ( input.LA(1) ) {
-            case NOT:
-                {
-                alt7=1;
-                }
-                break;
-            case ID:
-            case 31:
-                {
-                alt7=2;
-                }
-                break;
-            default:
-                NoViableAltException nvae =
-                    new NoViableAltException("", 7, 0, input);
-
-                throw nvae;
-
-            }
-
-            switch (alt7) {
-                case 1 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:274:2: NOT ^ operation
-                    {
-                    root_0 = (Object)adaptor.nil();
-
-
-                    NOT48=(Token)match(input,NOT,FOLLOW_NOT_in_notexp1326); 
-                    NOT48_tree = 
-                    new NotOperand(NOT48) 
-                    ;
-                    root_0 = (Object)adaptor.becomeRoot(NOT48_tree, root_0);
-
-
-                    pushFollow(FOLLOW_operation_in_notexp1332);
-                    operation49=operation();
-
-                    state._fsp--;
-
-                    adaptor.addChild(root_0, operation49.getTree());
-
-                    }
-                    break;
-                case 2 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:275:3: operation
-                    {
-                    root_0 = (Object)adaptor.nil();
-
-
-                    pushFollow(FOLLOW_operation_in_notexp1338);
-                    operation50=operation();
-
-                    state._fsp--;
-
-                    adaptor.addChild(root_0, operation50.getTree());
-
-                    }
-                    break;
-
-            }
-            retval.stop = input.LT(-1);
-
-
-            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
-            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
-        }
-         
-        finally {
-        	// do for sure before leaving
-        }
-        return retval;
-    }
-    // $ANTLR end "notexp"
-
-
-    public static class andexp_return extends ParserRuleReturnScope {
-        Object tree;
-        public Object getTree() { return tree; }
-    };
-
-
-    // $ANTLR start "andexp"
-    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:280:1: andexp : notexp ( AND ^ notexp )* ;
-    public final CpQueryFilterParser.andexp_return andexp() throws RecognitionException {
-        CpQueryFilterParser.andexp_return retval = new CpQueryFilterParser.andexp_return();
-        retval.start = input.LT(1);
-
-
-        Object root_0 = null;
-
-        Token AND52=null;
-        CpQueryFilterParser.notexp_return notexp51 =null;
-
-        CpQueryFilterParser.notexp_return notexp53 =null;
-
-
-        Object AND52_tree=null;
-
-        try {
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:280:8: ( notexp ( AND ^ notexp )* )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:281:2: notexp ( AND ^ notexp )*
-            {
-            root_0 = (Object)adaptor.nil();
-
-
-            pushFollow(FOLLOW_notexp_in_andexp1352);
-            notexp51=notexp();
-
-            state._fsp--;
-
-            adaptor.addChild(root_0, notexp51.getTree());
-
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:281:9: ( AND ^ notexp )*
-            loop8:
-            do {
-                int alt8=2;
-                switch ( input.LA(1) ) {
-                case AND:
-                    {
-                    alt8=1;
-                    }
-                    break;
-
-                }
-
-                switch (alt8) {
-            	case 1 :
-            	    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:281:10: AND ^ notexp
-            	    {
-            	    AND52=(Token)match(input,AND,FOLLOW_AND_in_andexp1355); 
-            	    AND52_tree = 
-            	    new AndOperand(AND52) 
-            	    ;
-            	    root_0 = (Object)adaptor.becomeRoot(AND52_tree, root_0);
-
-
-            	    pushFollow(FOLLOW_notexp_in_andexp1361);
-            	    notexp53=notexp();
-
-            	    state._fsp--;
-
-            	    adaptor.addChild(root_0, notexp53.getTree());
-
-            	    }
-            	    break;
-
-            	default :
-            	    break loop8;
-                }
-            } while (true);
-
-
-            }
-
-            retval.stop = input.LT(-1);
-
-
-            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
-            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
-        }
-         
-        finally {
-        	// do for sure before leaving
-        }
-        return retval;
-    }
-    // $ANTLR end "andexp"
-
-
-    public static class expression_return extends ParserRuleReturnScope {
-        Object tree;
-        public Object getTree() { return tree; }
-    };
-
-
-    // $ANTLR start "expression"
-    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:286:1: expression : andexp ( OR ^ andexp )* ;
-    public final CpQueryFilterParser.expression_return expression() throws RecognitionException {
-        CpQueryFilterParser.expression_return retval = new CpQueryFilterParser.expression_return();
-        retval.start = input.LT(1);
-
-
-        Object root_0 = null;
-
-        Token OR55=null;
-        CpQueryFilterParser.andexp_return andexp54 =null;
-
-        CpQueryFilterParser.andexp_return andexp56 =null;
-
-
-        Object OR55_tree=null;
-
-        try {
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:286:12: ( andexp ( OR ^ andexp )* )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:287:2: andexp ( OR ^ andexp )*
-            {
-            root_0 = (Object)adaptor.nil();
-
-
-            pushFollow(FOLLOW_andexp_in_expression1378);
-            andexp54=andexp();
-
-            state._fsp--;
-
-            adaptor.addChild(root_0, andexp54.getTree());
-
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:287:9: ( OR ^ andexp )*
-            loop9:
-            do {
-                int alt9=2;
-                switch ( input.LA(1) ) {
-                case OR:
-                    {
-                    alt9=1;
-                    }
-                    break;
-
-                }
-
-                switch (alt9) {
-            	case 1 :
-            	    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:287:10: OR ^ andexp
-            	    {
-            	    OR55=(Token)match(input,OR,FOLLOW_OR_in_expression1381); 
-            	    OR55_tree = 
-            	    new OrOperand(OR55) 
-            	    ;
-            	    root_0 = (Object)adaptor.becomeRoot(OR55_tree, root_0);
-
-
-            	    pushFollow(FOLLOW_andexp_in_expression1387);
-            	    andexp56=andexp();
-
-            	    state._fsp--;
-
-            	    adaptor.addChild(root_0, andexp56.getTree());
-
-            	    }
-            	    break;
-
-            	default :
-            	    break loop9;
-                }
-            } while (true);
-
-
-            }
-
-            retval.stop = input.LT(-1);
-
-
-            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
-            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
-        }
-         
-        finally {
-        	// do for sure before leaving
-        }
-        return retval;
-    }
-    // $ANTLR end "expression"
-
-
-    public static class direction_return extends ParserRuleReturnScope {
-        Object tree;
-        public Object getTree() { return tree; }
-    };
-
-
-    // $ANTLR start "direction"
-    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:296:1: direction : ( ASC | DESC ) ;
-    public final CpQueryFilterParser.direction_return direction() throws RecognitionException {
-        CpQueryFilterParser.direction_return retval = new CpQueryFilterParser.direction_return();
-        retval.start = input.LT(1);
-
-
-        Object root_0 = null;
-
-        Token set57=null;
-
-        Object set57_tree=null;
-
-        try {
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:296:12: ( ( ASC | DESC ) )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:
-            {
-            root_0 = (Object)adaptor.nil();
-
-
-            set57=(Token)input.LT(1);
-
-            if ( input.LA(1)==ASC||input.LA(1)==DESC ) {
-                input.consume();
-                adaptor.addChild(root_0, 
-                (Object)adaptor.create(set57)
-                );
-                state.errorRecovery=false;
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                throw mse;
-            }
-
-
-            }
-
-            retval.stop = input.LT(-1);
-
-
-            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
-            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
-        }
-         
-        finally {
-        	// do for sure before leaving
-        }
-        return retval;
-    }
-    // $ANTLR end "direction"
-
-
-    public static class order_return extends ParserRuleReturnScope {
-        Object tree;
-        public Object getTree() { return tree; }
-    };
-
-
-    // $ANTLR start "order"
-    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:299:1: order : ( property ( direction )? ) ;
-    public final CpQueryFilterParser.order_return order() throws RecognitionException {
-        CpQueryFilterParser.order_return retval = new CpQueryFilterParser.order_return();
-        retval.start = input.LT(1);
-
-
-        Object root_0 = null;
-
-        CpQueryFilterParser.property_return property58 =null;
-
-        CpQueryFilterParser.direction_return direction59 =null;
-
-
-
-        try {
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:300:3: ( ( property ( direction )? ) )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:300:5: ( property ( direction )? )
-            {
-            root_0 = (Object)adaptor.nil();
-
-
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:300:5: ( property ( direction )? )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:300:6: property ( direction )?
-            {
-            pushFollow(FOLLOW_property_in_order1424);
-            property58=property();
-
-            state._fsp--;
-
-            adaptor.addChild(root_0, property58.getTree());
-
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:300:15: ( direction )?
-            int alt10=2;
-            switch ( input.LA(1) ) {
-                case ASC:
-                case DESC:
-                    {
-                    alt10=1;
-                    }
-                    break;
-            }
-
-            switch (alt10) {
-                case 1 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:300:15: direction
-                    {
-                    pushFollow(FOLLOW_direction_in_order1426);
-                    direction59=direction();
-
-                    state._fsp--;
-
-                    adaptor.addChild(root_0, direction59.getTree());
-
-                    }
-                    break;
-
-            }
-
-
-            }
-
-
-
-            		String property = (property58!=null?input.toString(property58.start,property58.stop):null); 
-            		String direction = (direction59!=null?input.toString(direction59.start,direction59.stop):null);
-            		query.addSort(new SortPredicate(property, direction));
-                
-              
-
-            }
-
-            retval.stop = input.LT(-1);
-
-
-            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
-            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
-        }
-         
-        finally {
-        	// do for sure before leaving
-        }
-        return retval;
-    }
-    // $ANTLR end "order"
-
-
-    public static class select_subject_return extends ParserRuleReturnScope {
-        Object tree;
-        public Object getTree() { return tree; }
-    };
-
-
-    // $ANTLR start "select_subject"
-    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:311:1: select_subject : ID ;
-    public final CpQueryFilterParser.select_subject_return select_subject() throws RecognitionException {
-        CpQueryFilterParser.select_subject_return retval = new CpQueryFilterParser.select_subject_return();
-        retval.start = input.LT(1);
-
-
-        Object root_0 = null;
-
-        Token ID60=null;
-
-        Object ID60_tree=null;
-
-        try {
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:312:3: ( ID )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:312:5: ID
-            {
-            root_0 = (Object)adaptor.nil();
-
-
-            ID60=(Token)match(input,ID,FOLLOW_ID_in_select_subject1445); 
-            ID60_tree = 
-            (Object)adaptor.create(ID60)
-            ;
-            adaptor.addChild(root_0, ID60_tree);
-
-
-
-
-              query.addSelect((ID60!=null?ID60.getText():null));
-
-
-
-            }
-
-            retval.stop = input.LT(-1);
-
-
-            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
-            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
-        }
-         
-        finally {
-        	// do for sure before leaving
-        }
-        return retval;
-    }
-    // $ANTLR end "select_subject"
-
-
-    public static class select_assign_return extends ParserRuleReturnScope {
-        Object tree;
-        public Object getTree() { return tree; }
-    };
-
-
-    // $ANTLR start "select_assign"
-    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:320:1: select_assign : target= ID ':' source= ID ;
-    public final CpQueryFilterParser.select_assign_return select_assign() throws RecognitionException {
-        CpQueryFilterParser.select_assign_return retval = new CpQueryFilterParser.select_assign_return();
-        retval.start = input.LT(1);
-
-
-        Object root_0 = null;
-
-        Token target=null;
-        Token source=null;
-        Token char_literal61=null;
-
-        Object target_tree=null;
-        Object source_tree=null;
-        Object char_literal61_tree=null;
-
-        try {
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:321:3: (target= ID ':' source= ID )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:321:5: target= ID ':' source= ID
-            {
-            root_0 = (Object)adaptor.nil();
-
-
-            target=(Token)match(input,ID,FOLLOW_ID_in_select_assign1462); 
-            target_tree = 
-            (Object)adaptor.create(target)
-            ;
-            adaptor.addChild(root_0, target_tree);
-
-
-            char_literal61=(Token)match(input,35,FOLLOW_35_in_select_assign1464); 
-            char_literal61_tree = 
-            (Object)adaptor.create(char_literal61)
-            ;
-            adaptor.addChild(root_0, char_literal61_tree);
-
-
-            source=(Token)match(input,ID,FOLLOW_ID_in_select_assign1468); 
-            source_tree = 
-            (Object)adaptor.create(source)
-            ;
-            adaptor.addChild(root_0, source_tree);
-
-
-
-
-              query.addSelect((target!=null?target.getText():null), (source!=null?source.getText():null));
-
-
-
-            }
-
-            retval.stop = input.LT(-1);
-
-
-            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
-            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
-        }
-         
-        finally {
-        	// do for sure before leaving
-        }
-        return retval;
-    }
-    // $ANTLR end "select_assign"
-
-
-    public static class select_expr_return extends ParserRuleReturnScope {
-        Object tree;
-        public Object getTree() { return tree; }
-    };
-
-
-    // $ANTLR start "select_expr"
-    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:327:1: select_expr : ( '*' | select_subject ( ',' select_subject )* | '{' select_assign ( ',' select_assign )* '}' ) ;
-    public final CpQueryFilterParser.select_expr_return select_expr() throws RecognitionException {
-        CpQueryFilterParser.select_expr_return retval = new CpQueryFilterParser.select_expr_return();
-        retval.start = input.LT(1);
-
-
-        Object root_0 = null;
-
-        Token char_literal62=null;
-        Token char_literal64=null;
-        Token char_literal66=null;
-        Token char_literal68=null;
-        Token char_literal70=null;
-        CpQueryFilterParser.select_subject_return select_subject63 =null;
-
-        CpQueryFilterParser.select_subject_return select_subject65 =null;
-
-        CpQueryFilterParser.select_assign_return select_assign67 =null;
-
-        CpQueryFilterParser.select_assign_return select_assign69 =null;
-
-
-        Object char_literal62_tree=null;
-        Object char_literal64_tree=null;
-        Object char_literal66_tree=null;
-        Object char_literal68_tree=null;
-        Object char_literal70_tree=null;
-
-        try {
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:328:3: ( ( '*' | select_subject ( ',' select_subject )* | '{' select_assign ( ',' select_assign )* '}' ) )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:328:5: ( '*' | select_subject ( ',' select_subject )* | '{' select_assign ( ',' select_assign )* '}' )
-            {
-            root_0 = (Object)adaptor.nil();
-
-
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:328:5: ( '*' | select_subject ( ',' select_subject )* | '{' select_assign ( ',' select_assign )* '}' )
-            int alt13=3;
-            switch ( input.LA(1) ) {
-            case 33:
-                {
-                alt13=1;
-                }
-                break;
-            case ID:
-                {
-                alt13=2;
-                }
-                break;
-            case 39:
-                {
-                alt13=3;
-                }
-                break;
-            default:
-                NoViableAltException nvae =
-                    new NoViableAltException("", 13, 0, input);
-
-                throw nvae;
-
-            }
-
-            switch (alt13) {
-                case 1 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:328:6: '*'
-                    {
-                    char_literal62=(Token)match(input,33,FOLLOW_33_in_select_expr1482); 
-                    char_literal62_tree = 
-                    (Object)adaptor.create(char_literal62)
-                    ;
-                    adaptor.addChild(root_0, char_literal62_tree);
-
-
-                    }
-                    break;
-                case 2 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:328:12: select_subject ( ',' select_subject )*
-                    {
-                    pushFollow(FOLLOW_select_subject_in_select_expr1486);
-                    select_subject63=select_subject();
-
-                    state._fsp--;
-
-                    adaptor.addChild(root_0, select_subject63.getTree());
-
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:328:27: ( ',' select_subject )*
-                    loop11:
-                    do {
-                        int alt11=2;
-                        switch ( input.LA(1) ) {
-                        case 34:
-                            {
-                            alt11=1;
-                            }
-                            break;
-
-                        }
-
-                        switch (alt11) {
-                    	case 1 :
-                    	    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:328:28: ',' select_subject
-                    	    {
-                    	    char_literal64=(Token)match(input,34,FOLLOW_34_in_select_expr1489); 
-                    	    char_literal64_tree = 
-                    	    (Object)adaptor.create(char_literal64)
-                    	    ;
-                    	    adaptor.addChild(root_0, char_literal64_tree);
-
-
-                    	    pushFollow(FOLLOW_select_subject_in_select_expr1491);
-                    	    select_subject65=select_subject();
-
-                    	    state._fsp--;
-
-                    	    adaptor.addChild(root_0, select_subject65.getTree());
-
-                    	    }
-                    	    break;
-
-                    	default :
-                    	    break loop11;
-                        }
-                    } while (true);
-
-
-                    }
-                    break;
-                case 3 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:328:52: '{' select_assign ( ',' select_assign )* '}'
-                    {
-                    char_literal66=(Token)match(input,39,FOLLOW_39_in_select_expr1498); 
-                    char_literal66_tree = 
-                    (Object)adaptor.create(char_literal66)
-                    ;
-                    adaptor.addChild(root_0, char_literal66_tree);
-
-
-                    pushFollow(FOLLOW_select_assign_in_select_expr1500);
-                    select_assign67=select_assign();
-
-                    state._fsp--;
-
-                    adaptor.addChild(root_0, select_assign67.getTree());
-
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:328:70: ( ',' select_assign )*
-                    loop12:
-                    do {
-                        int alt12=2;
-                        switch ( input.LA(1) ) {
-                        case 34:
-                            {
-                            alt12=1;
-                            }
-                            break;
-
-                        }
-
-                        switch (alt12) {
-                    	case 1 :
-                    	    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:328:71: ',' select_assign
-                    	    {
-                    	    char_literal68=(Token)match(input,34,FOLLOW_34_in_select_expr1503); 
-                    	    char_literal68_tree = 
-                    	    (Object)adaptor.create(char_literal68)
-                    	    ;
-                    	    adaptor.addChild(root_0, char_literal68_tree);
-
-
-                    	    pushFollow(FOLLOW_select_assign_in_select_expr1505);
-                    	    select_assign69=select_assign();
-
-                    	    state._fsp--;
-
-                    	    adaptor.addChild(root_0, select_assign69.getTree());
-
-                    	    }
-                    	    break;
-
-                    	default :
-                    	    break loop12;
-                        }
-                    } while (true);
-
-
-                    char_literal70=(Token)match(input,40,FOLLOW_40_in_select_expr1510); 
-                    char_literal70_tree = 
-                    (Object)adaptor.create(char_literal70)
-                    ;
-                    adaptor.addChild(root_0, char_literal70_tree);
-
-
-                    }
-                    break;
-
-            }
-
-
-            }
-
-            retval.stop = input.LT(-1);
-
-
-            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
-            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
-        }
-         
-        finally {
-        	// do for sure before leaving
-        }
-        return retval;
-    }
-    // $ANTLR end "select_expr"
-
-
-    public static class ql_return extends ParserRuleReturnScope {
-        public Query query;
-        Object tree;
-        public Object getTree() { return tree; }
-    };
-
-
-    // $ANTLR start "ql"
-    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:332:1: ql returns [Query query] : ( 'select' ! select_expr !)? ( ( 'where' !)? expression )? ( 'order by' ! order ! ( ',' ! order !)* )? ;
-    public final CpQueryFilterParser.ql_return ql() throws RecognitionException {
-        CpQueryFilterParser.ql_return retval = new CpQueryFilterParser.ql_return();
-        retval.start = input.LT(1);
-
-
-        Object root_0 = null;
-
-        Token string_literal71=null;
-        Token string_literal73=null;
-        Token string_literal75=null;
-        Token char_literal77=null;
-        CpQueryFilterParser.select_expr_return select_expr72 =null;
-
-        CpQueryFilterParser.expression_return expression74 =null;
-
-        CpQueryFilterParser.order_return order76 =null;
-
-        CpQueryFilterParser.order_return order78 =null;
-
-
-        Object string_literal71_tree=null;
-        Object string_literal73_tree=null;
-        Object string_literal75_tree=null;
-        Object char_literal77_tree=null;
-
-        try {
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:333:3: ( ( 'select' ! select_expr !)? ( ( 'where' !)? expression )? ( 'order by' ! order ! ( ',' ! order !)* )? )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:333:5: ( 'select' ! select_expr !)? ( ( 'where' !)? expression )? ( 'order by' ! order ! ( ',' ! order !)* )?
-            {
-            root_0 = (Object)adaptor.nil();
-
-
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:333:5: ( 'select' ! select_expr !)?
-            int alt14=2;
-            switch ( input.LA(1) ) {
-                case 37:
-                    {
-                    alt14=1;
-                    }
-                    break;
-            }
-
-            switch (alt14) {
-                case 1 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:333:6: 'select' ! select_expr !
-                    {
-                    string_literal71=(Token)match(input,37,FOLLOW_37_in_ql1533); 
-
-                    pushFollow(FOLLOW_select_expr_in_ql1536);
-                    select_expr72=select_expr();
-
-                    state._fsp--;
-
-
-                    }
-                    break;
-
-            }
-
-
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:333:31: ( ( 'where' !)? expression )?
-            int alt16=2;
-            switch ( input.LA(1) ) {
-                case ID:
-                case NOT:
-                case 31:
-                case 38:
-                    {
-                    alt16=1;
-                    }
-                    break;
-            }
-
-            switch (alt16) {
-                case 1 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:333:32: ( 'where' !)? expression
-                    {
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:333:39: ( 'where' !)?
-                    int alt15=2;
-                    switch ( input.LA(1) ) {
-                        case 38:
-                            {
-                            alt15=1;
-                            }
-                            break;
-                    }
-
-                    switch (alt15) {
-                        case 1 :
-                            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:333:39: 'where' !
-                            {
-                            string_literal73=(Token)match(input,38,FOLLOW_38_in_ql1542); 
-
-                            }
-                            break;
-
-                    }
-
-
-                    pushFollow(FOLLOW_expression_in_ql1546);
-                    expression74=expression();
-
-                    state._fsp--;
-
-                    adaptor.addChild(root_0, expression74.getTree());
-
-                    }
-                    break;
-
-            }
-
-
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:333:55: ( 'order by' ! order ! ( ',' ! order !)* )?
-            int alt18=2;
-            switch ( input.LA(1) ) {
-                case 36:
-                    {
-                    alt18=1;
-                    }
-                    break;
-            }
-
-            switch (alt18) {
-                case 1 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:333:56: 'order by' ! order ! ( ',' ! order !)*
-                    {
-                    string_literal75=(Token)match(input,36,FOLLOW_36_in_ql1551); 
-
-                    pushFollow(FOLLOW_order_in_ql1554);
-                    order76=order();
-
-                    state._fsp--;
-
-
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:333:75: ( ',' ! order !)*
-                    loop17:
-                    do {
-                        int alt17=2;
-                        switch ( input.LA(1) ) {
-                        case 34:
-                            {
-                            alt17=1;
-                            }
-                            break;
-
-                        }
-
-                        switch (alt17) {
-                    	case 1 :
-                    	    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:333:76: ',' ! order !
-                    	    {
-                    	    char_literal77=(Token)match(input,34,FOLLOW_34_in_ql1558); 
-
-                    	    pushFollow(FOLLOW_order_in_ql1561);
-                    	    order78=order();
-
-                    	    state._fsp--;
-
-
-                    	    }
-                    	    break;
-
-                    	default :
-                    	    break loop17;
-                        }
-                    } while (true);
-
-
-                    }
-                    break;
-
-            }
-
-
-
-
-              if((expression74!=null?((Object)expression74.tree):null) instanceof Operand){
-                query.setRootOperand((Operand)(expression74!=null?((Object)expression74.tree):null));
-              }
-              
-              retval.query = query;
-
-
-
-
-            }
-
-            retval.stop = input.LT(-1);
-
-
-            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
-            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-
-        }
-         
-        finally {
-        	// do for sure before leaving
-        }
-        return retval;
-    }
-    // $ANTLR end "ql"
-
-    // Delegated rules
-
-
- 
-
-    public static final BitSet FOLLOW_ID_in_property991 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_ID_in_containsproperty1002 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_ID_in_withinproperty1013 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_BOOLEAN_in_booleanliteral1024 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_LONG_in_longliteral1038 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_UUID_in_uuidliteral1052 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_STRING_in_stringliteral1065 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_FLOAT_in_floatliteral1080 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_booleanliteral_in_value1096 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_longliteral_in_value1102 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_uuidliteral_in_value1108 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_stringliteral_in_value1114 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_floatliteral_in_value1120 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_property_in_equalityop1145 = new BitSet(new long[]{0x0000000000080000L});
-    public static final BitSet FOLLOW_LT_in_equalityop1147 = new BitSet(new long[]{0x0000000012042040L});
-    public static final BitSet FOLLOW_value_in_equalityop1153 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_property_in_equalityop1158 = new BitSet(new long[]{0x0000000000100000L});
-    public static final BitSet FOLLOW_LTE_in_equalityop1160 = new BitSet(new long[]{0x0000000012042040L});
-    public static final BitSet FOLLOW_value_in_equalityop1166 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_property_in_equalityop1171 = new BitSet(new long[]{0x0000000000000200L});
-    public static final BitSet FOLLOW_EQ_in_equalityop1173 = new BitSet(new long[]{0x0000000012042040L});
-    public static final BitSet FOLLOW_value_in_equalityop1179 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_property_in_equalityop1184 = new BitSet(new long[]{0x0000000000004000L});
-    public static final BitSet FOLLOW_GT_in_equalityop1186 = new BitSet(new long[]{0x0000000012042040L});
-    public static final BitSet FOLLOW_value_in_equalityop1192 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_property_in_equalityop1197 = new BitSet(new long[]{0x0000000000008000L});
-    public static final BitSet FOLLOW_GTE_in_equalityop1199 = new BitSet(new long[]{0x0000000012042040L});
-    public static final BitSet FOLLOW_value_in_equalityop1205 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_withinproperty_in_locationop1220 = new BitSet(new long[]{0x0000000020000000L});
-    public static final BitSet FOLLOW_WITHIN_in_locationop1222 = new BitSet(new long[]{0x0000000000042000L});
-    public static final BitSet FOLLOW_floatliteral_in_locationop1229 = new BitSet(new long[]{0x0000000000800000L});
-    public static final BitSet FOLLOW_longliteral_in_locationop1231 = new BitSet(new long[]{0x0000000000800000L});
-    public static final BitSet FOLLOW_OF_in_locationop1234 = new BitSet(new long[]{0x0000000000042000L});
-    public static final BitSet FOLLOW_floatliteral_in_locationop1238 = new BitSet(new long[]{0x0000000400000000L});
-    public static final BitSet FOLLOW_longliteral_in_locationop1240 = new BitSet(new long[]{0x0000000400000000L});
-    public static final BitSet FOLLOW_34_in_locationop1243 = new BitSet(new long[]{0x0000000000042000L});
-    public static final BitSet FOLLOW_floatliteral_in_locationop1247 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_longliteral_in_locationop1249 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_containsproperty_in_containsop1263 = new BitSet(new long[]{0x0000000000000080L});
-    public static final BitSet FOLLOW_CONTAINS_in_containsop1265 = new BitSet(new long[]{0x0000000002000000L});
-    public static final BitSet FOLLOW_stringliteral_in_containsop1271 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_31_in_operation1281 = new BitSet(new long[]{0x0000000080220000L});
-    public static final BitSet FOLLOW_expression_in_operation1284 = new BitSet(new long[]{0x0000000100000000L});
-    public static final BitSet FOLLOW_32_in_operation1286 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_equalityop_in_operation1294 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_locationop_in_operation1302 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_containsop_in_operation1310 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_NOT_in_notexp1326 = new BitSet(new long[]{0x0000000080020000L});
-    public static final BitSet FOLLOW_operation_in_notexp1332 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_operation_in_notexp1338 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_notexp_in_andexp1352 = new BitSet(new long[]{0x0000000000000012L});
-    public static final BitSet FOLLOW_AND_in_andexp1355 = new BitSet(new long[]{0x0000000080220000L});
-    public static final BitSet FOLLOW_notexp_in_andexp1361 = new BitSet(new long[]{0x0000000000000012L});
-    public static final BitSet FOLLOW_andexp_in_expression1378 = new BitSet(new long[]{0x0000000001000002L});
-    public static final BitSet FOLLOW_OR_in_expression1381 = new BitSet(new long[]{0x0000000080220000L});
-    public static final BitSet FOLLOW_andexp_in_expression1387 = new BitSet(new long[]{0x0000000001000002L});
-    public static final BitSet FOLLOW_property_in_order1424 = new BitSet(new long[]{0x0000000000000122L});
-    public static final BitSet FOLLOW_direction_in_order1426 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_ID_in_select_subject1445 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_ID_in_select_assign1462 = new BitSet(new long[]{0x0000000800000000L});
-    public static final BitSet FOLLOW_35_in_select_assign1464 = new BitSet(new long[]{0x0000000000020000L});
-    public static final BitSet FOLLOW_ID_in_select_assign1468 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_33_in_select_expr1482 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_select_subject_in_select_expr1486 = new BitSet(new long[]{0x0000000400000002L});
-    public static final BitSet FOLLOW_34_in_select_expr1489 = new BitSet(new long[]{0x0000000000020000L});
-    public static final BitSet FOLLOW_select_subject_in_select_expr1491 = new BitSet(new long[]{0x0000000400000002L});
-    public static final BitSet FOLLOW_39_in_select_expr1498 = new BitSet(new long[]{0x0000000000020000L});
-    public static final BitSet FOLLOW_select_assign_in_select_expr1500 = new BitSet(new long[]{0x0000010400000000L});
-    public static final BitSet FOLLOW_34_in_select_expr1503 = new BitSet(new long[]{0x0000000000020000L});
-    public static final BitSet FOLLOW_select_assign_in_select_expr1505 = new BitSet(new long[]{0x0000010400000000L});
-    public static final BitSet FOLLOW_40_in_select_expr1510 = new BitSet(new long[]{0x0000000000000002L});
-    public static final BitSet FOLLOW_37_in_ql1533 = new BitSet(new long[]{0x0000008200020000L});
-    public static final BitSet FOLLOW_select_expr_in_ql1536 = new BitSet(new long[]{0x0000005080220002L});
-    public static final BitSet FOLLOW_38_in_ql1542 = new BitSet(new long[]{0x0000000080220000L});
-    public static final BitSet FOLLOW_expression_in_ql1546 = new BitSet(new long[]{0x0000001000000002L});
-    public static final BitSet FOLLOW_36_in_ql1551 = new BitSet(new long[]{0x0000000000020000L});
-    public static final BitSet FOLLOW_order_in_ql1554 = new BitSet(new long[]{0x0000000400000002L});
-    public static final BitSet FOLLOW_34_in_ql1558 = new BitSet(new long[]{0x0000000000020000L});
-    public static final BitSet FOLLOW_order_in_ql1561 = new BitSet(new long[]{0x0000000400000002L});
-
-}
\ No newline at end of file


[49/52] [abbrv] git commit: Add some missing headers, and make some header more consistent.

Posted by gr...@apache.org.
Add some missing headers, and make some header more consistent.


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: 17a9b8c3092a45af4dd8cb460ce81b552940c97a
Parents: db32c15
Author: Dave Johnson <sn...@apache.org>
Authored: Wed Sep 3 12:44:52 2014 -0400
Committer: Dave Johnson <sn...@apache.org>
Committed: Wed Sep 3 12:44:52 2014 -0400

----------------------------------------------------------------------
 .../extensions/usergrid.validation.js           | 34 +++++++++---------
 sdks/html5-javascript/lib/Module.js             | 19 +++++++++--
 sdks/html5-javascript/lib/Usergrid.js           | 36 ++++++++------------
 sdks/html5-javascript/usergrid.js               | 31 ++++++++---------
 sdks/html5-javascript/usergrid.min.js           | 31 ++++++++---------
 .../test/resources/usergrid-test-context.xml    | 16 +++++++++
 .../test/resources/usergrid-test-context.xml    | 18 +++++++++-
 ugc/features/step_definitions/ugc_steps.rb      | 23 +++++++------
 ugc/features/support/env.rb                     | 23 +++++++------
 ugc/lib/ugc.rb                                  | 23 +++++++------
 ugc/lib/ugc/application.rb                      | 23 +++++++------
 ugc/lib/ugc/commands/delete.rb                  | 23 +++++++------
 ugc/lib/ugc/commands/get.rb                     | 23 +++++++------
 ugc/lib/ugc/commands/logout.rb                  | 16 +++++++++
 ugc/lib/ugc/commands/post.rb                    | 23 +++++++------
 ugc/lib/ugc/commands/profile.rb                 | 23 +++++++------
 ugc/lib/ugc/commands/put.rb                     | 23 +++++++------
 ugc/lib/ugc/commands/query.rb                   | 23 +++++++------
 ugc/lib/ugc/commands/target.rb                  | 23 +++++++------
 ugc/lib/ugc/helpers/curl.rb                     | 23 +++++++------
 ugc/lib/ugc/helpers/format.rb                   | 23 +++++++------
 ugc/lib/ugc/helpers/history.rb                  | 23 +++++++------
 ugc/lib/ugc/helpers/parse.rb                    | 23 +++++++------
 ugc/lib/ugc/helpers/rest.rb                     | 23 +++++++------
 ugc/lib/ugc/management.rb                       | 23 +++++++------
 ugc/lib/ugc/settings.rb                         | 23 +++++++------
 ugc/lib/ugc/version.rb                          | 23 +++++++------
 ugc/test/default_test.rb                        | 23 +++++++------
 ugc/test/test_helper.rb                         | 23 +++++++------
 29 files changed, 379 insertions(+), 305 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/17a9b8c3/sdks/html5-javascript/extensions/usergrid.validation.js
----------------------------------------------------------------------
diff --git a/sdks/html5-javascript/extensions/usergrid.validation.js b/sdks/html5-javascript/extensions/usergrid.validation.js
index adede45..42c1564 100755
--- a/sdks/html5-javascript/extensions/usergrid.validation.js
+++ b/sdks/html5-javascript/extensions/usergrid.validation.js
@@ -1,19 +1,21 @@
-//
-// 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.
-//
+/*
+ * 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.
+ */
 
 /**
  * validation is a Singleton that provides methods for validating common field types

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/17a9b8c3/sdks/html5-javascript/lib/Module.js
----------------------------------------------------------------------
diff --git a/sdks/html5-javascript/lib/Module.js b/sdks/html5-javascript/lib/Module.js
index d5c3251..38f5047 100644
--- a/sdks/html5-javascript/lib/Module.js
+++ b/sdks/html5-javascript/lib/Module.js
@@ -1,5 +1,20 @@
-/**
- * Created by ryan bridges on 2014-02-05.
+/*
+ * 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.
  */
 
     //noinspection ThisExpressionReferencesGlobalObjectJS

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/17a9b8c3/sdks/html5-javascript/lib/Usergrid.js
----------------------------------------------------------------------
diff --git a/sdks/html5-javascript/lib/Usergrid.js b/sdks/html5-javascript/lib/Usergrid.js
index 5fed303..f1bb218 100644
--- a/sdks/html5-javascript/lib/Usergrid.js
+++ b/sdks/html5-javascript/lib/Usergrid.js
@@ -1,28 +1,22 @@
 /*
- *  This module is a collection of classes designed to make working with
- *  the Appigee App Services API as easy as possible.
- *  Learn more at http://Usergrid.com/docs/usergrid
+ * 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
  *
- *   Copyright 2012 Usergrid Corporation
- *
- *  Licensed 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.
- *
- *  @author rod simpson (rod@Usergrid.com)
- *  @author matt dobson (matt@Usergrid.com)
- *  @author ryan bridges (rbridges@Usergrid.com)
+ *  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.
  */
 
-
 //Hack around IE console.log
 window.console = window.console || {};
 window.console.log = window.console.log || function() {};

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/17a9b8c3/sdks/html5-javascript/usergrid.js
----------------------------------------------------------------------
diff --git a/sdks/html5-javascript/usergrid.js b/sdks/html5-javascript/usergrid.js
index b0a34f6..5989d8a 100644
--- a/sdks/html5-javascript/usergrid.js
+++ b/sdks/html5-javascript/usergrid.js
@@ -1,23 +1,20 @@
-/*! 
- *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
+/*
+ * 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.
- * 
- * 
- * usergrid@0.11.0 2014-06-24 
+ * 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.
  */
 var UsergridEventable = function() {
     throw Error("'UsergridEventable' is not intended to be invoked directly");

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/17a9b8c3/sdks/html5-javascript/usergrid.min.js
----------------------------------------------------------------------
diff --git a/sdks/html5-javascript/usergrid.min.js b/sdks/html5-javascript/usergrid.min.js
index 883550d..0f50f94 100644
--- a/sdks/html5-javascript/usergrid.min.js
+++ b/sdks/html5-javascript/usergrid.min.js
@@ -1,23 +1,20 @@
-/*! 
- *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
+/*
+ * 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.
- * 
- * 
- * usergrid@0.11.0 2014-06-24 
+ * 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.
  */
 function extend(subClass,superClass){var F=function(){};return F.prototype=superClass.prototype,subClass.prototype=new F,subClass.prototype.constructor=subClass,subClass.superclass=superClass.prototype,superClass.prototype.constructor==Object.prototype.constructor&&(superClass.prototype.constructor=superClass),subClass}function propCopy(from,to){for(var prop in from)from.hasOwnProperty(prop)&&(to[prop]="object"==typeof from[prop]&&"object"==typeof to[prop]?propCopy(from[prop],to[prop]):from[prop]);return to}function NOOP(){}function isValidUrl(url){if(!url)return!1;var doc,base,anchor,isValid=!1;try{doc=document.implementation.createHTMLDocument(""),base=doc.createElement("base"),base.href=base||window.lo,doc.head.appendChild(base),anchor=doc.createElement("a"),anchor.href=url,doc.body.appendChild(anchor),isValid=!(""===anchor.href)}catch(e){console.error(e)}finally{return doc.head.removeChild(base),doc.body.removeChild(anchor),base=null,anchor=null,doc=null,isValid}}function isUUID
 (uuid){return uuid?uuidValueRegex.test(uuid):!1}function encodeParams(params){var queryString;return params&&Object.keys(params)&&(queryString=[].slice.call(arguments).reduce(function(a,b){return a.concat(b instanceof Array?b:[b])},[]).filter(function(c){return"object"==typeof c}).reduce(function(p,c){return c instanceof Array?p.push(c):p=p.concat(Object.keys(c).map(function(key){return[key,c[key]]})),p},[]).reduce(function(p,c){return 2===c.length?p.push(c):p=p.concat(c),p},[]).reduce(function(p,c){return c[1]instanceof Array?c[1].forEach(function(v){p.push([c[0],v])}):p.push(c),p},[]).map(function(c){return c[1]=encodeURIComponent(c[1]),c.join("=")}).join("&")),queryString}function isFunction(f){return f&&null!==f&&"function"==typeof f}function doCallback(callback,params,context){var returnValue;return isFunction(callback)&&(params||(params=[]),context||(context=this),params.push(context),returnValue=callback.apply(context,params)),returnValue}function getSafeTime(prop){var time;s
 witch(typeof prop){case"undefined":time=Date.now();break;case"number":time=prop;break;case"string":time=isNaN(prop)?Date.parse(prop):parseInt(prop);break;default:time=Date.parse(prop.toString())}return time}var UsergridEventable=function(){throw Error("'UsergridEventable' is not intended to be invoked directly")};UsergridEventable.prototype={bind:function(event,fn){this._events=this._events||{},this._events[event]=this._events[event]||[],this._events[event].push(fn)},unbind:function(event,fn){this._events=this._events||{},event in this._events!=!1&&this._events[event].splice(this._events[event].indexOf(fn),1)},trigger:function(event){if(this._events=this._events||{},event in this._events!=!1)for(var i=0;i<this._events[event].length;i++)this._events[event][i].apply(this,Array.prototype.slice.call(arguments,1))}},UsergridEventable.mixin=function(destObject){for(var props=["bind","unbind","trigger"],i=0;i<props.length;i++)props[i]in destObject.prototype&&(console.warn("overwriting '"+p
 rops[i]+"' on '"+destObject.name+"'."),console.warn("the previous version can be found at '_"+props[i]+"' on '"+destObject.name+"'."),destObject.prototype["_"+props[i]]=destObject.prototype[props[i]]),destObject.prototype[props[i]]=UsergridEventable.prototype[props[i]]},function(){function Logger(name){this.logEnabled=!0,this.init(name,!0)}var name="Logger",global=this,overwrittenName=global[name];return Logger.METHODS=["log","error","warn","info","debug","assert","clear","count","dir","dirxml","exception","group","groupCollapsed","groupEnd","profile","profileEnd","table","time","timeEnd","trace"],Logger.prototype.init=function(name,logEnabled){this.name=name||"UNKNOWN",this.logEnabled=logEnabled||!0;var addMethod=function(method){this[method]=this.createLogMethod(method)}.bind(this);Logger.METHODS.forEach(addMethod)},Logger.prototype.createLogMethod=function(method){return Logger.prototype.log.bind(this,method)},Logger.prototype.prefix=function(method,args){var prepend="["+method.t
 oUpperCase()+"]["+name+"]:	";return-1!==["log","error","warn","info"].indexOf(method)&&("string"==typeof args[0]?args[0]=prepend+args[0]:args.unshift(prepend)),args},Logger.prototype.log=function(){var args=[].slice.call(arguments);method=args.shift(),-1===Logger.METHODS.indexOf(method)&&(method="log"),this.logEnabled&&console&&console[method]&&(args=this.prefix(method,args),console[method].apply(console,args))},Logger.prototype.setLogEnabled=function(logEnabled){this.logEnabled=logEnabled||!0},Logger.mixin=function(destObject){destObject.__logger=new Logger(destObject.name||"UNKNOWN");var addMethod=function(method){method in destObject.prototype&&(console.warn("overwriting '"+method+"' on '"+destObject.name+"'."),console.warn("the previous version can be found at '_"+method+"' on '"+destObject.name+"'."),destObject.prototype["_"+method]=destObject.prototype[method]),destObject.prototype[method]=destObject.__logger.createLogMethod(method)};Logger.METHODS.forEach(addMethod)},global[n
 ame]=Logger,global[name].noConflict=function(){return overwrittenName&&(global[name]=overwrittenName),Logger},global[name]}(),function(global){function Promise(){this.complete=!1,this.error=null,this.result=null,this.callbacks=[]}var name="Promise",overwrittenName=global[name];return Promise.prototype.then=function(callback,context){var f=function(){return callback.apply(context,arguments)};this.complete?f(this.error,this.result):this.callbacks.push(f)},Promise.prototype.done=function(error,result){if(this.complete=!0,this.error=error,this.result=result,this.callbacks){for(var i=0;i<this.callbacks.length;i++)this.callbacks[i](error,result);this.callbacks.length=0}},Promise.join=function(promises){function notifier(i){return function(error,result){completed+=1,errors[i]=error,results[i]=result,completed===total&&p.done(errors,results)}}for(var p=new Promise,total=promises.length,completed=0,errors=[],results=[],i=0;total>i;i++)promises[i]().then(notifier(i));return p},Promise.chain=f
 unction(promises,error,result){var p=new Promise;return null===promises||0===promises.length?p.done(error,result):promises[0](error,result).then(function(res,err){promises.splice(0,1),promises?Promise.chain(promises,res,err).then(function(r,e){p.done(r,e)}):p.done(res,err)}),p},global[name]=Promise,global[name].noConflict=function(){return overwrittenName&&(global[name]=overwrittenName),Promise},global[name]}(this),function(){function partial(){var args=Array.prototype.slice.call(arguments),fn=args.shift();return fn.bind(this,args)}function Ajax(){function encode(data){var result="";if("string"==typeof data)result=data;else{var e=encodeURIComponent;for(var i in data)data.hasOwnProperty(i)&&(result+="&"+e(i)+"="+e(data[i]))}return result}function request(m,u,d){var timeout,p=new Promise;return self.logger.time(m+" "+u),function(xhr){xhr.onreadystatechange=function(){4===this.readyState&&(self.logger.timeEnd(m+" "+u),clearTimeout(timeout),p.done(null,this))},xhr.onerror=function(respo
 nse){clearTimeout(timeout),p.done(response,null)},xhr.oncomplete=function(){clearTimeout(timeout),self.logger.timeEnd(m+" "+u),self.info("%s request to %s returned %s",m,u,this.status)},xhr.open(m,u),d&&("object"==typeof d&&(d=JSON.stringify(d)),xhr.setRequestHeader("Content-Type","application/json"),xhr.setRequestHeader("Accept","application/json")),timeout=setTimeout(function(){xhr.abort(),p.done("API Call timed out.",null)},3e4),xhr.send(encode(d))}(new XMLHttpRequest),p}this.logger=new global.Logger(name);var self=this;this.request=request,this.get=partial(request,"GET"),this.post=partial(request,"POST"),this.put=partial(request,"PUT"),this.delete=partial(request,"DELETE")}var exports,name="Ajax",global=this,overwrittenName=global[name];return global[name]=new Ajax,global[name].noConflict=function(){return overwrittenName&&(global[name]=overwrittenName),exports},global[name]}(),window.console=window.console||{},window.console.log=window.console.log||function(){};var uuidValueReg
 ex=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;!function(global){function Usergrid(){this.logger=new Logger(name)}var name="Usergrid",overwrittenName=global[name],VALID_REQUEST_METHODS=["GET","POST","PUT","DELETE"];return Usergrid.isValidEndpoint=function(){return!0},Usergrid.Request=function(method,endpoint,query_params,data,callback){var p=new Promise;if(this.logger=new global.Logger("Usergrid.Request"),this.logger.time("process request "+method+" "+endpoint),this.endpoint=endpoint+"?"+encodeParams(query_params),this.method=method.toUpperCase(),this.data="object"==typeof data?JSON.stringify(data):data,-1===VALID_REQUEST_METHODS.indexOf(this.method))throw new UsergridInvalidHTTPMethodError("invalid request method '"+this.method+"'");if(!isValidUrl(this.endpoint))throw this.logger.error(endpoint,this.endpoint,/^https:\/\//.test(endpoint)),new UsergridInvalidURIError("The provided endpoint is not valid: "+this.endpoint);var request=function(){retur
 n Ajax.request(this.method,this.endpoint,this.data)}.bind(this),response=function(err,request){return new Usergrid.Response(err,request)}.bind(this),oncomplete=function(err,response){p.done(err,response),this.logger.info("REQUEST",err,response),doCallback(callback,[err,response]),this.logger.timeEnd("process request "+method+" "+endpoint)}.bind(this);return Promise.chain([request,response]).then(oncomplete),p},Usergrid.Response=function(err,response){var p=new Promise,data=null;try{data=JSON.parse(response.responseText)}catch(e){data={}}switch(Object.keys(data).forEach(function(key){Object.defineProperty(this,key,{value:data[key],enumerable:!0})}.bind(this)),Object.defineProperty(this,"logger",{enumerable:!1,configurable:!1,writable:!1,value:new global.Logger(name)}),Object.defineProperty(this,"success",{enumerable:!1,configurable:!1,writable:!0,value:!0}),Object.defineProperty(this,"err",{enumerable:!1,configurable:!1,writable:!0,value:err}),Object.defineProperty(this,"status",{enu
 merable:!1,configurable:!1,writable:!0,value:parseInt(response.status)}),Object.defineProperty(this,"statusGroup",{enumerable:!1,configurable:!1,writable:!0,value:this.status-this.status%100}),this.statusGroup){case 200:this.success=!0;break;case 400:case 500:case 300:case 100:default:this.success=!1}return this.success?p.done(null,this):p.done(UsergridError.fromResponse(data),this),p},Usergrid.Response.prototype.getEntities=function(){var entities;return this.success&&(entities=this.data?this.data.entities:this.entities),entities||[]},Usergrid.Response.prototype.getEntity=function(){var entities=this.getEntities();return entities[0]},Usergrid.VERSION=Usergrid.USERGRID_SDK_VERSION="0.11.0",global[name]=Usergrid,global[name].noConflict=function(){return overwrittenName&&(global[name]=overwrittenName),Usergrid},global[name]}(this),function(){var exports,name="Client",global=this,overwrittenName=global[name];return Usergrid.Client=function(options){this.URI=options.URI||"https://api.us
 ergrid.com",options.orgName&&this.set("orgName",options.orgName),options.appName&&this.set("appName",options.appName),options.qs&&this.setObject("default_qs",options.qs),this.buildCurl=options.buildCurl||!1,this.logging=options.logging||!1},Usergrid.Client.prototype.request=function(options,callback){var uri,method=options.method||"GET",endpoint=options.endpoint,body=options.body||{},qs=options.qs||{},mQuery=options.mQuery||!1,orgName=this.get("orgName"),appName=this.get("appName"),default_qs=this.getObject("default_qs");if(!mQuery&&!orgName&&!appName)return logoutCallback();uri=mQuery?this.URI+"/"+endpoint:this.URI+"/"+orgName+"/"+appName+"/"+endpoint,this.getToken()&&(qs.access_token=this.getToken()),default_qs&&(qs=propCopy(qs,default_qs));{var self=this;new Usergrid.Request(method,uri,qs,body,function(err,response){err?doCallback(callback,[err,response,self],self):doCallback(callback,[null,response,self],self)})}},Usergrid.Client.prototype.buildAssetURL=function(uuid){var self=t
 his,qs={},assetURL=this.URI+"/"+this.orgName+"/"+this.appName+"/assets/"+uuid+"/data";self.getToken()&&(qs.access_token=self.getToken());var encoded_params=encodeParams(qs);return encoded_params&&(assetURL+="?"+encoded_params),assetURL},Usergrid.Client.prototype.createGroup=function(options,callback){var group=new Usergrid.Group({path:options.path,client:this,data:options});group.save(function(err,response){doCallback(callback,[err,response,group],group)})},Usergrid.Client.prototype.createEntity=function(options,callback){var entity=new Usergrid.Entity({client:this,data:options});entity.save(function(err,response){doCallback(callback,[err,response,entity],entity)})},Usergrid.Client.prototype.getEntity=function(options,callback){var entity=new Usergrid.Entity({client:this,data:options});entity.fetch(function(err,response){doCallback(callback,[err,response,entity],entity)})},Usergrid.Client.prototype.restoreEntity=function(serializedObject){var data=JSON.parse(serializedObject),option
 s={client:this,data:data},entity=new Usergrid.Entity(options);return entity},Usergrid.Client.prototype.createCounter=function(options,callback){var counter=new Usergrid.Counter({client:this,data:options});counter.save(callback)},Usergrid.Client.prototype.createAsset=function(options,callback){var file=options.file;file&&(options.name=options.name||file.name,options["content-type"]=options["content-type"]||file.type,options.path=options.path||"/",delete options.file);var asset=new Usergrid.Asset({client:this,data:options});asset.save(function(err,response,asset){file&&!err?asset.upload(file,callback):doCallback(callback,[err,response,asset],asset)})},Usergrid.Client.prototype.createCollection=function(options,callback){return options.client=this,new Usergrid.Collection(options,function(err,data,collection){console.log("createCollection",arguments),doCallback(callback,[err,collection,data])})},Usergrid.Client.prototype.restoreCollection=function(serializedObject){var data=JSON.parse(s
 erializedObject);data.client=this;var collection=new Usergrid.Collection(data);return collection},Usergrid.Client.prototype.getFeedForUser=function(username,callback){var options={method:"GET",endpoint:"users/"+username+"/feed"};this.request(options,function(err,data){err?doCallback(callback,[err]):doCallback(callback,[err,data,data.getEntities()])})},Usergrid.Client.prototype.createUserActivity=function(user,options,callback){options.type="users/"+user+"/activities",options={client:this,data:options};var entity=new Usergrid.Entity(options);entity.save(function(err,data){doCallback(callback,[err,data,entity])})},Usergrid.Client.prototype.createUserActivityWithEntity=function(user,content,callback){var username=user.get("username"),options={actor:{displayName:username,uuid:user.get("uuid"),username:username,email:user.get("email"),picture:user.get("picture"),image:{duration:0,height:80,url:user.get("picture"),width:80}},verb:"post",content:content};this.createUserActivity(username,op
 tions,callback)},Usergrid.Client.prototype.calcTimeDiff=function(){var seconds=0,time=this._end-this._start;try{seconds=(time/10/60).toFixed(2)}catch(e){return 0}return seconds},Usergrid.Client.prototype.setToken=function(token){this.set("token",token)},Usergrid.Client.prototype.getToken=function(){return this.get("token")},Usergrid.Client.prototype.setObject=function(key,value){value&&(value=JSON.stringify(value)),this.set(key,value)},Usergrid.Client.prototype.set=function(key,value){var keyStore="apigee_"+key;this[key]=value,"undefined"!=typeof Storage&&(value?localStorage.setItem(keyStore,value):localStorage.removeItem(keyStore))},Usergrid.Client.prototype.getObject=function(key){return JSON.parse(this.get(key))},Usergrid.Client.prototype.get=function(key){var keyStore="apigee_"+key,value=null;return this[key]?value=this[key]:"undefined"!=typeof Storage&&(value=localStorage.getItem(keyStore)),value},Usergrid.Client.prototype.signup=function(username,password,email,name,callback){
 var options={type:"users",username:username,password:password,email:email,name:name};this.createEntity(options,callback)},Usergrid.Client.prototype.login=function(username,password,callback){var self=this,options={method:"POST",endpoint:"token",body:{username:username,password:password,grant_type:"password"}};self.request(options,function(err,response){var user={};if(err)self.logging&&console.log("error trying to log user in");else{var options={client:self,data:response.user};user=new Usergrid.Entity(options),self.setToken(response.access_token)}doCallback(callback,[err,response,user])})},Usergrid.Client.prototype.reAuthenticateLite=function(callback){var self=this,options={method:"GET",endpoint:"management/me",mQuery:!0};this.request(options,function(err,response){err&&self.logging?console.log("error trying to re-authenticate user"):self.setToken(response.data.access_token),doCallback(callback,[err])})},Usergrid.Client.prototype.reAuthenticate=function(email,callback){var self=this
 ,options={method:"GET",endpoint:"management/users/"+email,mQuery:!0};this.request(options,function(err,response){var data,organizations={},applications={},user={};if(err&&self.logging)console.log("error trying to full authenticate user");else{data=response.data,self.setToken(data.token),self.set("email",data.email),localStorage.setItem("accessToken",data.token),localStorage.setItem("userUUID",data.uuid),localStorage.setItem("userEmail",data.email);var userData={username:data.username,email:data.email,name:data.name,uuid:data.uuid},options={client:self,data:userData};user=new Usergrid.Entity(options),organizations=data.organizations;var org="";try{var existingOrg=self.get("orgName");org=organizations[existingOrg]?organizations[existingOrg]:organizations[Object.keys(organizations)[0]],self.set("orgName",org.name)}catch(e){err=!0,self.logging&&console.log("error selecting org")}applications=self.parseApplicationsArray(org),self.selectFirstApp(applications),self.setObject("organizations
 ",organizations),self.setObject("applications",applications)}doCallback(callback,[err,data,user,organizations,applications],self)})},Usergrid.Client.prototype.loginFacebook=function(facebookToken,callback){var self=this,options={method:"GET",endpoint:"auth/facebook",qs:{fb_access_token:facebookToken}};this.request(options,function(err,data){var user={};if(err&&self.logging)console.log("error trying to log user in");else{var options={client:self,data:data.user};user=new Usergrid.Entity(options),self.setToken(data.access_token)}doCallback(callback,[err,data,user],self)})},Usergrid.Client.prototype.getLoggedInUser=function(callback){var self=this;if(this.getToken()){var options={method:"GET",endpoint:"users/me"};this.request(options,function(err,response){if(err)self.logging&&console.log("error trying to log user in"),console.error(err,response),doCallback(callback,[err,response,self],self);else{var options={client:self,data:response.getEntity()},user=new Usergrid.Entity(options);doCal
 lback(callback,[null,response,user],self)}})}else doCallback(callback,[new UsergridError("Access Token not set"),null,self],self)},Usergrid.Client.prototype.isLoggedIn=function(){var token=this.getToken();return"undefined"!=typeof token&&null!==token},Usergrid.Client.prototype.logout=function(){this.setToken()},Usergrid.Client.prototype.destroyToken=function(username,token,revokeAll,callback){var options={client:self,method:"PUT"};options.endpoint=revokeAll===!0?"users/"+username+"/revoketokens":null===token?"users/"+username+"/revoketoken?token="+this.getToken():"users/"+username+"/revoketoken?token="+token,this.request(options,function(err,data){err?(self.logging&&console.log("error destroying access token"),doCallback(callback,[err,data,null],self)):(console.log(revokeAll===!0?"all user tokens invalidated":"token invalidated"),doCallback(callback,[err,data,null],self))})},Usergrid.Client.prototype.logoutAndDestroyToken=function(username,token,revokeAll,callback){null===username?c
 onsole.log("username required to revoke tokens"):(this.destroyToken(username,token,revokeAll,callback),(revokeAll===!0||token===this.getToken()||null===token)&&this.setToken(null))},Usergrid.Client.prototype.buildCurlCall=function(options){var curl=["curl"],method=(options.method||"GET").toUpperCase(),body=options.body,uri=options.uri;return curl.push("-X"),curl.push(["POST","PUT","DELETE"].indexOf(method)>=0?method:"GET"),curl.push(uri),"object"==typeof body&&Object.keys(body).length>0&&-1!==["POST","PUT"].indexOf(method)&&(curl.push("-d"),curl.push("'"+JSON.stringify(body)+"'")),curl=curl.join(" "),console.log(curl),curl},Usergrid.Client.prototype.getDisplayImage=function(email,picture,size){size=size||50;var image="https://apigee.com/usergrid/images/user_profile.png";try{picture?image=picture:email.length&&(image="https://secure.gravatar.com/avatar/"+MD5(email)+"?s="+size+encodeURI("&d=https://apigee.com/usergrid/images/user_profile.png"))}catch(e){}finally{return image}},global[
 name]=Usergrid.Client,global[name].noConflict=function(){return overwrittenName&&(global[name]=overwrittenName),exports},global[name]}();var ENTITY_SYSTEM_PROPERTIES=["metadata","created","modified","oldpassword","newpassword","type","activated","uuid"];Usergrid.Entity=function(options){this._data={},this._client=void 0,options&&(this.set(options.data||{}),this._client=options.client||{})},Usergrid.Entity.isEntity=function(obj){return obj&&obj instanceof Usergrid.Entity},Usergrid.Entity.isPersistedEntity=function(obj){return isEntity(obj)&&isUUID(obj.get("uuid"))},Usergrid.Entity.prototype.serialize=function(){return JSON.stringify(this._data)},Usergrid.Entity.prototype.get=function(key){var value;if(0===arguments.length?value=this._data:arguments.length>1&&(key=[].slice.call(arguments).reduce(function(p,c){return c instanceof Array?p=p.concat(c):p.push(c),p},[])),key instanceof Array){var self=this;value=key.map(function(k){return self.get(k)})}else"undefined"!=typeof key&&(value=t
 his._data[key]);return value},Usergrid.Entity.prototype.set=function(key,value){if("object"==typeof key)for(var field in key)this._data[field]=key[field];else"string"==typeof key?null===value?delete this._data[key]:this._data[key]=value:this._data={}},Usergrid.Entity.prototype.getEndpoint=function(){var name,type=this.get("type"),nameProperties=["uuid","name"];if(void 0===type)throw new UsergridError("cannot fetch entity, no entity type specified","no_type_specified");return/^users?$/.test(type)&&nameProperties.unshift("username"),name=this.get(nameProperties).filter(function(x){return null!==x&&"undefined"!=typeof x}).shift(),name?[type,name].join("/"):type},Usergrid.Entity.prototype.save=function(callback){var self=this,type=this.get("type"),method="POST",entityId=this.get("uuid"),entityData=this.get(),options={method:method,endpoint:type};entityId&&(options.method="PUT",options.endpoint+="/"+entityId),options.body=Object.keys(entityData).filter(function(key){return-1===ENTITY_SYS
 TEM_PROPERTIES.indexOf(key)}).reduce(function(data,key){return data[key]=entityData[key],data},{}),self._client.request(options,function(err,response){var entity=response.getEntity();entity&&(self.set(entity),self.set("type",/^\//.test(response.path)?response.path.substring(1):response.path)),err&&self._client.logging&&console.log("could not save entity"),doCallback(callback,[err,response,self],self)})},Usergrid.Entity.prototype.changePassword=function(oldpassword,newpassword,callback){var self=this;if("function"==typeof oldpassword&&void 0===callback&&(callback=oldpassword,oldpassword=self.get("oldpassword"),newpassword=self.get("newpassword")),self.set({password:null,oldpassword:null,newpassword:null}),!(/^users?$/.test(self.get("type"))&&oldpassword&&newpassword))throw new UsergridInvalidArgumentError("Invalid arguments passed to 'changePassword'");var options={method:"PUT",endpoint:"users/"+self.get("uuid")+"/password",body:{uuid:self.get("uuid"),username:self.get("username"),ol
 dpassword:oldpassword,newpassword:newpassword}};self._client.request(options,function(err,response){err&&self._client.logging&&console.log("could not update user"),doCallback(callback,[err,response,self],self)})},Usergrid.Entity.prototype.fetch=function(callback){var endpoint,self=this;endpoint=this.getEndpoint();var options={method:"GET",endpoint:endpoint};this._client.request(options,function(err,response){var entity=response.getEntity();entity&&self.set(entity),doCallback(callback,[err,response,self],self)})},Usergrid.Entity.prototype.destroy=function(callback){var self=this,endpoint=this.getEndpoint(),options={method:"DELETE",endpoint:endpoint};this._client.request(options,function(err,response){err||self.set(null),doCallback(callback,[err,response,self],self)})},Usergrid.Entity.prototype.connect=function(connection,entity,callback){this.addOrRemoveConnection("POST",connection,entity,callback)},Usergrid.Entity.prototype.disconnect=function(connection,entity,callback){this.addOrR
 emoveConnection("DELETE",connection,entity,callback)},Usergrid.Entity.prototype.addOrRemoveConnection=function(method,connection,entity,callback){var self=this;if(-1==["POST","DELETE"].indexOf(method.toUpperCase()))throw new UsergridInvalidArgumentError("invalid method for connection call. must be 'POST' or 'DELETE'");var connecteeType=entity.get("type"),connectee=this.getEntityId(entity);if(!connectee)throw new UsergridInvalidArgumentError("connectee could not be identified");var connectorType=this.get("type"),connector=this.getEntityId(this);if(!connector)throw new UsergridInvalidArgumentError("connector could not be identified");var endpoint=[connectorType,connector,connection,connecteeType,connectee].join("/"),options={method:method,endpoint:endpoint};this._client.request(options,function(err,response){err&&self._client.logging&&console.log("There was an error with the connection call"),doCallback(callback,[err,response,self],self)})},Usergrid.Entity.prototype.getEntityId=functi
 on(entity){var id;return id=entity.get(isUUID(entity.get("uuid"))?"uuid":"users"===this.get("type")||"user"===this.get("type")?"username":"name")},Usergrid.Entity.prototype.getConnections=function(connection,callback){var self=this,connectorType=this.get("type"),connector=this.getEntityId(this);if(connector){var endpoint=connectorType+"/"+connector+"/"+connection+"/",options={method:"GET",endpoint:endpoint};this._client.request(options,function(err,data){err&&self._client.logging&&console.log("entity could not be connected"),self[connection]={};for(var length=data&&data.entities?data.entities.length:0,i=0;length>i;i++)"user"===data.entities[i].type?self[connection][data.entities[i].username]=data.entities[i]:self[connection][data.entities[i].name]=data.entities[i];doCallback(callback,[err,data,data.entities],self)})}else if("function"==typeof callback){var error="Error in getConnections - no uuid specified.";self._client.logging&&console.log(error),doCallback(callback,[!0,error],sel
 f)}},Usergrid.Entity.prototype.getGroups=function(callback){var self=this,endpoint="users/"+this.get("uuid")+"/groups",options={method:"GET",endpoint:endpoint};this._client.request(options,function(err,data){err&&self._client.logging&&console.log("entity could not be connected"),self.groups=data.entities,doCallback(callback,[err,data,data.entities],self)})},Usergrid.Entity.prototype.getActivities=function(callback){var self=this,endpoint=this.get("type")+"/"+this.get("uuid")+"/activities",options={method:"GET",endpoint:endpoint};this._client.request(options,function(err,data){err&&self._client.logging&&console.log("entity could not be connected");for(var entity in data.entities)data.entities[entity].createdDate=new Date(data.entities[entity].created).toUTCString();self.activities=data.entities,doCallback(callback,[err,data,data.entities],self)})},Usergrid.Entity.prototype.getFollowing=function(callback){var self=this,endpoint="users/"+this.get("uuid")+"/following",options={method:"G
 ET",endpoint:endpoint};this._client.request(options,function(err,data){err&&self._client.logging&&console.log("could not get user following");for(var entity in data.entities){data.entities[entity].createdDate=new Date(data.entities[entity].created).toUTCString();var image=self._client.getDisplayImage(data.entities[entity].email,data.entities[entity].picture);data.entities[entity]._portal_image_icon=image}self.following=data.entities,doCallback(callback,[err,data,data.entities],self)})},Usergrid.Entity.prototype.getFollowers=function(callback){var self=this,endpoint="users/"+this.get("uuid")+"/followers",options={method:"GET",endpoint:endpoint};this._client.request(options,function(err,data){err&&self._client.logging&&console.log("could not get user followers");for(var entity in data.entities){data.entities[entity].createdDate=new Date(data.entities[entity].created).toUTCString();var image=self._client.getDisplayImage(data.entities[entity].email,data.entities[entity].picture);data.en
 tities[entity]._portal_image_icon=image}self.followers=data.entities,doCallback(callback,[err,data,data.entities],self)})},Usergrid.Client.prototype.createRole=function(roleName,permissions,callback){var options={type:"role",name:roleName};this.createEntity(options,function(err,response,entity){err?doCallback(callback,[err,response,self]):entity.assignPermissions(permissions,function(err,data){err?doCallback(callback,[err,response,self]):doCallback(callback,[err,data,data.data],self)})})},Usergrid.Entity.prototype.getRoles=function(callback){var self=this,endpoint=this.get("type")+"/"+this.get("uuid")+"/roles",options={method:"GET",endpoint:endpoint};this._client.request(options,function(err,data){err&&self._client.logging&&console.log("could not get user roles"),self.roles=data.entities,doCallback(callback,[err,data,data.entities],self)})},Usergrid.Entity.prototype.assignRole=function(roleName,callback){var entityID,self=this,type=self.get("type"),collection=type+"s";"user"==type&&
 null!=this.get("username")?entityID=self.get("username"):"group"==type&&null!=this.get("name")?entityID=self.get("name"):null!=this.get("uuid")&&(entityID=self.get("uuid")),"users"!=type&&"groups"!=type&&doCallback(callback,[new UsergridError("entity must be a group or user","invalid_entity_type"),null,this],this);var endpoint="roles/"+roleName+"/"+collection+"/"+entityID,options={method:"POST",endpoint:endpoint};this._client.request(options,function(err,response){err&&console.log("Could not assign role."),doCallback(callback,[err,response,self])})},Usergrid.Entity.prototype.removeRole=function(roleName,callback){var entityID,self=this,type=self.get("type"),collection=type+"s";"user"==type&&null!=this.get("username")?entityID=this.get("username"):"group"==type&&null!=this.get("name")?entityID=this.get("name"):null!=this.get("uuid")&&(entityID=this.get("uuid")),"users"!=type&&"groups"!=type&&doCallback(callback,[new UsergridError("entity must be a group or user","invalid_entity_type"
 ),null,this],this);var endpoint="roles/"+roleName+"/"+collection+"/"+entityID,options={method:"DELETE",endpoint:endpoint};this._client.request(options,function(err,response){err&&console.log("Could not assign role."),doCallback(callback,[err,response,self])})},Usergrid.Entity.prototype.assignPermissions=function(permissions,callback){var entityID,self=this,type=this.get("type");"user"!=type&&"users"!=type&&"group"!=type&&"groups"!=type&&"role"!=type&&"roles"!=type&&doCallback(callback,[new UsergridError("entity must be a group, user, or role","invalid_entity_type"),null,this],this),"user"==type&&null!=this.get("username")?entityID=this.get("username"):"group"==type&&null!=this.get("name")?entityID=this.get("name"):null!=this.get("uuid")&&(entityID=this.get("uuid"));var endpoint=type+"/"+entityID+"/permissions",options={method:"POST",endpoint:endpoint,body:{permission:permissions}};this._client.request(options,function(err,data){err&&self._client.logging&&console.log("could not assig
 n permissions"),doCallback(callback,[err,data,data.data],self)})},Usergrid.Entity.prototype.removePermissions=function(permissions,callback){var entityID,self=this,type=this.get("type");
 "user"!=type&&"users"!=type&&"group"!=type&&"groups"!=type&&"role"!=type&&"roles"!=type&&doCallback(callback,[new UsergridError("entity must be a group, user, or role","invalid_entity_type"),null,this],this),"user"==type&&null!=this.get("username")?entityID=this.get("username"):"group"==type&&null!=this.get("name")?entityID=this.get("name"):null!=this.get("uuid")&&(entityID=this.get("uuid"));var endpoint=type+"/"+entityID+"/permissions",options={method:"DELETE",endpoint:endpoint,qs:{permission:permissions}};this._client.request(options,function(err,data){err&&self._client.logging&&console.log("could not remove permissions"),doCallback(callback,[err,data,data.params.permission],self)})},Usergrid.Entity.prototype.getPermissions=function(callback){var self=this,endpoint=this.get("type")+"/"+this.get("uuid")+"/permissions",options={method:"GET",endpoint:endpoint};this._client.request(options,function(err,data){err&&self._client.logging&&console.log("could not get user permissions");var 
 permissions=[];if(data.data){var perms=data.data,count=0;for(var i in perms){count++;var perm=perms[i],parts=perm.split(":"),ops_part="",path_part=parts[0];parts.length>1&&(ops_part=parts[0],path_part=parts[1]),ops_part=ops_part.replace("*","get,post,put,delete");var ops=ops_part.split(","),ops_object={};ops_object.get="no",ops_object.post="no",ops_object.put="no",ops_object.delete="no";for(var j in ops)ops_object[ops[j]]="yes";permissions.push({operations:ops_object,path:path_part,perm:perm})}}self.permissions=permissions,doCallback(callback,[err,data,data.entities],self)})},Usergrid.Collection=function(options){if(options&&(this._client=options.client,this._type=options.type,this.qs=options.qs||{},this._list=options.list||[],this._iterator=options.iterator||-1,this._previous=options.previous||[],this._next=options.next||null,this._cursor=options.cursor||null,options.list))for(var count=options.list.length,i=0;count>i;i++){var entity=this._client.restoreEntity(options.list[i]);this
 ._list[i]=entity}},Usergrid.isCollection=function(obj){return obj&&obj instanceof Usergrid.Collection},Usergrid.Collection.prototype.serialize=function(){var data={};data.type=this._type,data.qs=this.qs,data.iterator=this._iterator,data.previous=this._previous,data.next=this._next,data.cursor=this._cursor,this.resetEntityPointer();var i=0;for(data.list=[];this.hasNextEntity();){var entity=this.getNextEntity();data.list[i]=entity.serialize(),i++}return data=JSON.stringify(data)},Usergrid.Collection.prototype.fetch=function(callback){var self=this,qs=this.qs;this._cursor?qs.cursor=this._cursor:delete qs.cursor;var options={method:"GET",endpoint:this._type,qs:this.qs};this._client.request(options,function(err,response){err&&self._client.logging?console.log("error getting collection"):(self.saveCursor(response.cursor||null),self.resetEntityPointer(),self._list=response.getEntities().filter(function(entity){return isUUID(entity.uuid)}).map(function(entity){var ent=new Usergrid.Entity({cl
 ient:self._client});return ent.set(entity),ent.type=self._type,ent})),doCallback(callback,[err,response,self],self)})},Usergrid.Collection.prototype.addEntity=function(entityObject,callback){var self=this;entityObject.type=this._type,this._client.createEntity(entityObject,function(err,response,entity){err||self.addExistingEntity(entity),doCallback(callback,[err,response,self],self)})},Usergrid.Collection.prototype.addExistingEntity=function(entity){var count=this._list.length;this._list[count]=entity},Usergrid.Collection.prototype.destroyEntity=function(entity,callback){var self=this;entity.destroy(function(err,response){err?(self._client.logging&&console.log("could not destroy entity"),doCallback(callback,[err,response,self],self)):self.fetch(callback),self.removeEntity(entity)})},Usergrid.Collection.prototype.getEntitiesByCriteria=function(criteria){return this._list.filter(criteria)},Usergrid.Collection.prototype.getEntityByCriteria=function(criteria){return this.getEntitiesByCri
 teria(criteria).shift()},Usergrid.Collection.prototype.removeEntity=function(entity){var removedEntity=this.getEntityByCriteria(function(item){return entity.uuid===item.get("uuid")});return delete this._list[this._list.indexOf(removedEntity)],removedEntity},Usergrid.Collection.prototype.getEntityByUUID=function(uuid,callback){var entity=this.getEntityByCriteria(function(item){return item.get("uuid")===uuid});if(entity)doCallback(callback,[null,entity,entity],this);else{var options={data:{type:this._type,uuid:uuid},client:this._client};entity=new Usergrid.Entity(options),entity.fetch(callback)}},Usergrid.Collection.prototype.getFirstEntity=function(){var count=this._list.length;return count>0?this._list[0]:null},Usergrid.Collection.prototype.getLastEntity=function(){var count=this._list.length;return count>0?this._list[count-1]:null},Usergrid.Collection.prototype.hasNextEntity=function(){var next=this._iterator+1,hasNextElement=next>=0&&next<this._list.length;return hasNextElement?!0
 :!1},Usergrid.Collection.prototype.getNextEntity=function(){this._iterator++;var hasNextElement=this._iterator>=0&&this._iterator<=this._list.length;return hasNextElement?this._list[this._iterator]:!1},Usergrid.Collection.prototype.hasPrevEntity=function(){var previous=this._iterator-1,hasPreviousElement=previous>=0&&previous<this._list.length;return hasPreviousElement?!0:!1},Usergrid.Collection.prototype.getPrevEntity=function(){this._iterator--;var hasPreviousElement=this._iterator>=0&&this._iterator<=this._list.length;return hasPreviousElement?this._list[this._iterator]:!1},Usergrid.Collection.prototype.resetEntityPointer=function(){this._iterator=-1},Usergrid.Collection.prototype.saveCursor=function(cursor){this._next!==cursor&&(this._next=cursor)},Usergrid.Collection.prototype.resetPaging=function(){this._previous=[],this._next=null,this._cursor=null},Usergrid.Collection.prototype.hasNextPage=function(){return this._next},Usergrid.Collection.prototype.getNextPage=function(callb
 ack){this.hasNextPage()&&(this._previous.push(this._cursor),this._cursor=this._next,this._list=[],this.fetch(callback))},Usergrid.Collection.prototype.hasPreviousPage=function(){return this._previous.length>0},Usergrid.Collection.prototype.getPreviousPage=function(callback){this.hasPreviousPage()&&(this._next=null,this._cursor=this._previous.pop(),this._list=[],this.fetch(callback))},Usergrid.Group=function(options){this._path=options.path,this._list=[],this._client=options.client,this._data=options.data||{},this._data.type="groups"},Usergrid.Group.prototype=new Usergrid.Entity,Usergrid.Group.prototype.fetch=function(callback){var self=this,groupEndpoint="groups/"+this._path,memberEndpoint="groups/"+this._path+"/users",groupOptions={method:"GET",endpoint:groupEndpoint},memberOptions={method:"GET",endpoint:memberEndpoint};this._client.request(groupOptions,function(err,response){if(err)self._client.logging&&console.log("error getting group"),doCallback(callback,[err,response],self);el
 se{var entities=response.getEntities();if(entities&&entities.length){{entities.shift()}self._client.request(memberOptions,function(err,response){err&&self._client.logging?console.log("error getting group users"):self._list=response.getEntities().filter(function(entity){return isUUID(entity.uuid)}).map(function(entity){return new Usergrid.Entity({type:entity.type,client:self._client,uuid:entity.uuid,response:entity})}),doCallback(callback,[err,response,self],self)})}}})},Usergrid.Group.prototype.members=function(){return this._list},Usergrid.Group.prototype.add=function(options,callback){var self=this;options.user?(options={method:"POST",endpoint:"groups/"+this._path+"/users/"+options.user.get("username")},this._client.request(options,function(error,response){error?doCallback(callback,[error,response,self],self):self.fetch(callback)})):doCallback(callback,[new UsergridError("no user specified","no_user_specified"),null,this],this)},Usergrid.Group.prototype.remove=function(options,cal
 lback){var self=this;options.user?(options={method:"DELETE",endpoint:"groups/"+this._path+"/users/"+options.user.username},this._client.request(options,function(error,response){error?doCallback(callback,[error,response,self],self):self.fetch(callback)})):doCallback(callback,[new UsergridError("no user specified","no_user_specified"),null,this],this)},Usergrid.Group.prototype.feed=function(callback){var self=this,options={method:"GET",endpoint:"groups/"+this._path+"/feed"};this._client.request(options,function(err,response){doCallback(callback,[err,response,self],self)})},Usergrid.Group.prototype.createGroupActivity=function(options,callback){var self=this,user=options.user,entity=new Usergrid.Entity({client:this._client,data:{actor:{displayName:user.get("username"),uuid:user.get("uuid"),username:user.get("username"),email:user.get("email"),picture:user.get("picture"),image:{duration:0,height:80,url:user.get("picture"),width:80}},verb:"post",content:options.content,type:"groups/"+thi
 s._path+"/activities"}});entity.save(function(err,response){doCallback(callback,[err,response,self])})},Usergrid.Counter=function(options){this._client=options.client,this._data=options.data||{},this._data.category=options.category||"UNKNOWN",this._data.timestamp=options.timestamp||0,this._data.type="events",this._data.counters=options.counters||{}};var COUNTER_RESOLUTIONS=["all","minute","five_minutes","half_hour","hour","six_day","day","week","month"];Usergrid.Counter.prototype=new Usergrid.Entity,Usergrid.Counter.prototype.fetch=function(callback){this.getData({},callback)},Usergrid.Counter.prototype.increment=function(options,callback){var self=this,name=options.name,value=options.value;return name?isNaN(value)?doCallback(callback,[new UsergridInvalidArgumentError("'value' for increment, decrement must be a number"),null,self],self):(self._data.counters[name]=parseInt(value)||1,self.save(callback)):doCallback(callback,[new UsergridInvalidArgumentError("'name' for increment, decr
 ement must be a number"),null,self],self)},Usergrid.Counter.prototype.decrement=function(options,callback){var self=this,name=options.name,value=options.value;self.increment({name:name,value:-(parseInt(value)||1)},callback)},Usergrid.Counter.prototype.reset=function(options,callback){var self=this,name=options.name;self.increment({name:name,value:0},callback)},Usergrid.Counter.prototype.getData=function(options,callback){var start_time,end_time,start=options.start||0,end=options.end||Date.now(),resolution=(options.resolution||"all").toLowerCase(),counters=options.counters||Object.keys(this._data.counters),res=(resolution||"all").toLowerCase();-1===COUNTER_RESOLUTIONS.indexOf(res)&&(res="all"),start_time=getSafeTime(start),end_time=getSafeTime(end);var self=this,params=Object.keys(counters).map(function(counter){return["counter",encodeURIComponent(counters[counter])].join("=")});params.push("resolution="+res),params.push("start_time="+String(start_time)),params.push("end_time="+Strin
 g(end_time));var endpoint="counters?"+params.join("&");this._client.request({endpoint:endpoint},function(err,data){return data.counters&&data.counters.length&&data.counters.forEach(function(counter){self._data.counters[counter.name]=counter.value||counter.values}),doCallback(callback,[err,data,self],self)})},Usergrid.Folder=function(options,callback){var self=this;console.log("FOLDER OPTIONS",options),self._client=options.client,self._data=options.data||{},self._data.type="folders";var missingData=["name","owner","path"].some(function(required){return!(required in self._data)});return missingData?doCallback(callback,[new UsergridInvalidArgumentError("Invalid asset data: 'name', 'owner', and 'path' are required properties."),null,self],self):void self.save(function(err,response){err?doCallback(callback,[new UsergridError(response),response,self],self):(response&&response.entities&&response.entities.length&&self.set(response.entities[0]),doCallback(callback,[null,response,self],self))
 })},Usergrid.Folder.prototype=new Usergrid.Entity,Usergrid.Folder.prototype.fetch=function(callback){var self=this;Usergrid.Entity.prototype.fetch.call(self,function(err,data){console.log("self",self.get()),console.log("data",data),err?doCallback(callback,[null,data,self],self):self.getAssets(function(err,response){err?doCallback(callback,[new UsergridError(response),resonse,self],self):doCallback(callback,[null,self],self)})})},Usergrid.Folder.prototype.addAsset=function(options,callback){var self=this;if("asset"in options){var asset=null;switch(typeof options.asset){case"object":asset=options.asset,asset instanceof Usergrid.Entity||(asset=new Usergrid.Asset(asset));break;case"string":isUUID(options.asset)&&(asset=new Usergrid.Asset({client:self._client,data:{uuid:options.asset,type:"assets"}}))}asset&&asset instanceof Usergrid.Entity&&asset.fetch(function(err,data){if(err)doCallback(callback,[new UsergridError(data),data,self],self);else{var endpoint=["folders",self.get("uuid"),"a
 ssets",asset.get("uuid")].join("/"),options={method:"POST",endpoint:endpoint};self._client.request(options,callback)}})}else doCallback(callback,[new UsergridInvalidArgumentError("No asset specified"),null,self],self)},Usergrid.Folder.prototype.removeAsset=function(options,callback){var self=this;if("asset"in options){var asset=null;switch(typeof options.asset){case"object":asset=options.asset;break;case"string":isUUID(options.asset)&&(asset=new Usergrid.Asset({client:self._client,data:{uuid:options.asset,type:"assets"}}))}if(asset&&null!==asset){var endpoint=["folders",self.get("uuid"),"assets",asset.get("uuid")].join("/");self._client.request({method:"DELETE",endpoint:endpoint},function(err,response){err?doCallback(callback,[new UsergridError(response),response,self],self):doCallback(callback,[null,response,self],self)})}}else doCallback(callback,[new UsergridInvalidArgumentError("No asset specified"),null,self],self)},Usergrid.Folder.prototype.getAssets=function(callback){return 
 this.getConnections("assets",callback)},XMLHttpRequest.prototype.sendAsBinary||(XMLHttpRequest.prototype.sendAsBinary=function(sData){for(var nBytes=sData.length,ui8Data=new Uint8Array(nBytes),nIdx=0;nBytes>nIdx;nIdx++)ui8Data[nIdx]=255&sData.charCodeAt(nIdx);this.send(ui8Data)}),Usergrid.Asset=function(options,callback){var self=this;self._client=options.client,self._data=options.data||{},self._data.type="assets";var missingData=["name","owner","path"].some(function(required){return!(required in self._data)});missingData?doCallback(callback,[new UsergridError("Invalid asset data: 'name', 'owner', and 'path' are required properties."),null,self],self):self.save(function(err,data){err?doCallback(callback,[new UsergridError(data),data,self],self):(data&&data.entities&&data.entities.length&&self.set(data.entities[0]),doCallback(callback,[null,data,self],self))})},Usergrid.Asset.prototype=new Usergrid.Entity,Usergrid.Asset.prototype.addToFolder=function(options,callback){var self=this;i
 f("folder"in options&&isUUID(options.folder)){Usergrid.Folder({uuid:options.folder},function(err,folder){if(err)doCallback(callback,[UsergridError.fromResponse(folder),folder,self],self);else{var endpoint=["folders",folder.get("uuid"),"assets",self.get("uuid")].join("/"),options={method:"POST",endpoint:endpoint};this._client.request(options,function(err,response){err?doCallback(callback,[UsergridError.fromResponse(folder),response,self],self):doCallback(callback,[null,folder,self],self)})}})}else doCallback(callback,[new UsergridError("folder not specified"),null,self],self)},Usergrid.Entity.prototype.attachAsset=function(file,callback){if(!(window.File&&window.FileReader&&window.FileList&&window.Blob))return void doCallback(callback,[new UsergridError("The File APIs are not fully supported by your browser."),null,this],this);var self=this,args=arguments,type=this._data.type,attempts=self.get("attempts");if(isNaN(attempts)&&(attempts=3),"assets"!=type&&"asset"!=type)var endpoint=[th
 is._client.URI,this._client.orgName,this._client.appName,type,self.get("uuid")].join("/");else{self.set("content-type",file.type),self.set("size",file.size);var endpoint=[this._client.URI,this._client.orgName,this._client.appName,"assets",self.get("uuid"),"data"].join("/")}var xhr=new XMLHttpRequest;xhr.open("POST",endpoint,!0),xhr.onerror=function(){doCallback(callback,[new UsergridError("The File APIs are not fully supported by your browser.")],xhr,self)},xhr.onload=function(){xhr.status>=500&&attempts>0?(self.set("attempts",--attempts),setTimeout(function(){self.attachAsset.apply(self,args)},100)):xhr.status>=300?(self.set("attempts"),doCallback(callback,[new UsergridError(JSON.parse(xhr.responseText)),xhr,self],self)):(self.set("attempts"),self.fetch(),doCallback(callback,[null,xhr,self],self))};var fr=new FileReader;fr.onload=function(){var binary=fr.result;("assets"===type||"asset"===type)&&(xhr.overrideMimeType("application/octet-stream"),xhr.setRequestHeader("Content-Type","
 application/octet-stream")),xhr.sendAsBinary(binary)},fr.readAsBinaryString(file)},Usergrid.Asset.prototype.upload=function(data,callback){this.attachAsset(data,function(err,response){err?doCallback(callback,[new UsergridError(err),response,self],self):doCallback(callback,[null,response,self],self)})},Usergrid.Entity.prototype.downloadAsset=function(callback){var endpoint,self=this,type=this._data.type,xhr=new XMLHttpRequest;endpoint="assets"!=type&&"asset"!=type?[this._client.URI,this._client.orgName,this._client.appName,type,self.get("uuid")].join("/"):[this._client.URI,this._client.orgName,this._client.appName,"assets",self.get("uuid"),"data"].join("/"),xhr.open("GET",endpoint,!0),xhr.responseType="blob",xhr.onload=function(){var blob=xhr.response;"assets"!=type&&"asset"!=type?doCallback(callback,[null,blob,xhr],self):doCallback(callback,[null,xhr,self],self)},xhr.onerror=function(err){callback(!0,err),doCallback(callback,[new UsergridError(err),xhr,self],self)},"assets"!=type&&"
 asset"!=type?xhr.setRequestHeader("Accept",self._data["file-metadata"]["content-type"]):xhr.overrideMimeType(self.get("content-type")),xhr.send()},Usergrid.Asset.prototype.download=function(callback){this.downloadAsset(function(err,response){err?doCallback(callback,[new UsergridError(err),response,self],self):doCallback(callback,[null,response,self],self)})},function(global){function UsergridError(message,name,timestamp,duration,exception){this.message=message,this.name=name,this.timestamp=timestamp||Date.now(),this.duration=duration||0,this.exception=exception}function UsergridHTTPResponseError(message,name,timestamp,duration,exception){this.message=message,this.name=name,this.timestamp=timestamp||Date.now(),this.duration=duration||0,this.exception=exception}function UsergridInvalidHTTPMethodError(message,name,timestamp,duration,exception){this.message=message,this.name=name||"invalid_http_method",this.timestamp=timestamp||Date.now(),this.duration=duration||0,this.exception=excepti
 on}function UsergridInvalidURIError(message,name,timestamp,duration,exception){this.message=message,this.name=name||"invalid_uri",this.timestamp=timestamp||Date.now(),this.duration=duration||0,this.exception=exception}function UsergridInvalidArgumentError(message,name,timestamp,duration,exception){this.message=message,this.name=name||"invalid_argument",this.timestamp=timestamp||Date.now(),this.duration=duration||0,this.exception=exception}function UsergridKeystoreDatabaseUpgradeNeededError(message,name,timestamp,duration,exception){this.message=message,this.name=name,this.timestamp=timestamp||Date.now(),this.duration=duration||0,this.exception=exception}var short,name="UsergridError",_name=global[name],_short=short&&void 0!==short?global[short]:void 0;return UsergridError.prototype=new Error,UsergridError.prototype.constructor=UsergridError,UsergridError.fromResponse=function(response){return response&&"undefined"!=typeof response?new UsergridError(response.error_description,respons
 e.error,response.timestamp,response.duration,response.exception):new UsergridError},UsergridError.createSubClass=function(name){return name in global&&global[name]?global[name]:(global[name]=function(){},global[name].name=name,global[name].prototype=new UsergridError,global[name])},UsergridHTTPResponseError.prototype=new UsergridError,UsergridInvalidHTTPMethodError.prototype=new UsergridError,UsergridInvalidURIError.prototype=new UsergridError,UsergridInvalidArgumentError.prototype=new UsergridError,UsergridKeystoreDatabaseUpgradeNeededError.prototype=new UsergridError,global.UsergridHTTPResponseError=UsergridHTTPResponseError,global.UsergridInvalidHTTPMethodError=UsergridInvalidHTTPMethodError,global.UsergridInvalidURIError=UsergridInvalidURIError,global.UsergridInvalidArgumentError=UsergridInvalidArgumentError,global.UsergridKeystoreDatabaseUpgradeNeededError=UsergridKeystoreDatabaseUpgradeNeededError,global[name]=UsergridError,void 0!==short&&(global[short]=UsergridError),global[
 name].noConflict=function(){return _name&&(global[name]=_name),void 0!==short&&(global[short]=_short),UsergridError},global[name]}(this);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/17a9b8c3/stack/core/src/test/resources/usergrid-test-context.xml
----------------------------------------------------------------------
diff --git a/stack/core/src/test/resources/usergrid-test-context.xml b/stack/core/src/test/resources/usergrid-test-context.xml
index d9976b3..ffa7c13 100644
--- a/stack/core/src/test/resources/usergrid-test-context.xml
+++ b/stack/core/src/test/resources/usergrid-test-context.xml
@@ -1,4 +1,20 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
 <beans xmlns="http://www.springframework.org/schema/beans"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:util="http://www.springframework.org/schema/util"

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/17a9b8c3/stack/mongo-emulator/src/test/resources/usergrid-test-context.xml
----------------------------------------------------------------------
diff --git a/stack/mongo-emulator/src/test/resources/usergrid-test-context.xml b/stack/mongo-emulator/src/test/resources/usergrid-test-context.xml
index 4884ecd..6c0fedb 100644
--- a/stack/mongo-emulator/src/test/resources/usergrid-test-context.xml
+++ b/stack/mongo-emulator/src/test/resources/usergrid-test-context.xml
@@ -1,4 +1,20 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
 <beans xmlns="http://www.springframework.org/schema/beans"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
 	xmlns:context="http://www.springframework.org/schema/context"
@@ -29,4 +45,4 @@
 
 	<bean id="databaseInitializer" class="org.apache.usergrid.mongo.DatabaseInitializer"
 		init-method="init" />
-</beans>
+</beans>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/17a9b8c3/ugc/features/step_definitions/ugc_steps.rb
----------------------------------------------------------------------
diff --git a/ugc/features/step_definitions/ugc_steps.rb b/ugc/features/step_definitions/ugc_steps.rb
index edf1dd4..a80cf7d 100644
--- a/ugc/features/step_definitions/ugc_steps.rb
+++ b/ugc/features/step_definitions/ugc_steps.rb
@@ -1,17 +1,18 @@
-#Licensed to the Apache Software Foundation (ASF) under one or more contributor
-#license agreements.  See the NOTICE.txt 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
+
+# Licensed to the Apache Software Foundation (ASF) under one or more contributor
+# license agreements.  See the NOTICE.txt 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.
+# 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.
 
 When /^I get help for "([^"]*)"$/ do |app_name|
   @app_name = app_name

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/17a9b8c3/ugc/features/support/env.rb
----------------------------------------------------------------------
diff --git a/ugc/features/support/env.rb b/ugc/features/support/env.rb
index b798cd0..c9be109 100644
--- a/ugc/features/support/env.rb
+++ b/ugc/features/support/env.rb
@@ -1,17 +1,18 @@
-#Licensed to the Apache Software Foundation (ASF) under one or more contributor
-#license agreements.  See the NOTICE.txt 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
+
+# Licensed to the Apache Software Foundation (ASF) under one or more contributor
+# license agreements.  See the NOTICE.txt 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.
+# 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.
 
 require 'aruba/cucumber'
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/17a9b8c3/ugc/lib/ugc.rb
----------------------------------------------------------------------
diff --git a/ugc/lib/ugc.rb b/ugc/lib/ugc.rb
index 73444a8..9c2d765 100644
--- a/ugc/lib/ugc.rb
+++ b/ugc/lib/ugc.rb
@@ -1,17 +1,18 @@
-#Licensed to the Apache Software Foundation (ASF) under one or more contributor
-#license agreements.  See the NOTICE.txt 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
+
+# Licensed to the Apache Software Foundation (ASF) under one or more contributor
+# license agreements.  See the NOTICE.txt 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.
+# 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.
 
 require 'ugc/version.rb'
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/17a9b8c3/ugc/lib/ugc/application.rb
----------------------------------------------------------------------
diff --git a/ugc/lib/ugc/application.rb b/ugc/lib/ugc/application.rb
index 2ea5e0d..cadaff2 100644
--- a/ugc/lib/ugc/application.rb
+++ b/ugc/lib/ugc/application.rb
@@ -1,17 +1,18 @@
-#Licensed to the Apache Software Foundation (ASF) under one or more contributor
-#license agreements.  See the NOTICE.txt 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
+
+# Licensed to the Apache Software Foundation (ASF) under one or more contributor
+# license agreements.  See the NOTICE.txt 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.
+# 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.
 
 module Ugc
   class Application < Usergrid::Application

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/17a9b8c3/ugc/lib/ugc/commands/delete.rb
----------------------------------------------------------------------
diff --git a/ugc/lib/ugc/commands/delete.rb b/ugc/lib/ugc/commands/delete.rb
index 16923dd..da6409f 100644
--- a/ugc/lib/ugc/commands/delete.rb
+++ b/ugc/lib/ugc/commands/delete.rb
@@ -1,17 +1,18 @@
-#Licensed to the Apache Software Foundation (ASF) under one or more contributor
-#license agreements.  See the NOTICE.txt 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
+
+# Licensed to the Apache Software Foundation (ASF) under one or more contributor
+# license agreements.  See the NOTICE.txt 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.
+# 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.
 
 desc 'delete an entity'
 arg_name 'url'

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/17a9b8c3/ugc/lib/ugc/commands/get.rb
----------------------------------------------------------------------
diff --git a/ugc/lib/ugc/commands/get.rb b/ugc/lib/ugc/commands/get.rb
index b987f41..712d0d2 100644
--- a/ugc/lib/ugc/commands/get.rb
+++ b/ugc/lib/ugc/commands/get.rb
@@ -1,17 +1,18 @@
-#Licensed to the Apache Software Foundation (ASF) under one or more contributor
-#license agreements.  See the NOTICE.txt 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
+
+# Licensed to the Apache Software Foundation (ASF) under one or more contributor
+# license agreements.  See the NOTICE.txt 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.
+# 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.
 
 desc 'retrieve and display a collection or entity'
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/17a9b8c3/ugc/lib/ugc/commands/logout.rb
----------------------------------------------------------------------
diff --git a/ugc/lib/ugc/commands/logout.rb b/ugc/lib/ugc/commands/logout.rb
index 4b92934..b52e620 100644
--- a/ugc/lib/ugc/commands/logout.rb
+++ b/ugc/lib/ugc/commands/logout.rb
@@ -1,3 +1,19 @@
+
+# Licensed to the Apache Software Foundation (ASF) under one or more contributor
+# license agreements.  See the NOTICE.txt 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.
+
 desc 'Performs a logout on the current profile'
 
 command :logout do |c|

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/17a9b8c3/ugc/lib/ugc/commands/post.rb
----------------------------------------------------------------------
diff --git a/ugc/lib/ugc/commands/post.rb b/ugc/lib/ugc/commands/post.rb
index 91fa257..083d3b8 100644
--- a/ugc/lib/ugc/commands/post.rb
+++ b/ugc/lib/ugc/commands/post.rb
@@ -1,17 +1,18 @@
-#Licensed to the Apache Software Foundation (ASF) under one or more contributor
-#license agreements.  See the NOTICE.txt 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
+
+# Licensed to the Apache Software Foundation (ASF) under one or more contributor
+# license agreements.  See the NOTICE.txt 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.
+# 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.
 
 desc 'non-idempotent create or update (post is usually create)'
 arg_name '[path] [data]'

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/17a9b8c3/ugc/lib/ugc/commands/profile.rb
----------------------------------------------------------------------
diff --git a/ugc/lib/ugc/commands/profile.rb b/ugc/lib/ugc/commands/profile.rb
index 4482a3a..cb1de69 100644
--- a/ugc/lib/ugc/commands/profile.rb
+++ b/ugc/lib/ugc/commands/profile.rb
@@ -1,17 +1,18 @@
-#Licensed to the Apache Software Foundation (ASF) under one or more contributor
-#license agreements.  See the NOTICE.txt 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
+
+# Licensed to the Apache Software Foundation (ASF) under one or more contributor
+# license agreements.  See the NOTICE.txt 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.
+# 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.
 
 desc "set the current profile (creates if it doesn't exist)"
 arg_name 'profile name'

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/17a9b8c3/ugc/lib/ugc/commands/put.rb
----------------------------------------------------------------------
diff --git a/ugc/lib/ugc/commands/put.rb b/ugc/lib/ugc/commands/put.rb
index 62fe6f5..e307bd0 100644
--- a/ugc/lib/ugc/commands/put.rb
+++ b/ugc/lib/ugc/commands/put.rb
@@ -1,17 +1,18 @@
-#Licensed to the Apache Software Foundation (ASF) under one or more contributor
-#license agreements.  See the NOTICE.txt 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
+
+# Licensed to the Apache Software Foundation (ASF) under one or more contributor
+# license agreements.  See the NOTICE.txt 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.
+# 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.
 
 desc 'idempotent create or update (put is usually an update)'
 arg_name '[path] [data]'


[02/52] [abbrv] Fix for the way that arrays are serialized by JSON and a test to verify that arrays work as expected.

Posted by gr...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4e428e36/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/tree/CpQueryFilterLexer.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/tree/CpQueryFilterLexer.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/tree/CpQueryFilterLexer.java
deleted file mode 100644
index 20cf4a1..0000000
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/tree/CpQueryFilterLexer.java
+++ /dev/null
@@ -1,3123 +0,0 @@
-// $ANTLR 3.4 org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g 2014-08-25 10:56:14
-
-/*
- * 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.query.tree;
-
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.usergrid.persistence.index.exceptions.QueryTokenException;
-
-
-
-import org.antlr.runtime.*;
-import java.util.Stack;
-import java.util.List;
-import java.util.ArrayList;
-
-@SuppressWarnings({"all", "warnings", "unchecked"})
-public class CpQueryFilterLexer extends Lexer {
-    public static final int EOF=-1;
-    public static final int T__31=31;
-    public static final int T__32=32;
-    public static final int T__33=33;
-    public static final int T__34=34;
-    public static final int T__35=35;
-    public static final int T__36=36;
-    public static final int T__37=37;
-    public static final int T__38=38;
-    public static final int T__39=39;
-    public static final int T__40=40;
-    public static final int AND=4;
-    public static final int ASC=5;
-    public static final int BOOLEAN=6;
-    public static final int CONTAINS=7;
-    public static final int DESC=8;
-    public static final int EQ=9;
-    public static final int ESC_SEQ=10;
-    public static final int EXPONENT=11;
-    public static final int FALSE=12;
-    public static final int FLOAT=13;
-    public static final int GT=14;
-    public static final int GTE=15;
-    public static final int HEX_DIGIT=16;
-    public static final int ID=17;
-    public static final int LONG=18;
-    public static final int LT=19;
-    public static final int LTE=20;
-    public static final int NOT=21;
-    public static final int OCTAL_ESC=22;
-    public static final int OF=23;
-    public static final int OR=24;
-    public static final int STRING=25;
-    public static final int TRUE=26;
-    public static final int UNICODE_ESC=27;
-    public static final int UUID=28;
-    public static final int WITHIN=29;
-    public static final int WS=30;
-
-
-
-
-      private static final Logger logger = LoggerFactory
-          .getLogger(CpQueryFilterLexer.class);
-
-
-
-
-    	@Override
-    	public void emitErrorMessage(String msg) {
-    		logger.info(msg);
-    	}
-
-    	@Override
-        public void recover(RecognitionException e) {
-             //We don't want to recover, we want to re-throw to the user since they passed us invalid input
-             throw new QueryTokenException(e);
-        }
-
-
-
-
-    // delegates
-    // delegators
-    public Lexer[] getDelegates() {
-        return new Lexer[] {};
-    }
-
-    public CpQueryFilterLexer() {} 
-    public CpQueryFilterLexer(CharStream input) {
-        this(input, new RecognizerSharedState());
-    }
-    public CpQueryFilterLexer(CharStream input, RecognizerSharedState state) {
-        super(input,state);
-    }
-    public String getGrammarFileName() { return "org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g"; }
-
-    // $ANTLR start "T__31"
-    public final void mT__31() throws RecognitionException {
-        try {
-            int _type = T__31;
-            int _channel = DEFAULT_TOKEN_CHANNEL;
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:52:7: ( '(' )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:52:9: '('
-            {
-            match('('); 
-
-            }
-
-            state.type = _type;
-            state.channel = _channel;
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "T__31"
-
-    // $ANTLR start "T__32"
-    public final void mT__32() throws RecognitionException {
-        try {
-            int _type = T__32;
-            int _channel = DEFAULT_TOKEN_CHANNEL;
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:53:7: ( ')' )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:53:9: ')'
-            {
-            match(')'); 
-
-            }
-
-            state.type = _type;
-            state.channel = _channel;
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "T__32"
-
-    // $ANTLR start "T__33"
-    public final void mT__33() throws RecognitionException {
-        try {
-            int _type = T__33;
-            int _channel = DEFAULT_TOKEN_CHANNEL;
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:54:7: ( '*' )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:54:9: '*'
-            {
-            match('*'); 
-
-            }
-
-            state.type = _type;
-            state.channel = _channel;
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "T__33"
-
-    // $ANTLR start "T__34"
-    public final void mT__34() throws RecognitionException {
-        try {
-            int _type = T__34;
-            int _channel = DEFAULT_TOKEN_CHANNEL;
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:55:7: ( ',' )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:55:9: ','
-            {
-            match(','); 
-
-            }
-
-            state.type = _type;
-            state.channel = _channel;
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "T__34"
-
-    // $ANTLR start "T__35"
-    public final void mT__35() throws RecognitionException {
-        try {
-            int _type = T__35;
-            int _channel = DEFAULT_TOKEN_CHANNEL;
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:56:7: ( ':' )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:56:9: ':'
-            {
-            match(':'); 
-
-            }
-
-            state.type = _type;
-            state.channel = _channel;
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "T__35"
-
-    // $ANTLR start "T__36"
-    public final void mT__36() throws RecognitionException {
-        try {
-            int _type = T__36;
-            int _channel = DEFAULT_TOKEN_CHANNEL;
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:57:7: ( 'order by' )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:57:9: 'order by'
-            {
-            match("order by"); 
-
-
-
-            }
-
-            state.type = _type;
-            state.channel = _channel;
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "T__36"
-
-    // $ANTLR start "T__37"
-    public final void mT__37() throws RecognitionException {
-        try {
-            int _type = T__37;
-            int _channel = DEFAULT_TOKEN_CHANNEL;
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:58:7: ( 'select' )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:58:9: 'select'
-            {
-            match("select"); 
-
-
-
-            }
-
-            state.type = _type;
-            state.channel = _channel;
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "T__37"
-
-    // $ANTLR start "T__38"
-    public final void mT__38() throws RecognitionException {
-        try {
-            int _type = T__38;
-            int _channel = DEFAULT_TOKEN_CHANNEL;
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:59:7: ( 'where' )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:59:9: 'where'
-            {
-            match("where"); 
-
-
-
-            }
-
-            state.type = _type;
-            state.channel = _channel;
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "T__38"
-
-    // $ANTLR start "T__39"
-    public final void mT__39() throws RecognitionException {
-        try {
-            int _type = T__39;
-            int _channel = DEFAULT_TOKEN_CHANNEL;
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:60:7: ( '{' )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:60:9: '{'
-            {
-            match('{'); 
-
-            }
-
-            state.type = _type;
-            state.channel = _channel;
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "T__39"
-
-    // $ANTLR start "T__40"
-    public final void mT__40() throws RecognitionException {
-        try {
-            int _type = T__40;
-            int _channel = DEFAULT_TOKEN_CHANNEL;
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:61:7: ( '}' )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:61:9: '}'
-            {
-            match('}'); 
-
-            }
-
-            state.type = _type;
-            state.channel = _channel;
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "T__40"
-
-    // $ANTLR start "LT"
-    public final void mLT() throws RecognitionException {
-        try {
-            int _type = LT;
-            int _channel = DEFAULT_TOKEN_CHANNEL;
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:105:5: ( '<' | 'lt' )
-            int alt1=2;
-            switch ( input.LA(1) ) {
-            case '<':
-                {
-                alt1=1;
-                }
-                break;
-            case 'l':
-                {
-                alt1=2;
-                }
-                break;
-            default:
-                NoViableAltException nvae =
-                    new NoViableAltException("", 1, 0, input);
-
-                throw nvae;
-
-            }
-
-            switch (alt1) {
-                case 1 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:105:7: '<'
-                    {
-                    match('<'); 
-
-                    }
-                    break;
-                case 2 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:105:13: 'lt'
-                    {
-                    match("lt"); 
-
-
-
-                    }
-                    break;
-
-            }
-            state.type = _type;
-            state.channel = _channel;
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "LT"
-
-    // $ANTLR start "LTE"
-    public final void mLTE() throws RecognitionException {
-        try {
-            int _type = LTE;
-            int _channel = DEFAULT_TOKEN_CHANNEL;
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:107:5: ( '<=' | 'lte' )
-            int alt2=2;
-            switch ( input.LA(1) ) {
-            case '<':
-                {
-                alt2=1;
-                }
-                break;
-            case 'l':
-                {
-                alt2=2;
-                }
-                break;
-            default:
-                NoViableAltException nvae =
-                    new NoViableAltException("", 2, 0, input);
-
-                throw nvae;
-
-            }
-
-            switch (alt2) {
-                case 1 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:107:7: '<='
-                    {
-                    match("<="); 
-
-
-
-                    }
-                    break;
-                case 2 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:107:15: 'lte'
-                    {
-                    match("lte"); 
-
-
-
-                    }
-                    break;
-
-            }
-            state.type = _type;
-            state.channel = _channel;
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "LTE"
-
-    // $ANTLR start "EQ"
-    public final void mEQ() throws RecognitionException {
-        try {
-            int _type = EQ;
-            int _channel = DEFAULT_TOKEN_CHANNEL;
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:109:5: ( '=' | 'eq' )
-            int alt3=2;
-            switch ( input.LA(1) ) {
-            case '=':
-                {
-                alt3=1;
-                }
-                break;
-            case 'e':
-                {
-                alt3=2;
-                }
-                break;
-            default:
-                NoViableAltException nvae =
-                    new NoViableAltException("", 3, 0, input);
-
-                throw nvae;
-
-            }
-
-            switch (alt3) {
-                case 1 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:109:7: '='
-                    {
-                    match('='); 
-
-                    }
-                    break;
-                case 2 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:109:13: 'eq'
-                    {
-                    match("eq"); 
-
-
-
-                    }
-                    break;
-
-            }
-            state.type = _type;
-            state.channel = _channel;
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "EQ"
-
-    // $ANTLR start "GT"
-    public final void mGT() throws RecognitionException {
-        try {
-            int _type = GT;
-            int _channel = DEFAULT_TOKEN_CHANNEL;
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:111:5: ( '>' | 'gt' )
-            int alt4=2;
-            switch ( input.LA(1) ) {
-            case '>':
-                {
-                alt4=1;
-                }
-                break;
-            case 'g':
-                {
-                alt4=2;
-                }
-                break;
-            default:
-                NoViableAltException nvae =
-                    new NoViableAltException("", 4, 0, input);
-
-                throw nvae;
-
-            }
-
-            switch (alt4) {
-                case 1 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:111:7: '>'
-                    {
-                    match('>'); 
-
-                    }
-                    break;
-                case 2 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:111:13: 'gt'
-                    {
-                    match("gt"); 
-
-
-
-                    }
-                    break;
-
-            }
-            state.type = _type;
-            state.channel = _channel;
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "GT"
-
-    // $ANTLR start "GTE"
-    public final void mGTE() throws RecognitionException {
-        try {
-            int _type = GTE;
-            int _channel = DEFAULT_TOKEN_CHANNEL;
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:113:5: ( '>=' | 'gte' )
-            int alt5=2;
-            switch ( input.LA(1) ) {
-            case '>':
-                {
-                alt5=1;
-                }
-                break;
-            case 'g':
-                {
-                alt5=2;
-                }
-                break;
-            default:
-                NoViableAltException nvae =
-                    new NoViableAltException("", 5, 0, input);
-
-                throw nvae;
-
-            }
-
-            switch (alt5) {
-                case 1 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:113:7: '>='
-                    {
-                    match(">="); 
-
-
-
-                    }
-                    break;
-                case 2 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:113:15: 'gte'
-                    {
-                    match("gte"); 
-
-
-
-                    }
-                    break;
-
-            }
-            state.type = _type;
-            state.channel = _channel;
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "GTE"
-
-    // $ANTLR start "BOOLEAN"
-    public final void mBOOLEAN() throws RecognitionException {
-        try {
-            int _type = BOOLEAN;
-            int _channel = DEFAULT_TOKEN_CHANNEL;
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:117:9: ( ( TRUE | FALSE ) )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:117:11: ( TRUE | FALSE )
-            {
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:117:11: ( TRUE | FALSE )
-            int alt6=2;
-            switch ( input.LA(1) ) {
-            case 'T':
-            case 't':
-                {
-                alt6=1;
-                }
-                break;
-            case 'F':
-            case 'f':
-                {
-                alt6=2;
-                }
-                break;
-            default:
-                NoViableAltException nvae =
-                    new NoViableAltException("", 6, 0, input);
-
-                throw nvae;
-
-            }
-
-            switch (alt6) {
-                case 1 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:117:12: TRUE
-                    {
-                    mTRUE(); 
-
-
-                    }
-                    break;
-                case 2 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:117:17: FALSE
-                    {
-                    mFALSE(); 
-
-
-                    }
-                    break;
-
-            }
-
-
-            }
-
-            state.type = _type;
-            state.channel = _channel;
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "BOOLEAN"
-
-    // $ANTLR start "AND"
-    public final void mAND() throws RecognitionException {
-        try {
-            int _type = AND;
-            int _channel = DEFAULT_TOKEN_CHANNEL;
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:119:5: ( ( 'A' | 'a' ) ( 'N' | 'n' ) ( 'D' | 'd' ) | '&&' )
-            int alt7=2;
-            switch ( input.LA(1) ) {
-            case 'A':
-            case 'a':
-                {
-                alt7=1;
-                }
-                break;
-            case '&':
-                {
-                alt7=2;
-                }
-                break;
-            default:
-                NoViableAltException nvae =
-                    new NoViableAltException("", 7, 0, input);
-
-                throw nvae;
-
-            }
-
-            switch (alt7) {
-                case 1 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:119:7: ( 'A' | 'a' ) ( 'N' | 'n' ) ( 'D' | 'd' )
-                    {
-                    if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
-                        input.consume();
-                    }
-                    else {
-                        MismatchedSetException mse = new MismatchedSetException(null,input);
-                        recover(mse);
-                        throw mse;
-                    }
-
-
-                    if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
-                        input.consume();
-                    }
-                    else {
-                        MismatchedSetException mse = new MismatchedSetException(null,input);
-                        recover(mse);
-                        throw mse;
-                    }
-
-
-                    if ( input.LA(1)=='D'||input.LA(1)=='d' ) {
-                        input.consume();
-                    }
-                    else {
-                        MismatchedSetException mse = new MismatchedSetException(null,input);
-                        recover(mse);
-                        throw mse;
-                    }
-
-
-                    }
-                    break;
-                case 2 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:119:37: '&&'
-                    {
-                    match("&&"); 
-
-
-
-                    }
-                    break;
-
-            }
-            state.type = _type;
-            state.channel = _channel;
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "AND"
-
-    // $ANTLR start "OR"
-    public final void mOR() throws RecognitionException {
-        try {
-            int _type = OR;
-            int _channel = DEFAULT_TOKEN_CHANNEL;
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:121:5: ( ( 'O' | 'o' ) ( 'R' | 'r' ) | '||' )
-            int alt8=2;
-            switch ( input.LA(1) ) {
-            case 'O':
-            case 'o':
-                {
-                alt8=1;
-                }
-                break;
-            case '|':
-                {
-                alt8=2;
-                }
-                break;
-            default:
-                NoViableAltException nvae =
-                    new NoViableAltException("", 8, 0, input);
-
-                throw nvae;
-
-            }
-
-            switch (alt8) {
-                case 1 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:121:7: ( 'O' | 'o' ) ( 'R' | 'r' )
-                    {
-                    if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
-                        input.consume();
-                    }
-                    else {
-                        MismatchedSetException mse = new MismatchedSetException(null,input);
-                        recover(mse);
-                        throw mse;
-                    }
-
-
-                    if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
-                        input.consume();
-                    }
-                    else {
-                        MismatchedSetException mse = new MismatchedSetException(null,input);
-                        recover(mse);
-                        throw mse;
-                    }
-
-
-                    }
-                    break;
-                case 2 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:121:28: '||'
-                    {
-                    match("||"); 
-
-
-
-                    }
-                    break;
-
-            }
-            state.type = _type;
-            state.channel = _channel;
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "OR"
-
-    // $ANTLR start "NOT"
-    public final void mNOT() throws RecognitionException {
-        try {
-            int _type = NOT;
-            int _channel = DEFAULT_TOKEN_CHANNEL;
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:123:5: ( ( 'N' | 'n' ) ( 'O' | 'o' ) ( 'T' | 't' ) )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:123:7: ( 'N' | 'n' ) ( 'O' | 'o' ) ( 'T' | 't' )
-            {
-            if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            }
-
-            state.type = _type;
-            state.channel = _channel;
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "NOT"
-
-    // $ANTLR start "ASC"
-    public final void mASC() throws RecognitionException {
-        try {
-            int _type = ASC;
-            int _channel = DEFAULT_TOKEN_CHANNEL;
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:125:5: ( ( 'A' | 'a' ) ( 'S' | 's' ) ( 'C' | 'c' ) )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:125:7: ( 'A' | 'a' ) ( 'S' | 's' ) ( 'C' | 'c' )
-            {
-            if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            if ( input.LA(1)=='C'||input.LA(1)=='c' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            }
-
-            state.type = _type;
-            state.channel = _channel;
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "ASC"
-
-    // $ANTLR start "DESC"
-    public final void mDESC() throws RecognitionException {
-        try {
-            int _type = DESC;
-            int _channel = DEFAULT_TOKEN_CHANNEL;
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:127:6: ( ( 'D' | 'd' ) ( 'E' | 'e' ) ( 'S' | 's' ) ( 'C' | 'c' ) )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:127:8: ( 'D' | 'd' ) ( 'E' | 'e' ) ( 'S' | 's' ) ( 'C' | 'c' )
-            {
-            if ( input.LA(1)=='D'||input.LA(1)=='d' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            if ( input.LA(1)=='C'||input.LA(1)=='c' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            }
-
-            state.type = _type;
-            state.channel = _channel;
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "DESC"
-
-    // $ANTLR start "CONTAINS"
-    public final void mCONTAINS() throws RecognitionException {
-        try {
-            int _type = CONTAINS;
-            int _channel = DEFAULT_TOKEN_CHANNEL;
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:129:10: ( ( 'C' | 'c' ) ( 'O' | 'o' ) ( 'N' | 'n' ) ( 'T' | 't' ) ( 'A' | 'a' ) ( 'I' | 'i' ) ( 'N' | 'n' ) ( 'S' | 's' ) )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:129:12: ( 'C' | 'c' ) ( 'O' | 'o' ) ( 'N' | 'n' ) ( 'T' | 't' ) ( 'A' | 'a' ) ( 'I' | 'i' ) ( 'N' | 'n' ) ( 'S' | 's' )
-            {
-            if ( input.LA(1)=='C'||input.LA(1)=='c' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            }
-
-            state.type = _type;
-            state.channel = _channel;
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "CONTAINS"
-
-    // $ANTLR start "WITHIN"
-    public final void mWITHIN() throws RecognitionException {
-        try {
-            int _type = WITHIN;
-            int _channel = DEFAULT_TOKEN_CHANNEL;
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:131:8: ( ( 'W' | 'w' ) ( 'I' | 'i' ) ( 'T' | 't' ) ( 'H' | 'h' ) ( 'I' | 'i' ) ( 'N' | 'n' ) )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:131:10: ( 'W' | 'w' ) ( 'I' | 'i' ) ( 'T' | 't' ) ( 'H' | 'h' ) ( 'I' | 'i' ) ( 'N' | 'n' )
-            {
-            if ( input.LA(1)=='W'||input.LA(1)=='w' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            if ( input.LA(1)=='H'||input.LA(1)=='h' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            }
-
-            state.type = _type;
-            state.channel = _channel;
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "WITHIN"
-
-    // $ANTLR start "OF"
-    public final void mOF() throws RecognitionException {
-        try {
-            int _type = OF;
-            int _channel = DEFAULT_TOKEN_CHANNEL;
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:133:4: ( ( 'O' | 'o' ) ( 'F' | 'f' ) )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:133:6: ( 'O' | 'o' ) ( 'F' | 'f' )
-            {
-            if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            if ( input.LA(1)=='F'||input.LA(1)=='f' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            }
-
-            state.type = _type;
-            state.channel = _channel;
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "OF"
-
-    // $ANTLR start "UUID"
-    public final void mUUID() throws RecognitionException {
-        try {
-            int _type = UUID;
-            int _channel = DEFAULT_TOKEN_CHANNEL;
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:135:6: ( HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT '-' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT '-' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT '-' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT '-' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:135:9: HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT '-' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT '-' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT '-' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT '-' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT
-            {
-            mHEX_DIGIT(); 
-
-
-            mHEX_DIGIT(); 
-
-
-            mHEX_DIGIT(); 
-
-
-            mHEX_DIGIT(); 
-
-
-            mHEX_DIGIT(); 
-
-
-            mHEX_DIGIT(); 
-
-
-            mHEX_DIGIT(); 
-
-
-            mHEX_DIGIT(); 
-
-
-            match('-'); 
-
-            mHEX_DIGIT(); 
-
-
-            mHEX_DIGIT(); 
-
-
-            mHEX_DIGIT(); 
-
-
-            mHEX_DIGIT(); 
-
-
-            match('-'); 
-
-            mHEX_DIGIT(); 
-
-
-            mHEX_DIGIT(); 
-
-
-            mHEX_DIGIT(); 
-
-
-            mHEX_DIGIT(); 
-
-
-            match('-'); 
-
-            mHEX_DIGIT(); 
-
-
-            mHEX_DIGIT(); 
-
-
-            mHEX_DIGIT(); 
-
-
-            mHEX_DIGIT(); 
-
-
-            match('-'); 
-
-            mHEX_DIGIT(); 
-
-
-            mHEX_DIGIT(); 
-
-
-            mHEX_DIGIT(); 
-
-
-            mHEX_DIGIT(); 
-
-
-            mHEX_DIGIT(); 
-
-
-            mHEX_DIGIT(); 
-
-
-            mHEX_DIGIT(); 
-
-
-            mHEX_DIGIT(); 
-
-
-            mHEX_DIGIT(); 
-
-
-            mHEX_DIGIT(); 
-
-
-            mHEX_DIGIT(); 
-
-
-            mHEX_DIGIT(); 
-
-
-            }
-
-            state.type = _type;
-            state.channel = _channel;
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "UUID"
-
-    // $ANTLR start "ID"
-    public final void mID() throws RecognitionException {
-        try {
-            int _type = ID;
-            int _channel = DEFAULT_TOKEN_CHANNEL;
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:146:5: ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' | '.' | '-' )* )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:146:7: ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' | '.' | '-' )*
-            {
-            if ( (input.LA(1) >= 'A' && input.LA(1) <= 'Z')||input.LA(1)=='_'||(input.LA(1) >= 'a' && input.LA(1) <= 'z') ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:146:31: ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' | '.' | '-' )*
-            loop9:
-            do {
-                int alt9=2;
-                switch ( input.LA(1) ) {
-                case '-':
-                case '.':
-                case '0':
-                case '1':
-                case '2':
-                case '3':
-                case '4':
-                case '5':
-                case '6':
-                case '7':
-                case '8':
-                case '9':
-                case 'A':
-                case 'B':
-                case 'C':
-                case 'D':
-                case 'E':
-                case 'F':
-                case 'G':
-                case 'H':
-                case 'I':
-                case 'J':
-                case 'K':
-                case 'L':
-                case 'M':
-                case 'N':
-                case 'O':
-                case 'P':
-                case 'Q':
-                case 'R':
-                case 'S':
-                case 'T':
-                case 'U':
-                case 'V':
-                case 'W':
-                case 'X':
-                case 'Y':
-                case 'Z':
-                case '_':
-                case 'a':
-                case 'b':
-                case 'c':
-                case 'd':
-                case 'e':
-                case 'f':
-                case 'g':
-                case 'h':
-                case 'i':
-                case 'j':
-                case 'k':
-                case 'l':
-                case 'm':
-                case 'n':
-                case 'o':
-                case 'p':
-                case 'q':
-                case 'r':
-                case 's':
-                case 't':
-                case 'u':
-                case 'v':
-                case 'w':
-                case 'x':
-                case 'y':
-                case 'z':
-                    {
-                    alt9=1;
-                    }
-                    break;
-
-                }
-
-                switch (alt9) {
-            	case 1 :
-            	    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:
-            	    {
-            	    if ( (input.LA(1) >= '-' && input.LA(1) <= '.')||(input.LA(1) >= '0' && input.LA(1) <= '9')||(input.LA(1) >= 'A' && input.LA(1) <= 'Z')||input.LA(1)=='_'||(input.LA(1) >= 'a' && input.LA(1) <= 'z') ) {
-            	        input.consume();
-            	    }
-            	    else {
-            	        MismatchedSetException mse = new MismatchedSetException(null,input);
-            	        recover(mse);
-            	        throw mse;
-            	    }
-
-
-            	    }
-            	    break;
-
-            	default :
-            	    break loop9;
-                }
-            } while (true);
-
-
-            }
-
-            state.type = _type;
-            state.channel = _channel;
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "ID"
-
-    // $ANTLR start "LONG"
-    public final void mLONG() throws RecognitionException {
-        try {
-            int _type = LONG;
-            int _channel = DEFAULT_TOKEN_CHANNEL;
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:149:6: ( ( '-' )? ( '0' .. '9' )+ )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:149:8: ( '-' )? ( '0' .. '9' )+
-            {
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:149:8: ( '-' )?
-            int alt10=2;
-            switch ( input.LA(1) ) {
-                case '-':
-                    {
-                    alt10=1;
-                    }
-                    break;
-            }
-
-            switch (alt10) {
-                case 1 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:149:9: '-'
-                    {
-                    match('-'); 
-
-                    }
-                    break;
-
-            }
-
-
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:149:15: ( '0' .. '9' )+
-            int cnt11=0;
-            loop11:
-            do {
-                int alt11=2;
-                switch ( input.LA(1) ) {
-                case '0':
-                case '1':
-                case '2':
-                case '3':
-                case '4':
-                case '5':
-                case '6':
-                case '7':
-                case '8':
-                case '9':
-                    {
-                    alt11=1;
-                    }
-                    break;
-
-                }
-
-                switch (alt11) {
-            	case 1 :
-            	    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:
-            	    {
-            	    if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) {
-            	        input.consume();
-            	    }
-            	    else {
-            	        MismatchedSetException mse = new MismatchedSetException(null,input);
-            	        recover(mse);
-            	        throw mse;
-            	    }
-
-
-            	    }
-            	    break;
-
-            	default :
-            	    if ( cnt11 >= 1 ) break loop11;
-                        EarlyExitException eee =
-                            new EarlyExitException(11, input);
-                        throw eee;
-                }
-                cnt11++;
-            } while (true);
-
-
-            }
-
-            state.type = _type;
-            state.channel = _channel;
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "LONG"
-
-    // $ANTLR start "FLOAT"
-    public final void mFLOAT() throws RecognitionException {
-        try {
-            int _type = FLOAT;
-            int _channel = DEFAULT_TOKEN_CHANNEL;
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:153:5: ( ( '-' )? ( ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( EXPONENT )? | '.' ( '0' .. '9' )+ ( EXPONENT )? | ( '0' .. '9' )+ EXPONENT ) )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:153:8: ( '-' )? ( ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( EXPONENT )? | '.' ( '0' .. '9' )+ ( EXPONENT )? | ( '0' .. '9' )+ EXPONENT )
-            {
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:153:8: ( '-' )?
-            int alt12=2;
-            switch ( input.LA(1) ) {
-                case '-':
-                    {
-                    alt12=1;
-                    }
-                    break;
-            }
-
-            switch (alt12) {
-                case 1 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:153:9: '-'
-                    {
-                    match('-'); 
-
-                    }
-                    break;
-
-            }
-
-
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:153:15: ( ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( EXPONENT )? | '.' ( '0' .. '9' )+ ( EXPONENT )? | ( '0' .. '9' )+ EXPONENT )
-            int alt19=3;
-            alt19 = dfa19.predict(input);
-            switch (alt19) {
-                case 1 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:153:17: ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( EXPONENT )?
-                    {
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:153:17: ( '0' .. '9' )+
-                    int cnt13=0;
-                    loop13:
-                    do {
-                        int alt13=2;
-                        switch ( input.LA(1) ) {
-                        case '0':
-                        case '1':
-                        case '2':
-                        case '3':
-                        case '4':
-                        case '5':
-                        case '6':
-                        case '7':
-                        case '8':
-                        case '9':
-                            {
-                            alt13=1;
-                            }
-                            break;
-
-                        }
-
-                        switch (alt13) {
-                    	case 1 :
-                    	    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:
-                    	    {
-                    	    if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) {
-                    	        input.consume();
-                    	    }
-                    	    else {
-                    	        MismatchedSetException mse = new MismatchedSetException(null,input);
-                    	        recover(mse);
-                    	        throw mse;
-                    	    }
-
-
-                    	    }
-                    	    break;
-
-                    	default :
-                    	    if ( cnt13 >= 1 ) break loop13;
-                                EarlyExitException eee =
-                                    new EarlyExitException(13, input);
-                                throw eee;
-                        }
-                        cnt13++;
-                    } while (true);
-
-
-                    match('.'); 
-
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:153:33: ( '0' .. '9' )*
-                    loop14:
-                    do {
-                        int alt14=2;
-                        switch ( input.LA(1) ) {
-                        case '0':
-                        case '1':
-                        case '2':
-                        case '3':
-                        case '4':
-                        case '5':
-                        case '6':
-                        case '7':
-                        case '8':
-                        case '9':
-                            {
-                            alt14=1;
-                            }
-                            break;
-
-                        }
-
-                        switch (alt14) {
-                    	case 1 :
-                    	    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:
-                    	    {
-                    	    if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) {
-                    	        input.consume();
-                    	    }
-                    	    else {
-                    	        MismatchedSetException mse = new MismatchedSetException(null,input);
-                    	        recover(mse);
-                    	        throw mse;
-                    	    }
-
-
-                    	    }
-                    	    break;
-
-                    	default :
-                    	    break loop14;
-                        }
-                    } while (true);
-
-
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:153:45: ( EXPONENT )?
-                    int alt15=2;
-                    switch ( input.LA(1) ) {
-                        case 'E':
-                        case 'e':
-                            {
-                            alt15=1;
-                            }
-                            break;
-                    }
-
-                    switch (alt15) {
-                        case 1 :
-                            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:153:45: EXPONENT
-                            {
-                            mEXPONENT(); 
-
-
-                            }
-                            break;
-
-                    }
-
-
-                    }
-                    break;
-                case 2 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:154:9: '.' ( '0' .. '9' )+ ( EXPONENT )?
-                    {
-                    match('.'); 
-
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:154:13: ( '0' .. '9' )+
-                    int cnt16=0;
-                    loop16:
-                    do {
-                        int alt16=2;
-                        switch ( input.LA(1) ) {
-                        case '0':
-                        case '1':
-                        case '2':
-                        case '3':
-                        case '4':
-                        case '5':
-                        case '6':
-                        case '7':
-                        case '8':
-                        case '9':
-                            {
-                            alt16=1;
-                            }
-                            break;
-
-                        }
-
-                        switch (alt16) {
-                    	case 1 :
-                    	    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:
-                    	    {
-                    	    if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) {
-                    	        input.consume();
-                    	    }
-                    	    else {
-                    	        MismatchedSetException mse = new MismatchedSetException(null,input);
-                    	        recover(mse);
-                    	        throw mse;
-                    	    }
-
-
-                    	    }
-                    	    break;
-
-                    	default :
-                    	    if ( cnt16 >= 1 ) break loop16;
-                                EarlyExitException eee =
-                                    new EarlyExitException(16, input);
-                                throw eee;
-                        }
-                        cnt16++;
-                    } while (true);
-
-
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:154:25: ( EXPONENT )?
-                    int alt17=2;
-                    switch ( input.LA(1) ) {
-                        case 'E':
-                        case 'e':
-                            {
-                            alt17=1;
-                            }
-                            break;
-                    }
-
-                    switch (alt17) {
-                        case 1 :
-                            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:154:25: EXPONENT
-                            {
-                            mEXPONENT(); 
-
-
-                            }
-                            break;
-
-                    }
-
-
-                    }
-                    break;
-                case 3 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:155:9: ( '0' .. '9' )+ EXPONENT
-                    {
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:155:9: ( '0' .. '9' )+
-                    int cnt18=0;
-                    loop18:
-                    do {
-                        int alt18=2;
-                        switch ( input.LA(1) ) {
-                        case '0':
-                        case '1':
-                        case '2':
-                        case '3':
-                        case '4':
-                        case '5':
-                        case '6':
-                        case '7':
-                        case '8':
-                        case '9':
-                            {
-                            alt18=1;
-                            }
-                            break;
-
-                        }
-
-                        switch (alt18) {
-                    	case 1 :
-                    	    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:
-                    	    {
-                    	    if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) {
-                    	        input.consume();
-                    	    }
-                    	    else {
-                    	        MismatchedSetException mse = new MismatchedSetException(null,input);
-                    	        recover(mse);
-                    	        throw mse;
-                    	    }
-
-
-                    	    }
-                    	    break;
-
-                    	default :
-                    	    if ( cnt18 >= 1 ) break loop18;
-                                EarlyExitException eee =
-                                    new EarlyExitException(18, input);
-                                throw eee;
-                        }
-                        cnt18++;
-                    } while (true);
-
-
-                    mEXPONENT(); 
-
-
-                    }
-                    break;
-
-            }
-
-
-            }
-
-            state.type = _type;
-            state.channel = _channel;
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "FLOAT"
-
-    // $ANTLR start "STRING"
-    public final void mSTRING() throws RecognitionException {
-        try {
-            int _type = STRING;
-            int _channel = DEFAULT_TOKEN_CHANNEL;
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:159:5: ( '\\'' ( ESC_SEQ |~ ( '\\\\' | '\\'' ) )* '\\'' )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:159:8: '\\'' ( ESC_SEQ |~ ( '\\\\' | '\\'' ) )* '\\''
-            {
-            match('\''); 
-
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:159:13: ( ESC_SEQ |~ ( '\\\\' | '\\'' ) )*
-            loop20:
-            do {
-                int alt20=3;
-                int LA20_0 = input.LA(1);
-
-                if ( (LA20_0=='\\') ) {
-                    alt20=1;
-                }
-                else if ( ((LA20_0 >= '\u0000' && LA20_0 <= '&')||(LA20_0 >= '(' && LA20_0 <= '[')||(LA20_0 >= ']' && LA20_0 <= '\uFFFF')) ) {
-                    alt20=2;
-                }
-
-
-                switch (alt20) {
-            	case 1 :
-            	    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:159:15: ESC_SEQ
-            	    {
-            	    mESC_SEQ(); 
-
-
-            	    }
-            	    break;
-            	case 2 :
-            	    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:159:25: ~ ( '\\\\' | '\\'' )
-            	    {
-            	    if ( (input.LA(1) >= '\u0000' && input.LA(1) <= '&')||(input.LA(1) >= '(' && input.LA(1) <= '[')||(input.LA(1) >= ']' && input.LA(1) <= '\uFFFF') ) {
-            	        input.consume();
-            	    }
-            	    else {
-            	        MismatchedSetException mse = new MismatchedSetException(null,input);
-            	        recover(mse);
-            	        throw mse;
-            	    }
-
-
-            	    }
-            	    break;
-
-            	default :
-            	    break loop20;
-                }
-            } while (true);
-
-
-            match('\''); 
-
-            }
-
-            state.type = _type;
-            state.channel = _channel;
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "STRING"
-
-    // $ANTLR start "WS"
-    public final void mWS() throws RecognitionException {
-        try {
-            int _type = WS;
-            int _channel = DEFAULT_TOKEN_CHANNEL;
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:164:4: ( ( ' ' | '\\t' | '\\n' | '\\r' | '\\f' )+ )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:164:6: ( ' ' | '\\t' | '\\n' | '\\r' | '\\f' )+
-            {
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:164:6: ( ' ' | '\\t' | '\\n' | '\\r' | '\\f' )+
-            int cnt21=0;
-            loop21:
-            do {
-                int alt21=2;
-                switch ( input.LA(1) ) {
-                case '\t':
-                case '\n':
-                case '\f':
-                case '\r':
-                case ' ':
-                    {
-                    alt21=1;
-                    }
-                    break;
-
-                }
-
-                switch (alt21) {
-            	case 1 :
-            	    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:
-            	    {
-            	    if ( (input.LA(1) >= '\t' && input.LA(1) <= '\n')||(input.LA(1) >= '\f' && input.LA(1) <= '\r')||input.LA(1)==' ' ) {
-            	        input.consume();
-            	    }
-            	    else {
-            	        MismatchedSetException mse = new MismatchedSetException(null,input);
-            	        recover(mse);
-            	        throw mse;
-            	    }
-
-
-            	    }
-            	    break;
-
-            	default :
-            	    if ( cnt21 >= 1 ) break loop21;
-                        EarlyExitException eee =
-                            new EarlyExitException(21, input);
-                        throw eee;
-                }
-                cnt21++;
-            } while (true);
-
-
-            _channel=HIDDEN;
-
-            }
-
-            state.type = _type;
-            state.channel = _channel;
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "WS"
-
-    // $ANTLR start "TRUE"
-    public final void mTRUE() throws RecognitionException {
-        try {
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:172:15: ( ( 'T' | 't' ) ( 'R' | 'r' ) ( 'U' | 'u' ) ( 'E' | 'e' ) )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:172:17: ( 'T' | 't' ) ( 'R' | 'r' ) ( 'U' | 'u' ) ( 'E' | 'e' )
-            {
-            if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            if ( input.LA(1)=='R'||input.LA(1)=='r' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            if ( input.LA(1)=='U'||input.LA(1)=='u' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            }
-
-
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "TRUE"
-
-    // $ANTLR start "FALSE"
-    public final void mFALSE() throws RecognitionException {
-        try {
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:174:16: ( ( 'F' | 'f' ) ( 'A' | 'a' ) ( 'L' | 'l' ) ( 'S' | 's' ) ( 'E' | 'e' ) )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:174:18: ( 'F' | 'f' ) ( 'A' | 'a' ) ( 'L' | 'l' ) ( 'S' | 's' ) ( 'E' | 'e' )
-            {
-            if ( input.LA(1)=='F'||input.LA(1)=='f' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            if ( input.LA(1)=='A'||input.LA(1)=='a' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            if ( input.LA(1)=='S'||input.LA(1)=='s' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            }
-
-
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "FALSE"
-
-    // $ANTLR start "EXPONENT"
-    public final void mEXPONENT() throws RecognitionException {
-        try {
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:179:10: ( ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+ )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:179:12: ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+
-            {
-            if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:179:22: ( '+' | '-' )?
-            int alt22=2;
-            switch ( input.LA(1) ) {
-                case '+':
-                case '-':
-                    {
-                    alt22=1;
-                    }
-                    break;
-            }
-
-            switch (alt22) {
-                case 1 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:
-                    {
-                    if ( input.LA(1)=='+'||input.LA(1)=='-' ) {
-                        input.consume();
-                    }
-                    else {
-                        MismatchedSetException mse = new MismatchedSetException(null,input);
-                        recover(mse);
-                        throw mse;
-                    }
-
-
-                    }
-                    break;
-
-            }
-
-
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:179:33: ( '0' .. '9' )+
-            int cnt23=0;
-            loop23:
-            do {
-                int alt23=2;
-                switch ( input.LA(1) ) {
-                case '0':
-                case '1':
-                case '2':
-                case '3':
-                case '4':
-                case '5':
-                case '6':
-                case '7':
-                case '8':
-                case '9':
-                    {
-                    alt23=1;
-                    }
-                    break;
-
-                }
-
-                switch (alt23) {
-            	case 1 :
-            	    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:
-            	    {
-            	    if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) {
-            	        input.consume();
-            	    }
-            	    else {
-            	        MismatchedSetException mse = new MismatchedSetException(null,input);
-            	        recover(mse);
-            	        throw mse;
-            	    }
-
-
-            	    }
-            	    break;
-
-            	default :
-            	    if ( cnt23 >= 1 ) break loop23;
-                        EarlyExitException eee =
-                            new EarlyExitException(23, input);
-                        throw eee;
-                }
-                cnt23++;
-            } while (true);
-
-
-            }
-
-
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "EXPONENT"
-
-    // $ANTLR start "HEX_DIGIT"
-    public final void mHEX_DIGIT() throws RecognitionException {
-        try {
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:182:11: ( ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' ) )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:
-            {
-            if ( (input.LA(1) >= '0' && input.LA(1) <= '9')||(input.LA(1) >= 'A' && input.LA(1) <= 'F')||(input.LA(1) >= 'a' && input.LA(1) <= 'f') ) {
-                input.consume();
-            }
-            else {
-                MismatchedSetException mse = new MismatchedSetException(null,input);
-                recover(mse);
-                throw mse;
-            }
-
-
-            }
-
-
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "HEX_DIGIT"
-
-    // $ANTLR start "ESC_SEQ"
-    public final void mESC_SEQ() throws RecognitionException {
-        try {
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:186:5: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | UNICODE_ESC | OCTAL_ESC )
-            int alt24=3;
-            switch ( input.LA(1) ) {
-            case '\\':
-                {
-                switch ( input.LA(2) ) {
-                case '\"':
-                case '\'':
-                case '\\':
-                case 'b':
-                case 'f':
-                case 'n':
-                case 'r':
-                case 't':
-                    {
-                    alt24=1;
-                    }
-                    break;
-                case 'u':
-                    {
-                    alt24=2;
-                    }
-                    break;
-                case '0':
-                case '1':
-                case '2':
-                case '3':
-                case '4':
-                case '5':
-                case '6':
-                case '7':
-                    {
-                    alt24=3;
-                    }
-                    break;
-                default:
-                    NoViableAltException nvae =
-                        new NoViableAltException("", 24, 1, input);
-
-                    throw nvae;
-
-                }
-
-                }
-                break;
-            default:
-                NoViableAltException nvae =
-                    new NoViableAltException("", 24, 0, input);
-
-                throw nvae;
-
-            }
-
-            switch (alt24) {
-                case 1 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:186:9: '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' )
-                    {
-                    match('\\'); 
-
-                    if ( input.LA(1)=='\"'||input.LA(1)=='\''||input.LA(1)=='\\'||input.LA(1)=='b'||input.LA(1)=='f'||input.LA(1)=='n'||input.LA(1)=='r'||input.LA(1)=='t' ) {
-                        input.consume();
-                    }
-                    else {
-                        MismatchedSetException mse = new MismatchedSetException(null,input);
-                        recover(mse);
-                        throw mse;
-                    }
-
-
-                    }
-                    break;
-                case 2 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:187:9: UNICODE_ESC
-                    {
-                    mUNICODE_ESC(); 
-
-
-                    }
-                    break;
-                case 3 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:188:9: OCTAL_ESC
-                    {
-                    mOCTAL_ESC(); 
-
-
-                    }
-                    break;
-
-            }
-
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "ESC_SEQ"
-
-    // $ANTLR start "OCTAL_ESC"
-    public final void mOCTAL_ESC() throws RecognitionException {
-        try {
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:193:5: ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) )
-            int alt25=3;
-            switch ( input.LA(1) ) {
-            case '\\':
-                {
-                switch ( input.LA(2) ) {
-                case '0':
-                case '1':
-                case '2':
-                case '3':
-                    {
-                    switch ( input.LA(3) ) {
-                    case '0':
-                    case '1':
-                    case '2':
-                    case '3':
-                    case '4':
-                    case '5':
-                    case '6':
-                    case '7':
-                        {
-                        switch ( input.LA(4) ) {
-                        case '0':
-                        case '1':
-                        case '2':
-                        case '3':
-                        case '4':
-                        case '5':
-                        case '6':
-                        case '7':
-                            {
-                            alt25=1;
-                            }
-                            break;
-                        default:
-                            alt25=2;
-                        }
-
-                        }
-                        break;
-                    default:
-                        alt25=3;
-                    }
-
-                    }
-                    break;
-                case '4':
-                case '5':
-                case '6':
-                case '7':
-                    {
-                    switch ( input.LA(3) ) {
-                    case '0':
-                    case '1':
-                    case '2':
-                    case '3':
-                    case '4':
-                    case '5':
-                    case '6':
-                    case '7':
-                        {
-                        alt25=2;
-                        }
-                        break;
-                    default:
-                        alt25=3;
-                    }
-
-                    }
-                    break;
-                default:
-                    NoViableAltException nvae =
-                        new NoViableAltException("", 25, 1, input);
-
-                    throw nvae;
-
-                }
-
-                }
-                break;
-            default:
-                NoViableAltException nvae =
-                    new NoViableAltException("", 25, 0, input);
-
-                throw nvae;
-
-            }
-
-            switch (alt25) {
-                case 1 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:193:9: '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' )
-                    {
-                    match('\\'); 
-
-                    if ( (input.LA(1) >= '0' && input.LA(1) <= '3') ) {
-                        input.consume();
-                    }
-                    else {
-                        MismatchedSetException mse = new MismatchedSetException(null,input);
-                        recover(mse);
-                        throw mse;
-                    }
-
-
-                    if ( (input.LA(1) >= '0' && input.LA(1) <= '7') ) {
-                        input.consume();
-                    }
-                    else {
-                        MismatchedSetException mse = new MismatchedSetException(null,input);
-                        recover(mse);
-                        throw mse;
-                    }
-
-
-                    if ( (input.LA(1) >= '0' && input.LA(1) <= '7') ) {
-                        input.consume();
-                    }
-                    else {
-                        MismatchedSetException mse = new MismatchedSetException(null,input);
-                        recover(mse);
-                        throw mse;
-                    }
-
-
-                    }
-                    break;
-                case 2 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:194:9: '\\\\' ( '0' .. '7' ) ( '0' .. '7' )
-                    {
-                    match('\\'); 
-
-                    if ( (input.LA(1) >= '0' && input.LA(1) <= '7') ) {
-                        input.consume();
-                    }
-                    else {
-                        MismatchedSetException mse = new MismatchedSetException(null,input);
-                        recover(mse);
-                        throw mse;
-                    }
-
-
-                    if ( (input.LA(1) >= '0' && input.LA(1) <= '7') ) {
-                        input.consume();
-                    }
-                    else {
-                        MismatchedSetException mse = new MismatchedSetException(null,input);
-                        recover(mse);
-                        throw mse;
-                    }
-
-
-                    }
-                    break;
-                case 3 :
-                    // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:195:9: '\\\\' ( '0' .. '7' )
-                    {
-                    match('\\'); 
-
-                    if ( (input.LA(1) >= '0' && input.LA(1) <= '7') ) {
-                        input.consume();
-                    }
-                    else {
-                        MismatchedSetException mse = new MismatchedSetException(null,input);
-                        recover(mse);
-                        throw mse;
-                    }
-
-
-                    }
-                    break;
-
-            }
-
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "OCTAL_ESC"
-
-    // $ANTLR start "UNICODE_ESC"
-    public final void mUNICODE_ESC() throws RecognitionException {
-        try {
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:200:5: ( '\\\\' 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT )
-            // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:200:9: '\\\\' 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT
-            {
-            match('\\'); 
-
-            match('u'); 
-
-            mHEX_DIGIT(); 
-
-
-            mHEX_DIGIT(); 
-
-
-            mHEX_DIGIT(); 
-
-
-            mHEX_DIGIT(); 
-
-
-            }
-
-
-        }
-        finally {
-        	// do for sure before leaving
-        }
-    }
-    // $ANTLR end "UNICODE_ESC"
-
-    public void mTokens() throws RecognitionException {
-        // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:1:8: ( T__31 | T__32 | T__33 | T__34 | T__35 | T__36 | T__37 | T__38 | T__39 | T__40 | LT | LTE | EQ | GT | GTE | BOOLEAN | AND | OR | NOT | ASC | DESC | CONTAINS | WITHIN | OF | UUID | ID | LONG | FLOAT | STRING | WS )
-        int alt26=30;
-        alt26 = dfa26.predict(input);
-        switch (alt26) {
-            case 1 :
-                // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:1:10: T__31
-                {
-                mT__31(); 
-
-
-                }
-                break;
-            case 2 :
-                // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:1:16: T__32
-                {
-                mT__32(); 
-
-
-                }
-                break;
-            case 3 :
-                // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:1:22: T__33
-                {
-                mT__33(); 
-
-
-                }
-                break;
-            case 4 :
-                // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:1:28: T__34
-                {
-                mT__34(); 
-
-
-                }
-                break;
-            case 5 :
-                // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:1:34: T__35
-                {
-                mT__35(); 
-
-
-                }
-                break;
-            case 6 :
-                // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:1:40: T__36
-                {
-                mT__36(); 
-
-
-                }
-                break;
-            case 7 :
-                // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:1:46: T__37
-                {
-                mT__37(); 
-
-
-                }
-                break;
-            case 8 :
-                // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:1:52: T__38
-                {
-                mT__38(); 
-
-
-                }
-                break;
-            case 9 :
-                // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:1:58: T__39
-                {
-                mT__39(); 
-
-
-                }
-                break;
-            case 10 :
-                // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:1:64: T__40
-                {
-                mT__40(); 
-
-
-                }
-                break;
-            case 11 :
-                // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:1:70: LT
-                {
-                mLT(); 
-
-
-                }
-                break;
-            case 12 :
-                // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:1:73: LTE
-                {
-                mLTE(); 
-
-
-                }
-                break;
-            case 13 :
-                // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:1:77: EQ
-                {
-                mEQ(); 
-
-
-                }
-                break;
-            case 14 :
-                // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:1:80: GT
-                {
-                mGT(); 
-
-
-                }
-                break;
-            case 15 :
-                // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:1:83: GTE
-                {
-                mGTE(); 
-
-
-                }
-                break;
-            case 16 :
-                // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:1:87: BOOLEAN
-                {
-                mBOOLEAN(); 
-
-
-                }
-                break;
-            case 17 :
-                // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:1:95: AND
-                {
-                mAND(); 
-
-
-                }
-                break;
-            case 18 :
-                // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:1:99: OR
-                {
-                mOR(); 
-
-
-                }
-                break;
-            case 19 :
-                // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:1:102: NOT
-                {
-                mNOT(); 
-
-
-                }
-                break;
-            case 20 :
-                // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:1:106: ASC
-                {
-                mASC(); 
-
-
-                }
-                break;
-            case 21 :
-                // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:1:110: DESC
-                {
-                mDESC(); 
-
-
-                }
-                break;
-            case 22 :
-                // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:1:115: CONTAINS
-                {
-                mCONTAINS(); 
-
-
-                }
-                break;
-            case 23 :
-                // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:1:124: WITHIN
-                {
-                mWITHIN(); 
-
-
-                }
-                break;
-            case 24 :
-                // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:1:131: OF
-                {
-                mOF(); 
-
-
-                }
-                break;
-            case 25 :
-                // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:1:134: UUID
-                {
-                mUUID(); 
-
-
-                }
-                break;
-            case 26 :
-                // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:1:139: ID
-                {
-                mID(); 
-
-
-                }
-                break;
-            case 27 :
-                // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:1:142: LONG
-                {
-                mLONG(); 
-
-
-                }
-                break;
-            case 28 :
-                // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:1:147: FLOAT
-                {
-                mFLOAT(); 
-
-
-                }
-                break;
-            case 29 :
-                // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:1:153: STRING
-                {
-                mSTRING(); 
-
-
-                }
-                break;
-            case 30 :
-                // org/apache/usergrid/persistence/index/query/tree/CpQueryFilter.g:1:160: WS
-                {
-                mWS(); 
-
-
-                }
-                break;
-
-        }
-
-    }
-
-
-    protected DFA19 dfa19 = new DFA19(this);
-    protected DFA26 dfa26 = new DFA26(this);
-    static final String DFA19_eotS =
-        "\5\uffff";
-    static final String DFA19_eofS =
-        "\5\uffff";
-    static final String DFA19_minS =
-        "\2\56\3\uffff";
-    static final String DFA19_maxS =
-        "\1\71\1\145\3\uffff";
-    static final String DFA19_acceptS =
-        "\2\uffff\1\2\1\1\1\3";
-    static final String DFA19_specialS =
-        "\5\uffff}>";
-    static final String[] DFA19_transitionS = {
-            "\1\2\1\uffff\12\1",
-            "\1\3\1\uffff\12\1\13\uffff\1\4\37\uffff\1\4",
-            "",
-            "",
-            ""
-    };
-
-    static final short[] DFA19_eot = DFA.unpackEncodedString(DFA19_eotS);
-    static final short[] DFA19_eof = DFA.unpackEncodedString(DFA19_eofS);
-    static final char[] DFA19_min = DFA.unpackEncodedStringToUnsignedChars(DFA19_minS);
-    static final char[] DFA19_max = DFA.unpackEncodedStringToUnsignedChars(DFA19_maxS);
-    static final short[] DFA19_accept = DFA.unpackEncodedString(DFA19_acceptS);
-    static final short[] DFA19_special = DFA.unpackEncodedString(DFA19_specialS);
-    static final short[][] DFA19_transition;
-
-    static {
-        int numStates = DFA19_transitionS.length;
-        DFA19_transition = new short[numStates][];
-        for (int i=0; i<numStates; i++) {
-            DFA19_transition[i] = DFA.unpackEncodedString(DFA19_transitionS[i]);
-        }
-    }
-
-    class DFA19 extends DFA {
-
-        public DFA19(BaseRecognizer recognizer) {
-            this.recognizer = recognizer;
-            this.decisionNumber = 19;
-            this.eot = DFA19_eot;
-            this.eof = DFA19_eof;
-            this.min = DFA19_min;
-            this.max = DFA19_max;
-            this.accept = DFA19_accept;
-            this.special = DFA19_special;
-            this.transition = DFA19_transition;
-        }
-        public String getDescription() {
-            return "153:15: ( ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( EXPONENT )? | '.' ( '0' .. '9' )+ ( EXPONENT )? | ( '0' .. '9' )+ EXPONENT )";
-        }
-    }
-    static final String DFA26_eotS =
-        "\6\uffff\3\35\2\uffff\1\51\1\35\1\uffff\1\35\1\56\4\35\1\uffff\1"+
-        "\35\1\uffff\5\35\1\67\5\uffff\2\26\1\75\3\35\2\uffff\1\51\1\15\1"+
-        "\35\2\uffff\1\56\7\35\1\uffff\1\67\2\uffff\1\67\1\35\1\uffff\3\35"+
-        "\1\50\1\35\1\55\2\35\1\24\1\125\1\126\2\35\1\67\1\uffff\1\37\5\35"+
-        "\1\141\1\35\2\uffff\1\143\1\35\1\67\1\uffff\1\37\2\35\1\152\2\35"+
-        "\1\uffff\1\141\1\uffff\1\35\1\67\1\uffff\1\37\1\uffff\1\161\1\uffff"+
-        "\1\162\2\35\1\67\1\uffff\1\37\2\uffff\2\35\1\67\1\uffff\1\37\1\35"+
-        "\1\176\1\67\1\uffff\1\37\1\35\2\uffff\1\35\1\37\1\35\1\37\1\35\1"+
-        "\37\1\35\1\37\26\35\1\72";
-    static final String DFA26_eofS =
-        "\u009f\uffff";
-    static final String DFA26_minS =
-        "\1\11\5\uffff\1\106\1\145\1\111\2\uffff\1\75\1\164\1\uffff\1\60"+
-        "\1\75\1\164\1\122\2\60\1\uffff\1\106\1\uffff\1\117\2\60\1\111\1"+
-        "\60\1\56\1\uffff\1\56\3\uffff\3\55\1\154\1\145\1\124\2\uffff\2\55"+
-        "\1\60\2\uffff\1\55\1\125\1\60\1\104\1\103\1\124\1\60\1\116\1\uffff"+
-        "\1\56\1\53\1\uffff\1\56\1\145\1\uffff\1\145\1\162\1\110\1\55\1\60"+
-        "\1\55\1\105\1\123\3\55\1\103\1\124\1\56\1\53\1\60\1\162\1\143\1"+
-        "\145\1\111\1\60\1\55\1\105\2\uffff\1\55\1\101\1\56\1\53\1\60\1\40"+
-        "\1\164\1\55\1\116\1\60\1\uffff\1\55\1\uffff\1\111\1\56\1\53\1\60"+
-        "\1\uffff\1\55\1\uffff\1\55\1\60\1\116\1\56\1\53\1\60\2\uffff\1\60"+
-        "\1\123\1\56\1\53\1\60\3\55\1\53\1\55\1\60\1\uffff\7\60\2\55\4\60"+
-        "\1\5

<TRUNCATED>

[19/52] [abbrv] git commit: Merge branch 'pr/70' into two-dot-o

Posted by gr...@apache.org.
Merge branch 'pr/70' into two-dot-o


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: 8b2c1b71dff1e112a1b67612b68e5ac3ed43431d
Parents: efdc08d 9ddb537
Author: Dave Johnson <sn...@apache.org>
Authored: Thu Aug 28 16:26:56 2014 -0400
Committer: Dave Johnson <sn...@apache.org>
Committed: Thu Aug 28 16:26:56 2014 -0400

----------------------------------------------------------------------
 .../usergrid/batch/job/SchedulerRuntime2IT.java | 54 ++++++++++----------
 .../usergrid/batch/job/SchedulerRuntime3IT.java |  2 +
 .../usergrid/persistence/CollectionIT.java      | 17 +++---
 .../persistence/GeoQueryBooleanTest.java        |  2 +
 .../exception/CollectionRuntimeException.java   |  1 -
 .../MvccEntitySerializationStrategyImpl.java    | 16 +++++-
 .../persistence/index/impl/EntityIndexTest.java | 19 +++++++
 .../src/test/resources/log4j.properties         |  6 ++-
 stack/pom.xml                                   |  6 ++-
 .../test/resources/usergrid-test-context.xml    |  3 +-
 10 files changed, 86 insertions(+), 40 deletions(-)
----------------------------------------------------------------------



[17/52] [abbrv] git commit: Move to ElasticSearch 1.2.4 and comment out query validator for now, see USERGRID-221.

Posted by gr...@apache.org.
Move to ElasticSearch 1.2.4 and comment out query validator for now, see USERGRID-221.


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: ce8c1706adab05767db46c70c340d3dc7a264916
Parents: 9c47aee
Author: Dave Johnson <dm...@apigee.com>
Authored: Thu Aug 28 15:36:28 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Thu Aug 28 15:36:28 2014 -0400

----------------------------------------------------------------------
 stack/pom.xml | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ce8c1706/stack/pom.xml
----------------------------------------------------------------------
diff --git a/stack/pom.xml b/stack/pom.xml
index 7b8d7be..1656d24 100644
--- a/stack/pom.xml
+++ b/stack/pom.xml
@@ -114,7 +114,7 @@
     <tomcat-version>7.0.52</tomcat-version>
     <antlr.version>3.4</antlr.version>
     <tika.version>1.4</tika.version>
-    <elasticsearch.version>1.2.3</elasticsearch.version>
+    <elasticsearch.version>1.2.4</elasticsearch.version>
 
     <usergrid.it.forkCount>3</usergrid.it.forkCount>
     <usergrid.it.reuseForks>false</usergrid.it.reuseForks>
@@ -202,7 +202,11 @@
     <module>websocket</module>
     <module>launcher</module>
     <module>mongo-emulator</module>
+    <!--  
+    Re-enable when query-validator updated to work with Core Persistence.
+    https://issues.apache.org/jira/browse/USERGRID-221
     <module>query-validator</module>
+    -->
   </modules>
 
   <dependencyManagement>


[14/52] [abbrv] git commit: remove extra ref

Posted by gr...@apache.org.
remove extra ref


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: 78ce124675b6d71deed2c73522dd0720fb39e0c3
Parents: 1d74ec0
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Aug 28 10:18:49 2014 -0600
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Aug 28 10:18:49 2014 -0600

----------------------------------------------------------------------
 stack/core/pom.xml | 39 ++++++++++++++-------------------------
 1 file changed, 14 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/78ce1246/stack/core/pom.xml
----------------------------------------------------------------------
diff --git a/stack/core/pom.xml b/stack/core/pom.xml
index 41c7244..08c8c1c 100644
--- a/stack/core/pom.xml
+++ b/stack/core/pom.xml
@@ -550,38 +550,15 @@
             <groupId>org.apache.usergrid.chop</groupId>
             <artifactId>chop-stack</artifactId>
             <version>2.0.0-SNAPSHOT</version>
-        </dependency>-->
-
-        <dependency>
-            <groupId>com.codahale.metrics</groupId>
-            <artifactId>metrics-core</artifactId>
-            <version>${metrics.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>com.codahale.metrics</groupId>
-            <artifactId>metrics-graphite</artifactId>
-            <version>${metrics.version}</version>
         </dependency>
-
-        <dependency>
-            <groupId>com.netflix.rxjava</groupId>
-            <artifactId>rxjava-core</artifactId>
-            <version>${rx.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>com.netflix.rxjava</groupId>
-            <artifactId>rxjava-math</artifactId>
-            <version>${rx.version}</version>
-        </dependency>
-
+    -->
 
     <dependency>
       <groupId>com.codahale.metrics</groupId>
       <artifactId>metrics-core</artifactId>
       <version>${metrics.version}</version>
     </dependency>
+
     <dependency>
       <groupId>com.codahale.metrics</groupId>
       <artifactId>metrics-graphite</artifactId>
@@ -589,6 +566,18 @@
     </dependency>
 
     <dependency>
+      <groupId>com.netflix.rxjava</groupId>
+      <artifactId>rxjava-core</artifactId>
+      <version>${rx.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>com.netflix.rxjava</groupId>
+      <artifactId>rxjava-math</artifactId>
+      <version>${rx.version}</version>
+    </dependency>
+
+    <dependency>
       <groupId>com.clearspring.analytics</groupId>
       <artifactId>stream</artifactId>
       <version>2.7.0</version>


[51/52] [abbrv] git commit: Merge branch 'two-dot-o' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into two-dot-o-push-notifications

Posted by gr...@apache.org.
Merge branch 'two-dot-o' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into two-dot-o-push-notifications

# By Anuradha Weeraman (55) and others
# Via Dave Johnson (30) and others
* 'two-dot-o' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid: (212 commits)
  Add some missing headers, and make some header more consistent.
  Exclude all DLL files from the release, and add a README file to each directory that formerly contained DLLs to explain that.
  Change to allow Launcher to compile with AppleJavaExtensions v1.4
  Permissive license notices should go in license file.
  Preparing for RC5 which will exclude the Portal's bower_components, node_modules and other giti-gnored files.
  Adding properties file for corepersistence/common tests.
  refreshIndex() fixes counting mutator test.
  Test fixes for tests that seem to fail intermittently on machines with lots of cores.
  Test to prove that arrays, not queries and geo queries play well together.
  Get permissions right, who knows who that WAR came from.
  configurable surefire arglines
  Revert to launcher AppleJavaExtensions 1.4 so that at least the launcher will build.
  Make it possible to deploy a UG 1 WAR.
  Don't build the launcher until we have a fix for the Apple ext jar issue.
  Fork count of two seems to work for me.
  Portal - updated grunt to remove old task types
  More JSON serialization fixes: EntityRef and CredentialsInfo should not be serialized with type info.
  Fixed obscelete tests
  Reverting previous change; jumped the gun on that one.
  Fix JSON mapper to use same setup as we do in Collections module serializer.
  ...

Conflicts:
	stack/core/src/main/java/org/apache/usergrid/metrics/MetricsFactory.java
	stack/core/src/main/resources/usergrid-core-context.xml
	stack/pom.xml


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: 1d8dd2f6d970af69740e725825fd3d8db1aec5b0
Parents: 646b98c 479969f
Author: grey <gr...@apigee.com>
Authored: Wed Sep 3 14:50:06 2014 -0700
Committer: grey <gr...@apigee.com>
Committed: Wed Sep 3 14:50:06 2014 -0700

----------------------------------------------------------------------
 .gitignore                                      |    22 +-
 DISCLAIMER                                      |     9 +
 LICENSE                                         |    26 +
 NOTICE                                          |    11 +-
 README.md                                       |    20 +-
 bower.json                                      |    39 -
 .../src/test/resources/install_cassandra.sh     |    19 -
 chop/stack/src/test/resources/install_es.sh     |    19 -
 .../stack/src/test/resources/setup_cassandra.sh |    19 -
 chop/stack/src/test/resources/setup_es.sh       |    19 -
 .../src/main/resources/jettyjam.properties      |    18 -
 portal/Gruntfile.js                             |   136 +-
 portal/README.md                                |    20 +-
 portal/archive/coming_soon.html                 |    31 -
 portal/archive/config.js                        |    72 -
 .../ui-bg_diagonals-thick_90_eeeeee_40x40.png   |   Bin 251 -> 0 bytes
 .../images/ui-bg_flat_100_deedf7_40x100.png     |   Bin 182 -> 0 bytes
 .../images/ui-bg_flat_100_e4f1fb_40x100.png     |   Bin 213 -> 0 bytes
 .../images/ui-bg_flat_100_f2f5f7_40x100.png     |   Bin 212 -> 0 bytes
 .../images/ui-bg_flat_15_cd0a0a_40x100.png      |   Bin 181 -> 0 bytes
 .../images/ui-bg_flat_50_3baae3_40x100.png      |   Bin 182 -> 0 bytes
 .../images/ui-bg_flat_80_d7ebf9_40x100.png      |   Bin 183 -> 0 bytes
 .../ui-bg_highlight-hard_70_000000_1x100.png    |   Bin 118 -> 0 bytes
 .../ui-bg_highlight-soft_25_ffef8f_1x100.png    |   Bin 153 -> 0 bytes
 .../images/ui-icons_000000_256x240.png          |   Bin 4369 -> 0 bytes
 .../images/ui-icons_2694e8_256x240.png          |   Bin 4369 -> 0 bytes
 .../images/ui-icons_2e83ff_256x240.png          |   Bin 4369 -> 0 bytes
 .../images/ui-icons_3d80b3_256x240.png          |   Bin 4369 -> 0 bytes
 .../images/ui-icons_72a7cf_256x240.png          |   Bin 4369 -> 0 bytes
 .../images/ui-icons_ffffff_256x240.png          |   Bin 4369 -> 0 bytes
 .../css/custom-theme/jquery-ui-1.8.9.custom.css |   573 -
 portal/archive/css/jquery-ui-timepicker.css     |    53 -
 portal/archive/css/jquery.ui.statusbar.css      |    25 -
 portal/archive/css/prettify.css                 |    52 -
 portal/archive/css/usergrid-stripped.css        |  5199 ----
 portal/archive/css/usergrid.css                 |  5203 ----
 portal/archive/dash/README.md                   |     3 -
 .../archive/dash/config/testacular-e2e.conf.js  |    22 -
 portal/archive/dash/config/testacular.conf.js   |    20 -
 portal/archive/dash/test/e2e/runner.html        |    10 -
 portal/archive/dash/test/e2e/scenarios.js       |    45 -
 .../dash/test/lib/angular/angular-mocks.js      |  1764 --
 .../dash/test/lib/angular/angular-scenario.js   | 26195 -----------------
 .../archive/dash/test/lib/angular/version.txt   |     1 -
 .../archive/dash/test/unit/controllersSpec.js   |    31 -
 portal/archive/dash/test/unit/directivesSpec.js |    19 -
 portal/archive/dash/test/unit/filtersSpec.js    |    19 -
 portal/archive/dash/test/unit/servicesSpec.js   |    14 -
 portal/archive/images/APNS_cert_upload.png      |   Bin 33956 -> 0 bytes
 portal/archive/images/APNS_certification.png    |   Bin 16855 -> 0 bytes
 portal/archive/images/android-notification.png  |   Bin 41629 -> 0 bytes
 portal/archive/images/android-sdk-download.png  |   Bin 4848 -> 0 bytes
 portal/archive/images/api-activity.gif          |   Bin 10819 -> 0 bytes
 portal/archive/images/apigee-logo.png           |   Bin 3647 -> 0 bytes
 portal/archive/images/apigeetopbar.png          |   Bin 4658 -> 0 bytes
 portal/archive/images/background_one_col.png    |   Bin 3126 -> 0 bytes
 portal/archive/images/btn-copyCurl-up.png       |   Bin 2762 -> 0 bytes
 portal/archive/images/clippy-bg.png             |   Bin 561 -> 0 bytes
 portal/archive/images/close.gif                 |   Bin 718 -> 0 bytes
 portal/archive/images/dotnet-sdk-download.png   |   Bin 7149 -> 0 bytes
 portal/archive/images/down_arrow.png            |   Bin 1285 -> 0 bytes
 portal/archive/images/error.png                 |   Bin 2009 -> 0 bytes
 portal/archive/images/faviconApigee.ico         |   Bin 1150 -> 0 bytes
 .../images/glyphicons-halflings-white.png       |   Bin 4352 -> 0 bytes
 portal/archive/images/glyphicons-halflings.png  |   Bin 4352 -> 0 bytes
 .../glyphicons_halflings_135_wrench-white2.pdn  |   Bin 5400 -> 0 bytes
 .../glyphicons_halflings_135_wrench-white2.png  |   Bin 296 -> 0 bytes
 .../images/glyphicons_halflings_135_wrench.png  |   Bin 228 -> 0 bytes
 .../glyphicons_halflings_135_wrench_white.png   |   Bin 251 -> 0 bytes
 .../glyphicons_halflings_wrench_white.png       |   Bin 1016 -> 0 bytes
 portal/archive/images/google_api_key.png        |   Bin 98118 -> 0 bytes
 portal/archive/images/green_dot.png             |   Bin 3472 -> 0 bytes
 portal/archive/images/grid.png                  |   Bin 166 -> 0 bytes
 portal/archive/images/icons.png                 |   Bin 13132 -> 0 bytes
 portal/archive/images/ios-sdk-download.png      |   Bin 4886 -> 0 bytes
 portal/archive/images/iphone_message.png        |   Bin 90307 -> 0 bytes
 .../archive/images/javascript-sdk-download.png  |   Bin 4618 -> 0 bytes
 portal/archive/images/left_arrow.png            |   Bin 1257 -> 0 bytes
 portal/archive/images/logo-white.png            |   Bin 2014 -> 0 bytes
 portal/archive/images/menuActiveTriangle.png    |   Bin 315 -> 0 bytes
 portal/archive/images/nodejs-sdk-download.png   |   Bin 5273 -> 0 bytes
 portal/archive/images/notice.png                |   Bin 2112 -> 0 bytes
 portal/archive/images/orange-arrow.png          |   Bin 242 -> 0 bytes
 .../archive/images/push_notifications_icon.png  |   Bin 338 -> 0 bytes
 portal/archive/images/red_dot.png               |   Bin 3482 -> 0 bytes
 portal/archive/images/right_arrow.png           |   Bin 1251 -> 0 bytes
 portal/archive/images/ruby-sdk-download.png     |   Bin 6343 -> 0 bytes
 portal/archive/images/step_1.png                |   Bin 1953 -> 0 bytes
 portal/archive/images/step_2.png                |   Bin 2117 -> 0 bytes
 portal/archive/images/step_3.png                |   Bin 2162 -> 0 bytes
 portal/archive/images/success.png               |   Bin 1863 -> 0 bytes
 portal/archive/images/swish_arrow.png           |   Bin 220 -> 0 bytes
 portal/archive/images/topbackground.png         |   Bin 2890 -> 0 bytes
 portal/archive/images/up_arrow.png              |   Bin 1292 -> 0 bytes
 portal/archive/images/user-photo.png            |   Bin 3849 -> 0 bytes
 portal/archive/images/user_profile.png          |   Bin 3775 -> 0 bytes
 portal/archive/images/usergrid_200.png          |   Bin 6397 -> 0 bytes
 portal/archive/images/usergrid_400.png          |   Bin 8746 -> 0 bytes
 portal/archive/images/warning.png               |   Bin 1179 -> 0 bytes
 portal/archive/images/yellow_dot.png            |   Bin 3475 -> 0 bytes
 portal/archive/index-stripped2.html             |  1795 --
 portal/archive/index.html                       |  1932 --
 portal/archive/js/app/app.js                    |   131 -
 portal/archive/js/app/console.js                |  5397 ----
 portal/archive/js/app/helpers.js                |   241 -
 portal/archive/js/app/navigation.js             |   251 -
 portal/archive/js/app/pages.js                  |   161 -
 portal/archive/js/app/params.js                 |    30 -
 portal/archive/js/app/quickLogin.js             |    30 -
 portal/archive/js/app/session.js                |   176 -
 portal/archive/js/app/sso.js                    |   135 -
 portal/archive/js/app/status.js                 |    37 -
 portal/archive/js/app/ui/collections.entity.js  |   320 -
 portal/archive/js/app/ui/collections.user.js    |   120 -
 portal/archive/js/app/ui/ui.js                  |   415 -
 portal/archive/js/app/usergrid.appSDK.js        |  2097 --
 portal/archive/js/app/usergrid.appSDK.orig.js   |  2070 --
 portal/archive/js/lib/MD5.min.js                |     1 -
 portal/archive/js/lib/backbone.js               |  1431 -
 portal/archive/js/lib/bootstrap.min.js          |     7 -
 portal/archive/js/lib/date.min.js               |     2 -
 portal/archive/js/lib/jquery-1.7.2.min.js       |     4 -
 portal/archive/js/lib/jquery-ui-1.8.18.min.js   |    15 -
 portal/archive/js/lib/jquery.dataset.min.js     |     1 -
 portal/archive/js/lib/jquery.dform-0.1.3.min.js |    16 -
 portal/archive/js/lib/jquery.jsonp-2.3.1.min.js |     3 -
 portal/archive/js/lib/jquery.tmpl.min.js        |    10 -
 .../archive/js/lib/jquery.ui.statusbar.min.js   |     1 -
 .../archive/js/lib/jquery.ui.timepicker.min.js  |     1 -
 portal/archive/js/lib/prettify.js               |  1477 -
 portal/archive/js/lib/underscore-min.js         |     5 -
 portal/archive/js/spec/client-tests.js          |   159 -
 portal/archive/js/spec/index.html               |    20 -
 portal/archive/js/spec/qunit-git.css            |   238 -
 portal/archive/js/spec/qunit-git.js             |  1865 --
 portal/archive/js/unit-tests/appSDK-tests.js    |   255 -
 portal/archive/js/unit-tests/ie-jquery-tests.js |   191 -
 portal/archive/js/unit-tests/qunit.css          |   231 -
 portal/archive/js/unit-tests/qunit.js           |  1934 --
 portal/archive/loading.html                     |     9 -
 portal/archive/max/index.html                   |     0
 portal/archive/planned_outage.html              |    48 -
 portal/archive/push/index.html                  |    34 -
 portal/archive/service_down.html                |    48 -
 .../apigee.ui.activities.table_rows.html        |    14 -
 .../templates/apigee.ui.admins.table_rows.html  |     8 -
 .../apigee.ui.applications.table_rows.html      |     4 -
 .../apigee.ui.collection.table_rows.html        |    67 -
 .../apigee.ui.collections.query.indexes.html    |     5 -
 .../apigee.ui.collections.table_rows.html       |     9 -
 .../apigee.ui.collections.user.header.html      |    21 -
 .../templates/apigee.ui.curl.detail.html        |    11 -
 .../templates/apigee.ui.feed.table_rows.html    |    15 -
 .../templates/apigee.ui.groups.table_rows.html  |    14 -
 .../apigee.ui.panels.group.activities.html      |    28 -
 .../apigee.ui.panels.group.details.html         |    97 -
 .../apigee.ui.panels.group.memberships.html     |    40 -
 .../apigee.ui.panels.group.permissions.html     |    99 -
 ...pigee.ui.panels.notifications.configure.html |    14 -
 .../apigee.ui.panels.role.permissions.html      |    58 -
 .../templates/apigee.ui.panels.role.users.html  |    38 -
 .../apigee.ui.panels.user.activities.html       |    40 -
 .../templates/apigee.ui.panels.user.graph.html  |    80 -
 .../apigee.ui.panels.user.memberships.html      |    40 -
 .../apigee.ui.panels.user.permissions.html      |   105 -
 .../apigee.ui.panels.user.profile.html          |   113 -
 .../apigee.ui.role.groups.table_rows.html       |    44 -
 .../templates/apigee.ui.roles.table_rows.html   |    15 -
 .../templates/apigee.ui.users.table_rows.html   |    18 -
 portal/archive/templates/test/modalForm2.html   |    32 -
 portal/archive/test/autocomplete.html           |    25 -
 portal/archive/test/modalForm.html              |    32 -
 portal/bower.json                               |     6 +-
 portal/build.sh                                 |    24 +-
 portal/config.js                                |    49 +-
 portal/css/apigeeGlobalNavigation.css           |   291 -
 portal/css/dash.min.css                         |     1 -
 portal/css/main.css                             |    94 +-
 portal/css/main.min.css                         |     1 +
 portal/favicon.ico                              |   Bin 1150 -> 3989 bytes
 portal/helpJson.json                            |    47 +
 portal/img/green_dot.png                        |   Bin 3472 -> 0 bytes
 portal/img/logo.gif                             |   Bin 2279 -> 0 bytes
 portal/img/logo.png                             |   Bin 0 -> 7758 bytes
 portal/img/push/APNS_cert_upload.png            |   Bin 33956 -> 0 bytes
 portal/img/push/APNS_certification.png          |   Bin 16855 -> 0 bytes
 portal/img/push/android-notification.png        |   Bin 41629 -> 0 bytes
 portal/img/push/google_api_key.png              |   Bin 98118 -> 0 bytes
 portal/img/push/iphone_message.png              |   Bin 90307 -> 0 bytes
 portal/img/push/step_1.png                      |   Bin 1953 -> 0 bytes
 portal/img/push/step_2.png                      |   Bin 2117 -> 0 bytes
 portal/img/push/step_3.png                      |   Bin 2162 -> 0 bytes
 portal/img/red_dot.png                          |   Bin 3482 -> 0 bytes
 portal/img/yellow_dot.png                       |   Bin 3475 -> 0 bytes
 portal/index-template.html                      |    44 +-
 portal/js/activities/activities.html            |    56 +-
 .../js/app-overview/app-overview-controller.js  |    61 +-
 portal/js/app-overview/app-overview.html        |    60 +-
 .../js/app-overview/doc-includes/android.html   |   401 +-
 portal/js/app-overview/doc-includes/ios.html    |   364 +-
 .../app-overview/doc-includes/javascript.html   |   216 +-
 portal/js/app-overview/doc-includes/net.html    |    16 +
 portal/js/app-overview/doc-includes/node.html   |    16 +
 portal/js/app-overview/doc-includes/ruby.html   |    16 +
 .../app-overview/getting-started-controller.js  |   107 -
 portal/js/app-overview/getting-started.html     |   119 -
 portal/js/app.js                                |    21 +-
 portal/js/charts/chart-controller.js            |     6 -
 portal/js/charts/chart-directives.js            |   141 -
 portal/js/charts/chart-service.js               |   494 -
 portal/js/charts/highcharts.json                |   329 -
 portal/js/charts/sparklines.js                  |     2 -
 portal/js/data/data.html                        |   261 +-
 portal/js/data/display-generic.html             |   168 +-
 portal/js/data/display-groups.html              |    16 +
 portal/js/data/display-roles.html               |    18 +-
 portal/js/data/display-users.html               |   257 +-
 portal/js/data/entity.html                      |    31 +-
 portal/js/dialogs/modal.html                    |    49 +-
 portal/js/global/app-switcher-directive.js      |    53 -
 portal/js/global/appswitcher-template.html      |    34 -
 portal/js/global/help-service.js                |    22 +-
 portal/js/global/insecure-banner.html           |    30 +-
 portal/js/global/page-controller.js             |    17 +-
 portal/js/global/page-title.html                |    44 +-
 portal/js/global/ug-service.js                  |    45 +-
 portal/js/groups/groups-activities.html         |    44 +-
 portal/js/groups/groups-details.html            |    83 +-
 portal/js/groups/groups-members.html            |   101 +-
 portal/js/groups/groups-roles.html              |   247 +-
 portal/js/groups/groups-tabs.html               |    45 +-
 portal/js/groups/groups.html                    |   196 +-
 portal/js/libs/Highcharts-2.3.5/index.htm       |    79 -
 .../js/adapters/mootools-adapter.js             |    13 -
 .../js/adapters/mootools-adapter.src.js         |   328 -
 .../js/adapters/prototype-adapter.js            |    16 -
 .../js/adapters/prototype-adapter.src.js        |   385 -
 .../libs/Highcharts-2.3.5/js/highcharts-more.js |    35 -
 .../Highcharts-2.3.5/js/highcharts-more.src.js  |  1581 -
 .../js/libs/Highcharts-2.3.5/js/highcharts.js   |   250 -
 .../libs/Highcharts-2.3.5/js/highcharts.src.js  | 15281 ----------
 .../Highcharts-2.3.5/js/modules/canvas-tools.js |   133 -
 .../js/modules/canvas-tools.src.js              |  3113 --
 .../js/libs/Highcharts-2.3.5/js/modules/data.js |    14 -
 .../Highcharts-2.3.5/js/modules/data.src.js     |   512 -
 .../Highcharts-2.3.5/js/modules/exporting.js    |    23 -
 .../js/modules/exporting.src.js                 |   752 -
 .../Highcharts-2.3.5/js/themes/dark-blue.js     |   263 -
 .../Highcharts-2.3.5/js/themes/dark-green.js    |   263 -
 .../js/libs/Highcharts-2.3.5/js/themes/gray.js  |   262 -
 .../js/libs/Highcharts-2.3.5/js/themes/grid.js  |    95 -
 .../js/libs/Highcharts-2.3.5/js/themes/skies.js |    89 -
 portal/js/libs/angular-1.0.5/angular-cookies.js |   183 -
 .../libs/angular-1.0.5/angular-cookies.min.js   |     7 -
 portal/js/libs/angular-1.0.5/angular-loader.js  |   276 -
 .../js/libs/angular-1.0.5/angular-loader.min.js |     7 -
 portal/js/libs/angular-1.0.5/angular-mocks.js   |  1886 --
 .../js/libs/angular-1.0.5/angular-resource.js   |   445 -
 .../libs/angular-1.0.5/angular-resource.min.js  |    10 -
 .../js/libs/angular-1.0.5/angular-sanitize.js   |   535 -
 .../libs/angular-1.0.5/angular-sanitize.min.js  |    13 -
 portal/js/libs/angular-1.0.5/angular.js         | 14733 ---------
 portal/js/libs/angular-1.0.5/angular.min.js     |   161 -
 portal/js/libs/angular-1.0.5/version.txt        |     1 -
 portal/js/libs/angular-1.1.5/angular-1.1.5.js   | 16876 -----------
 .../js/libs/angular-1.1.5/angular-merge.min.js  |     8 -
 .../angular-1.1.5/angular-resource-1.1.5.js     |   537 -
 .../angularitics-0.8.5-google-analytics.js      |     7 -
 .../js/libs/angularitics/angularitics-0.8.5.js  |     6 -
 portal/js/login/forgot-password.html            |    27 +-
 portal/js/login/loading.html                    |    20 +-
 portal/js/login/login.html                      |   114 +-
 portal/js/login/logout.html                     |    18 +-
 portal/js/login/register.html                   |    80 +-
 portal/js/menu.html                             |    32 +-
 portal/js/menus/appMenu.html                    |    88 +-
 portal/js/menus/orgMenu.html                    |    39 +-
 portal/js/org-overview/org-overview.html        |   269 +-
 portal/js/profile/account.html                  |    31 +-
 portal/js/profile/organizations.html            |   136 +-
 portal/js/profile/profile.html                  |   105 +-
 portal/js/roles/roles-groups.html               |    99 +-
 portal/js/roles/roles-settings.html             |   173 +-
 portal/js/roles/roles-tabs.html                 |    48 +-
 portal/js/roles/roles-users.html                |   100 +-
 portal/js/roles/roles.html                      |   184 +-
 portal/js/shell/shell.html                      |    37 +-
 portal/js/users/users-activities.html           |    75 +-
 portal/js/users/users-feed.html                 |    63 +-
 portal/js/users/users-graph.html                |   125 +-
 portal/js/users/users-groups.html               |   116 +-
 portal/js/users/users-profile.html              |   154 +-
 portal/js/users/users-roles.html                |   258 +-
 portal/js/users/users-tabs.html                 |    17 +-
 portal/js/users/users.html                      |   272 +-
 portal/package.json                             |     7 +-
 portal/scripts/e2e-test.bat                     |    15 +
 portal/scripts/e2e-test.sh                      |    15 +
 portal/scripts/test.bat                         |    15 +
 portal/scripts/test.sh                          |    15 +
 portal/scripts/watchr.rb                        |    15 +
 portal/scripts/web-server.js                    |    19 +
 portal/sdk/usergrid.0.10.4.js                   |  1402 -
 portal/sdk/usergrid.0.10.5.js                   |  1755 --
 portal/sdk/usergrid.0.10.7.js                   |  2265 --
 portal/server.js                                |    19 +
 portal/tests/karma.conf.js                      |    23 +-
 portal/tests/protractor-ignore/profile.spec.js  |    97 +
 portal/tests/protractor/applications.spec.js    |    20 +
 portal/tests/protractor/data.spec.js            |    20 +
 portal/tests/protractor/forgotPassword.spec.js  |    20 +
 portal/tests/protractor/login.spec.js           |    20 +
 portal/tests/protractor/organization.spec.js    |    20 +
 portal/tests/protractor/profile.spec.js         |    77 -
 portal/tests/protractor/roles.spec.js           |    20 +
 portal/tests/protractor/shell.spec.js           |    20 +
 portal/tests/protractor/users.spec.js           |    20 +
 portal/tests/protractor/util.js                 |    24 +-
 portal/tests/protractorConf.js                  |    24 +-
 portal/tests/selenium/chromedriver              |   Bin 22034760 -> 0 bytes
 .../selenium-server-standalone-2.37.0.jar       |   Bin 34730734 -> 0 bytes
 portal/tests/unit/sample.spec.js                |    19 +
 release/pom.xml                                 |    65 +
 release/sign-release.sh                         |    30 +
 release/src/main/assembly/source.xml            |    57 +
 sdks/android/.gitignore                         |    20 -
 sdks/android/README.txt                         |     2 +
 sdks/android/dist/jackson-core-asl-1.9.1.jar    |   Bin 228286 -> 0 bytes
 sdks/android/dist/jackson-mapper-asl-1.9.1.jar  |   Bin 764465 -> 0 bytes
 .../dist/spring-android-core-1.0.0.M4.jar       |   Bin 83065 -> 0 bytes
 .../spring-android-rest-template-1.0.0.M4.jar   |   Bin 137368 -> 0 bytes
 sdks/android/doc/allclasses-frame.html          |    27 -
 sdks/android/doc/allclasses-noframe.html        |    27 -
 sdks/android/doc/constant-values.html           |   153 -
 sdks/android/doc/deprecated-list.html           |   117 -
 sdks/android/doc/help-doc.html                  |   222 -
 sdks/android/doc/index-all.html                 |   371 -
 sdks/android/doc/index.html                     |    68 -
 .../apache/usergrid/android/client/Client.html  |   989 -
 .../client/callbacks/ApiResponseCallback.html   |   224 -
 .../client/callbacks/ClientAsyncTask.html       |   338 -
 .../client/callbacks/ClientCallback.html        |   227 -
 .../callbacks/DeviceRegistrationCallback.html   |   220 -
 .../callbacks/GroupsRetrievedCallback.html      |   220 -
 .../client/callbacks/QueryResultsCallback.html  |   220 -
 .../class-use/ApiResponseCallback.html          |   282 -
 .../callbacks/class-use/ClientAsyncTask.html    |   117 -
 .../callbacks/class-use/ClientCallback.html     |   180 -
 .../class-use/DeviceRegistrationCallback.html   |   171 -
 .../class-use/GroupsRetrievedCallback.html      |   160 -
 .../class-use/QueryResultsCallback.html         |   219 -
 .../android/client/callbacks/package-frame.html |    28 -
 .../client/callbacks/package-summary.html       |   166 -
 .../android/client/callbacks/package-tree.html  |   145 -
 .../android/client/callbacks/package-use.html   |   178 -
 .../android/client/class-use/Client.html        |   117 -
 .../usergrid/android/client/package-frame.html  |    20 -
 .../android/client/package-summary.html         |   137 -
 .../usergrid/android/client/package-tree.html   |   134 -
 .../usergrid/android/client/package-use.html    |   117 -
 .../android/client/utils/DeviceUuidFactory.html |   352 -
 .../android/client/utils/ObjectUtils.html       |   258 -
 .../utils/class-use/DeviceUuidFactory.html      |   117 -
 .../client/utils/class-use/ObjectUtils.html     |   117 -
 .../android/client/utils/package-frame.html     |    21 -
 .../android/client/utils/package-summary.html   |   142 -
 .../android/client/utils/package-tree.html      |   131 -
 .../android/client/utils/package-use.html       |   117 -
 sdks/android/doc/overview-frame.html            |    23 -
 sdks/android/doc/overview-summary.html          |   139 -
 sdks/android/doc/overview-tree.html             |   154 -
 sdks/android/doc/package-list                   |     3 -
 sdks/android/doc/resources/background.gif       |   Bin 2313 -> 0 bytes
 sdks/android/doc/resources/tab.gif              |   Bin 291 -> 0 bytes
 sdks/android/doc/resources/titlebar.gif         |   Bin 10701 -> 0 bytes
 sdks/android/doc/resources/titlebar_end.gif     |   Bin 849 -> 0 bytes
 sdks/android/doc/stylesheet.css                 |   474 -
 .../0.0.6/usergrid-java-client-0.0.6.jar        |   Bin 46389 -> 0 bytes
 .../0.0.6/usergrid-java-client-0.0.6.jar.sha1   |     1 -
 .../0.0.6/usergrid-java-client-0.0.6.pom        |    95 -
 .../0.0.6/usergrid-java-client-0.0.6.pom.sha1   |     1 -
 .../maven-metadata-local.xml                    |    12 -
 sdks/android/pom.xml                            |    43 +-
 .../apache/usergrid/android/client/Client.java  |   185 +-
 .../client/callbacks/ApiResponseCallback.java   |    16 +
 .../client/callbacks/ClientAsyncTask.java       |    16 +
 .../client/callbacks/ClientCallback.java        |    16 +
 .../callbacks/DeviceRegistrationCallback.java   |    16 +
 .../callbacks/GroupsRetrievedCallback.java      |    16 +
 .../client/callbacks/QueryResultsCallback.java  |    16 +
 .../android/client/utils/DeviceUuidFactory.java |    16 +
 .../android/client/utils/ObjectUtils.java       |    16 +
 .../NSubstitute.1.6.0.0/BreakingChanges.txt     |   131 -
 .../packages/NSubstitute.1.6.0.0/CHANGELOG.txt  |   103 -
 .../packages/NSubstitute.1.6.0.0/README.txt     |   119 -
 sdks/dotnet/packages/NUnit.2.6.2/README.txt     |     3 +
 .../packages/Newtonsoft.Json.4.5.11/README.txt  |     3 +
 sdks/dotnet/packages/RestSharp.104.1/readme.txt |    19 -
 .../LocationDotNetSample/Form1.cs               |    18 +-
 .../packages/Geocoder.0.1.0.0/README.txt        |     3 +
 sdks/html5-javascript/README.md                 |    76 +-
 .../examples/all-calls/all-calls.html           |    18 +-
 sdks/html5-javascript/examples/all-calls/app.js |    19 +-
 sdks/html5-javascript/examples/dogs/app.js      |    17 +
 sdks/html5-javascript/examples/dogs/dogs.html   |    19 +-
 sdks/html5-javascript/examples/facebook/app.js  |    17 +
 .../examples/facebook/facebook.html             |    19 +-
 .../examples/facebook/guide.html                |    17 +
 .../examples/persistence/test.html              |    19 +-
 .../examples/persistence/test.js                |    17 +
 sdks/html5-javascript/examples/test/test.html   |    19 +-
 .../extensions/usergrid.validation.js           |    30 +-
 sdks/html5-javascript/index.html                |    17 +
 sdks/html5-javascript/lib/Module.js             |    19 +-
 sdks/html5-javascript/lib/Usergrid.js           |    36 +-
 sdks/html5-javascript/lib/modules/Asset.js      |   168 +-
 sdks/html5-javascript/lib/modules/Client.js     |     8 +-
 sdks/html5-javascript/lib/modules/Entity.js     |   179 +-
 sdks/html5-javascript/lib/modules/Group.js      |     2 +-
 sdks/html5-javascript/tests/mocha/index.html    |    25 +-
 sdks/html5-javascript/tests/mocha/test.js       |    17 +
 .../tests/qunit/apigee_test.html                |    17 +
 sdks/html5-javascript/tests/qunit/tests.js      |    17 +
 sdks/html5-javascript/tests/test.html           |    17 +
 sdks/html5-javascript/tests/test.js             |    17 +
 sdks/html5-javascript/usergrid.js               |   268 +-
 sdks/html5-javascript/usergrid.min.js           |    35 +-
 sdks/ios/Nukefile                               |    17 +
 sdks/ios/UGAPI/v2/UGConnection.h                |    16 +
 sdks/ios/UGAPI/v2/UGConnection.m                |    18 +-
 sdks/ios/UGAPI/v2/UGHTTPClient.h                |    16 +
 sdks/ios/UGAPI/v2/UGHTTPClient.m                |    16 +
 sdks/ios/UGAPI/v2/UGHTTPHelpers.h               |    19 +-
 sdks/ios/UGAPI/v2/UGHTTPHelpers.m               |    17 +-
 sdks/ios/UGAPI/v2/UGHTTPResult.h                |    16 +
 sdks/ios/UGAPI/v2/UGHTTPResult.m                |    16 +
 .../samples/Books/books/AddBookViewController.h |    31 +
 .../samples/Books/books/AddBookViewController.m |    17 +
 sdks/ios/samples/Books/books/AppDelegate.h      |    31 +
 sdks/ios/samples/Books/books/AppDelegate.m      |    17 +
 .../samples/Books/books/BooksViewController.h   |    31 +
 .../samples/Books/books/BooksViewController.m   |    17 +
 .../Books/books/UGSignInViewController.h        |    14 +
 .../Books/books/UGSignInViewController.m        |    17 +
 sdks/ios/samples/Books/books/books-Info.plist   |    18 +
 sdks/ios/samples/Books/books/books-Prefix.pch   |    17 +
 .../Books/books/en.lproj/InfoPlist.strings      |    19 +
 sdks/ios/samples/Books/books/main.m             |    17 +
 .../ios/samples/Browser/browser/UGAppDelegate.h |    14 +
 .../ios/samples/Browser/browser/UGAppDelegate.m |    17 +
 .../Browser/browser/UGAppViewController.h       |    14 +
 .../Browser/browser/UGAppViewController.m       |    17 +
 .../browser/UGCollectionViewController.h        |    14 +
 .../browser/UGCollectionViewController.m        |    17 +
 .../Browser/browser/UGEntityViewController.h    |    14 +
 .../Browser/browser/UGEntityViewController.m    |    17 +
 .../Browser/browser/UGSignInViewController.h    |    14 +
 .../Browser/browser/UGSignInViewController.m    |    17 +
 .../Browser/browser/UGTextViewController.h      |    14 +
 .../Browser/browser/UGTextViewController.m      |    17 +
 .../samples/Browser/browser/browser-Info.plist  |    18 +
 sdks/ios/samples/Browser/browser/main.m         |    17 +
 sdks/ios/samples/parties/parties/AppDelegate.h  |    14 +-
 sdks/ios/samples/parties/parties/AppDelegate.m  |    17 +
 .../parties/parties/PartiesViewController.h     |    14 +-
 .../parties/parties/PartiesViewController.m     |    17 +
 .../parties/parties/PartyViewController.h       |    14 +-
 .../parties/parties/PartyViewController.m       |    17 +
 sdks/ios/samples/parties/parties/main.m         |    17 +
 .../samples/parties/parties/parties-Info.plist  |    18 +
 sdks/ios/test/test_client.nu                    |    17 +
 sdks/ios/test/test_connection.nu                |    17 +
 sdks/java/.gitignore                            |    20 -
 sdks/java/dist/jackson-core-asl-1.9.1.jar       |   Bin 228286 -> 0 bytes
 sdks/java/dist/jackson-mapper-asl-1.9.1.jar     |   Bin 764465 -> 0 bytes
 sdks/java/dist/spring-android-core-1.0.0.M4.jar |   Bin 83065 -> 0 bytes
 .../spring-android-rest-template-1.0.0.M4.jar   |   Bin 137368 -> 0 bytes
 .../usergrid-android-client-0.0.1-SNAPSHOT.jar  |   Bin 66123 -> 0 bytes
 sdks/java/doc/allclasses-frame.html             |    40 -
 sdks/java/doc/allclasses-noframe.html           |    40 -
 sdks/java/doc/constant-values.html              |   731 -
 sdks/java/doc/deprecated-list.html              |   117 -
 sdks/java/doc/help-doc.html                     |   222 -
 sdks/java/doc/index-all.html                    |  1299 -
 sdks/java/doc/index.html                        |    68 -
 .../usergrid/java/client/Client.Query.html      |   238 -
 .../java/client/Client.QueuePosition.html       |   381 -
 .../org/apache/usergrid/java/client/Client.html |  1652 --
 .../java/client/class-use/Client.Query.html     |   246 -
 .../client/class-use/Client.QueuePosition.html  |   192 -
 .../usergrid/java/client/class-use/Client.html  |   175 -
 .../entities/Activity.ActivityCollection.html   |   408 -
 .../entities/Activity.ActivityObject.html       |   720 -
 .../client/entities/Activity.MediaLink.html     |   434 -
 .../usergrid/java/client/entities/Activity.html |  1449 -
 .../usergrid/java/client/entities/Device.html   |   387 -
 .../usergrid/java/client/entities/Entity.html   |   599 -
 .../usergrid/java/client/entities/Group.html    |   427 -
 .../usergrid/java/client/entities/Message.html  |   641 -
 .../usergrid/java/client/entities/User.html     |   707 -
 .../class-use/Activity.ActivityCollection.html  |   117 -
 .../class-use/Activity.ActivityObject.html      |   231 -
 .../entities/class-use/Activity.MediaLink.html  |   191 -
 .../client/entities/class-use/Activity.html     |   203 -
 .../java/client/entities/class-use/Device.html  |   169 -
 .../java/client/entities/class-use/Entity.html  |   415 -
 .../java/client/entities/class-use/Group.html   |   159 -
 .../java/client/entities/class-use/Message.html |   183 -
 .../java/client/entities/class-use/User.html    |   248 -
 .../java/client/entities/package-frame.html     |    28 -
 .../java/client/entities/package-summary.html   |   169 -
 .../java/client/entities/package-tree.html      |   141 -
 .../java/client/entities/package-use.html       |   219 -
 .../java/client/exception/ClientException.html  |   263 -
 .../exception/class-use/ClientException.html    |   117 -
 .../java/client/exception/package-frame.html    |    20 -
 .../java/client/exception/package-summary.html  |   137 -
 .../java/client/exception/package-tree.html     |   142 -
 .../java/client/exception/package-use.html      |   117 -
 .../usergrid/java/client/package-frame.html     |    28 -
 .../usergrid/java/client/package-summary.html   |   167 -
 .../usergrid/java/client/package-tree.html      |   146 -
 .../usergrid/java/client/package-use.html       |   158 -
 .../java/client/response/AggregateCounter.html  |   316 -
 .../client/response/AggregateCounterSet.html    |   444 -
 .../java/client/response/ApiResponse.html       |  1148 -
 .../client/response/ClientCredentialsInfo.html  |   316 -
 .../java/client/response/QueueInfo.html         |   297 -
 .../response/class-use/AggregateCounter.html    |   191 -
 .../response/class-use/AggregateCounterSet.html |   170 -
 .../client/response/class-use/ApiResponse.html  |   365 -
 .../class-use/ClientCredentialsInfo.html        |   170 -
 .../client/response/class-use/QueueInfo.html    |   187 -
 .../java/client/response/package-frame.html     |    24 -
 .../java/client/response/package-summary.html   |   151 -
 .../java/client/response/package-tree.html      |   134 -
 .../java/client/response/package-use.html       |   178 -
 .../usergrid/java/client/utils/JsonUtils.html   |   480 -
 .../usergrid/java/client/utils/MapUtils.html    |   260 -
 .../usergrid/java/client/utils/ObjectUtils.html |   258 -
 .../usergrid/java/client/utils/UrlUtils.html    |   314 -
 .../java/client/utils/class-use/JsonUtils.html  |   117 -
 .../java/client/utils/class-use/MapUtils.html   |   117 -
 .../client/utils/class-use/ObjectUtils.html     |   117 -
 .../java/client/utils/class-use/UrlUtils.html   |   117 -
 .../java/client/utils/package-frame.html        |    23 -
 .../java/client/utils/package-summary.html      |   147 -
 .../java/client/utils/package-tree.html         |   133 -
 .../usergrid/java/client/utils/package-use.html |   117 -
 sdks/java/doc/overview-frame.html               |    25 -
 sdks/java/doc/overview-summary.html             |   147 -
 sdks/java/doc/overview-tree.html                |   184 -
 sdks/java/doc/package-list                      |     5 -
 sdks/java/doc/resources/background.gif          |   Bin 2313 -> 0 bytes
 sdks/java/doc/resources/tab.gif                 |   Bin 291 -> 0 bytes
 sdks/java/doc/resources/titlebar.gif            |   Bin 10701 -> 0 bytes
 sdks/java/doc/resources/titlebar_end.gif        |   Bin 849 -> 0 bytes
 sdks/java/doc/serialized-form.html              |   134 -
 sdks/java/doc/stylesheet.css                    |   474 -
 sdks/java/pom.xml                               |    21 +-
 sdks/nodejs/.gitignore                          |     2 -
 sdks/nodejs/.npmignore                          |     1 -
 sdks/nodejs/lib/usergrid.js                     |   195 +-
 sdks/nodejs/test.js                             |    17 +
 sdks/nodejs/test/client.js                      |    18 +
 sdks/nodejs/test/collection.js                  |    17 +
 sdks/nodejs/test/entity.js                      |    17 +
 sdks/perl/Build.PL                              |    46 +
 sdks/perl/LICENSE                               |   202 +
 sdks/perl/MANIFEST                              |    23 +
 sdks/perl/Makefile.PL                           |    41 +
 sdks/perl/README.md                             |   341 +
 sdks/perl/examples/books.pl                     |    48 +
 sdks/perl/lib/Usergrid/Client.pm                |   492 +
 sdks/perl/lib/Usergrid/Collection.pm            |   212 +
 sdks/perl/lib/Usergrid/Entity.pm                |    92 +
 sdks/perl/lib/Usergrid/Request.pm               |   249 +
 sdks/perl/t/01_init.t                           |    27 +
 sdks/perl/t/02_login.t                          |    64 +
 sdks/perl/t/03_update.t                         |   102 +
 sdks/perl/t/04_collection.t                     |   104 +
 sdks/perl/t/05_query.t                          |   108 +
 sdks/perl/t/06_batch_update.t                   |   107 +
 sdks/perl/t/07_batch_delete.t                   |    87 +
 sdks/perl/t/08_connections.t                    |    94 +
 sdks/perl/t/09_paging.t                         |   140 +
 sdks/perl/t/10_auto_paging.t                    |    94 +
 sdks/php/kessel/config.ini                      |    18 -
 sdks/php/kessel/kessel.rb                       |   188 -
 sdks/ruby-on-rails/.gitignore                   |    18 -
 sdks/ruby-on-rails/.rspec                       |     1 -
 sdks/ruby-on-rails/.rvmrc                       |     2 -
 sdks/usergrid-java-sdk-0.0.6/README.txt         |     5 +
 sdks/usergrid-java-sdk-0.0.6/pom.xml            |   114 +
 .../java/org/usergrid/java/client/Client.java   |  1292 +
 .../usergrid/java/client/entities/Activity.java |   626 +
 .../usergrid/java/client/entities/Device.java   |    68 +
 .../usergrid/java/client/entities/Entity.java   |   191 +
 .../usergrid/java/client/entities/Group.java    |    79 +
 .../usergrid/java/client/entities/Message.java  |   148 +
 .../org/usergrid/java/client/entities/User.java |   158 +
 .../java/client/exception/ClientException.java  |    42 +
 .../java/client/response/AggregateCounter.java  |    52 +
 .../client/response/AggregateCounterSet.java    |   111 +
 .../java/client/response/ApiResponse.java       |   421 +
 .../client/response/ClientCredentialsInfo.java  |    58 +
 .../java/client/response/QueueInfo.java         |    44 +
 .../usergrid/java/client/utils/JsonUtils.java   |   182 +
 .../usergrid/java/client/utils/MapUtils.java    |    39 +
 .../usergrid/java/client/utils/ObjectUtils.java |    36 +
 .../usergrid/java/client/utils/UrlUtils.java    |   124 +
 stack/README.md                                 |    14 +-
 stack/awscluster/aws-sample.properties          |    17 +
 stack/awscluster/src/main/cql/create_locks.cql  |    17 +
 .../awscluster/src/main/cql/create_usergrid.cql |    17 +
 .../main/cql/create_usergrid_applications.cql   |    17 +
 .../main/dist/init_instance/init_rest_server.sh |    13 +-
 stack/cloudbees.xml                             |    18 +
 .../main/resources/usergrid-default.properties  |    29 +-
 stack/config/src/test/resources/cassandra.yaml  |    25 +-
 .../src/test/resources/usergrid-test.properties |    14 +
 stack/core/pom.xml                              |    44 +-
 .../java/org/apache/usergrid/batch/Job.java     |    12 +-
 .../org/apache/usergrid/batch/JobFactory.java   |     2 +-
 .../usergrid/batch/UsergridJobFactory.java      |     6 +-
 .../batch/service/JobSchedulerService.java      |   302 +-
 .../corepersistence/CpEntityManager.java        |    54 +-
 .../corepersistence/CpEntityMapUtils.java       |     2 +-
 .../corepersistence/CpRelationManager.java      |    63 +-
 .../apache/usergrid/metrics/MetricsFactory.java |     8 -
 .../java/org/apache/usergrid/mq/Message.java    |    10 +-
 .../usergrid/mq/cassandra/QueueManagerImpl.java |    38 +-
 .../mq/cassandra/io/AbstractSearch.java         |     5 +-
 .../mq/cassandra/io/ConsumerTransaction.java    |    12 +-
 .../usergrid/persistence/CredentialsInfo.java   |    13 +-
 .../apache/usergrid/persistence/EntityRef.java  |     1 -
 .../persistence/ObservableIterator.java         |    82 +
 .../apache/usergrid/persistence/PathQuery.java  |     8 +-
 .../usergrid/persistence/SimpleEntityRef.java   |    36 +-
 .../cassandra/CassandraPersistenceUtils.java    |     9 +-
 .../persistence/cassandra/CassandraService.java |   137 +-
 .../cassandra/EntityManagerFactoryImpl.java     |     5 +-
 .../cassandra/EntityManagerImpl.java            |    58 +-
 .../persistence/cassandra/GeoIndexManager.java  |    21 +-
 .../persistence/cassandra/QueryProcessor.java   |     3 +-
 .../cassandra/RelationManagerImpl.java          |    55 +-
 .../persistence/cassandra/Serializers.java      |    14 +-
 .../persistence/hector/CountingMutator.java     |   344 +
 .../usergrid/persistence/query/ir/AllNode.java  |    12 +
 .../persistence/query/ir/BooleanNode.java       |    16 +
 .../query/ir/EmailIdentifierNode.java           |    12 +
 .../query/ir/NameIdentifierNode.java            |    12 +
 .../usergrid/persistence/query/ir/NotNode.java  |    12 +
 .../persistence/query/ir/OrderByNode.java       |    16 +-
 .../persistence/query/ir/QueryNode.java         |    12 +
 .../persistence/query/ir/SliceNode.java         |    12 +
 .../query/ir/UuidIdentifierNode.java            |    12 +
 .../persistence/query/ir/WithinNode.java        |    12 +
 .../query/ir/result/SubtractionIterator.java    |     8 +-
 .../org/apache/usergrid/utils/JsonUtils.java    |     8 +-
 .../org/apache/usergrid/utils/UUIDUtils.java    |    11 +
 .../main/resources/usergrid-core-context.xml    |     2 +-
 .../apache/usergrid/batch/BulkTestUtils.java    |    10 +-
 .../usergrid/batch/UsergridJobFactoryTest.java  |     3 +-
 .../usergrid/batch/job/CountdownLatchJob.java   |     6 +
 .../usergrid/batch/job/DelayExecution.java      |     6 +
 .../usergrid/batch/job/DelayHeartbeat.java      |     6 +
 .../batch/job/FailureJobExceuction.java         |    74 -
 .../usergrid/batch/job/FailureJobExecution.java |    87 +
 .../usergrid/batch/job/OnlyOnceExceution.java   |     6 +
 .../job/OnlyOnceUnlockOnFailExceution.java      |     6 +
 .../usergrid/batch/job/SchedulerRuntime1IT.java |     5 +-
 .../usergrid/batch/job/SchedulerRuntime2IT.java |    61 +-
 .../usergrid/batch/job/SchedulerRuntime3IT.java |    39 +-
 .../usergrid/batch/job/SchedulerRuntime4IT.java |    11 +-
 .../usergrid/batch/job/SchedulerRuntime5IT.java |     4 +-
 .../usergrid/batch/job/SchedulerRuntime6IT.java |    14 +-
 .../usergrid/batch/job/SchedulerRuntime7IT.java |    14 +-
 .../usergrid/batch/job/SchedulerRuntime8IT.java |     4 +-
 .../batch/job/SchedulerRuntimeIntervalIT.java   |   115 +
 .../usergrid/batch/job/TestJobListener.java     |    67 +-
 .../usergrid/batch/job/TestJobListenerTest.java |     7 +-
 .../corepersistence/CpEntityMapUtilsTest.java   |   119 +
 .../usergrid/persistence/CollectionIT.java      |    66 +
 .../usergrid/persistence/CountingMutatorIT.java |   119 +
 .../org/apache/usergrid/persistence/GeoIT.java  |    95 +-
 .../persistence/GeoQueryBooleanTest.java        |   190 +
 .../apache/usergrid/persistence/IndexIT.java    |    21 +-
 .../usergrid/persistence/PathQueryIT.java       |     4 +-
 .../cassandra/QueryProcessorTest.java           |    93 +-
 .../query/IntersectionTransitivePagingIT.java   |   163 +
 .../query/IntersectionUnionPagingIT.java        |     4 +-
 .../persistence/query/NotSubPropertyIT.java     |   177 +
 stack/core/src/test/resources/cassandra.yaml    |    17 +
 .../core/src/test/resources/project.properties  |    24 +-
 .../resources/usergrid-properties-context.xml   |    17 +
 .../usergrid-scheduler-test.properties          |    20 +-
 .../test/resources/usergrid-test-context.xml    |    16 +
 .../exception/CollectionRuntimeException.java   |     1 -
 .../exception/WriteUniqueVerifyException.java   |    18 -
 .../mvcc/entity/impl/MvccLogEntryImpl.java      |     3 +-
 .../UniqueValueSerializationStrategyImpl.java   |     2 +-
 .../mvcc/stage/write/WriteUniqueVerify.java     |     7 +-
 .../MvccEntitySerializationStrategyImpl.java    |    25 +-
 .../collection/guice/TestModule.java            |     2 +
 .../mvcc/stage/delete/MarkStartTest.java        |     3 +
 .../collection/mvcc/stage/load/LoadTest.java    |     7 +
 ...MvccEntitySerializationStrategyImplTest.java |    13 +-
 .../collection/util/InvalidIdGenerator.java     |    14 -
 .../src/test/resources/usergrid-UNIT.properties |     1 +
 .../core/astyanax/ColumnNameIterator.java       |    27 +-
 .../persistence/core/astyanax/ColumnSearch.java |    46 +
 .../persistence/core/astyanax/ColumnTypes.java  |     3 +
 .../astyanax/MultiKeyColumnNameIterator.java    |   235 +
 .../core/astyanax/MultiRowColumnIterator.java   |   253 +
 .../core/astyanax/MultiTennantColumnFamily.java |    13 +-
 .../core/hystrix/HystrixCassandra.java          |    73 +-
 .../persistence/core/rx/ObservableIterator.java |     2 +-
 .../persistence/core/rx/OrderedMerge.java       |   194 +-
 .../core/scope/ApplicationScopeImpl.java        |     3 +-
 .../persistence/core/util/ValidationUtils.java  |     2 +-
 .../core/astyanax/ColumnNameIteratorTest.java   |   205 +
 .../MultiKeyColumnNameIteratorTest.java         |   330 +
 .../astyanax/MultiRowColumnIteratorTest.java    |   502 +
 .../persistence/core/astyanax/TestUtils.java    |    76 +
 .../core/cassandra/CassandraRule.java           |    24 +-
 .../persistence/core/rx/OrderedMergeTest.java   |   146 +-
 .../common/src/test/resources/log4j.properties  |    39 +
 .../src/test/resources/usergrid-UNIT.properties |    14 +
 .../src/test/resources/usergrid.properties      |     1 +
 stack/corepersistence/graph/pom.xml             |     7 +
 .../apache/usergrid/persistence/graph/Edge.java |     1 -
 .../usergrid/persistence/graph/GraphFig.java    |    90 +-
 .../persistence/graph/SearchByEdge.java         |     8 +-
 .../persistence/graph/SearchByEdgeType.java     |    18 +-
 .../persistence/graph/guice/GraphModule.java    |    51 +-
 .../persistence/graph/guice/MergedProxy.java    |    34 -
 .../graph/guice/StorageEdgeSerialization.java   |    34 -
 .../graph/impl/CollectionIndexObserver.java     |     2 +-
 .../graph/impl/GraphManagerImpl.java            |    54 +-
 .../persistence/graph/impl/SimpleEdge.java      |     7 +-
 .../graph/impl/SimpleMarkedEdge.java            |     4 +-
 .../graph/impl/SimpleSearchByEdge.java          |    20 +-
 .../graph/impl/SimpleSearchByEdgeType.java      |    22 +-
 .../graph/impl/SimpleSearchByIdType.java        |     6 +-
 .../impl/stage/EdgeDeleteListenerImpl.java      |     3 -
 .../graph/impl/stage/EdgeDeleteRepairImpl.java  |    16 +-
 .../graph/impl/stage/EdgeMetaRepair.java        |     2 -
 .../graph/impl/stage/EdgeMetaRepairImpl.java    |    67 +-
 .../impl/stage/NodeDeleteListenerImpl.java      |    26 +-
 .../EdgeMetadataSerialization.java              |     3 +-
 .../graph/serialization/EdgeSerialization.java  |     3 +-
 .../graph/serialization/NodeSerialization.java  |     3 +-
 .../impl/EdgeMetadataSerializationImpl.java     |     8 +-
 .../impl/EdgeSerializationImpl.java             |  1037 +-
 .../impl/NodeSerializationImpl.java             |    86 +-
 .../serialization/impl/shard/DirectedEdge.java  |    41 +
 .../impl/shard/DirectedEdgeMeta.java            |   575 +
 .../impl/shard/EdgeColumnFamilies.java          |    60 +
 .../serialization/impl/shard/EdgeRowKey.java    |    44 +
 .../impl/shard/EdgeShardSerialization.java      |    24 +-
 .../impl/shard/EdgeShardStrategy.java           |    45 +-
 .../impl/shard/NodeShardAllocation.java         |    21 +-
 .../impl/shard/NodeShardApproximation.java      |    31 +-
 .../impl/shard/NodeShardCache.java              |    21 +-
 .../serialization/impl/shard/NodeType.java      |    66 +
 .../graph/serialization/impl/shard/RowKey.java  |    55 +
 .../serialization/impl/shard/RowKeyType.java    |    66 +
 .../graph/serialization/impl/shard/Shard.java   |   143 +
 .../impl/shard/ShardEntryGroup.java             |   324 +
 .../impl/shard/ShardGroupCompaction.java        |    71 +
 .../impl/shard/ShardedEdgeSerialization.java    |   186 +
 .../serialization/impl/shard/count/Counter.java |     8 +-
 .../shard/count/NodeShardApproximationImpl.java |   177 +-
 .../count/NodeShardCounterSerialization.java    |     2 +-
 .../NodeShardCounterSerializationImpl.java      |    98 +-
 .../impl/shard/count/ShardKey.java              |    53 +-
 .../impl/shard/impl/EdgeRowKey.java             |    46 -
 .../impl/shard/impl/EdgeRowKeySerializer.java   |    58 -
 .../impl/shard/impl/EdgeSearcher.java           |   162 +
 .../shard/impl/EdgeShardSerializationImpl.java  |    90 +-
 .../shard/impl/NodeShardAllocationImpl.java     |   288 +-
 .../impl/shard/impl/NodeShardCacheImpl.java     |   254 +-
 .../shard/impl/ShardEntryGroupIterator.java     |   123 +
 .../shard/impl/ShardGroupColumnIterator.java    |   130 +
 .../shard/impl/ShardGroupCompactionImpl.java    |   618 +
 .../impl/ShardedEdgeSerializationImpl.java      |  1006 +
 .../impl/shard/impl/ShardsColumnIterator.java   |   127 +
 .../shard/impl/SizebasedEdgeColumnFamilies.java |   154 +
 .../shard/impl/SizebasedEdgeShardStrategy.java  |    51 +-
 .../impl/shard/impl/SourceEdgeSearcher.java     |    22 +
 .../DescendingTimestampComparator.java          |    43 +
 .../DirectedEdgeDescendingComparator.java       |    69 +
 .../impl/comparators/OrderedComparator.java     |    52 +
 .../SourceDirectedEdgeDescendingComparator.java |    42 +
 .../TargetDirectedEdgeDescendingComparator.java |    42 +
 .../impl/serialize/EdgeRowKeySerializer.java    |    63 +
 .../shard/impl/serialize/EdgeSerializer.java    |    77 +
 .../serialize/EdgeShardRowKeySerializer.java    |   103 +
 .../shard/impl/serialize/RowSerializer.java     |    63 +
 .../shard/impl/serialize/RowTypeSerializer.java |    62 +
 .../graph/serialization/util/EdgeHasher.java    |    86 -
 .../graph/serialization/util/EdgeUtils.java     |   132 -
 .../serialization/util/GraphValidation.java     |   189 +
 .../graph/ComittedGraphManagerIT.java           |   138 -
 .../graph/CommittedGraphManagerIT.java          |   135 +
 .../persistence/graph/GraphManagerIT.java       |     3 -
 .../persistence/graph/GraphManagerLoadTest.java |     7 +-
 .../graph/GraphManagerShardConsistencyIT.java   |   563 +
 .../graph/GraphManagerShardingIT.java           |    48 +-
 .../graph/GraphManagerStressTest.java           |     9 +-
 .../usergrid/persistence/graph/SimpleTest.java  |    18 +-
 .../graph/StorageGraphManagerIT.java            |     2 +-
 .../graph/impl/EdgeDeleteListenerTest.java      |     4 +-
 .../graph/impl/NodeDeleteListenerTest.java      |     2 -
 .../graph/impl/stage/EdgeDeleteRepairTest.java  |     7 +-
 .../graph/impl/stage/EdgeMetaRepairTest.java    |     2 -
 .../EdgeMetadataSerializationTest.java          |     2 +-
 .../EdgeSerializationChopTest.java              |     7 +-
 .../serialization/NodeSerializationTest.java    |     3 +-
 .../PermanentSerializationTest.java             |     3 -
 .../graph/serialization/TestCount.java          |     1 -
 .../impl/shard/EdgeShardSerializationTest.java  |   108 +-
 .../impl/shard/NodeShardAllocationTest.java     |   620 +-
 .../impl/shard/NodeShardCacheTest.java          |   235 +-
 .../impl/shard/ShardEntryGroupTest.java         |   409 +
 .../impl/shard/ShardGroupCompactionTest.java    |   226 +
 .../shard/count/NodeShardApproximationTest.java |   130 +-
 .../NodeShardCounterSerializationTest.java      |     8 +-
 .../shard/impl/ShardEntryGroupIteratorTest.java |   276 +
 ...rceDirectedEdgeDescendingComparatorTest.java |   136 +
 ...getDirectedEdgeDescendingComparatorTest.java |   136 +
 .../serialization/util/EdgeHasherTest.java      |   501 -
 .../graph/test/util/EdgeTestUtils.java          |    12 +-
 .../graph/src/test/resources/log4j.properties   |     1 +
 .../test/resources/usergrid-SHARD.properties    |    23 +
 .../src/test/resources/usergrid-UNIT.properties |     3 +
 .../persistence/model/entity/Entity.java        |     2 +-
 .../persistence/model/field/AbstractField.java  |     2 +-
 .../persistence/model/field/ArrayField.java     |     4 +
 .../usergrid/persistence/model/field/Field.java |     2 +-
 .../persistence/model/field/SetField.java       |     1 +
 .../model/field/value/EntityObject.java         |    12 +-
 .../persistence/model/entity/SimpleIdTest.java  |    73 +
 .../model/src/test/resources/log4j.properties   |    29 +
 stack/corepersistence/pom.xml                   |     4 +-
 .../src/main/java/CpQueryFilter.tokens          |    47 +
 .../usergrid/persistence/index/query/Query.java |    19 +-
 .../persistence/index/utils/JsonUtils.java      |   329 -
 .../persistence/index/impl/EntityIndexTest.java |    19 +
 .../src/test/resources/log4j.properties         |     6 +-
 .../apache/usergrid/launcher/AppleUtils.java    |    21 +-
 .../launcher/src/main/resources/cassandra.yaml  |    25 +-
 .../1.5.4/AppleJavaExtensions-1.5.4.jar         |   Bin 23531 -> 0 bytes
 .../1.5.4/AppleJavaExtensions-1.5.4.pom         |     9 -
 .../maven-metadata-local.xml                    |    12 -
 .../recaptcha4j/0.0.8/recaptcha4j-0.0.8.jar     |   Bin 10344 -> 0 bytes
 .../recaptcha4j/0.0.8/recaptcha4j-0.0.8.pom     |     9 -
 .../recaptcha4j/maven-metadata-local.xml        |    12 -
 .../0.0.3/usergrid-java-client-0.0.3.jar        |   Bin 45750 -> 0 bytes
 .../usergrid-java-client-0.0.3.jar.lastUpdated  |     5 -
 .../0.0.3/usergrid-java-client-0.0.3.jar.sha1   |     1 -
 .../0.0.3/usergrid-java-client-0.0.3.pom        |    87 -
 .../usergrid-java-client-0.0.3.pom.lastUpdated  |     5 -
 .../0.0.3/usergrid-java-client-0.0.3.pom.sha1   |     1 -
 .../maven-metadata-local.xml                    |    13 -
 stack/mongo-emulator/pom.xml                    |     2 +-
 .../test/resources/usergrid-test-context.xml    |    78 +-
 stack/pom.xml                                   |    69 +-
 stack/query-validator/pom.xml                   |     2 +-
 .../test/resources/usergrid-test-context.xml    |     3 +-
 stack/rest/pom.xml                              |    29 +-
 .../exceptions/JsonParseExceptionMapper.java    |    35 +
 .../apache/usergrid/rest/AbstractRestIT.java    |    11 +
 .../applications/users/MatrixQueryTests.java    |   202 +
 .../users/PermissionsResourceIT.java            |     1 +
 .../rest/applications/utils/UserRepo.java       |     9 +
 .../rest/management/ExportResourceIT.java       |   131 +-
 .../rest/test/resource/MatrixResource.java      |    64 +
 .../rest/test/resource/NamedResource.java       |     5 +
 .../rest/test/resource/SetResource.java         |    12 +
 .../rest/test/resource/ValueResource.java       |    18 +-
 .../resources/usergrid-properties-context.xml   |    17 +
 .../resources/usergrid-rest-deploy-context.xml  |    16 +
 .../test/resources/usergrid-test-context.xml    |    16 +
 stack/services/pom.xml                          |    10 +-
 .../management/AccountCreationProps.java        |     6 +-
 .../cassandra/ManagementServiceImpl.java        |     8 +-
 .../usergrid/management/export/ExportJob.java   |     6 +
 .../management/export/ExportServiceImpl.java    |     5 +
 .../usergrid/services/ServiceRequest.java       |    11 +-
 .../apache/usergrid/management/EmailFlowIT.java |    17 +-
 .../usergrid/management/OrganizationIT.java     |     2 +
 .../resources/usergrid-properties-context.xml   |    17 +
 stack/test-utils/pom.xml                        |     2 +-
 .../src/main/resources/cassandra.yaml           |    25 +-
 .../src/test/resources/project.properties       |    21 +-
 .../resources/usergrid-custom-test.properties   |    16 +
 .../resources/usergrid-properties-context.xml   |    17 +
 stack/tools/pom.xml                             |     2 +-
 .../org/apache/usergrid/tools/AppNameFix.java   |    59 +-
 .../RepairingMismatchedApplicationMetadata.java |    92 +-
 .../src/main/resources/apidoc/applications.yaml |    21 +-
 .../src/main/resources/apidoc/management.yaml   |    21 +-
 stack/tools/src/main/resources/log4j.properties |    45 +
 stack/websocket/pom.xml                         |     2 +-
 ugc/features/step_definitions/ugc_steps.rb      |    23 +-
 ugc/features/support/env.rb                     |    23 +-
 ugc/lib/ugc.rb                                  |    23 +-
 ugc/lib/ugc/application.rb                      |    23 +-
 ugc/lib/ugc/commands/delete.rb                  |    23 +-
 ugc/lib/ugc/commands/get.rb                     |    23 +-
 ugc/lib/ugc/commands/logout.rb                  |    16 +
 ugc/lib/ugc/commands/post.rb                    |    23 +-
 ugc/lib/ugc/commands/profile.rb                 |    23 +-
 ugc/lib/ugc/commands/put.rb                     |    23 +-
 ugc/lib/ugc/commands/query.rb                   |    23 +-
 ugc/lib/ugc/commands/target.rb                  |    23 +-
 ugc/lib/ugc/helpers/curl.rb                     |    23 +-
 ugc/lib/ugc/helpers/format.rb                   |    23 +-
 ugc/lib/ugc/helpers/history.rb                  |    23 +-
 ugc/lib/ugc/helpers/parse.rb                    |    23 +-
 ugc/lib/ugc/helpers/rest.rb                     |    23 +-
 ugc/lib/ugc/management.rb                       |    23 +-
 ugc/lib/ugc/settings.rb                         |    23 +-
 ugc/lib/ugc/version.rb                          |    23 +-
 ugc/test/default_test.rb                        |    23 +-
 ugc/test/test_helper.rb                         |    23 +-
 928 files changed, 28111 insertions(+), 168084 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1d8dd2f6/stack/core/pom.xml
----------------------------------------------------------------------
diff --cc stack/core/pom.xml
index 899d30e,709d9aa..33a0ca4
--- a/stack/core/pom.xml
+++ b/stack/core/pom.xml
@@@ -545,22 -545,43 +544,53 @@@
          <version>2.0.0-SNAPSHOT</version>
      </dependency>
  
+         <dependency>
+             <groupId>org.apache.usergrid.chop</groupId>
+             <artifactId>chop-stack</artifactId>
+             <version>2.0.0-SNAPSHOT</version>
+         </dependency>
+     -->
+ 
      <dependency>
-         <groupId>org.apache.usergrid.chop</groupId>
-         <artifactId>chop-stack</artifactId>
-         <version>2.0.0-SNAPSHOT</version>
-     </dependency>-->
+       <groupId>com.codahale.metrics</groupId>
+       <artifactId>metrics-core</artifactId>
+       <version>${metrics.version}</version>
+     </dependency>
+ 
+     <dependency>
+       <groupId>com.codahale.metrics</groupId>
+       <artifactId>metrics-graphite</artifactId>
+       <version>${metrics.version}</version>
+     </dependency>
+ 
+     <dependency>
+       <groupId>com.netflix.rxjava</groupId>
+       <artifactId>rxjava-core</artifactId>
+       <version>${rx.version}</version>
+     </dependency>
+ 
+     <dependency>
+       <groupId>com.netflix.rxjava</groupId>
+       <artifactId>rxjava-math</artifactId>
+       <version>${rx.version}</version>
+     </dependency>
+ 
+     <dependency>
+       <groupId>com.clearspring.analytics</groupId>
+       <artifactId>stream</artifactId>
+       <version>2.7.0</version>
+     </dependency>
  
 +    <dependency>
 +      <groupId>com.codahale.metrics</groupId>
 +      <artifactId>metrics-core</artifactId>
 +      <version>${metrics.version}</version>
 +    </dependency>
 +    <dependency>
 +      <groupId>com.codahale.metrics</groupId>
 +      <artifactId>metrics-graphite</artifactId>
 +      <version>${metrics.version}</version>
 +    </dependency>
    </dependencies>
  
  </project>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1d8dd2f6/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
----------------------------------------------------------------------
diff --cc stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
index 4640fba,7e1f199..b27a61d
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
@@@ -410,13 -411,13 +411,13 @@@ public class CpEntityManager implement
  
          EntityCollectionManager ecm = managerCache.getEntityCollectionManager( collectionScope );
  
-         if ( !UUIDUtils.isTimeBased( id.getUuid() ) ) {
-             throw new IllegalArgumentException(
-                 "Entity Id " + id.getType() + ":"+ id.getUuid() +" uuid not time based");
-         }
+ //        if ( !UUIDUtils.isTimeBased( id.getUuid() ) ) {
+ //            throw new IllegalArgumentException(
+ //                "Entity Id " + id.getType() + ":"+ id.getUuid() +" uuid not time based");
+ //        }
  
          org.apache.usergrid.persistence.model.entity.Entity cpEntity = 
 -                ecm.load( id ).toBlockingObservable().last();
 +                ecm.load( id ).toBlocking().last();
  
          if ( cpEntity == null ) {
              if ( logger.isDebugEnabled() ) {

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1d8dd2f6/stack/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1d8dd2f6/stack/services/pom.xml
----------------------------------------------------------------------


[27/52] [abbrv] git commit: Merge branch 'two-dot-o' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into two-dot-o

Posted by gr...@apache.org.
Merge branch 'two-dot-o' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into two-dot-o

Conflicts:
	stack/corepersistence/common/src/test/resources/log4j.properties


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: 9855727992a46bddba05dcbff7d820abe468023a
Parents: dc12e8b b1c7051
Author: Dave Johnson <dm...@apigee.com>
Authored: Fri Aug 29 13:48:51 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Fri Aug 29 13:48:51 2014 -0400

----------------------------------------------------------------------
 .gitignore                                      |    4 +-
 .../corepersistence/CpRelationManager.java      |   27 +-
 .../exception/WriteUniqueVerifyException.java   |   18 -
 .../mvcc/entity/impl/MvccLogEntryImpl.java      |    3 +-
 .../UniqueValueSerializationStrategyImpl.java   |    2 +-
 .../mvcc/stage/write/WriteUniqueVerify.java     |    7 +-
 .../collection/guice/TestModule.java            |    2 +
 .../mvcc/stage/delete/MarkStartTest.java        |    3 +
 .../collection/mvcc/stage/load/LoadTest.java    |    7 +
 .../collection/util/InvalidIdGenerator.java     |   14 -
 .../src/test/resources/usergrid-UNIT.properties |    1 +
 .../core/astyanax/ColumnNameIterator.java       |   27 +-
 .../persistence/core/astyanax/ColumnSearch.java |   46 +
 .../persistence/core/astyanax/ColumnTypes.java  |    3 +
 .../astyanax/MultiKeyColumnNameIterator.java    |  235 ++++
 .../core/astyanax/MultiRowColumnIterator.java   |  253 +++++
 .../core/astyanax/MultiTennantColumnFamily.java |   13 +-
 .../core/hystrix/HystrixCassandra.java          |   73 +-
 .../persistence/core/rx/ObservableIterator.java |    2 +-
 .../persistence/core/rx/OrderedMerge.java       |  194 ++--
 .../core/scope/ApplicationScopeImpl.java        |    3 +-
 .../core/astyanax/ColumnNameIteratorTest.java   |  205 ++++
 .../MultiKeyColumnNameIteratorTest.java         |  330 ++++++
 .../astyanax/MultiRowColumnIteratorTest.java    |  502 +++++++++
 .../persistence/core/astyanax/TestUtils.java    |   76 ++
 .../core/cassandra/CassandraRule.java           |   24 +-
 .../persistence/core/rx/OrderedMergeTest.java   |  146 ++-
 .../common/src/test/resources/log4j.properties  |   38 +-
 .../src/test/resources/usergrid.properties      |    1 +
 stack/corepersistence/graph/pom.xml             |    7 +
 .../apache/usergrid/persistence/graph/Edge.java |    1 -
 .../usergrid/persistence/graph/GraphFig.java    |   90 +-
 .../persistence/graph/SearchByEdge.java         |    8 +-
 .../persistence/graph/SearchByEdgeType.java     |   18 +-
 .../persistence/graph/guice/GraphModule.java    |   51 +-
 .../persistence/graph/guice/MergedProxy.java    |   34 -
 .../graph/guice/StorageEdgeSerialization.java   |   34 -
 .../graph/impl/CollectionIndexObserver.java     |    2 +-
 .../graph/impl/GraphManagerImpl.java            |   54 +-
 .../persistence/graph/impl/SimpleEdge.java      |    7 +-
 .../graph/impl/SimpleMarkedEdge.java            |    4 +-
 .../graph/impl/SimpleSearchByEdge.java          |   20 +-
 .../graph/impl/SimpleSearchByEdgeType.java      |   22 +-
 .../graph/impl/SimpleSearchByIdType.java        |    6 +-
 .../impl/stage/EdgeDeleteListenerImpl.java      |    3 -
 .../graph/impl/stage/EdgeDeleteRepairImpl.java  |   16 +-
 .../graph/impl/stage/EdgeMetaRepair.java        |    2 -
 .../graph/impl/stage/EdgeMetaRepairImpl.java    |   67 +-
 .../impl/stage/NodeDeleteListenerImpl.java      |   26 +-
 .../EdgeMetadataSerialization.java              |    3 +-
 .../graph/serialization/EdgeSerialization.java  |    3 +-
 .../graph/serialization/NodeSerialization.java  |    3 +-
 .../impl/EdgeMetadataSerializationImpl.java     |    8 +-
 .../impl/EdgeSerializationImpl.java             | 1037 ++++--------------
 .../impl/NodeSerializationImpl.java             |   86 +-
 .../serialization/impl/shard/DirectedEdge.java  |   41 +
 .../impl/shard/DirectedEdgeMeta.java            |  575 ++++++++++
 .../impl/shard/EdgeColumnFamilies.java          |   60 +
 .../serialization/impl/shard/EdgeRowKey.java    |   44 +
 .../impl/shard/EdgeShardSerialization.java      |   24 +-
 .../impl/shard/EdgeShardStrategy.java           |   45 +-
 .../impl/shard/NodeShardAllocation.java         |   21 +-
 .../impl/shard/NodeShardApproximation.java      |   31 +-
 .../impl/shard/NodeShardCache.java              |   21 +-
 .../serialization/impl/shard/NodeType.java      |   66 ++
 .../graph/serialization/impl/shard/RowKey.java  |   55 +
 .../serialization/impl/shard/RowKeyType.java    |   66 ++
 .../graph/serialization/impl/shard/Shard.java   |  143 +++
 .../impl/shard/ShardEntryGroup.java             |  324 ++++++
 .../impl/shard/ShardGroupCompaction.java        |   71 ++
 .../impl/shard/ShardedEdgeSerialization.java    |  186 ++++
 .../serialization/impl/shard/count/Counter.java |    8 +-
 .../shard/count/NodeShardApproximationImpl.java |  177 +--
 .../count/NodeShardCounterSerialization.java    |    2 +-
 .../NodeShardCounterSerializationImpl.java      |   98 +-
 .../impl/shard/count/ShardKey.java              |   53 +-
 .../impl/shard/impl/EdgeRowKey.java             |   46 -
 .../impl/shard/impl/EdgeRowKeySerializer.java   |   58 -
 .../impl/shard/impl/EdgeSearcher.java           |  162 +++
 .../shard/impl/EdgeShardSerializationImpl.java  |   90 +-
 .../shard/impl/NodeShardAllocationImpl.java     |  288 +++--
 .../impl/shard/impl/NodeShardCacheImpl.java     |  254 +++--
 .../shard/impl/ShardEntryGroupIterator.java     |  123 +++
 .../shard/impl/ShardGroupColumnIterator.java    |  130 +++
 .../shard/impl/ShardGroupCompactionImpl.java    |  618 +++++++++++
 .../impl/ShardedEdgeSerializationImpl.java      | 1006 +++++++++++++++++
 .../impl/shard/impl/ShardsColumnIterator.java   |  127 +++
 .../shard/impl/SizebasedEdgeColumnFamilies.java |  154 +++
 .../shard/impl/SizebasedEdgeShardStrategy.java  |   51 +-
 .../impl/shard/impl/SourceEdgeSearcher.java     |   22 +
 .../DescendingTimestampComparator.java          |   43 +
 .../DirectedEdgeDescendingComparator.java       |   69 ++
 .../impl/comparators/OrderedComparator.java     |   52 +
 .../SourceDirectedEdgeDescendingComparator.java |   42 +
 .../TargetDirectedEdgeDescendingComparator.java |   42 +
 .../impl/serialize/EdgeRowKeySerializer.java    |   63 ++
 .../shard/impl/serialize/EdgeSerializer.java    |   77 ++
 .../serialize/EdgeShardRowKeySerializer.java    |  103 ++
 .../shard/impl/serialize/RowSerializer.java     |   63 ++
 .../shard/impl/serialize/RowTypeSerializer.java |   62 ++
 .../graph/serialization/util/EdgeHasher.java    |   86 --
 .../graph/serialization/util/EdgeUtils.java     |  132 ---
 .../serialization/util/GraphValidation.java     |  189 ++++
 .../graph/ComittedGraphManagerIT.java           |  138 ---
 .../graph/CommittedGraphManagerIT.java          |  135 +++
 .../persistence/graph/GraphManagerIT.java       |    3 -
 .../persistence/graph/GraphManagerLoadTest.java |    7 +-
 .../graph/GraphManagerShardConsistencyIT.java   |  563 ++++++++++
 .../graph/GraphManagerShardingIT.java           |   48 +-
 .../graph/GraphManagerStressTest.java           |    9 +-
 .../usergrid/persistence/graph/SimpleTest.java  |   18 +-
 .../graph/StorageGraphManagerIT.java            |    2 +-
 .../graph/impl/EdgeDeleteListenerTest.java      |    4 +-
 .../graph/impl/NodeDeleteListenerTest.java      |    2 -
 .../graph/impl/stage/EdgeDeleteRepairTest.java  |    7 +-
 .../graph/impl/stage/EdgeMetaRepairTest.java    |    2 -
 .../EdgeMetadataSerializationTest.java          |    2 +-
 .../EdgeSerializationChopTest.java              |    7 +-
 .../serialization/NodeSerializationTest.java    |    3 +-
 .../PermanentSerializationTest.java             |    3 -
 .../graph/serialization/TestCount.java          |    1 -
 .../impl/shard/EdgeShardSerializationTest.java  |  108 +-
 .../impl/shard/NodeShardAllocationTest.java     |  620 ++++++++---
 .../impl/shard/NodeShardCacheTest.java          |  235 ++--
 .../impl/shard/ShardEntryGroupTest.java         |  409 +++++++
 .../impl/shard/ShardGroupCompactionTest.java    |  226 ++++
 .../shard/count/NodeShardApproximationTest.java |  130 ++-
 .../NodeShardCounterSerializationTest.java      |    8 +-
 .../shard/impl/ShardEntryGroupIteratorTest.java |  276 +++++
 ...rceDirectedEdgeDescendingComparatorTest.java |  136 +++
 ...getDirectedEdgeDescendingComparatorTest.java |  136 +++
 .../serialization/util/EdgeHasherTest.java      |  501 ---------
 .../graph/test/util/EdgeTestUtils.java          |   12 +-
 .../graph/src/test/resources/log4j.properties   |    1 +
 .../test/resources/usergrid-SHARD.properties    |   23 +
 .../src/test/resources/usergrid-UNIT.properties |    3 +
 .../persistence/model/entity/SimpleIdTest.java  |   73 ++
 stack/corepersistence/pom.xml                   |    6 +-
 138 files changed, 10787 insertions(+), 3204 deletions(-)
----------------------------------------------------------------------



[08/52] [abbrv] git commit: Updated OrderedMerge to use a faster implementation at runtime. After initialization, it's an O(1) emit operation as long as our produces are fast enough.

Posted by gr...@apache.org.
Updated OrderedMerge to use a faster implementation at runtime.  After initialization, it's an O(1) emit operation as long as our produces are fast enough.

Updated to fix comparator issues

Fixed tests

Changed algorithm.  Counters not decrementing as expected on shard balancing.


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: e040fdf4c2846188455b8cbcbac812e8a44ea69e
Parents: c69c197
Author: Todd Nine <to...@apache.org>
Authored: Mon Aug 18 17:19:11 2014 -0600
Committer: Todd Nine <to...@apache.org>
Committed: Wed Aug 27 21:35:49 2014 -0600

----------------------------------------------------------------------
 .../src/test/resources/usergrid-UNIT.properties |   1 +
 .../core/astyanax/ColumnNameIterator.java       |   3 -
 .../persistence/core/astyanax/ColumnSearch.java |  46 ++
 .../astyanax/MultiKeyColumnNameIterator.java    |  48 +-
 .../core/astyanax/MultiRowColumnIterator.java   | 251 +++++++++
 .../persistence/core/rx/ObservableIterator.java |   2 +-
 .../persistence/core/rx/OrderedMerge.java       | 193 +++----
 .../core/astyanax/ColumnNameIteratorTest.java   | 205 ++++++++
 .../MultiKeyColumnNameIteratorTest.java         | 330 ++++++++++++
 .../astyanax/MultiRowColumnIteratorTest.java    | 387 ++++++++++++++
 .../persistence/core/astyanax/TestUtils.java    |  76 +++
 .../core/cassandra/CassandraRule.java           |   9 +
 .../persistence/core/rx/OrderedMergeTest.java   | 146 +++++-
 .../common/src/test/resources/log4j.properties  |  39 ++
 .../src/test/resources/usergrid.properties      |   1 +
 .../usergrid/persistence/graph/GraphFig.java    |  71 ++-
 .../persistence/graph/SearchByEdge.java         |   6 +
 .../persistence/graph/SearchByEdgeType.java     |  16 +
 .../persistence/graph/guice/GraphModule.java    |   4 +
 .../persistence/graph/guice/MergedProxy.java    |  34 --
 .../graph/impl/SimpleMarkedEdge.java            |   2 +-
 .../graph/impl/SimpleSearchByEdge.java          |  14 +-
 .../graph/impl/SimpleSearchByEdgeType.java      |  16 +-
 .../graph/impl/SimpleSearchByIdType.java        |   4 +-
 .../graph/impl/stage/EdgeDeleteRepairImpl.java  |   5 +-
 .../graph/impl/stage/EdgeMetaRepairImpl.java    |   7 +-
 .../impl/stage/NodeDeleteListenerImpl.java      |   7 +-
 .../impl/shard/DirectedEdgeMeta.java            | 189 ++++++-
 .../graph/serialization/impl/shard/RowKey.java  |  10 +
 .../serialization/impl/shard/RowKeyType.java    |   7 +-
 .../graph/serialization/impl/shard/Shard.java   |   3 +-
 .../impl/shard/ShardEntryGroup.java             |  62 ++-
 .../impl/shard/ShardGroupCompaction.java        |  31 +-
 .../NodeShardCounterSerializationImpl.java      |   9 +-
 .../impl/shard/impl/EdgeRowKeySerializer.java   |  63 ---
 .../impl/shard/impl/EdgeSearcher.java           |  79 ++-
 .../impl/shard/impl/EdgeSerializer.java         |  77 ---
 .../shard/impl/EdgeShardRowKeySerializer.java   | 103 ----
 .../shard/impl/EdgeShardSerializationImpl.java  |   1 +
 .../shard/impl/NodeShardAllocationImpl.java     |  85 ++-
 .../impl/shard/impl/NodeShardCacheImpl.java     |   4 +-
 .../impl/shard/impl/RowSerializer.java          |  63 ---
 .../impl/shard/impl/RowTypeSerializer.java      |  62 ---
 .../shard/impl/ShardEntryGroupIterator.java     |  39 +-
 .../shard/impl/ShardGroupCompactionImpl.java    | 519 +++++++++++++++----
 .../impl/ShardedEdgeSerializationImpl.java      | 187 +++----
 .../impl/shard/impl/ShardsColumnIterator.java   |  27 +-
 .../shard/impl/SizebasedEdgeColumnFamilies.java |   4 +
 .../DescendingTimestampComparator.java          |  43 ++
 .../DirectedEdgeDescendingComparator.java       |  69 +++
 .../impl/comparators/OrderedComparator.java     |  52 ++
 .../SourceDirectedEdgeDescendingComparator.java |  42 ++
 .../TargetDirectedEdgeDescendingComparator.java |  42 ++
 .../impl/serialize/EdgeRowKeySerializer.java    |  63 +++
 .../shard/impl/serialize/EdgeSerializer.java    |  77 +++
 .../serialize/EdgeShardRowKeySerializer.java    | 103 ++++
 .../shard/impl/serialize/RowSerializer.java     |  63 +++
 .../shard/impl/serialize/RowTypeSerializer.java |  62 +++
 .../persistence/graph/GraphManagerLoadTest.java |   4 +-
 .../graph/GraphManagerShardConsistencyIT.java   | 372 +++++++++----
 .../graph/GraphManagerStressTest.java           |   6 +-
 .../graph/impl/stage/EdgeDeleteRepairTest.java  |   5 +-
 .../impl/shard/NodeShardAllocationTest.java     | 249 ++++++++-
 .../impl/shard/ShardEntryGroupTest.java         |  28 +-
 .../impl/shard/ShardGroupCompactionTest.java    | 226 ++++++++
 .../shard/count/NodeShardApproximationTest.java |  12 +
 .../shard/impl/ShardEntryGroupIteratorTest.java | 180 ++++---
 ...rceDirectedEdgeDescendingComparatorTest.java | 136 +++++
 ...getDirectedEdgeDescendingComparatorTest.java | 136 +++++
 .../graph/test/util/EdgeTestUtils.java          |   6 +-
 .../graph/src/test/resources/log4j.properties   |   1 +
 .../src/test/resources/usergrid-UNIT.properties |   2 +
 .../persistence/model/entity/SimpleIdTest.java  |  73 +++
 stack/corepersistence/pom.xml                   |   2 +-
 74 files changed, 4510 insertions(+), 1091 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/collection/src/test/resources/usergrid-UNIT.properties
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/resources/usergrid-UNIT.properties b/stack/corepersistence/collection/src/test/resources/usergrid-UNIT.properties
index 9785b25..d038a4a 100644
--- a/stack/corepersistence/collection/src/test/resources/usergrid-UNIT.properties
+++ b/stack/corepersistence/collection/src/test/resources/usergrid-UNIT.properties
@@ -6,6 +6,7 @@ cassandra.hosts=localhost
 cassandra.cluster_name=Usergrid
 collections.keyspace=Usergrid_Collections
 cassandra.timeout=5000
+cassandra.embedded=true
 
 
 collections.keyspace.strategy.options=replication_factor:1

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/ColumnNameIterator.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/ColumnNameIterator.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/ColumnNameIterator.java
index af4e1f9..6256e9c 100644
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/ColumnNameIterator.java
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/ColumnNameIterator.java
@@ -35,9 +35,6 @@ import com.netflix.hystrix.HystrixCommandGroupKey;
 public class ColumnNameIterator<C, T> implements Iterable<T>, Iterator<T> {
 
 
-    private static final HystrixCommandGroupKey GROUP_KEY = HystrixCommandGroupKey.Factory.asKey( "CassRead" );
-
-
     private final RowQuery<?, C> rowQuery;
     private final ColumnParser<C, T> parser;
     private final boolean skipFirst;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/ColumnSearch.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/ColumnSearch.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/ColumnSearch.java
new file mode 100644
index 0000000..589cb72
--- /dev/null
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/ColumnSearch.java
@@ -0,0 +1,46 @@
+/*
+ *
+ *  * 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.core.astyanax;
+
+
+import com.netflix.astyanax.util.RangeBuilder;
+
+
+/**
+ *
+ *
+ */
+public interface ColumnSearch<T> {
+
+    /**
+     * Set the start value supplied and the user supplied end value (if present)
+     * @param rangeBuilder
+     * @param value The value to set in the start
+     */
+    public  void   buildRange(final RangeBuilder rangeBuilder, final T value);
+
+    /**
+     * Set the range builder with the user supplied start and finish
+     * @param rangeBuilder
+     */
+    public void buildRange(final RangeBuilder rangeBuilder);
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/MultiKeyColumnNameIterator.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/MultiKeyColumnNameIterator.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/MultiKeyColumnNameIterator.java
index c5a8c95..16ae97a 100644
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/MultiKeyColumnNameIterator.java
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/MultiKeyColumnNameIterator.java
@@ -24,22 +24,21 @@ package org.apache.usergrid.persistence.core.astyanax;
 import java.util.Collection;
 import java.util.Comparator;
 import java.util.Iterator;
-import java.util.LinkedList;
 import java.util.NoSuchElementException;
+import java.util.concurrent.ArrayBlockingQueue;
 import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.Exchanger;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.Semaphore;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.locks.ReentrantReadWriteLock;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import org.apache.usergrid.persistence.core.rx.OrderedMerge;
 
 import com.amazonaws.services.redshift.model.UnsupportedOptionException;
-import com.google.common.base.Preconditions;
 
+import rx.Notification;
 import rx.Observable;
 import rx.Subscriber;
+import rx.functions.Action1;
 import rx.schedulers.Schedulers;
 
 
@@ -54,13 +53,26 @@ import rx.schedulers.Schedulers;
 public class MultiKeyColumnNameIterator<C, T> implements Iterable<T>, Iterator<T> {
 
 
-    private InnerIterator<T> iterator;
+    private static final Logger LOG = LoggerFactory.getLogger( MultiKeyColumnNameIterator.class );
+
+    private Iterator<T> iterator;
 
 
     public MultiKeyColumnNameIterator( final Collection<ColumnNameIterator<C, T>> columnNameIterators,
                                        final Comparator<T> comparator, final int bufferSize ) {
 
 
+        //optimization for single use case
+        if ( columnNameIterators.size() == 1 ) {
+            iterator = columnNameIterators.iterator().next();
+            return;
+        }
+
+
+        /**
+         * We have more than 1 iterator, subscribe to all of them on their own thread so they can
+         * produce in parallel.  This way our inner iterator will be filled and processed the fastest
+         */
         Observable<T>[] observables = new Observable[columnNameIterators.size()];
 
         int i = 0;
@@ -77,9 +89,11 @@ public class MultiKeyColumnNameIterator<C, T> implements Iterable<T>, Iterator<T
         Observable<T> merged = OrderedMerge.orderedMerge( comparator, bufferSize, observables ).distinctUntilChanged();
 
 
-        iterator = new InnerIterator(bufferSize);
+        InnerIterator innerIterator = new InnerIterator( bufferSize );
+
+        merged.subscribe( innerIterator );
 
-        merged.subscribe( iterator );
+        iterator = innerIterator;
     }
 
 
@@ -114,9 +128,12 @@ public class MultiKeyColumnNameIterator<C, T> implements Iterable<T>, Iterator<T
      */
     private final class InnerIterator<T> extends Subscriber<T> implements Iterator<T> {
 
-        private CountDownLatch startLatch = new CountDownLatch( 1 );
+        private final CountDownLatch startLatch = new CountDownLatch( 1 );
 
-        private final LinkedBlockingQueue<T> queue;
+        /**
+         * Use an ArrayBlockingQueue for faster access since our upper bounds is static
+         */
+        private final ArrayBlockingQueue<T> queue;
 
 
         private Throwable error;
@@ -126,7 +143,7 @@ public class MultiKeyColumnNameIterator<C, T> implements Iterable<T>, Iterator<T
 
 
         private InnerIterator( int maxSize ) {
-            queue = new LinkedBlockingQueue<>( maxSize );
+            queue = new ArrayBlockingQueue<>( maxSize );
         }
 
 
@@ -148,7 +165,6 @@ public class MultiKeyColumnNameIterator<C, T> implements Iterable<T>, Iterator<T
             }
 
 
-
             //this is almost a busy wait, and is intentional, if we have nothing to poll, we want to get it as soon
             //as it's available.  We generally only hit this once
             do {
@@ -204,11 +220,13 @@ public class MultiKeyColumnNameIterator<C, T> implements Iterable<T>, Iterator<T
         public void onNext( final T t ) {
 
             //may block if we get full, that's expected behavior
+
             try {
+                LOG.trace( "Received element {}" , t );
                 queue.put( t );
             }
             catch ( InterruptedException e ) {
-                throw new RuntimeException( "Unable to take from queue" );
+                throw new RuntimeException( "Unable to insert to queue" );
             }
 
             startLatch.countDown();

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/MultiRowColumnIterator.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/MultiRowColumnIterator.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/MultiRowColumnIterator.java
new file mode 100644
index 0000000..155ce84
--- /dev/null
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/MultiRowColumnIterator.java
@@ -0,0 +1,251 @@
+/*
+ *
+ *  * 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.core.astyanax;
+
+
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+import java.util.TreeSet;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.usergrid.persistence.core.hystrix.HystrixCassandra;
+
+import com.netflix.astyanax.Keyspace;
+import com.netflix.astyanax.model.Column;
+import com.netflix.astyanax.model.ColumnFamily;
+import com.netflix.astyanax.model.ColumnList;
+import com.netflix.astyanax.model.ConsistencyLevel;
+import com.netflix.astyanax.model.Rows;
+import com.netflix.astyanax.query.RowSliceQuery;
+import com.netflix.astyanax.util.RangeBuilder;
+
+
+/**
+ *
+ *
+ */
+public class MultiRowColumnIterator<R, C, T> implements Iterator<T> {
+
+    private static final Logger LOG = LoggerFactory.getLogger( MultiRowColumnIterator.class );
+
+    private final int pageSize;
+
+    private final ColumnFamily<R, C> cf;
+
+
+    private final ColumnParser<C, T> columnParser;
+
+    private final ColumnSearch<T> columnSearch;
+
+    private final Comparator<T> comparator;
+
+
+    private final Collection<R> rowKeys;
+
+    private final Keyspace keyspace;
+
+    private final ConsistencyLevel consistencyLevel;
+
+
+    private T startColumn;
+
+    private boolean moreToFollow;
+
+    private Iterator<T> currentColumnIterator;
+
+
+    /**
+     * Remove after finding bug
+     */
+
+
+    //    private int advanceCount;
+    //
+    //    private final HashMap<T, SeekPosition> seenResults;
+
+    /**
+     * Complete Remove
+     */
+
+
+    /**
+     * Create the iterator
+     */
+    public MultiRowColumnIterator( final Keyspace keyspace, final ColumnFamily<R, C> cf,
+                                   final ConsistencyLevel consistencyLevel, final ColumnParser<C, T> columnParser,
+                                   final ColumnSearch<T> columnSearch, final Comparator<T> comparator,
+                                   final Collection<R> rowKeys, final int pageSize ) {
+        this.cf = cf;
+        this.pageSize = pageSize;
+        this.columnParser = columnParser;
+        this.columnSearch = columnSearch;
+        this.comparator = comparator;
+        this.rowKeys = rowKeys;
+        this.keyspace = keyspace;
+        this.consistencyLevel = consistencyLevel;
+        this.moreToFollow = false;
+
+        //        seenResults = new HashMap<>( pageSize * 10 );
+    }
+
+
+    @Override
+    public boolean hasNext() {
+
+        if ( currentColumnIterator == null || ( !currentColumnIterator.hasNext() && moreToFollow ) ) {
+            advance();
+        }
+
+
+        return currentColumnIterator.hasNext();
+    }
+
+
+    @Override
+    public T next() {
+        if ( !hasNext() ) {
+            throw new NoSuchElementException( "No new element exists" );
+        }
+
+        final T next = currentColumnIterator.next();
+
+        //        LOG.trace( "Emitting {}", next );
+
+        return next;
+    }
+
+
+    @Override
+    public void remove() {
+        throw new UnsupportedOperationException( "Remove is unsupported this is a read only iterator" );
+    }
+
+
+    public void advance() {
+
+
+        /**
+         * If the edge is present, we need to being seeking from this
+         */
+
+
+        //TODO, finalize why this isn't working as expected
+        final int selectSize = startColumn == null ? pageSize : pageSize + 1;
+
+        final RangeBuilder rangeBuilder = new RangeBuilder();
+
+
+        //set the range into the search
+
+        if ( startColumn == null ) {
+            columnSearch.buildRange( rangeBuilder );
+        }
+        else {
+            columnSearch.buildRange( rangeBuilder, startColumn );
+        }
+
+
+        rangeBuilder.setLimit( selectSize );
+
+
+        /**
+         * Get our list of slices
+         */
+        final RowSliceQuery<R, C> query =
+                keyspace.prepareQuery( cf ).setConsistencyLevel( consistencyLevel ).getKeySlice( rowKeys )
+                        .withColumnRange( rangeBuilder.build() );
+
+        final Rows<R, C> result = HystrixCassandra.user( query ).getResult();
+
+        final TreeSet<T> mergedResults = new TreeSet<>( comparator );
+
+
+        //now aggregate them together
+
+        for ( final R key : result.getKeys() ) {
+            final ColumnList<C> columns = result.getRow( key ).getColumns();
+            final int size = columns.size();
+
+            int readIndex = 0;
+
+            //skip the first since it's equal and has been set
+            if ( startColumn != null && size > 0 ) {
+                final T returnedValue = columnParser.parseColumn( columns.getColumnByIndex( 0 ) );
+
+                if ( comparator.compare( returnedValue, startColumn ) == 0 ) {
+                    readIndex++;
+                }
+            }
+
+
+//            T previous = null;
+
+            for (; readIndex < size; readIndex++ ) {
+                final Column<C> column = columns.getColumnByIndex( readIndex );
+                final T returnedValue = columnParser.parseColumn( column );
+
+                /**
+                 * DO NOT remove this section of code. If you're seeing inconsistent results during shard transition, you'll
+                 * need to enable this
+                 */
+//
+//                if ( previous != null && comparator.compare( previous, returnedValue ) == 0 ) {
+//                    throw new RuntimeException( String.format(
+//                            "Cassandra returned 2 unique columns, but your comparator marked them as equal.  This " +
+//                                    "indicates a bug in your comparator.  Previous value was %s and current value is " +
+//                                    "%s",
+//                            previous, returnedValue ) );
+//                }
+//
+//                previous = returnedValue;
+
+                mergedResults.add( returnedValue );
+
+                //prune the mergedResults
+                while ( mergedResults.size() > pageSize ) {
+                    mergedResults.pollLast();
+                }
+            }
+
+            LOG.trace( "Read {} columns from row key {}", readIndex, key );
+            LOG.trace( "Candidate result set size is {}", mergedResults.size() );
+        }
+
+
+        //we've parsed everything truncate to the first pageSize, it's all we can ensure is correct without another
+        //trip back to cassandra
+
+        startColumn = mergedResults.last();
+
+        moreToFollow = mergedResults.size() == pageSize;
+
+        currentColumnIterator = mergedResults.iterator();
+
+        LOG.trace( "Finished parsing {} rows for a total of {} results", rowKeys.size(), mergedResults.size() );
+    }
+}
+
+

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/rx/ObservableIterator.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/rx/ObservableIterator.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/rx/ObservableIterator.java
index a6c3aa9..2bd1edb 100644
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/rx/ObservableIterator.java
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/rx/ObservableIterator.java
@@ -64,7 +64,7 @@ public abstract class ObservableIterator<T> implements Observable.OnSubscribe<T>
             while ( itr.hasNext() && !subscriber.isUnsubscribed() ) {
                 final T next = itr.next();
 
-                log.trace( "Iterator '{}' emitting item '{}'", name, next );
+//                log.trace( "Iterator '{}' emitting item '{}'", name, next );
 
                 subscriber.onNext( next );
             }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/rx/OrderedMerge.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/rx/OrderedMerge.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/rx/OrderedMerge.java
index 4032176..cdad0d1 100644
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/rx/OrderedMerge.java
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/rx/OrderedMerge.java
@@ -20,17 +20,21 @@
 package org.apache.usergrid.persistence.core.rx;
 
 
+import java.util.ArrayDeque;
 import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.Deque;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.NavigableSet;
 import java.util.concurrent.Semaphore;
 import java.util.concurrent.atomic.AtomicInteger;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.collect.TreeMultimap;
+
 import rx.Observable;
 import rx.Subscriber;
 import rx.Subscription;
@@ -40,9 +44,9 @@ import rx.subscriptions.CompositeSubscription;
 
 /**
  * Produces a single Observable from multiple ordered source observables.  The same as the "merge" step in a merge sort.
- * Ensure that your comparator matches the ordering of your inputs, or you may get strange results.
- * The current implementation requires each Observable to be running in it's own thread.  Once backpressure in RX is
- * implemented, this requirement can be removed.
+ * Ensure that your comparator matches the ordering of your inputs, or you may get strange results. The current
+ * implementation requires each Observable to be running in it's own thread.  Once backpressure in RX is implemented,
+ * this requirement can be removed.
  */
 public final class OrderedMerge<T> implements Observable.OnSubscribe<T> {
 
@@ -74,7 +78,7 @@ public final class OrderedMerge<T> implements Observable.OnSubscribe<T> {
 
 
         //when a subscription is received, we need to subscribe on each observable
-        SubscriberCoordinator coordinator = new SubscriberCoordinator( comparator, outerOperation );
+        SubscriberCoordinator coordinator = new SubscriberCoordinator( comparator, outerOperation, observables.length );
 
         InnerObserver<T>[] innerObservers = new InnerObserver[observables.length];
 
@@ -84,7 +88,7 @@ public final class OrderedMerge<T> implements Observable.OnSubscribe<T> {
         for ( int i = 0; i < observables.length; i++ ) {
             //subscribe to each one and add it to the composite
             //create a new inner and subscribe
-            final InnerObserver<T> inner = new InnerObserver<T>( coordinator, maxBufferSize );
+            final InnerObserver<T> inner = new InnerObserver<T>( coordinator, maxBufferSize, i );
 
             coordinator.add( inner );
 
@@ -117,16 +121,19 @@ public final class OrderedMerge<T> implements Observable.OnSubscribe<T> {
         private volatile boolean readyToProduce = false;
 
 
-        private final Comparator<T> comparator;
         private final Subscriber<? super T> subscriber;
+        private final TreeMultimap<T, InnerObserver<T>> nextValues;
         private final List<InnerObserver<T>> innerSubscribers;
+        private final ArrayDeque<InnerObserver<T>> toProduce;
 
 
-        private SubscriberCoordinator( final Comparator<T> comparator, final Subscriber<? super T> subscriber ) {
+        private SubscriberCoordinator( final Comparator<T> comparator, final Subscriber<? super T> subscriber,
+                                       final int innerSize ) {
             //we only want to emit events serially
             this.subscriber = new SerializedSubscriber( subscriber );
-            this.innerSubscribers = new ArrayList<InnerObserver<T>>();
-            this.comparator = comparator;
+            this.innerSubscribers = new ArrayList<>( innerSize );
+            this.nextValues = TreeMultimap.create( comparator, InnerObserverComparator.INSTANCE );
+            this.toProduce = new ArrayDeque<>( innerSize );
         }
 
 
@@ -146,7 +153,7 @@ public final class OrderedMerge<T> implements Observable.OnSubscribe<T> {
                 log.trace( "Completing Observable.  Draining elements from the subscribers", innerSubscribers.size() );
 
                 //Drain the queues
-                while ( !subscriber.isUnsubscribed() && !drained() ) {
+                while ( !subscriber.isUnsubscribed() && (!nextValues.isEmpty() || !toProduce.isEmpty()) ) {
                     next();
                 }
 
@@ -158,6 +165,7 @@ public final class OrderedMerge<T> implements Observable.OnSubscribe<T> {
 
         public void add( InnerObserver<T> inner ) {
             this.innerSubscribers.add( inner );
+            this.toProduce.add( inner );
         }
 
 
@@ -168,100 +176,108 @@ public final class OrderedMerge<T> implements Observable.OnSubscribe<T> {
 
         public void next() {
 
-            //nothing to do, we haven't started emitting values yet
-            if ( !readyToProduce() ) {
-                return;
-            }
-
             //we want to emit items in order, so we synchronize our next
             synchronized ( this ) {
+                /**
+                 * Init before our loop
+                 */
+                while ( !toProduce.isEmpty() ) {
+
+                    InnerObserver<T> inner = toProduce.pop();
+
+                    //This has nothing left to produce, skip it
+                    if ( inner.drained ) {
+                        continue;
+                    }
+
+                    final T nextKey = inner.peek();
+
+                    //we can't produce, not everything has an element to inspect, leave it in the set to produce next
+                    // time
+                    if ( nextKey == null ) {
+                        toProduce.push( inner );
+                        return;
+                    }
+
+                    //add it to our fast access set
+                    nextValues.put( nextKey, inner );
+                }
+
+
+                //take as many elements as we can until we hit a case where we can't take anymore
+                while ( !nextValues.isEmpty() ) {
 
-                //take as many elements as we can until we hit the completed case
-                while ( true ) {
-                    InnerObserver<T> maxObserver = null;
-                    T max = null;
 
                     /**
-                     * TODO T.N. change this to be an 0(1) for min and O(log n) to update after pop rather than O(n*inner)
+                     * Get our lowest key and begin producing until we can't produce any longer
                      */
-                    for ( InnerObserver<T> inner : innerSubscribers ) {
+                    final T lowestKey = nextValues.keySet().first();
 
-                        //nothing to do, this inner
 
-                        //we're done skip it
-                        if ( inner.drained ) {
-                            continue;
-                        }
+                    //we need to create a copy, otherwise we receive errors. We use ArrayDque
 
+                    NavigableSet<InnerObserver<T>> nextObservers = nextValues.get( lowestKey );
 
-                        final T current = inner.peek();
+                    while ( !nextObservers.isEmpty() ) {
 
-                        /**
-                         * Our current is null but we're not drained (I.E we haven't finished and completed consuming)
-                         * This means the producer is slow, and we don't have a complete set to compare,
-                         * we can't produce.  Bail and try again on the next event.
-                         */
-                        if ( current == null ) {
-                            return;
-                        }
+                        final InnerObserver<T> inner = nextObservers.pollFirst();
 
+                        nextValues.remove( lowestKey, inner );
 
-                        if ( max == null || ( current != null
-                                && comparator.compare( current, max ) > 0 ) ) {
-                            maxObserver = inner;
-                            max = current;
-                        }
-                    }
+                        final T value = inner.pop();
 
-                    //No max observer was ever assigned, meaning all our inners are drained, break from loop
-                    if ( maxObserver == null ) {
-                        return;
-                    }
+                        log.trace( "Emitting value {}", value );
 
-                    log.trace( "Max element is item {}", max );
+                        subscriber.onNext( value );
 
-                    subscriber.onNext( maxObserver.pop() );
-                }
-            }
-        }
+                        final T nextKey = inner.peek();
 
+                        //nothing to peek, it's either drained or slow
+                        if ( nextKey == null ) {
 
-        /**
-         * Return true if we're ready to produce
-         */
-        private boolean readyToProduce() {
-            if ( readyToProduce ) {
-                return true;
-            }
+                            //it's drained, nothing left to do
+                            if ( inner.drained ) {
+                                continue;
+                            }
 
+                            //it's slow, we can't process because we don't know if this is another min value without
+                            // inspecting it. Stop emitting and try again next pass through
+                            toProduce.push( inner );
+                            return;
+                        }
 
-            //perform an audit
-            for ( InnerObserver<T> inner : innerSubscribers ) {
-                if ( !inner.started ) {
-                    readyToProduce = false;
-                    return false;
+                        //we have a next value, insert it and keep running
+                        nextValues.put( nextKey, inner );
+                    }
                 }
             }
+        }
 
-            readyToProduce = true;
 
-            //we'll try again next time
-            return false;
-        }
+//        /**
+//         * Return true if every inner observer has been drained
+//         */
+//        private boolean drained() {
+//            //perform an audit
+//            for ( InnerObserver<T> inner : innerSubscribers ) {
+//                if ( !inner.drained ) {
+//                    return false;
+//                }
+//            }
+//
+//            return true;
+//        }
+    }
 
 
-        /**
-         * Return true if every inner observer has been drained
-         */
-        private boolean drained() {
-            //perform an audit
-            for ( InnerObserver<T> inner : innerSubscribers ) {
-                if ( !inner.drained ) {
-                    return false;
-                }
-            }
+    private static final class InnerObserverComparator implements Comparator<InnerObserver> {
 
-            return true;
+        private static final InnerObserverComparator INSTANCE = new InnerObserverComparator();
+
+
+        @Override
+        public int compare( final InnerObserver o1, final InnerObserver o2 ) {
+            return Integer.compare( o1.id, o2.id );
         }
     }
 
@@ -269,13 +285,18 @@ public final class OrderedMerge<T> implements Observable.OnSubscribe<T> {
     private static final class InnerObserver<T> extends Subscriber<T> {
 
         private final SubscriberCoordinator<T> coordinator;
-        private final Deque<T> items = new LinkedList<T>();
+        private final Deque<T> items = new LinkedList<>();
         private final int maxQueueSize;
         /**
          * TODO: T.N. Once backpressure makes it into RX Java, this needs to be remove and should use backpressure
          */
         private final Semaphore semaphore;
 
+        /**
+         * Our id so we have something unique to compare in the multimap
+         */
+        public final int id;
+
 
         /**
          * Flags for synchronization with coordinator. Multiple threads may be used, so volatile is required
@@ -285,9 +306,11 @@ public final class OrderedMerge<T> implements Observable.OnSubscribe<T> {
         private volatile boolean drained = false;
 
 
-        public InnerObserver( final SubscriberCoordinator<T> coordinator, final int maxQueueSize ) {
+        public InnerObserver( final SubscriberCoordinator<T> coordinator, final int maxQueueSize, final int id ) {
             this.coordinator = coordinator;
             this.maxQueueSize = maxQueueSize;
+            this.id = id;
+
             this.semaphore = new Semaphore( maxQueueSize );
         }
 
@@ -302,8 +325,7 @@ public final class OrderedMerge<T> implements Observable.OnSubscribe<T> {
              * release this semaphore and invoke next.  Both these calls can be removed when backpressure is added.
              * We need the next to force removal of other inner consumers
              */
-             coordinator.onCompleted();
-
+            coordinator.onCompleted();
         }
 
 
@@ -316,21 +338,14 @@ public final class OrderedMerge<T> implements Observable.OnSubscribe<T> {
         @Override
         public void onNext( T a ) {
 
-            log.trace( "Received {}", a );
-
             try {
                 this.semaphore.acquire();
             }
             catch ( InterruptedException e ) {
-                onError(e);
-            }
-
-            if ( items.size() == maxQueueSize ) {
-                RuntimeException e =
-                        new RuntimeException( "The maximum queue size of " + maxQueueSize + " has been reached" );
                 onError( e );
             }
 
+
             items.add( a );
 
             started = true;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/astyanax/ColumnNameIteratorTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/astyanax/ColumnNameIteratorTest.java b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/astyanax/ColumnNameIteratorTest.java
new file mode 100644
index 0000000..aabab24
--- /dev/null
+++ b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/astyanax/ColumnNameIteratorTest.java
@@ -0,0 +1,205 @@
+/*
+ *
+ *  * 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.core.astyanax;
+
+
+import java.util.HashMap;
+
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Test;
+
+import org.apache.usergrid.persistence.core.cassandra.CassandraRule;
+import org.apache.usergrid.persistence.core.scope.ApplicationScope;
+import org.apache.usergrid.persistence.model.util.UUIDGenerator;
+
+import com.netflix.astyanax.Keyspace;
+import com.netflix.astyanax.MutationBatch;
+import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
+import com.netflix.astyanax.model.Column;
+import com.netflix.astyanax.model.ColumnFamily;
+import com.netflix.astyanax.model.ConsistencyLevel;
+import com.netflix.astyanax.query.RowQuery;
+import com.netflix.astyanax.serializers.LongSerializer;
+import com.netflix.astyanax.serializers.StringSerializer;
+import com.netflix.astyanax.util.RangeBuilder;
+
+import static org.junit.Assert.assertEquals;
+
+
+public class ColumnNameIteratorTest {
+
+
+    @ClassRule
+    public static CassandraRule rule = new CassandraRule();
+
+    protected static Keyspace keyspace;
+
+    protected ApplicationScope scope;
+
+    protected static ColumnFamily<String, Long> COLUMN_FAMILY =
+            new ColumnFamily<>( "LongTests", StringSerializer.get(), LongSerializer.get() );
+
+    protected static final boolean TRUE = true;
+
+
+    @BeforeClass
+    public static void setup() throws ConnectionException {
+
+
+        final CassandraConfig cassandraConfig = new CassandraConfig() {
+            @Override
+            public ConsistencyLevel getReadCL() {
+                return ConsistencyLevel.CL_QUORUM;
+            }
+
+
+            @Override
+            public ConsistencyLevel getWriteCL() {
+                return ConsistencyLevel.CL_QUORUM;
+            }
+        };
+
+
+        AstyanaxKeyspaceProvider astyanaxKeyspaceProvider =
+                new AstyanaxKeyspaceProvider( rule.getCassandraFig(), cassandraConfig );
+
+        keyspace = astyanaxKeyspaceProvider.get();
+
+        TestUtils.createKeyspace( keyspace );
+
+        TestUtils.createColumnFamiliy( keyspace, COLUMN_FAMILY, new HashMap<String, Object>() );
+    }
+
+
+    @Test
+    public void testSingleIterator() {
+
+        String rowKey1 = UUIDGenerator.newTimeUUID().toString();
+
+
+        final long maxValue = 10000;
+
+
+        /**
+         * Write to both rows in parallel
+         */
+
+
+        final MutationBatch batch = keyspace.prepareMutationBatch();
+
+        for ( long i = 0; i < maxValue; i++ ) {
+            batch.withRow( COLUMN_FAMILY, rowKey1 ).putColumn( i, TRUE );
+
+            if ( i % 1000 == 0 ) {
+                try {
+                    batch.execute();
+                }
+                catch ( ConnectionException e ) {
+                    throw new RuntimeException( e );
+                }
+            }
+        }
+
+        try {
+            batch.execute();
+        }
+        catch ( ConnectionException e ) {
+            throw new RuntimeException( e );
+        }
+
+
+        //now read from them, we should get an iterator that repeats from 0 to 9999 2 x for every entry
+
+        final ColumnParser<Long, Long> longParser = new ColumnParser<Long, Long>() {
+            @Override
+            public Long parseColumn( final Column<Long> column ) {
+                return column.getName();
+            }
+        };
+
+
+        //ensure we have to make several trips, purposefully set to a nonsensical value to ensure we make all the
+        // trips required
+        final RangeBuilder forwardRange = new RangeBuilder().setLimit( 720 );
+
+
+        final RowQuery<String, Long> forwardQuery =
+                keyspace.prepareQuery( COLUMN_FAMILY ).getKey( rowKey1 ).withColumnRange( forwardRange.build() );
+
+
+        ColumnNameIterator<Long, Long> itr = new ColumnNameIterator<>( forwardQuery, longParser, false );
+
+        for ( long i = 0; i < maxValue; i++ ) {
+            assertEquals( i, itr.next().longValue() );
+        }
+
+        //now test it in reverse
+
+
+        final RangeBuilder reverseRange = new RangeBuilder().setLimit( 720 ).setReversed( true );
+
+
+        final RowQuery<String, Long> reverseQuery =
+                keyspace.prepareQuery( COLUMN_FAMILY ).getKey( rowKey1 ).withColumnRange( reverseRange.build() );
+
+
+        ColumnNameIterator<Long, Long> reverseItr = new ColumnNameIterator<>( reverseQuery, longParser, false );
+
+        for ( long i = maxValue - 1; i > -1; i-- ) {
+            assertEquals( i, reverseItr.next().longValue() );
+        }
+    }
+
+
+    //    /**
+    //             * Write to both rows in parallel
+    //             */
+    //            Observable.from( new String[]{rowKey1, rowKey2} ).parallel( new Func1<Observable<String>,
+    // Observable<String>>() {
+    //                @Override
+    //                public Observable<String> call( final Observable<String> stringObservable ) {
+    //                   return stringObservable.doOnNext( new Action1<String>() {
+    //                       @Override
+    //                       public void call( final String key ) {
+    //
+    //                           final MutationBatch batch = keyspace.prepareMutationBatch();
+    //
+    //                           for(long i = 0; i < maxValue; i ++){
+    //                               batch.withRow( COLUMN_FAMILY, key).putColumn( i, TRUE );
+    //
+    //                               if(i % 1000 == 0){
+    //                                   try {
+    //                                       batch.execute();
+    //                                   }
+    //                                   catch ( ConnectionException e ) {
+    //                                       throw new RuntimeException(e);
+    //                                   }
+    //                               }
+    //
+    //                           }
+    //
+    //                       }
+    //                   } );
+    //                }
+    //            } ).toBlocking().last();
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/astyanax/MultiKeyColumnNameIteratorTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/astyanax/MultiKeyColumnNameIteratorTest.java b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/astyanax/MultiKeyColumnNameIteratorTest.java
new file mode 100644
index 0000000..6762588
--- /dev/null
+++ b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/astyanax/MultiKeyColumnNameIteratorTest.java
@@ -0,0 +1,330 @@
+/*
+ *
+ *  * 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.core.astyanax;
+
+
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.HashMap;
+
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Test;
+
+import org.apache.usergrid.persistence.core.cassandra.CassandraRule;
+import org.apache.usergrid.persistence.core.scope.ApplicationScope;
+import org.apache.usergrid.persistence.model.util.UUIDGenerator;
+
+import com.netflix.astyanax.Keyspace;
+import com.netflix.astyanax.MutationBatch;
+import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
+import com.netflix.astyanax.model.Column;
+import com.netflix.astyanax.model.ColumnFamily;
+import com.netflix.astyanax.model.ConsistencyLevel;
+import com.netflix.astyanax.query.RowQuery;
+import com.netflix.astyanax.serializers.LongSerializer;
+import com.netflix.astyanax.serializers.StringSerializer;
+import com.netflix.astyanax.util.RangeBuilder;
+
+import rx.Observable;
+import rx.functions.Action1;
+import rx.functions.Func1;
+
+import static org.junit.Assert.assertEquals;
+
+
+public class MultiKeyColumnNameIteratorTest {
+
+    @ClassRule
+    public static CassandraRule rule = new CassandraRule();
+
+    protected static Keyspace keyspace;
+
+    protected ApplicationScope scope;
+
+    protected static ColumnFamily<String, Long> COLUMN_FAMILY =
+            new ColumnFamily<>( "MultiKeyLongTests", StringSerializer.get(), LongSerializer.get() );
+
+    protected static final boolean TRUE = true;
+
+
+    @BeforeClass
+    public static void setup() throws ConnectionException {
+
+
+        final CassandraConfig cassandraConfig = new CassandraConfig() {
+            @Override
+            public ConsistencyLevel getReadCL() {
+                return ConsistencyLevel.CL_QUORUM;
+            }
+
+
+            @Override
+            public ConsistencyLevel getWriteCL() {
+                return ConsistencyLevel.CL_QUORUM;
+            }
+        };
+
+
+        AstyanaxKeyspaceProvider astyanaxKeyspaceProvider =
+                new AstyanaxKeyspaceProvider( rule.getCassandraFig(), cassandraConfig );
+
+        keyspace = astyanaxKeyspaceProvider.get();
+
+        TestUtils.createKeyspace( keyspace );
+
+        TestUtils.createColumnFamiliy( keyspace, COLUMN_FAMILY, new HashMap<String, Object>() );
+    }
+
+
+    @Test
+    public void multiIterator() {
+
+        final String rowKey1 = UUIDGenerator.newTimeUUID().toString();
+
+        final String rowKey2 = UUIDGenerator.newTimeUUID().toString();
+
+        final String rowKey3 = UUIDGenerator.newTimeUUID().toString();
+
+
+        final long maxValue = 10000;
+
+        /**
+         * Write to both rows in parallel
+         */
+        Observable.from( new String[] { rowKey1, rowKey2, rowKey3 } )
+                  .parallel( new Func1<Observable<String>, Observable<String>>() {
+                      @Override
+                      public Observable<String> call( final Observable<String> stringObservable ) {
+                          return stringObservable.doOnNext( new Action1<String>() {
+                              @Override
+                              public void call( final String key ) {
+
+                                  final MutationBatch batch = keyspace.prepareMutationBatch();
+
+                                  for ( long i = 0; i < maxValue; i++ ) {
+                                      batch.withRow( COLUMN_FAMILY, key ).putColumn( i, TRUE );
+
+                                      if ( i % 1000 == 0 ) {
+                                          try {
+                                              batch.execute();
+                                          }
+                                          catch ( ConnectionException e ) {
+                                              throw new RuntimeException( e );
+                                          }
+                                      }
+                                  }
+
+                                  try {
+                                      batch.execute();
+                                  }
+                                  catch ( ConnectionException e ) {
+                                      throw new RuntimeException( e );
+                                  }
+                              }
+                          } );
+                      }
+                  } ).toBlocking().last();
+
+
+        //create 3 iterators
+
+        ColumnNameIterator<Long, Long> row1Iterator = createIterator( rowKey1, false );
+        ColumnNameIterator<Long, Long> row2Iterator = createIterator( rowKey2, false );
+        ColumnNameIterator<Long, Long> row3Iterator = createIterator( rowKey3, false );
+
+        final Comparator<Long> ascendingComparator = new Comparator<Long>() {
+
+            @Override
+            public int compare( final Long o1, final Long o2 ) {
+                return Long.compare( o1, o2 );
+            }
+        };
+
+        /**
+         * Again, arbitrary buffer size to attempt we buffer at some point
+         */
+        final MultiKeyColumnNameIterator<Long, Long> ascendingItr =
+                new MultiKeyColumnNameIterator<>( Arrays.asList( row1Iterator, row2Iterator, row3Iterator ),
+                        ascendingComparator, 900 );
+
+
+        //ensure we have to make several trips, purposefully set to a nonsensical value to ensure we make all the
+        // trips required
+
+
+        for ( long i = 0; i < maxValue; i++ ) {
+            assertEquals( i, ascendingItr.next().longValue() );
+        }
+
+        //now test it in reverse
+
+        ColumnNameIterator<Long, Long> row1IteratorDesc = createIterator( rowKey1, true );
+        ColumnNameIterator<Long, Long> row2IteratorDesc = createIterator( rowKey2, true );
+        ColumnNameIterator<Long, Long> row3IteratorDesc = createIterator( rowKey3, true );
+
+        final Comparator<Long> descendingComparator = new Comparator<Long>() {
+
+            @Override
+            public int compare( final Long o1, final Long o2 ) {
+                return ascendingComparator.compare( o1, o2 ) * -1;
+            }
+        };
+
+        /**
+         * Again, arbitrary buffer size to attempt we buffer at some point
+         */
+        final MultiKeyColumnNameIterator<Long, Long> descendingItr =
+                new MultiKeyColumnNameIterator<>( Arrays.asList( row1IteratorDesc, row2IteratorDesc, row3IteratorDesc ),
+                        descendingComparator, 900 );
+
+
+        for ( long i = maxValue - 1; i > -1; i-- ) {
+            assertEquals( i, descendingItr.next().longValue() );
+        }
+    }
+
+
+    @Test
+       public void singleIterator() {
+
+           final String rowKey1 = UUIDGenerator.newTimeUUID().toString();
+
+
+
+           final long maxValue = 10000;
+
+           /**
+            * Write to both rows in parallel
+            */
+           Observable.just( rowKey1  )
+                     .parallel( new Func1<Observable<String>, Observable<String>>() {
+                         @Override
+                         public Observable<String> call( final Observable<String> stringObservable ) {
+                             return stringObservable.doOnNext( new Action1<String>() {
+                                 @Override
+                                 public void call( final String key ) {
+
+                                     final MutationBatch batch = keyspace.prepareMutationBatch();
+
+                                     for ( long i = 0; i < maxValue; i++ ) {
+                                         batch.withRow( COLUMN_FAMILY, key ).putColumn( i, TRUE );
+
+                                         if ( i % 1000 == 0 ) {
+                                             try {
+                                                 batch.execute();
+                                             }
+                                             catch ( ConnectionException e ) {
+                                                 throw new RuntimeException( e );
+                                             }
+                                         }
+                                     }
+
+                                     try {
+                                         batch.execute();
+                                     }
+                                     catch ( ConnectionException e ) {
+                                         throw new RuntimeException( e );
+                                     }
+                                 }
+                             } );
+                         }
+                     } ).toBlocking().last();
+
+
+           //create 3 iterators
+
+           ColumnNameIterator<Long, Long> row1Iterator = createIterator( rowKey1, false );
+
+           final Comparator<Long> ascendingComparator = new Comparator<Long>() {
+
+               @Override
+               public int compare( final Long o1, final Long o2 ) {
+                   return Long.compare( o1, o2 );
+               }
+           };
+
+           /**
+            * Again, arbitrary buffer size to attempt we buffer at some point
+            */
+           final MultiKeyColumnNameIterator<Long, Long> ascendingItr =
+                   new MultiKeyColumnNameIterator<>( Arrays.asList( row1Iterator ),
+                           ascendingComparator, 900 );
+
+
+           //ensure we have to make several trips, purposefully set to a nonsensical value to ensure we make all the
+           // trips required
+
+
+           for ( long i = 0; i < maxValue; i++ ) {
+               //we have 3 iterators, so we should get each value 3 times in the aggregation
+               assertEquals( i, ascendingItr.next().longValue() );
+           }
+
+           //now test it in reverse
+
+           ColumnNameIterator<Long, Long> row1IteratorDesc = createIterator( rowKey1, true );
+
+           final Comparator<Long> descendingComparator = new Comparator<Long>() {
+
+               @Override
+               public int compare( final Long o1, final Long o2 ) {
+                   return ascendingComparator.compare( o1, o2 ) * -1;
+               }
+           };
+
+           /**
+            * Again, arbitrary buffer size to attempt we buffer at some point
+            */
+           final MultiKeyColumnNameIterator<Long, Long> descendingItr =
+                   new MultiKeyColumnNameIterator<>( Arrays.asList( row1IteratorDesc),
+                           descendingComparator, 900 );
+
+
+           for ( long i = maxValue - 1; i > -1; i-- ) {
+               assertEquals( i, descendingItr.next().longValue() );
+           }
+       }
+
+
+    private static ColumnNameIterator<Long, Long> createIterator( final String rowKey, final boolean reversed ) {
+
+
+        final ColumnParser<Long, Long> longParser = new ColumnParser<Long, Long>() {
+            @Override
+            public Long parseColumn( final Column<Long> column ) {
+                return column.getName();
+            }
+        };
+
+        final RangeBuilder forwardRange = new RangeBuilder().setLimit( 720 ).setReversed( reversed );
+
+
+        final RowQuery<String, Long> forwardQuery =
+                keyspace.prepareQuery( COLUMN_FAMILY ).getKey( rowKey ).withColumnRange( forwardRange.build() );
+
+
+        ColumnNameIterator<Long, Long> itr = new ColumnNameIterator<>( forwardQuery, longParser, false );
+
+        return itr;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/astyanax/MultiRowColumnIteratorTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/astyanax/MultiRowColumnIteratorTest.java b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/astyanax/MultiRowColumnIteratorTest.java
new file mode 100644
index 0000000..8a8d0b0
--- /dev/null
+++ b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/astyanax/MultiRowColumnIteratorTest.java
@@ -0,0 +1,387 @@
+/*
+ *
+ *  * 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.core.astyanax;
+
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.concurrent.CountDownLatch;
+
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Test;
+
+import org.apache.usergrid.persistence.core.cassandra.CassandraRule;
+import org.apache.usergrid.persistence.core.scope.ApplicationScope;
+import org.apache.usergrid.persistence.model.util.UUIDGenerator;
+
+import com.netflix.astyanax.Keyspace;
+import com.netflix.astyanax.MutationBatch;
+import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
+import com.netflix.astyanax.model.Column;
+import com.netflix.astyanax.model.ColumnFamily;
+import com.netflix.astyanax.model.ConsistencyLevel;
+import com.netflix.astyanax.serializers.LongSerializer;
+import com.netflix.astyanax.serializers.StringSerializer;
+import com.netflix.astyanax.util.RangeBuilder;
+
+import rx.Observable;
+import rx.Observer;
+import rx.Subscription;
+import rx.functions.Action1;
+import rx.functions.Func1;
+
+import static org.junit.Assert.assertEquals;
+
+
+public class MultiRowColumnIteratorTest {
+
+    @ClassRule
+    public static CassandraRule rule = new CassandraRule();
+
+    protected static Keyspace keyspace;
+
+    protected ApplicationScope scope;
+
+    protected static ColumnFamily<String, Long> COLUMN_FAMILY =
+            new ColumnFamily<>( "MultiRowLongTests", StringSerializer.get(), LongSerializer.get() );
+
+    protected static final boolean TRUE = true;
+
+
+    @BeforeClass
+    public static void setup() throws ConnectionException {
+
+
+        final CassandraConfig cassandraConfig = new CassandraConfig() {
+            @Override
+            public ConsistencyLevel getReadCL() {
+                return ConsistencyLevel.CL_QUORUM;
+            }
+
+
+            @Override
+            public ConsistencyLevel getWriteCL() {
+                return ConsistencyLevel.CL_QUORUM;
+            }
+        };
+
+
+        AstyanaxKeyspaceProvider astyanaxKeyspaceProvider =
+                new AstyanaxKeyspaceProvider( rule.getCassandraFig(), cassandraConfig );
+
+        keyspace = astyanaxKeyspaceProvider.get();
+
+        TestUtils.createKeyspace( keyspace );
+
+        TestUtils.createColumnFamiliy( keyspace, COLUMN_FAMILY, new HashMap<String, Object>() );
+    }
+
+
+    @Test
+    public void multiIterator() throws InterruptedException {
+
+        final String rowKey1 = UUIDGenerator.newTimeUUID().toString();
+
+        final String rowKey2 = UUIDGenerator.newTimeUUID().toString();
+
+        final String rowKey3 = UUIDGenerator.newTimeUUID().toString();
+
+
+        final long maxValue = 10000;
+
+        final CountDownLatch latch = new CountDownLatch( 3 );
+
+
+        writeData( latch, rowKey1, maxValue, 1 );
+        writeData( latch, rowKey2, maxValue, 2 );
+        writeData( latch, rowKey3, maxValue, 10 );
+
+
+        latch.await();
+
+
+        //create 3 iterators
+
+
+        final ColumnParser<Long, Long> longParser = new ColumnParser<Long, Long>() {
+            @Override
+            public Long parseColumn( final Column<Long> column ) {
+                return column.getName();
+            }
+        };
+
+
+        final ColumnSearch<Long> ascendingSearch = new ColumnSearch<Long>() {
+            @Override
+            public void buildRange( final RangeBuilder rangeBuilder, final Long value ) {
+                rangeBuilder.setStart( value );
+            }
+
+
+            @Override
+            public void buildRange( final RangeBuilder rangeBuilder ) {
+
+            }
+        };
+
+
+        final Comparator<Long> ascendingComparator = new Comparator<Long>() {
+
+            @Override
+            public int compare( final Long o1, final Long o2 ) {
+                return Long.compare( o1, o2 );
+            }
+        };
+
+
+        final Collection<String> rowKeys = Arrays.asList( rowKey1, rowKey2, rowKey3 );
+
+        MultiRowColumnIterator<String, Long, Long> ascendingItr =
+                new MultiRowColumnIterator<>( keyspace, COLUMN_FAMILY, ConsistencyLevel.CL_QUORUM, longParser,
+                        ascendingSearch, ascendingComparator, rowKeys, 852 );
+
+
+        //ensure we have to make several trips, purposefully set to a nonsensical value to ensure we make all the
+        // trips required
+
+
+        for ( long i = 0; i < maxValue; i++ ) {
+            assertEquals( i, ascendingItr.next().longValue() );
+        }
+
+
+        final ColumnSearch<Long> descendingSearch = new ColumnSearch<Long>() {
+            @Override
+            public void buildRange( final RangeBuilder rangeBuilder, final Long value ) {
+                rangeBuilder.setStart( value );
+                buildRange( rangeBuilder );
+            }
+
+
+            @Override
+            public void buildRange( final RangeBuilder rangeBuilder ) {
+                rangeBuilder.setReversed( true );
+            }
+        };
+
+
+        final Comparator<Long> descendingComparator = new Comparator<Long>() {
+
+            @Override
+            public int compare( final Long o1, final Long o2 ) {
+                return ascendingComparator.compare( o1, o2 ) * -1;
+            }
+        };
+
+
+        MultiRowColumnIterator<String, Long, Long> descendingItr =
+                new MultiRowColumnIterator<>( keyspace, COLUMN_FAMILY, ConsistencyLevel.CL_QUORUM, longParser,
+                        descendingSearch, descendingComparator, rowKeys, 712 );
+
+        for ( long i = maxValue - 1; i > -1; i-- ) {
+            assertEquals( i, descendingItr.next().longValue() );
+        }
+    }
+
+
+    @Test
+    public void singleIterator() {
+
+        final String rowKey1 = UUIDGenerator.newTimeUUID().toString();
+
+
+        final long maxValue = 10000;
+
+        /**
+         * Write to both rows in parallel
+         */
+        Observable.just( rowKey1 ).parallel( new Func1<Observable<String>, Observable<String>>() {
+            @Override
+            public Observable<String> call( final Observable<String> stringObservable ) {
+                return stringObservable.doOnNext( new Action1<String>() {
+                    @Override
+                    public void call( final String key ) {
+
+                        final MutationBatch batch = keyspace.prepareMutationBatch();
+
+                        for ( long i = 0; i < maxValue; i++ ) {
+                            batch.withRow( COLUMN_FAMILY, key ).putColumn( i, TRUE );
+
+                            if ( i % 1000 == 0 ) {
+                                try {
+                                    batch.execute();
+                                }
+                                catch ( ConnectionException e ) {
+                                    throw new RuntimeException( e );
+                                }
+                            }
+                        }
+
+                        try {
+                            batch.execute();
+                        }
+                        catch ( ConnectionException e ) {
+                            throw new RuntimeException( e );
+                        }
+                    }
+                } );
+            }
+        } ).toBlocking().last();
+
+
+        //create 3 iterators
+
+        final ColumnParser<Long, Long> longParser = new ColumnParser<Long, Long>() {
+            @Override
+            public Long parseColumn( final Column<Long> column ) {
+                return column.getName();
+            }
+        };
+
+
+        final ColumnSearch<Long> ascendingSearch = new ColumnSearch<Long>() {
+            @Override
+            public void buildRange( final RangeBuilder rangeBuilder, final Long value ) {
+                rangeBuilder.setStart( value );
+            }
+
+
+            @Override
+            public void buildRange( final RangeBuilder rangeBuilder ) {
+
+            }
+        };
+
+
+        final Comparator<Long> ascendingComparator = new Comparator<Long>() {
+
+            @Override
+            public int compare( final Long o1, final Long o2 ) {
+                return Long.compare( o1, o2 );
+            }
+        };
+
+
+        final Collection<String> rowKeys = Arrays.asList( rowKey1 );
+
+        MultiRowColumnIterator<String, Long, Long> ascendingItr =
+                new MultiRowColumnIterator<>( keyspace, COLUMN_FAMILY, ConsistencyLevel.CL_QUORUM, longParser,
+                        ascendingSearch, ascendingComparator, rowKeys, 712 );
+
+
+        //ensure we have to make several trips, purposefully set to a nonsensical value to ensure we make all the
+        // trips required
+
+
+        for ( long i = 0; i < maxValue; i++ ) {
+            assertEquals( i, ascendingItr.next().longValue() );
+        }
+
+
+        final ColumnSearch<Long> descendingSearch = new ColumnSearch<Long>() {
+            @Override
+            public void buildRange( final RangeBuilder rangeBuilder, final Long value ) {
+                rangeBuilder.setStart( value );
+                buildRange( rangeBuilder );
+            }
+
+
+            @Override
+            public void buildRange( final RangeBuilder rangeBuilder ) {
+                rangeBuilder.setReversed( true );
+            }
+        };
+
+
+        final Comparator<Long> descendingComparator = new Comparator<Long>() {
+
+            @Override
+            public int compare( final Long o1, final Long o2 ) {
+                return ascendingComparator.compare( o1, o2 ) * -1;
+            }
+        };
+
+
+        MultiRowColumnIterator<String, Long, Long> descendingItr =
+                new MultiRowColumnIterator<>( keyspace, COLUMN_FAMILY, ConsistencyLevel.CL_QUORUM, longParser,
+                        descendingSearch, descendingComparator, rowKeys, 712 );
+
+        for ( long i = maxValue - 1; i > -1; i-- ) {
+            assertEquals( i, descendingItr.next().longValue() );
+        }
+    }
+
+
+    private void writeData(final CountDownLatch latch, final String rowKey, final long maxValue, final long mod){
+
+        Observable.just( rowKey ).doOnNext( new Action1<String>() {
+            @Override
+            public void call( final String key ) {
+
+                final MutationBatch batch = keyspace.prepareMutationBatch();
+
+                for ( long i = 0; i < maxValue; i++ ) {
+
+                    if ( i % mod == 0 ) {
+                        batch.withRow( COLUMN_FAMILY, key ).putColumn( i, TRUE );
+                    }
+
+                    if ( i % 1000 == 0 ) {
+                                               try {
+                                                   batch.execute();
+                                               }
+                                               catch ( ConnectionException e ) {
+                                                   throw new RuntimeException( e );
+                                               }
+                                           }
+                }
+
+                try {
+                    batch.execute();
+                }
+                catch ( ConnectionException e ) {
+                    throw new RuntimeException( e );
+                }
+            }
+        } ).subscribe( new Observer<String>() {
+            @Override
+            public void onCompleted() {
+                latch.countDown();
+            }
+
+
+            @Override
+            public void onError( final Throwable e ) {
+
+            }
+
+
+            @Override
+            public void onNext( final String s ) {
+
+            }
+        } );
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/astyanax/TestUtils.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/astyanax/TestUtils.java b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/astyanax/TestUtils.java
new file mode 100644
index 0000000..1ede643
--- /dev/null
+++ b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/astyanax/TestUtils.java
@@ -0,0 +1,76 @@
+/*
+ *
+ *  * 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.core.astyanax;
+
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+import com.google.common.collect.ImmutableMap;
+import com.netflix.astyanax.Keyspace;
+import com.netflix.astyanax.model.ColumnFamily;
+
+
+/**
+ * Utilities for Cassandra tests
+ */
+public class TestUtils {
+
+    private static final Logger log = LoggerFactory.getLogger( TestUtils.class );
+
+    /**
+     * Create the kespace, ignore exceptions if it already exists
+     * @param keyspace
+     */
+    public static void createKeyspace(final Keyspace keyspace){
+
+        ImmutableMap.Builder<Object, Object> strategyOptions = ImmutableMap.builder().put( "replication_factor", "1" );
+
+        ImmutableMap<String, Object> options = ImmutableMap.<String, Object>builder().put( "strategy_class",
+                "org.apache.cassandra.locator.SimpleStrategy" ).put( "strategy_options", strategyOptions.build() )
+                                                           .build();
+
+
+        try {
+            keyspace.createKeyspace( options );
+        }
+        catch ( Throwable t ) {
+          log.error( "Error on creating keyspace, ignoring", t );
+        }
+
+
+
+    }
+
+
+    public static <K, C> void createColumnFamiliy(final Keyspace keyspace, final ColumnFamily<K, C> columnFamily, final Map<String, Object> options){
+        try{
+            keyspace.createColumnFamily( columnFamily, new HashMap<String, Object>() );
+        }catch(Exception e){
+           log.error( "Error on creating column family, ignoring" , e);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/cassandra/CassandraRule.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/cassandra/CassandraRule.java b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/cassandra/CassandraRule.java
index ee89e0f..43f5a0c 100644
--- a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/cassandra/CassandraRule.java
+++ b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/cassandra/CassandraRule.java
@@ -51,6 +51,15 @@ public class CassandraRule extends EnvironResource {
         cassandraFig = injector.getInstance( CassandraFig.class );
     }
 
+
+    /**
+     * Get the cassandra fig
+     * @return
+     */
+    public CassandraFig getCassandraFig(){
+        return cassandraFig;
+    }
+
     @Override
     protected void before() throws Throwable {
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/rx/OrderedMergeTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/rx/OrderedMergeTest.java b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/rx/OrderedMergeTest.java
index 72e49f7..07e2e58 100644
--- a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/rx/OrderedMergeTest.java
+++ b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/rx/OrderedMergeTest.java
@@ -107,7 +107,7 @@ public class OrderedMergeTest {
 
 
         Observable<Integer> ordered =
-                OrderedMerge.orderedMerge( new IntegerComparator(), 10, expected1, expected2, expected3 );
+                OrderedMerge.orderedMerge( new ReverseIntegerComparator(), 10, expected1, expected2, expected3 );
 
         final CountDownLatch latch = new CountDownLatch( 1 );
         final List<Integer> results = new ArrayList();
@@ -165,7 +165,7 @@ public class OrderedMergeTest {
         //set our buffer size to 2.  We should easily exceed this since every observable has more than 2 elements
 
         Observable<Integer> ordered =
-                OrderedMerge.orderedMerge( new IntegerComparator(), 2, expected1, expected2, expected3 );
+                OrderedMerge.orderedMerge( new ReverseIntegerComparator(), 2, expected1, expected2, expected3 );
 
         final CountDownLatch latch = new CountDownLatch( 1 );
         final List<Integer> results = new ArrayList();
@@ -228,7 +228,7 @@ public class OrderedMergeTest {
 
 
         Observable<Integer> ordered =
-                OrderedMerge.orderedMerge( new IntegerComparator(), 10, expected1, expected2, expected3 );
+                OrderedMerge.orderedMerge( new ReverseIntegerComparator(), 10, expected1, expected2, expected3 );
 
         final CountDownLatch latch = new CountDownLatch( 1 );
         final List<Integer> results = new ArrayList();
@@ -359,7 +359,7 @@ public class OrderedMergeTest {
          * proceed
          */
         Observable<Integer> ordered =
-                OrderedMerge.orderedMerge( new IntegerComparator(), 2, expected1, expected2, expected3 );
+                OrderedMerge.orderedMerge( new ReverseIntegerComparator(), 2, expected1, expected2, expected3 );
 
 
         final CountDownLatch latch = new CountDownLatch( 1 );
@@ -399,6 +399,144 @@ public class OrderedMergeTest {
     }
 
 
+    /**
+       * Tests that with a buffer size much smaller than our inputs, we successfully block observables from
+       * producing values when our pressure gets too high.  Eventually, one of these events should begin production, eventually
+       * draining all values
+       *
+       * @throws InterruptedException
+       */
+      @Test
+      public void testDuplicateOrderingCorrect() throws InterruptedException {
+
+          List<Integer> expected1List = Arrays.asList( 10, 5, 4,  3, 2, 1 );
+
+          Observable<Integer> expected1 = Observable.from( expected1List ).subscribeOn( Schedulers.io() );
+
+          List<Integer> expected2List = Arrays.asList( 9, 8, 7, 6, 5 );
+
+          Observable<Integer> expected2 = Observable.from( expected2List ).subscribeOn( Schedulers.io() );
+
+
+          List<Integer> expected3List = Arrays.asList( 9, 6, 5, 3, 2, 1, 0 );
+
+          Observable<Integer> expected3 = Observable.from( expected3List ).subscribeOn( Schedulers.io() );
+
+
+          /**
+           * Fails because our first observable will have to buffer the last 4 elements while waiting for the others to
+           * proceed
+           */
+          Observable<Integer> ordered =
+                  OrderedMerge.orderedMerge( new ReverseIntegerComparator(), 2, expected1, expected2, expected3 );
+
+
+          final CountDownLatch latch = new CountDownLatch( 1 );
+          final List<Integer> results = new ArrayList();
+
+          ordered.subscribe( new Subscriber<Integer>() {
+              @Override
+              public void onCompleted() {
+                  latch.countDown();
+              }
+
+
+              @Override
+              public void onError( final Throwable e ) {
+                  e.printStackTrace();
+                  fail( "An error was thrown " );
+              }
+
+
+              @Override
+              public void onNext( final Integer integer ) {
+                  log.info( "onNext invoked with {}", integer );
+                  results.add( integer );
+              }
+          } );
+
+          latch.await();
+
+          List<Integer> expected = Arrays.asList( 10, 9, 9,  8, 7, 6,  6, 5, 5, 5, 4, 3, 3, 2, 2, 1, 1, 0);
+
+          assertEquals( expected.size(), results.size() );
+
+
+          for ( int i = 0; i < expected.size(); i++ ) {
+              assertEquals( "Same element expected", expected.get( i ), results.get( i ) );
+          }
+      }
+
+
+    /**
+       * Tests that with a buffer size much smaller than our inputs, we successfully block observables from
+       * producing values when our pressure gets too high.  Eventually, one of these events should begin production, eventually
+       * draining all values
+       *
+       * @throws InterruptedException
+       */
+      @Test
+      public void testDuplicateOrderingCorrectComparator() throws InterruptedException {
+
+          List<Integer> expected1List = Arrays.asList( 1, 2, 3, 4, 5, 10 );
+
+          Observable<Integer> expected1 = Observable.from( expected1List ).subscribeOn( Schedulers.io() );
+
+          List<Integer> expected2List = Arrays.asList( 5, 6, 7, 8, 9 );
+
+          Observable<Integer> expected2 = Observable.from( expected2List ).subscribeOn( Schedulers.io() );
+
+
+          List<Integer> expected3List = Arrays.asList( 0, 1, 2, 3, 5, 6, 9 );
+
+          Observable<Integer> expected3 = Observable.from( expected3List ).subscribeOn( Schedulers.io() );
+
+
+          /**
+           * Fails because our first observable will have to buffer the last 4 elements while waiting for the others to
+           * proceed
+           */
+          Observable<Integer> ordered =
+                  OrderedMerge.orderedMerge( new IntegerComparator(), 2, expected1, expected2, expected3 );
+
+
+          final CountDownLatch latch = new CountDownLatch( 1 );
+          final List<Integer> results = new ArrayList();
+
+          ordered.subscribe( new Subscriber<Integer>() {
+              @Override
+              public void onCompleted() {
+                  latch.countDown();
+              }
+
+
+              @Override
+              public void onError( final Throwable e ) {
+                  e.printStackTrace();
+                  fail( "An error was thrown " );
+              }
+
+
+              @Override
+              public void onNext( final Integer integer ) {
+                  log.info( "onNext invoked with {}", integer );
+                  results.add( integer );
+              }
+          } );
+
+          latch.await();
+
+          List<Integer> expected = Arrays.asList(  0, 1, 1,2, 2, 3, 3,4,  5, 5, 5,  6,  6, 7,8,  9, 9,10 );
+
+          assertEquals( expected.size(), results.size() );
+
+
+          for ( int i = 0; i < expected.size(); i++ ) {
+              assertEquals( "Same element expected", expected.get( i ), results.get( i ) );
+          }
+      }
+
+
     private static class IntegerComparator implements Comparator<Integer> {
 
         @Override

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/common/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/test/resources/log4j.properties b/stack/corepersistence/common/src/test/resources/log4j.properties
new file mode 100644
index 0000000..08d897c
--- /dev/null
+++ b/stack/corepersistence/common/src/test/resources/log4j.properties
@@ -0,0 +1,39 @@
+#
+# 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.
+#
+
+# suppress inspection "UnusedProperty" for whole file
+log4j.rootLogger=INFO,stdout
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %p %c{3}.%M(%L)<%t>- %m%n
+
+log4j.logger.org.safehaus.chop.plugin=DEBUG
+log4j.logger.org.safehaus.guicyfig=ERROR
+log4j.logger.org.safehaus.chop.api.store.amazon=DEBUG
+log4j.logger.org.apache.http=ERROR
+log4j.logger.com.amazonaws.request=ERROR
+log4j.logger.cassandra.db=ERROR
+
+#log4j.logger.org.apache.usergrid=DEBUG
+
+log4j.logger.org.apache.usergrid.persistence.graph=TRACE
+log4j.logger.org.apache.usergrid.persistence.core.rx=TRACE
+#log4j.logger.org.apache.usergrid.persistence.graph.serialization.impl.parse=TRACE
+

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/common/src/test/resources/usergrid.properties
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/test/resources/usergrid.properties b/stack/corepersistence/common/src/test/resources/usergrid.properties
new file mode 100644
index 0000000..febda88
--- /dev/null
+++ b/stack/corepersistence/common/src/test/resources/usergrid.properties
@@ -0,0 +1 @@
+# No properties in our test env


[39/52] [abbrv] git commit: Test to prove that arrays, not queries and geo queries play well together.

Posted by gr...@apache.org.
Test to prove that arrays, not queries and geo queries play well together.


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: 2b1f7351d33d1c1be6ab74b1a3f2221a9afe3295
Parents: f7e8f26
Author: Dave Johnson <dm...@apigee.com>
Authored: Tue Sep 2 11:19:40 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Tue Sep 2 11:19:40 2014 -0400

----------------------------------------------------------------------
 .../org/apache/usergrid/persistence/GeoQueryBooleanTest.java   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2b1f7351/stack/core/src/test/java/org/apache/usergrid/persistence/GeoQueryBooleanTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/GeoQueryBooleanTest.java b/stack/core/src/test/java/org/apache/usergrid/persistence/GeoQueryBooleanTest.java
index 0d9810f..0e1faa5 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/GeoQueryBooleanTest.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/GeoQueryBooleanTest.java
@@ -112,7 +112,7 @@ public class GeoQueryBooleanTest extends AbstractCoreIT {
 
 
     @Test
-    @Ignore // work in progress
+    //@Ignore // work in progress
     public void testGeoQueryWithNot() throws Exception {
 
         log.info( "GeoQueryBooleanTest.testGeoQueryWithOr" );
@@ -176,14 +176,14 @@ public class GeoQueryBooleanTest extends AbstractCoreIT {
             "select * where NOT blockedBy.name='bart' and location within 400 of " 
                + center.getLat() + "," + center.getLon());
         Results listResults = em.searchCollection( em.getApplicationRef(), "users", query );
-        assertEquals( 2, listResults.size() );
+        assertEquals( 1, listResults.size() );
 
         // one user within 400 meters IS blocked by bart
         query = Query.fromQL( 
             "select * where blockedBy.name='bart' and location within 400 of " 
                + center.getLat() + "," + center.getLon());
         listResults = em.searchCollection( em.getApplicationRef(), "users", query );
-        assertEquals( 2, listResults.size() );
+        assertEquals( 1, listResults.size() );
 
      }
 


[32/52] [abbrv] git commit: Revert to launcher AppleJavaExtensions 1.4 so that at least the launcher will build.

Posted by gr...@apache.org.
Revert to launcher AppleJavaExtensions 1.4 so that at least the launcher will build.


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: 676520c587839058032db1d355e27ac23626dc8c
Parents: 62de58f
Author: Dave Johnson <sn...@apache.org>
Authored: Fri Aug 29 17:33:45 2014 -0400
Committer: Dave Johnson <sn...@apache.org>
Committed: Fri Aug 29 17:33:45 2014 -0400

----------------------------------------------------------------------
 stack/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/676520c5/stack/pom.xml
----------------------------------------------------------------------
diff --git a/stack/pom.xml b/stack/pom.xml
index c7cf26d..363efcf 100644
--- a/stack/pom.xml
+++ b/stack/pom.xml
@@ -1299,7 +1299,7 @@
         <groupId>com.apple</groupId>
         <artifactId>AppleJavaExtensions</artifactId>
         <!-- from local-depedendencies -->
-        <version>1.5.4</version>
+        <version>1.4</version>
       </dependency>
 
       <dependency>


[44/52] [abbrv] git commit: Permissive license notices should go in license file.

Posted by gr...@apache.org.
Permissive license notices should go in license file.


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: e433064bd079ef9644d117752c076c566d4cb41f
Parents: 8efa278
Author: Dave Johnson <sn...@apache.org>
Authored: Wed Sep 3 08:48:56 2014 -0400
Committer: Dave Johnson <sn...@apache.org>
Committed: Wed Sep 3 08:48:56 2014 -0400

----------------------------------------------------------------------
 LICENSE | 28 ++++++++++++++++++++++++++++
 NOTICE  | 33 +++------------------------------
 2 files changed, 31 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e433064b/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index 9fc77ee..1d90c5c 100644
--- a/LICENSE
+++ b/LICENSE
@@ -263,3 +263,31 @@ For the SSKeychain component:
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+This product bundles SBJson, which is available under a "3-clause BSD" license.
+For details, see sdks/ios/UGAPI/SBJson/ .
+
+This product bundles SSKeychain, which is available under a "MIT/X11" license.
+For details, see sdks/ios/UGAPI/SSKeychain/.
+
+This product bundles angular-senario.js, part of jQuery JavaScript Library v1.10.2
+which Includes Sizzle.js Copyright 2005, 2013 jQuery Foundation, Inc. and
+other contributors. Released under the MIT license.
+
+This product bundles angular.js, specifically AngularJS v1.2.5 (c) 2010-2014
+Google, Inc. Released under the MIT license.
+
+This product bundles Bootstrap v2.3.2 Copyright 2012 Twitter, Inc
+Licensed under the Apache License v2.0
+
+This product bundles jquery-ui-1.8.9. Licensed under MIT license.
+
+This product bundles jquery-1.9.1 Licensed under MIT license.
+
+This product bundles mocha. All rights reserved. Licensed under MIT.
+Copyright (c) 2011-2014 TJ Holowaychuk <tj...@vision-media.ca>
+
+This product bundles NSubstitute v1.6.0.0. Licensed under the BSD 2-Clause License.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e433064b/NOTICE
----------------------------------------------------------------------
diff --git a/NOTICE b/NOTICE
index 45ddf8f..9b0902f 100644
--- a/NOTICE
+++ b/NOTICE
@@ -1,36 +1,9 @@
 Apache Usergrid_
 Copyright 2014 The Apache Software Foundation.
 
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-
-This product bundles SBJson, which is available under a "3-clause BSD" license.
-For details, see sdks/ios/UGAPI/SBJson/ .
-
-This product bundles SSKeychain, which is available under a "MIT/X11" license.
-For details, see sdks/ios/UGAPI/SSKeychain/.
-
-This product bundles angular-senario.js, part of jQuery JavaScript Library v1.10.2
-which Includes Sizzle.js Copyright 2005, 2013 jQuery Foundation, Inc. and
-other contributors. Released under the MIT license.
-
-This product bundles angular.js, specifically AngularJS v1.2.5 (c) 2010-2014
-Google, Inc. Released under the MIT license.
-
-This product bundles Bootstrap v2.3.2 Copyright 2012 Twitter, Inc
-Licensed under the Apache License v2.0
-
-This product bundles jquery-ui-1.8.9. Licensed under MIT license.
-
-This product bundles jquery-1.9.1 Licensed under MIT license.
-
-This product bundles mocha. All rights reserved. Licensed under MIT.
-Copyright (c) 2011-2014 TJ Holowaychuk <tj...@vision-media.ca>
-
-This product bundles NSubstitute v1.6.0.0. Licensed under the BSD 2-Clause License.
-
 This product bundles NUnit v2.6.2.
-Portions Copyright © 2002-2012 Charlie Poole or Copyright © 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov or Copyright © 2000-2002 Philip A. Craig
+Portions Copyright © 2002-2012 Charlie Poole or Copyright © 2002-2004 
+James W. Newkirk, Michael C. Two, Alexei A. Vorontsov or Copyright © 2000-2002 Philip A. Craig
 
 This product bundles a number of files within the /sdks/ios
 package.
@@ -64,4 +37,4 @@ package.
 
 This product bundles SSToolkit Copyright (c) 2009-2011 Sam Soffes. All rights reserved.
 These files can be located within the /sdks/ios package.
- 
+ 
\ No newline at end of file


[36/52] [abbrv] git commit: Merge branch 'master' of https://github.com/apache/incubator-usergrid

Posted by gr...@apache.org.
Merge branch 'master' of https://github.com/apache/incubator-usergrid


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: bb5dc2ed6193e513a75964779b6e7f8ce0b1a3e8
Parents: aaedb9a cd4915a
Author: Ed Anuff <ed...@anuff.com>
Authored: Fri Aug 29 22:49:49 2014 -0700
Committer: Ed Anuff <ed...@anuff.com>
Committed: Fri Aug 29 22:49:49 2014 -0700

----------------------------------------------------------------------
 .gitignore          | 2 ++
 portal/Gruntfile.js | 4 ----
 stack/pom.xml       | 2 +-
 3 files changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bb5dc2ed/stack/pom.xml
----------------------------------------------------------------------


[12/52] [abbrv] git commit: uuid fixes, adding serialization fixes

Posted by gr...@apache.org.
uuid fixes, adding serialization fixes


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: 64ad13d5a1ec3fe9d158e39ac4a6d80df3aedcfe
Parents: 9c47aee
Author: Shawn Feldman <sf...@apache.org>
Authored: Tue Aug 26 12:50:54 2014 -0600
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Aug 28 09:30:04 2014 -0600

----------------------------------------------------------------------
 stack/core/pom.xml                              | 20 +++++++-
 .../corepersistence/CpEntityManager.java        | 49 +++++++++++---------
 .../corepersistence/CpRelationManager.java      | 10 ++--
 .../java/org/apache/usergrid/mq/Message.java    | 13 +++---
 .../apache/usergrid/persistence/EntityRef.java  |  3 ++
 .../apache/usergrid/persistence/PathQuery.java  |  8 ++--
 .../usergrid/persistence/SimpleEntityRef.java   | 36 +++++++-------
 .../usergrid/persistence/PathQueryIT.java       |  4 +-
 .../persistence/core/util/ValidationUtils.java  |  2 +-
 .../usergrid/persistence/index/query/Query.java |  4 +-
 10 files changed, 93 insertions(+), 56 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/64ad13d5/stack/core/pom.xml
----------------------------------------------------------------------
diff --git a/stack/core/pom.xml b/stack/core/pom.xml
index 0972a89..41c7244 100644
--- a/stack/core/pom.xml
+++ b/stack/core/pom.xml
@@ -576,6 +576,24 @@
             <version>${rx.version}</version>
         </dependency>
 
-    </dependencies>
+
+    <dependency>
+      <groupId>com.codahale.metrics</groupId>
+      <artifactId>metrics-core</artifactId>
+      <version>${metrics.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>com.codahale.metrics</groupId>
+      <artifactId>metrics-graphite</artifactId>
+      <version>${metrics.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>com.clearspring.analytics</groupId>
+      <artifactId>stream</artifactId>
+      <version>2.7.0</version>
+    </dependency>
+
+  </dependencies>
 
 </project>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/64ad13d5/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 28124c2..f40bc3b 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
@@ -33,6 +33,7 @@ import java.util.TreeMap;
 import java.util.TreeSet;
 import java.util.UUID;
 
+import com.clearspring.analytics.hash.MurmurHash;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.util.Assert;
@@ -323,10 +324,10 @@ public class CpEntityManager implements EntityManager {
 
         EntityCollectionManager ecm = managerCache.getEntityCollectionManager( collectionScope );
 
-        if ( !UUIDUtils.isTimeBased( id.getUuid() ) ) {
-            throw new IllegalArgumentException(
-                "Entity Id " + id.getType() + ":"+ id.getUuid() +" uuid not time based");
-        }
+//        if ( !UUIDUtils.isTimeBased( id.getUuid() ) ) {
+//            throw new IllegalArgumentException(
+//                "Entity Id " + id.getType() + ":"+ id.getUuid() +" uuid not time based");
+//        }
 
        org.apache.usergrid.persistence.model.entity.Entity cpEntity = 
                 ecm.load( id ).toBlockingObservable().last();
@@ -410,10 +411,10 @@ public class CpEntityManager implements EntityManager {
 
         EntityCollectionManager ecm = managerCache.getEntityCollectionManager( collectionScope );
 
-        if ( !UUIDUtils.isTimeBased( id.getUuid() ) ) {
-            throw new IllegalArgumentException(
-                "Entity Id " + id.getType() + ":"+ id.getUuid() +" uuid not time based");
-        }
+//        if ( !UUIDUtils.isTimeBased( id.getUuid() ) ) {
+//            throw new IllegalArgumentException(
+//                "Entity Id " + id.getType() + ":"+ id.getUuid() +" uuid not time based");
+//        }
 
         org.apache.usergrid.persistence.model.entity.Entity cpEntity = 
                 ecm.load( id ).toBlockingObservable().last();
@@ -489,10 +490,10 @@ public class CpEntityManager implements EntityManager {
             } );
         }
 
-        if ( !UUIDUtils.isTimeBased( entityId.getUuid() ) ) {
-            throw new IllegalArgumentException(
-                "Entity Id " + entityId.getType() + ":"+ entityId.getUuid() +" uuid not time based");
-        }
+//        if ( !UUIDUtils.isTimeBased( entityId.getUuid() ) ) {
+//            throw new IllegalArgumentException(
+//                "Entity Id " + entityId.getType() + ":"+ entityId.getUuid() +" uuid not time based");
+//        }
 
         org.apache.usergrid.persistence.model.entity.Entity cpEntity =
                 ecm.load( entityId ).toBlockingObservable().last();
@@ -543,10 +544,10 @@ public class CpEntityManager implements EntityManager {
 
         Id entityId = new SimpleId( entityRef.getUuid(), entityRef.getType() );
 
-        if ( !UUIDUtils.isTimeBased( entityId.getUuid() ) ) {
-            throw new IllegalArgumentException(
-                "Entity Id " + entityId.getType() + ":"+ entityId.getUuid() +" uuid not time based");
-        }
+//        if ( !UUIDUtils.isTimeBased( entityId.getUuid() ) ) {
+//            throw new IllegalArgumentException(
+//                "Entity Id " + entityId.getType() + ":"+ entityId.getUuid() +" uuid not time based");
+//        }
 
         org.apache.usergrid.persistence.model.entity.Entity entity = 
                 ecm.load( entityId ).toBlockingObservable().last();
@@ -984,10 +985,10 @@ public class CpEntityManager implements EntityManager {
 
         Id entityId = new SimpleId( entityRef.getUuid(), entityRef.getType() );
 
-        if ( !UUIDUtils.isTimeBased( entityId.getUuid() ) ) {
-            throw new IllegalArgumentException(
-                "Entity Id " + entityId.getType() + ":"+entityId.getUuid() +" uuid not time based");
-        }
+//        if ( !UUIDUtils.isTimeBased( entityId.getUuid() ) ) {
+//            throw new IllegalArgumentException(
+//                "Entity Id " + entityId.getType() + ":"+entityId.getUuid() +" uuid not time based");
+//        }
 
         org.apache.usergrid.persistence.model.entity.Entity cpEntity =
                 ecm.load( entityId ).toBlockingObservable().last();
@@ -2363,7 +2364,13 @@ public class CpEntityManager implements EntityManager {
             return null;
         }
 
-        long timestamp = UUIDUtils.getTimestampInMicros( timestampUuid );
+        long timestamp = 0;
+
+        if(UUIDUtils.isTimeBased(timestampUuid)) {
+            timestamp = UUIDUtils.getTimestampInMicros(timestampUuid);
+        }else{
+            timestamp = MurmurHash.hash64(timestampUuid);
+        }
 
         UUID itemId = UUIDUtils.newTimeUUID();
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/64ad13d5/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
index 31d32dd..9199d19 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
@@ -28,6 +28,7 @@ import java.util.Map;
 import java.util.Set;
 import java.util.UUID;
 
+import com.clearspring.analytics.hash.MurmurHash;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.util.Assert;
@@ -685,12 +686,13 @@ public class CpRelationManager implements RelationManager {
                 headEntity.getType(), headEntity.getUuid(), 
                 itemRef.getType(), itemRef.getUuid() });
 
+        long uuidHash = MurmurHash.hash64( memberEntity.getId().getUuid());
         // create graph edge connection from head entity to member entity
         Edge edge = new SimpleEdge(
-            cpHeadEntity.getId(), 
-            edgeType, 
-            memberEntity.getId(), 
-            memberEntity.getId().getUuid().timestamp() );
+            cpHeadEntity.getId(),
+            edgeType,
+            memberEntity.getId(),
+           uuidHash);
         GraphManager gm = managerCache.getGraphManager(applicationScope);
         gm.writeEdge(edge).toBlockingObservable().last();
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/64ad13d5/stack/core/src/main/java/org/apache/usergrid/mq/Message.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/mq/Message.java b/stack/core/src/main/java/org/apache/usergrid/mq/Message.java
index 85aea1f..b48fe74 100644
--- a/stack/core/src/main/java/org/apache/usergrid/mq/Message.java
+++ b/stack/core/src/main/java/org/apache/usergrid/mq/Message.java
@@ -30,6 +30,7 @@ import java.util.UUID;
 
 import javax.xml.bind.annotation.XmlRootElement;
 
+import com.clearspring.analytics.hash.MurmurHash;
 import org.apache.usergrid.utils.UUIDUtils;
 
 import com.fasterxml.jackson.annotation.JsonAnyGetter;
@@ -484,13 +485,13 @@ public class Message {
 
 
     public void setUuid( UUID uuid ) {
-        if ( isTimeBased( uuid ) ) {
+        //if ( isTimeBased( uuid ) ) {
             properties.put( MESSAGE_ID, uuid );
-            properties.put( MESSAGE_TIMESTAMP, getTimestampInMillis( uuid ) );
-        }
-        else {
-            throw new IllegalArgumentException( "Not a time-based UUID" );
-        }
+            properties.put( MESSAGE_TIMESTAMP, MurmurHash.hash64(uuid));
+//        }
+//        else {
+//            throw new IllegalArgumentException( "Not a time-based UUID" );
+//        }
     }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/64ad13d5/stack/core/src/main/java/org/apache/usergrid/persistence/EntityRef.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/EntityRef.java b/stack/core/src/main/java/org/apache/usergrid/persistence/EntityRef.java
index b9d60cb..8133840 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/EntityRef.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/EntityRef.java
@@ -17,8 +17,11 @@
 package org.apache.usergrid.persistence;
 
 
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+
 import java.util.UUID;
 
+@JsonTypeInfo( use= JsonTypeInfo.Id.CLASS,include= JsonTypeInfo.As.WRAPPER_OBJECT,property="@class" )
 public interface EntityRef {
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/64ad13d5/stack/core/src/main/java/org/apache/usergrid/persistence/PathQuery.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/PathQuery.java b/stack/core/src/main/java/org/apache/usergrid/persistence/PathQuery.java
index 6721fa6..c1d0360 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/PathQuery.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/PathQuery.java
@@ -26,7 +26,7 @@ public class PathQuery<E> {
 
     private PathQuery source;
     private Query query;
-    private EntityRef head;
+    private SimpleEntityRef head;
 
 
     public PathQuery() {
@@ -38,7 +38,7 @@ public class PathQuery<E> {
      *
      * @param head the top-level entity
      */
-    public PathQuery( EntityRef head ) {
+    public PathQuery( SimpleEntityRef head ) {
         this.head = head;
         this.query = null;
     }
@@ -50,7 +50,7 @@ public class PathQuery<E> {
      * @param head the top-level entity
      * @param query the query - must have a collection or connectType value set
      */
-    public PathQuery( EntityRef head, Query query ) {
+    public PathQuery( SimpleEntityRef head, Query query ) {
         if ( query.getCollection() == null && query.getConnectionType() == null ) {
             throw new IllegalArgumentException( "Query must have a collection or connectionType value" );
         }
@@ -122,7 +122,7 @@ public class PathQuery<E> {
     }
 
 
-    public EntityRef getHead() {
+    public SimpleEntityRef getHead() {
         return head;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/64ad13d5/stack/core/src/main/java/org/apache/usergrid/persistence/SimpleEntityRef.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/SimpleEntityRef.java b/stack/core/src/main/java/org/apache/usergrid/persistence/SimpleEntityRef.java
index 3e0f413..65f093f 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/SimpleEntityRef.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/SimpleEntityRef.java
@@ -17,6 +17,9 @@
 package org.apache.usergrid.persistence;
 
 
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
 import java.util.UUID;
 
 
@@ -26,24 +29,25 @@ public class SimpleEntityRef implements EntityRef {
 
     protected final String type;
 
-    protected final UUID id;
+    protected final UUID uuid;
 
 
-    public SimpleEntityRef( UUID id ) {
-        this.id = id;
+    public SimpleEntityRef( UUID uuid ) {
+        this.uuid = uuid;
         type = null;
     }
 
 
-    public SimpleEntityRef( String type, UUID id ) {
+    @JsonCreator
+    public SimpleEntityRef(@JsonProperty("type")  String type,@JsonProperty("uuid")  UUID uuid ) {
         this.type = type;
-        this.id = id;
+        this.uuid = uuid;
     }
 
 
     public SimpleEntityRef( EntityRef entityRef ) {
         type = entityRef.getType();
-        id = entityRef.getUuid();
+        uuid = entityRef.getUuid();
     }
 
 
@@ -54,7 +58,7 @@ public class SimpleEntityRef implements EntityRef {
 
     @Override
     public UUID getUuid() {
-        return id;
+        return uuid;
     }
 
 
@@ -69,8 +73,8 @@ public class SimpleEntityRef implements EntityRef {
     }
 
 
-    public static EntityRef ref( UUID entityId ) {
-        return new SimpleEntityRef( null, entityId );
+    public static EntityRef ref( UUID uuid ) {
+        return new SimpleEntityRef( null, uuid );
     }
 
 
@@ -83,7 +87,7 @@ public class SimpleEntityRef implements EntityRef {
     public int hashCode() {
         final int prime = 31;
         int result = 1;
-        result = prime * result + ( ( id == null ) ? 0 : id.hashCode() );
+        result = prime * result + ( ( uuid == null ) ? 0 : uuid.hashCode() );
         result = prime * result + ( ( type == null ) ? 0 : type.hashCode() );
         return result;
     }
@@ -101,12 +105,12 @@ public class SimpleEntityRef implements EntityRef {
             return false;
         }
         SimpleEntityRef other = ( SimpleEntityRef ) obj;
-        if ( id == null ) {
-            if ( other.id != null ) {
+        if ( uuid == null ) {
+            if ( other.uuid != null ) {
                 return false;
             }
         }
-        else if ( !id.equals( other.id ) ) {
+        else if ( !uuid.equals( other.uuid ) ) {
             return false;
         }
         if ( type == null ) {
@@ -123,13 +127,13 @@ public class SimpleEntityRef implements EntityRef {
 
     @Override
     public String toString() {
-        if ( ( type == null ) && ( id == null ) ) {
+        if ( ( type == null ) && ( uuid == null ) ) {
             return "EntityRef(" + NULL_ID.toString() + ")";
         }
         if ( type == null ) {
-            return "EntityRef(" + id.toString() + ")";
+            return "EntityRef(" + uuid.toString() + ")";
         }
-        return type + "(" + id + ")";
+        return type + "(" + uuid + ")";
     }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/64ad13d5/stack/core/src/test/java/org/apache/usergrid/persistence/PathQueryIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/PathQueryIT.java b/stack/core/src/test/java/org/apache/usergrid/persistence/PathQueryIT.java
index bdaef0a..16fae85 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/PathQueryIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/PathQueryIT.java
@@ -92,7 +92,7 @@ public class PathQueryIT extends AbstractCoreIT {
         deviceQuery.addFilter( "index >= 2" );
         int expectedDeviceQuerySize = 3;
 
-        PathQuery<EntityRef> usersPQ = new PathQuery<EntityRef>( em.getApplicationRef(), userQuery );
+        PathQuery<EntityRef> usersPQ = new PathQuery<EntityRef>( new SimpleEntityRef( em.getApplicationRef()), userQuery );
         PathQuery<Entity> devicesPQ = usersPQ.chain( deviceQuery );
         HashSet set = new HashSet( expectedUserQuerySize * expectedDeviceQuerySize );
         Iterator<Entity> i = devicesPQ.iterator( em );
@@ -174,7 +174,7 @@ public class PathQueryIT extends AbstractCoreIT {
         deviceQuery.addFilter( "index >= 4" );
         int expectedDeviceQuerySize = 3;
 
-        PathQuery groupsPQ = new PathQuery( em.getApplicationRef(), groupQuery );
+        PathQuery groupsPQ = new PathQuery(new SimpleEntityRef( em.getApplicationRef() ), groupQuery );
         PathQuery usersPQ = groupsPQ.chain( userQuery );
         PathQuery<Entity> devicesPQ = usersPQ.chain( deviceQuery );
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/64ad13d5/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/util/ValidationUtils.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/util/ValidationUtils.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/util/ValidationUtils.java
index 62f7ab6..141978a 100644
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/util/ValidationUtils.java
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/util/ValidationUtils.java
@@ -80,7 +80,7 @@ public class ValidationUtils {
 
         Preconditions.checkNotNull( uuid, "The id uuid is required to be set" );
 
-        Preconditions.checkArgument( uuid.version() == UUID_VERSION, "The uuid must be version 1" );
+        //Preconditions.checkArgument( uuid.version() == UUID_VERSION, "The uuid must be version 1" );
 
         final String type = entityId.getType();
         Preconditions.checkNotNull( type, "The id type is required " );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/64ad13d5/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/Query.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/Query.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/Query.java
index 9dda724..569c08d 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/Query.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/Query.java
@@ -28,6 +28,8 @@ import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
 import java.util.UUID;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
 import org.antlr.runtime.ANTLRStringStream;
 import org.antlr.runtime.ClassicToken;
 import org.antlr.runtime.CommonTokenStream;
@@ -1081,7 +1083,7 @@ public class Query {
         private final Query.SortDirection direction;
 
 
-        public SortPredicate( String propertyName, Query.SortDirection direction ) {
+        public SortPredicate(@JsonProperty("propertyName")  String propertyName, @JsonProperty("direction")  Query.SortDirection direction ) {
             if ( propertyName == null ) {
                 throw new NullPointerException( "Property name was null" );
             }


[05/52] [abbrv] Updated OrderedMerge to use a faster implementation at runtime. After initialization, it's an O(1) emit operation as long as our produces are fast enough.

Posted by gr...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerLoadTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerLoadTest.java b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerLoadTest.java
index d0a0525..d39e433 100644
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerLoadTest.java
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerLoadTest.java
@@ -112,7 +112,7 @@ public class GraphManagerLoadTest {
 
             @Override
             public Observable<Edge> doSearch( final GraphManager manager ) {
-                 return manager.loadEdgesFromSource( new SimpleSearchByEdgeType( sourceId, "test", System.currentTimeMillis(), null ) );
+                 return manager.loadEdgesFromSource( new SimpleSearchByEdgeType( sourceId, "test", System.currentTimeMillis(), SearchByEdgeType.Order.DESCENDING, null) );
             }
         };
 
@@ -139,7 +139,7 @@ public class GraphManagerLoadTest {
 
             @Override
             public Observable<Edge> doSearch( final GraphManager manager ) {
-                return manager.loadEdgesToTarget( new SimpleSearchByEdgeType( targetId, "test", System.currentTimeMillis(), null ) );
+                return manager.loadEdgesToTarget( new SimpleSearchByEdgeType( targetId, "test", System.currentTimeMillis(), SearchByEdgeType.Order.DESCENDING, null ) );
             }
         };
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerShardConsistencyIT.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerShardConsistencyIT.java b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerShardConsistencyIT.java
index 59bf014..c01d157 100644
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerShardConsistencyIT.java
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerShardConsistencyIT.java
@@ -21,27 +21,31 @@
 package org.apache.usergrid.persistence.graph;
 
 
+import java.io.ByteArrayOutputStream;
+import java.io.PrintWriter;
+import java.io.UnsupportedEncodingException;
 import java.util.ArrayList;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Set;
 import java.util.UUID;
 import java.util.concurrent.Callable;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicLong;
+
+import javax.annotation.Nullable;
 
 import org.junit.After;
 import org.junit.Before;
 import org.junit.ClassRule;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.slf4j.Marker;
-
-import org.apache.commons.lang.time.StopWatch;
 
 import org.apache.usergrid.persistence.core.cassandra.CassandraRule;
 import org.apache.usergrid.persistence.core.migration.MigrationException;
@@ -51,29 +55,33 @@ import org.apache.usergrid.persistence.core.scope.ApplicationScopeImpl;
 import org.apache.usergrid.persistence.graph.guice.TestGraphModule;
 import org.apache.usergrid.persistence.graph.impl.SimpleSearchByEdgeType;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.DirectedEdgeMeta;
-import org.apache.usergrid.persistence.graph.serialization.impl.shard.NodeShardAllocation;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.NodeShardCache;
-import org.apache.usergrid.persistence.graph.serialization.impl.shard.Shard;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.ShardEntryGroup;
 import org.apache.usergrid.persistence.model.entity.Id;
 
 import com.codahale.metrics.Meter;
 import com.codahale.metrics.MetricRegistry;
 import com.codahale.metrics.Slf4jReporter;
-import com.google.common.base.Optional;
+import com.google.common.util.concurrent.FutureCallback;
+import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.ListeningExecutorService;
+import com.google.common.util.concurrent.MoreExecutors;
 import com.google.inject.Guice;
 import com.google.inject.Injector;
 import com.netflix.config.ConfigurationManager;
 
 import rx.Observable;
+import rx.functions.Action1;
 
 import static org.apache.usergrid.persistence.graph.test.util.EdgeTestUtils.createEdge;
 import static org.apache.usergrid.persistence.graph.test.util.EdgeTestUtils.createId;
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.fail;
 
 
-@Ignore("A stress test, not part of functional testing")
+//@Ignore( "A stress test, not part of functional testing" )
 public class GraphManagerShardConsistencyIT {
     private static final Logger log = LoggerFactory.getLogger( GraphManagerShardConsistencyIT.class );
 
@@ -85,12 +93,9 @@ public class GraphManagerShardConsistencyIT {
 
     private static final Meter writeMeter = registry.meter( "writeThroughput" );
 
-    private static final Slf4jReporter reporter = Slf4jReporter.forRegistry( registry )
-                                                .outputTo( log )
-                                                .convertRatesTo( TimeUnit.SECONDS )
-                                                .convertDurationsTo( TimeUnit.MILLISECONDS )
-                                                .build();
-
+    private static final Slf4jReporter reporter =
+            Slf4jReporter.forRegistry( registry ).outputTo( log ).convertRatesTo( TimeUnit.SECONDS )
+                         .convertDurationsTo( TimeUnit.MILLISECONDS ).build();
 
 
     protected ApplicationScope scope;
@@ -102,6 +107,7 @@ public class GraphManagerShardConsistencyIT {
 
     protected Object originalShardDelta;
 
+
     @Before
     public void setupOrg() {
 
@@ -110,82 +116,52 @@ public class GraphManagerShardConsistencyIT {
 
         originalShardTimeout = ConfigurationManager.getConfigInstance().getProperty( GraphFig.SHARD_CACHE_TIMEOUT );
 
-        originalShardDelta =  ConfigurationManager.getConfigInstance().getProperty( GraphFig.SHARD_MIN_DELTA );
+        originalShardDelta = ConfigurationManager.getConfigInstance().getProperty( GraphFig.SHARD_MIN_DELTA );
 
 
-        ConfigurationManager.getConfigInstance().setProperty( GraphFig.SHARD_SIZE, 10000 );
+        ConfigurationManager.getConfigInstance().setProperty( GraphFig.SHARD_SIZE, 1000 );
 
 
-        final long cacheTimeout = 10000;
-        //set our cache timeout to 10 seconds
+        final long cacheTimeout = 5000;
+        //set our cache timeout to the above value
         ConfigurationManager.getConfigInstance().setProperty( GraphFig.SHARD_CACHE_TIMEOUT, cacheTimeout );
 
 
-        final long minDelta = ( long ) (cacheTimeout * 2.5);
+        final long minDelta = ( long ) ( cacheTimeout * 2.5 );
 
         ConfigurationManager.getConfigInstance().setProperty( GraphFig.SHARD_MIN_DELTA, minDelta );
 
 
-
-
         //get the system property of the UUID to use.  If one is not set, use the defualt
         String uuidString = System.getProperty( "org.id", "80a42760-b699-11e3-a5e2-0800200c9a66" );
 
         scope = new ApplicationScopeImpl( createId( UUID.fromString( uuidString ), "test" ) );
 
 
-
         reporter.start( 10, TimeUnit.SECONDS );
     }
 
 
     @After
-    public void tearDown(){
+    public void tearDown() {
         reporter.stop();
         reporter.report();
     }
 
 
-//    @Test
-//    public void writeThousandsSingleSource() throws InterruptedException, ExecutionException {
-//        EdgeGenerator generator = new EdgeGenerator() {
-//
-//            private Id sourceId = createId( "source" );
-//
-//
-//            @Override
-//            public Edge newEdge() {
-//                Edge edge = createEdge( sourceId, "test", createId( "target" ) );
-//
-//
-//                return edge;
-//            }
-//
-//
-//            @Override
-//            public Observable<Edge> doSearch( final GraphManager manager ) {
-//                return manager.loadEdgesFromSource( new SimpleSearchByEdgeType( sourceId, "test", System.currentTimeMillis(), null ) );
-//            }
-//        };
-//
-//
-//
-//        doTest( generator );
-//    }
-
-
     @Test
-    public void writeThousandsSingleTarget() throws InterruptedException, ExecutionException, MigrationException {
+    public void writeThousandsSingleSource()
+            throws InterruptedException, ExecutionException, MigrationException, UnsupportedEncodingException {
 
-        final Id sourceId = createId("source");
+        final Id sourceId = createId( "source" );
         final String edgeType = "test";
 
-        EdgeGenerator generator = new EdgeGenerator() {
+        final EdgeGenerator generator = new EdgeGenerator() {
 
 
             @Override
             public Edge newEdge() {
-                Edge edge = createEdge( sourceId, edgeType,  createId( "target" ) );
+                Edge edge = createEdge( sourceId, edgeType, createId( "target" ) );
 
 
                 return edge;
@@ -194,59 +170,84 @@ public class GraphManagerShardConsistencyIT {
 
             @Override
             public Observable<Edge> doSearch( final GraphManager manager ) {
-                return manager.loadEdgesFromSource( new SimpleSearchByEdgeType( sourceId, "test", System.currentTimeMillis(), null ) );
+                return manager.loadEdgesFromSource(
+                        new SimpleSearchByEdgeType( sourceId, edgeType, Long.MAX_VALUE,
+                                SearchByEdgeType.Order.DESCENDING, null ) );
             }
         };
 
 
-        final int numInjectors = 2;
+//        final int numInjectors = 2;
+        final int numInjectors = 1;
 
         /**
          * create 3 injectors.  This way all the caches are independent of one another.  This is the same as
          * multiple nodes
          */
-        final List<Injector> injectors = createInjectors(numInjectors);
+        final List<Injector> injectors = createInjectors( numInjectors );
 
 
         final GraphFig graphFig = getInstance( injectors, GraphFig.class );
 
-        final long shardSize =  graphFig.getShardSize();
+        final long shardSize = graphFig.getShardSize();
 
 
-        //we don't want to starve the cass runtime since it will be on the same box. Only take 50% of processing power for writes
-        final int numProcessors = Runtime.getRuntime().availableProcessors() /2 ;
+        //we don't want to starve the cass runtime since it will be on the same box. Only take 50% of processing
+        // power for writes
+        final int numProcessors = Runtime.getRuntime().availableProcessors() / 2;
 
-        final int numWorkers = numProcessors/numInjectors;
+        final int numWorkersPerInjector = numProcessors / numInjectors;
 
 
         /**
          * Do 4x shard size so we should have approximately 4 shards
          */
-        final long numberOfEdges =  shardSize * 4;
+        final long numberOfEdges = shardSize * 4;
 
 
-        final long countPerWorker = numberOfEdges/numWorkers;
+        final long workerWriteLimit = numberOfEdges / numWorkersPerInjector;
 
-        final long writeLimit = countPerWorker;
 
 
+        final long expectedShardCount = numberOfEdges/shardSize;
+
+
+        final ListeningExecutorService
+                executor = MoreExecutors.listeningDecorator( Executors.newFixedThreadPool( numWorkersPerInjector ) );
+
+
+        final AtomicLong writeCounter = new AtomicLong();
+
 
         //min stop time the min delta + 1 cache cycle timeout
         final long minExecutionTime = graphFig.getShardMinDelta() + graphFig.getShardCacheTimeout();
 
 
-
+        log.info( "Writing {} edges per worker on {} workers in {} injectors", workerWriteLimit, numWorkersPerInjector,
+                numInjectors );
 
 
         final List<Future<Boolean>> futures = new ArrayList<>();
 
-        for(Injector injector: injectors) {
+
+
+        for ( Injector injector : injectors ) {
             final GraphManagerFactory gmf = injector.getInstance( GraphManagerFactory.class );
 
-            futures.addAll( doTest( gmf, generator, numWorkers,  writeLimit, minExecutionTime ) );
+
+            for ( int i = 0; i < numWorkersPerInjector; i++ ) {
+                Future<Boolean> future = executor
+                        .submit( new Worker( gmf, generator, workerWriteLimit, minExecutionTime, writeCounter ) );
+
+                futures.add( future );
+            }
+
         }
 
-        for(Future<Boolean> future: futures){
+        /**
+         * Wait for all writes to complete
+         */
+        for ( Future<Boolean> future : futures ) {
             future.get();
         }
 
@@ -255,53 +256,134 @@ public class GraphManagerShardConsistencyIT {
 
         final DirectedEdgeMeta directedEdgeMeta = DirectedEdgeMeta.fromSourceNode( sourceId, edgeType );
 
-        int count = 0;
+        //now submit the readers.
+        final GraphManagerFactory gmf = getInstance( injectors, GraphManagerFactory.class );
 
-        while(true) {
 
-            //reset our count.  Ultimately we'll have 4 groups once our compaction completes
-            count = 0;
+        final long writeCount = writeCounter.get();
+        final Meter readMeter = registry.meter( "readThroughput" );
+
 
+        /**
+         * Start reading continuously while we migrate data to ensure our view is always correct
+         */
+        final ListenableFuture<Long> future = executor.submit( new ReadWorker( gmf, generator, writeCount, readMeter ) );
+
+        final List<Throwable> failures = new ArrayList<>(  );
+
+
+
+
+        //add the future
+        Futures.addCallback( future, new FutureCallback<Long>() {
+
+            @Override
+            public void onSuccess( @Nullable final Long result ) {
+                log.info( "Successfully ran the read, re-running" );
+                executor.submit( new ReadWorker( gmf, generator, writeCount, readMeter ) );
+            }
+
+
+            @Override
+            public void onFailure( final Throwable t ) {
+                failures.add( t );
+                log.error( "Failed test!", t );
+            }
+        } );
+
+
+
+        int compactedCount;
+
+
+
+
+
+        //now start our readers
+
+        while ( true ) {
+
+            if(!failures.isEmpty()){
+
+                StringBuilder builder = new StringBuilder(  );
+
+                builder.append("Read runner failed!\n");
+
+                for(Throwable t: failures){
+                    builder.append( "Exception is: " );
+                    ByteArrayOutputStream output = new ByteArrayOutputStream(  );
+
+                    t.printStackTrace( new PrintWriter( output ) );
+
+                    builder.append( output.toString( "UTF-8" ));
+                    builder.append( "\n\n" );
+
+                }
+
+
+
+                fail(builder.toString());
+            }
+
+            //reset our count.  Ultimately we'll have 4 groups once our compaction completes
+            compactedCount = 0;
 
             //we have to get it from the cache, because this will trigger the compaction process
             final Iterator<ShardEntryGroup> groups = cache.getReadShardGroup( scope, Long.MAX_VALUE, directedEdgeMeta );
+            final Set<ShardEntryGroup> shardEntryGroups = new HashSet<>();
+
+            while ( groups.hasNext() ) {
 
-            while(groups.hasNext()){
                 final ShardEntryGroup group = groups.next();
+                shardEntryGroups.add( group );
 
                 log.info( "Compaction pending status for group {} is {}", group, group.isCompactionPending() );
 
-                count++;
-
+                if ( !group.isCompactionPending() ) {
+                    compactedCount++;
+                }
             }
 
+
             //we're done
-            if(count == 4){
+            if ( compactedCount >= expectedShardCount ) {
+                log.info( "All compactions complete, sleeping" );
+
+//                final Object mutex = new Object();
+//
+//                synchronized ( mutex ){
+//
+//                    mutex.wait();
+//                }
+
                 break;
+
             }
 
-            Thread.sleep(5000);
-        }
 
+            Thread.sleep( 2000 );
 
+        }
+
+        executor.shutdownNow();
 
 
     }
 
-    private <T> T getInstance(final List<Injector> injectors, Class<T> clazz ){
+
+    private <T> T getInstance( final List<Injector> injectors, Class<T> clazz ) {
         return injectors.get( 0 ).getInstance( clazz );
     }
 
 
     /**
      * Create new Guice injector environments and return them
-     * @param count
      */
     private List<Injector> createInjectors( int count ) throws MigrationException {
 
-        final List<Injector> injectors = new ArrayList<>(count);
+        final List<Injector> injectors = new ArrayList<>( count );
 
-        for(int i = 0; i < count; i++){
+        for ( int i = 0; i < count; i++ ) {
             final Injector injector = Guice.createInjector( new TestGraphModule() );
             injectors.add( injector );
         }
@@ -312,42 +394,27 @@ public class GraphManagerShardConsistencyIT {
         migrationManager.migrate();
 
         return injectors;
-
-
     }
 
-    /**
-     * Execute the test with the generator
-     */
-    private List<Future<Boolean>> doTest(final GraphManagerFactory factory, final EdgeGenerator generator, final int numWorkers, final long writeCount, final long minExecutionTime ) throws InterruptedException, ExecutionException {
-
-        ExecutorService executor = Executors.newFixedThreadPool( numWorkers );
-
-        List<Future<Boolean>> futures = new ArrayList<>( numWorkers );
 
-        for ( int i = 0; i < numWorkers; i++ ) {
-            Future<Boolean> future = executor.submit( new Worker(factory, generator, writeCount, minExecutionTime ) );
-
-            futures.add( future );
-        }
 
 
-        return futures;
-    }
-
 
     private class Worker implements Callable<Boolean> {
         private final GraphManagerFactory factory;
         private final EdgeGenerator generator;
         private final long writeLimit;
         private final long minExecutionTime;
+        private final AtomicLong writeCounter;
 
 
-        private Worker( final GraphManagerFactory factory, final EdgeGenerator generator, final long writeLimit, final long minExecutionTime ) {
+        private Worker( final GraphManagerFactory factory, final EdgeGenerator generator, final long writeLimit,
+                        final long minExecutionTime, final AtomicLong writeCounter ) {
             this.factory = factory;
             this.generator = generator;
             this.writeLimit = writeLimit;
             this.minExecutionTime = minExecutionTime;
+            this.writeCounter = writeCounter;
         }
 
 
@@ -356,11 +423,10 @@ public class GraphManagerShardConsistencyIT {
             GraphManager manager = factory.createEdgeManager( scope );
 
 
-
             final long startTime = System.currentTimeMillis();
 
 
-            for ( long i = 0; i < writeLimit || System.currentTimeMillis() - startTime < minExecutionTime ; i++ ) {
+            for ( long i = 0; i < writeLimit || System.currentTimeMillis() - startTime < minExecutionTime; i++ ) {
 
                 Edge edge = generator.newEdge();
 
@@ -372,6 +438,10 @@ public class GraphManagerShardConsistencyIT {
 
                 writeMeter.mark();
 
+                writeCounter.incrementAndGet();
+
+
+
                 if ( i % 1000 == 0 ) {
                     log.info( "   Wrote: " + i );
                 }
@@ -383,6 +453,94 @@ public class GraphManagerShardConsistencyIT {
     }
 
 
+    private class ReadWorker implements Callable<Long> {
+        private final GraphManagerFactory factory;
+        private final EdgeGenerator generator;
+        private final long writeCount;
+        private final Meter readMeter;
+
+        private ReadWorker( final GraphManagerFactory factory, final EdgeGenerator generator, final long writeCount,
+                            final Meter readMeter) {
+            this.factory = factory;
+            this.generator = generator;
+            this.writeCount = writeCount;
+            this.readMeter = readMeter;
+        }
+
+
+        @Override
+        public Long call() throws Exception {
+
+
+
+
+            GraphManager gm = factory.createEdgeManager( scope );
+
+
+
+            while(true) {
+
+//                final long[] count = {0};
+//                final long[] duplicate = {0};
+//                final HashSet<Edge >  seen = new HashSet<>((int)writeCount);
+
+
+                //do a read to eventually trigger our group compaction. Take 2 pages of columns
+                final long returnedEdgeCount = generator.doSearch( gm )
+
+                                                        .doOnNext( new Action1<Edge>() {
+
+
+
+//                    private Edge last;
+
+
+                    @Override
+                    public void call( final Edge edge ) {
+                        readMeter.mark();
+
+//                        count[0]++;
+//
+//                        /**
+//                         * Added this check as part of the read
+//                         */
+//                        if ( last != null && last.equals(edge) ) {
+//                            fail( String.format( "Expected edges to be in order, however last was %s and current is %s",
+//                                    last, edge ) );
+//                        }
+//
+//                        last = edge;
+//
+//                        if( seen.contains( edge ) ){
+//                            fail( String.format("Returned an edge that was already seen! Edge was %s, last edge was %s", edge, last) );
+//                            duplicate[0]++;
+//                        }
+//
+//                        seen.add( edge );
+
+                    }
+                } )
+
+                                                        .longCount().toBlocking().last();
+
+
+//                if(returnedEdgeCount != count[0]-duplicate[0]){
+//                    log.warn( "Missing entries from the initial put" );
+//                }
+
+                log.info( "Completed reading {} edges", returnedEdgeCount );
+
+                if(writeCount != returnedEdgeCount){
+                    log.warn( "Unexpected edge count returned!!!  Expected {} but was {}", writeCount, returnedEdgeCount );
+                }
+
+                assertEquals( "Expected to read same edge count", writeCount, returnedEdgeCount );
+            }
+
+        }
+    }
+
+
     private interface EdgeGenerator {
 
         /**
@@ -392,13 +550,9 @@ public class GraphManagerShardConsistencyIT {
 
         /**
          * Perform the search returning an observable edge
-         * @param manager
-         * @return
          */
         public Observable<Edge> doSearch( final GraphManager manager );
     }
-
-
 }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerStressTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerStressTest.java b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerStressTest.java
index cf6dda8..e4b67c2 100644
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerStressTest.java
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerStressTest.java
@@ -118,7 +118,7 @@ public class GraphManagerStressTest {
                             for ( Id sourceId : sourceIds ) {
 
                                 final Iterable<Edge> edges = manager.loadEdgesFromSource(
-                                        new SimpleSearchByEdgeType( sourceId, "test", timestamp, null ) )
+                                        new SimpleSearchByEdgeType( sourceId, "test", timestamp, SearchByEdgeType.Order.DESCENDING, null ) )
                                                                     .toBlocking().toIterable();
 
                                 for ( Edge edge : edges ) {
@@ -192,7 +192,7 @@ public class GraphManagerStressTest {
 
             @Override
             public Observable<Edge> doSearch( final GraphManager manager ) {
-                return manager.loadEdgesFromSource( new SimpleSearchByEdgeType( sourceId, "test", System.currentTimeMillis(), null ) );
+                return manager.loadEdgesFromSource( new SimpleSearchByEdgeType( sourceId, "test", System.currentTimeMillis(), SearchByEdgeType.Order.DESCENDING, null ) );
             }
         };
 
@@ -220,7 +220,7 @@ public class GraphManagerStressTest {
             @Override
             public Observable<Edge> doSearch( final GraphManager manager ) {
 
-                return manager.loadEdgesToTarget( new SimpleSearchByEdgeType( targetId, "test", System.currentTimeMillis(), null ) );
+                return manager.loadEdgesToTarget( new SimpleSearchByEdgeType( targetId, "test", System.currentTimeMillis(), SearchByEdgeType.Order.DESCENDING, null ) );
             }
         };
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/impl/stage/EdgeDeleteRepairTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/impl/stage/EdgeDeleteRepairTest.java b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/impl/stage/EdgeDeleteRepairTest.java
index 4b62ad1..e8af91c 100644
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/impl/stage/EdgeDeleteRepairTest.java
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/impl/stage/EdgeDeleteRepairTest.java
@@ -34,6 +34,7 @@ import org.apache.usergrid.persistence.collection.guice.MigrationManagerRule;
 import org.apache.usergrid.persistence.core.cassandra.ITRunner;
 import org.apache.usergrid.persistence.core.scope.ApplicationScope;
 import org.apache.usergrid.persistence.graph.MarkedEdge;
+import org.apache.usergrid.persistence.graph.SearchByEdgeType;
 import org.apache.usergrid.persistence.graph.guice.TestGraphModule;
 import org.apache.usergrid.persistence.graph.impl.SimpleSearchByEdge;
 import org.apache.usergrid.persistence.graph.serialization.EdgeSerialization;
@@ -131,7 +132,7 @@ public class EdgeDeleteRepairTest {
 
 
         Iterator<MarkedEdge> itr = storageEdgeSerialization.getEdgeVersions( scope,
-                new SimpleSearchByEdge( sourceId, edgeType, targetId, System.currentTimeMillis(), null ) );
+                new SimpleSearchByEdge( sourceId, edgeType, targetId, System.currentTimeMillis(), SearchByEdgeType.Order.DESCENDING, null ) );
 
         assertEquals( edge2, itr.next() );
         assertEquals( edge1, itr.next() );
@@ -142,7 +143,7 @@ public class EdgeDeleteRepairTest {
         assertEquals( edge1, deleted );
 
         itr = storageEdgeSerialization.getEdgeVersions( scope,
-                new SimpleSearchByEdge( sourceId, edgeType, targetId, System.currentTimeMillis(), null ) );
+                new SimpleSearchByEdge( sourceId, edgeType, targetId, System.currentTimeMillis(), SearchByEdgeType.Order.DESCENDING,  null ) );
 
         assertEquals( edge2, itr.next() );
         assertFalse( itr.hasNext() );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/NodeShardAllocationTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/NodeShardAllocationTest.java b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/NodeShardAllocationTest.java
index 878674a..b8be5d2 100644
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/NodeShardAllocationTest.java
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/NodeShardAllocationTest.java
@@ -19,10 +19,12 @@
 package org.apache.usergrid.persistence.graph.serialization.impl.shard;
 
 
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Iterator;
+import java.util.List;
 
 import org.junit.Before;
 import org.junit.Test;
@@ -87,6 +89,8 @@ public class NodeShardAllocationTest {
 
     @Test
     public void minTime() {
+        final ShardGroupCompaction shardGroupCompaction = mock( ShardGroupCompaction.class );
+
         final EdgeShardSerialization edgeShardSerialization = mock( EdgeShardSerialization.class );
 
         final EdgeColumnFamilies edgeColumnFamilies = mock( EdgeColumnFamilies.class );
@@ -101,7 +105,7 @@ public class NodeShardAllocationTest {
 
         NodeShardAllocation approximation =
                 new NodeShardAllocationImpl( edgeShardSerialization, edgeColumnFamilies, shardedEdgeSerialization,
-                        nodeShardCounterSerialization, timeService, graphFig );
+                        nodeShardCounterSerialization, timeService, graphFig, shardGroupCompaction );
 
 
         final long timeservicetime = System.currentTimeMillis();
@@ -116,9 +120,10 @@ public class NodeShardAllocationTest {
     }
 
 
-
     @Test
     public void existingFutureShardSameTime() {
+        final ShardGroupCompaction shardGroupCompaction = mock( ShardGroupCompaction.class );
+
         final EdgeShardSerialization edgeShardSerialization = mock( EdgeShardSerialization.class );
 
         final EdgeColumnFamilies edgeColumnFamilies = mock( EdgeColumnFamilies.class );
@@ -131,10 +136,9 @@ public class NodeShardAllocationTest {
         final TimeService timeService = mock( TimeService.class );
 
 
-
         NodeShardAllocation approximation =
                 new NodeShardAllocationImpl( edgeShardSerialization, edgeColumnFamilies, shardedEdgeSerialization,
-                        nodeShardCounterSerialization, timeService, graphFig );
+                        nodeShardCounterSerialization, timeService, graphFig, shardGroupCompaction );
 
         final Id nodeId = createId( "test" );
         final String type = "type";
@@ -145,7 +149,7 @@ public class NodeShardAllocationTest {
 
         when( timeService.getCurrentTime() ).thenReturn( timeservicetime );
 
-        final Shard firstShard = new Shard(0l, 0l, true);
+        final Shard firstShard = new Shard( 0l, 0l, true );
         final Shard futureShard = new Shard( 10000l, timeservicetime, false );
 
         final ShardEntryGroup shardEntryGroup = new ShardEntryGroup( 1000l );
@@ -162,6 +166,8 @@ public class NodeShardAllocationTest {
 
     @Test
     public void lowCountFutureShard() {
+        final ShardGroupCompaction shardGroupCompaction = mock( ShardGroupCompaction.class );
+
         final EdgeShardSerialization edgeShardSerialization = mock( EdgeShardSerialization.class );
 
         final EdgeColumnFamilies edgeColumnFamilies = mock( EdgeColumnFamilies.class );
@@ -175,7 +181,7 @@ public class NodeShardAllocationTest {
 
         NodeShardAllocation approximation =
                 new NodeShardAllocationImpl( edgeShardSerialization, edgeColumnFamilies, shardedEdgeSerialization,
-                        nodeShardApproximation, timeService, graphFig );
+                        nodeShardApproximation, timeService, graphFig, shardGroupCompaction );
 
         final Id nodeId = createId( "test" );
         final String type = "type";
@@ -207,7 +213,9 @@ public class NodeShardAllocationTest {
 
 
     @Test
-    public void equalCountFutureShard() {
+    public void overAllocatedShard() {
+        final ShardGroupCompaction shardGroupCompaction = mock( ShardGroupCompaction.class );
+
         final EdgeShardSerialization edgeShardSerialization = mock( EdgeShardSerialization.class );
 
         final EdgeColumnFamilies edgeColumnFamilies = mock( EdgeColumnFamilies.class );
@@ -221,7 +229,7 @@ public class NodeShardAllocationTest {
 
         NodeShardAllocation approximation =
                 new NodeShardAllocationImpl( edgeShardSerialization, edgeColumnFamilies, shardedEdgeSerialization,
-                        nodeShardApproximation, timeService, graphFig );
+                        nodeShardApproximation, timeService, graphFig, shardGroupCompaction );
 
         final Id nodeId = createId( "test" );
         final String type = "type";
@@ -239,11 +247,58 @@ public class NodeShardAllocationTest {
 
         final DirectedEdgeMeta targetEdgeMeta = DirectedEdgeMeta.fromSourceNodeTargetType( nodeId, type, subType );
 
-        final long shardCount = graphFig.getShardSize();
+
+        /**
+         * Allocate 2.5x what this shard should have.  We should ultimately have a split at 2x
+         */
+        final long shardCount = ( long ) (graphFig.getShardSize() * 2.5);
+
 
         //return a shard size equal to our max
         when( nodeShardApproximation.getCount( scope, futureShard, targetEdgeMeta ) ).thenReturn( shardCount );
 
+
+        //this is how many we should be iterating and should set the value of the last shard we keep
+        final int numToIterate = ( int ) (graphFig.getShardSize() *2);
+
+
+        /**
+         * Just use 2 edges.  It means that we won't generate a boatload of data and kill our test. We just want
+         * to check that the one we want to return is correct
+         */
+        SimpleMarkedEdge skipped = new SimpleMarkedEdge( nodeId, type, createId( subType ), 10000, false );
+        SimpleMarkedEdge keep = new SimpleMarkedEdge( nodeId, type, createId( subType ), 20000, false );
+
+        //allocate some extra to ensure we seek the right value
+        List<MarkedEdge> edges = new ArrayList( numToIterate + 100 );
+
+        int i = 0;
+
+        for (; i < numToIterate - 1; i++ ) {
+            edges.add( skipped );
+        }
+
+        //add our keep edge
+        edges.add( keep );
+        i++;
+
+        for ( ; i < shardCount; i++ ) {
+
+            edges.add( skipped );
+        }
+
+
+        final Iterator<MarkedEdge> edgeIterator = edges.iterator();
+
+        //mock up returning the value
+        when( shardedEdgeSerialization
+                .getEdgesFromSourceByTargetType( same( edgeColumnFamilies ), same( scope ), any( SearchByIdType.class ),
+                        any( Collection.class ) ) ).thenReturn( edgeIterator );
+
+
+        /**
+         * Mock up the write shard meta data
+         */
         ArgumentCaptor<Shard> shardValue = ArgumentCaptor.forClass( Shard.class );
 
 
@@ -252,10 +307,89 @@ public class NodeShardAllocationTest {
                 .thenReturn( mock( MutationBatch.class ) );
 
 
+        final boolean result = approximation.auditShard( scope, shardEntryGroup, targetEdgeMeta );
+
+        assertTrue( "Shard was split correctly", result );
+
+        final long savedTimestamp = shardValue.getValue().getCreatedTime();
+
+
+        assertEquals( "Expected time service time", timeservicetime, savedTimestamp );
+
+
+        //now check our max value was set.  Since our shard is significantly over allocated, we should be iterating
+        //through elements to move the pivot down to a more manageable size
+
+        final long savedShardPivot = shardValue.getValue().getShardIndex();
+
+        assertEquals( "Expected max value to be the same", keep.getTimestamp(), savedShardPivot );
+    }
+
+
+    @Test
+    public void equalCountFutureShard() {
+
+        final ShardGroupCompaction shardGroupCompaction = mock( ShardGroupCompaction.class );
+
+        final EdgeShardSerialization edgeShardSerialization = mock( EdgeShardSerialization.class );
+
+        final EdgeColumnFamilies edgeColumnFamilies = mock( EdgeColumnFamilies.class );
+
+        final ShardedEdgeSerialization shardedEdgeSerialization = mock( ShardedEdgeSerialization.class );
+
+        final NodeShardApproximation nodeShardApproximation = mock( NodeShardApproximation.class );
+
+
+        final TimeService timeService = mock( TimeService.class );
+
+        NodeShardAllocation approximation =
+                new NodeShardAllocationImpl( edgeShardSerialization, edgeColumnFamilies, shardedEdgeSerialization,
+                        nodeShardApproximation, timeService, graphFig, shardGroupCompaction );
+
+        final Id nodeId = createId( "test" );
+        final String type = "type";
+        final String subType = "subType";
+
+
+        final long timeservicetime = System.currentTimeMillis();
+
+        when( timeService.getCurrentTime() ).thenReturn( timeservicetime );
+
+        final Shard futureShard = new Shard( 0l, 0l, true );
+
+        final ShardEntryGroup shardEntryGroup = new ShardEntryGroup( 1000l );
+        shardEntryGroup.addShard( futureShard );
+
+        final DirectedEdgeMeta targetEdgeMeta = DirectedEdgeMeta.fromSourceNodeTargetType( nodeId, type, subType );
+
+        final long shardCount = graphFig.getShardSize();
+
+
+        final SimpleMarkedEdge skippedEdge =   new SimpleMarkedEdge( nodeId, type, createId( "subType" ), 10000l, false );
         final SimpleMarkedEdge returnedEdge =
                 new SimpleMarkedEdge( nodeId, type, createId( "subType" ), 10005l, false );
 
-        final Iterator<MarkedEdge> edgeIterator = Collections.singleton( ( MarkedEdge ) returnedEdge ).iterator();
+        List<MarkedEdge> iteratedEdges = new ArrayList<>( ( int ) shardCount );
+
+        for(long i = 0; i < shardCount-1; i ++){
+            iteratedEdges.add( skippedEdge);
+        }
+
+        iteratedEdges.add( returnedEdge );
+
+        //return a shard size equal to our max
+        when( nodeShardApproximation.getCount( scope, futureShard, targetEdgeMeta ) ).thenReturn( shardCount );
+
+        ArgumentCaptor<Shard> shardValue = ArgumentCaptor.forClass( Shard.class );
+
+
+        //mock up our mutation
+        when( edgeShardSerialization.writeShardMeta( same( scope ), shardValue.capture(), same( targetEdgeMeta ) ) )
+                .thenReturn( mock( MutationBatch.class ) );
+
+
+
+        final Iterator<MarkedEdge> edgeIterator = iteratedEdges.iterator();
 
         //mock up returning the value
         when( shardedEdgeSerialization
@@ -285,7 +419,76 @@ public class NodeShardAllocationTest {
 
 
     @Test
+    public void invalidCountNoShards() {
+
+        final ShardGroupCompaction shardGroupCompaction = mock( ShardGroupCompaction.class );
+
+        final EdgeShardSerialization edgeShardSerialization = mock( EdgeShardSerialization.class );
+
+        final EdgeColumnFamilies edgeColumnFamilies = mock( EdgeColumnFamilies.class );
+
+        final ShardedEdgeSerialization shardedEdgeSerialization = mock( ShardedEdgeSerialization.class );
+
+        final NodeShardApproximation nodeShardApproximation = mock( NodeShardApproximation.class );
+
+
+        final TimeService timeService = mock( TimeService.class );
+
+        NodeShardAllocation approximation =
+                new NodeShardAllocationImpl( edgeShardSerialization, edgeColumnFamilies, shardedEdgeSerialization,
+                        nodeShardApproximation, timeService, graphFig, shardGroupCompaction );
+
+        final Id nodeId = createId( "test" );
+        final String type = "type";
+        final String subType = "subType";
+
+
+        final long timeservicetime = System.currentTimeMillis();
+
+        when( timeService.getCurrentTime() ).thenReturn( timeservicetime );
+
+        final Shard futureShard = new Shard( 0l, 0l, true );
+
+        final ShardEntryGroup shardEntryGroup = new ShardEntryGroup( 1000l );
+        shardEntryGroup.addShard( futureShard );
+
+        final DirectedEdgeMeta targetEdgeMeta = DirectedEdgeMeta.fromSourceNodeTargetType( nodeId, type, subType );
+
+        final long shardCount = graphFig.getShardSize();
+
+        //return a shard size equal to our max
+        when( nodeShardApproximation.getCount( scope, futureShard, targetEdgeMeta ) ).thenReturn( shardCount );
+
+        ArgumentCaptor<Shard> shardValue = ArgumentCaptor.forClass( Shard.class );
+
+
+        //mock up our mutation
+        when( edgeShardSerialization.writeShardMeta( same( scope ), shardValue.capture(), same( targetEdgeMeta ) ) )
+                .thenReturn( mock( MutationBatch.class ) );
+
+
+        final SimpleMarkedEdge returnedEdge =
+                new SimpleMarkedEdge( nodeId, type, createId( "subType" ), 10005l, false );
+
+        final Iterator<MarkedEdge> edgeIterator = Collections.singleton( ( MarkedEdge ) returnedEdge ).iterator();
+
+        //mock up returning the value
+        when( shardedEdgeSerialization
+                .getEdgesFromSourceByTargetType( same( edgeColumnFamilies ), same( scope ), any( SearchByIdType.class ),
+                        any( Collection.class ) ) ).thenReturn( edgeIterator );
+
+
+        final boolean result = approximation.auditShard( scope, shardEntryGroup, targetEdgeMeta );
+
+        assertFalse( "Shard should not be allocated", result );
+    }
+
+
+    @Test
     public void futureCountShardCleanup() {
+
+        final ShardGroupCompaction shardGroupCompaction = mock( ShardGroupCompaction.class );
+
         final EdgeShardSerialization edgeShardSerialization = mock( EdgeShardSerialization.class );
 
         final EdgeColumnFamilies edgeColumnFamilies = mock( EdgeColumnFamilies.class );
@@ -300,7 +503,7 @@ public class NodeShardAllocationTest {
 
         NodeShardAllocation approximation =
                 new NodeShardAllocationImpl( edgeShardSerialization, edgeColumnFamilies, shardedEdgeSerialization,
-                        nodeShardApproximation, timeService, graphFig );
+                        nodeShardApproximation, timeService, graphFig, shardGroupCompaction );
 
         final Id nodeId = createId( "test" );
         final String type = "type";
@@ -310,7 +513,7 @@ public class NodeShardAllocationTest {
         /**
          * Use the time service to generate timestamps
          */
-        final long timeservicetime = 10000;
+        final long timeservicetime = System.currentTimeMillis() + 60000;
 
 
         when( timeService.getCurrentTime() ).thenReturn( timeservicetime );
@@ -382,21 +585,16 @@ public class NodeShardAllocationTest {
 
         Collection<Shard> writeShards = shardEntryGroup.getWriteShards( minTime + minDelta );
 
-        assertEquals( "Shard size as expected", 4, writeShards.size() );
+        assertEquals( "Shard size as expected", 1, writeShards.size() );
 
-        assertTrue( writeShards.contains( futureShard1 ) );
-        assertTrue( writeShards.contains( futureShard2 ) );
-        assertTrue( writeShards.contains( futureShard3 ) );
         assertTrue( writeShards.contains( compactedShard ) );
 
 
         Collection<Shard> readShards = shardEntryGroup.getReadShards();
 
-        assertEquals( "Shard size as expected", 4, readShards.size() );
+        assertEquals( "Shard size as expected", 2, readShards.size() );
 
         assertTrue( readShards.contains( futureShard1 ) );
-        assertTrue( readShards.contains( futureShard2 ) );
-        assertTrue( readShards.contains( futureShard3 ) );
         assertTrue( readShards.contains( compactedShard ) );
 
 
@@ -423,6 +621,9 @@ public class NodeShardAllocationTest {
 
     @Test
     public void noShardsReturns() throws ConnectionException {
+
+        final ShardGroupCompaction shardGroupCompaction = mock( ShardGroupCompaction.class );
+
         final EdgeShardSerialization edgeShardSerialization = mock( EdgeShardSerialization.class );
 
         final EdgeColumnFamilies edgeColumnFamilies = mock( EdgeColumnFamilies.class );
@@ -434,13 +635,15 @@ public class NodeShardAllocationTest {
 
         final TimeService timeService = mock( TimeService.class );
 
-        when( timeService.getCurrentTime() ).thenReturn( 10000l );
+        final long returnTime = System.currentTimeMillis()+graphFig.getShardCacheTimeout()*2 ;
+
+        when( timeService.getCurrentTime() ).thenReturn( returnTime );
 
         final MutationBatch batch = mock( MutationBatch.class );
 
         NodeShardAllocation approximation =
                 new NodeShardAllocationImpl( edgeShardSerialization, edgeColumnFamilies, shardedEdgeSerialization,
-                        nodeShardApproximation, timeService, graphFig );
+                        nodeShardApproximation, timeService, graphFig, shardGroupCompaction );
 
         final Id nodeId = createId( "test" );
         final String type = "type";
@@ -499,6 +702,8 @@ public class NodeShardAllocationTest {
     @Test
     public void invalidConfiguration() {
 
+        final ShardGroupCompaction shardGroupCompaction = mock( ShardGroupCompaction.class );
+
         final GraphFig graphFig = mock( GraphFig.class );
 
         final EdgeShardSerialization edgeShardSerialization = mock( EdgeShardSerialization.class );
@@ -531,7 +736,7 @@ public class NodeShardAllocationTest {
 
         NodeShardAllocation approximation =
                 new NodeShardAllocationImpl( edgeShardSerialization, edgeColumnFamilies, shardedEdgeSerialization,
-                        nodeShardApproximation, timeService, graphFig );
+                        nodeShardApproximation, timeService, graphFig, shardGroupCompaction );
 
 
         /**

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardEntryGroupTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardEntryGroupTest.java b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardEntryGroupTest.java
index 6096e58..ee4b94a 100644
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardEntryGroupTest.java
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardEntryGroupTest.java
@@ -264,13 +264,11 @@ public class ShardEntryGroupTest {
 
         Collection<Shard> readShards = shardEntryGroup.getReadShards();
 
-        assertEquals("Shard size correct", 3, readShards.size());
+        assertEquals("Shard size correct", 2, readShards.size());
 
-        assertTrue("First shard present",  readShards.contains( firstShard ) );
+        assertTrue("First shard present",  readShards.contains( secondShard ) );
 
-        assertTrue("Second shard present",  readShards.contains( firstShard ) );
-
-        assertTrue("Third shard present",  readShards.contains( firstShard ) );
+        assertTrue("Second shard present",  readShards.contains( compactedShard1 ) );
 
     }
 
@@ -308,23 +306,15 @@ public class ShardEntryGroupTest {
 
         Collection<Shard> writeShards = shardEntryGroup.getWriteShards( firstShard.getCreatedTime() + delta );
 
-        assertEquals("Shard size correct", 3, writeShards.size());
-
-        assertTrue("First shard present",  writeShards.contains( firstShard ) );
-
-        assertTrue("Second shard present",  writeShards.contains( secondShard ) );
+        assertEquals("Shard size correct", 1, writeShards.size());
 
-        assertTrue("Third shard present",  writeShards.contains( compactedShard ) );
+        assertTrue("Root shard present",  writeShards.contains( compactedShard ) );
 
 
 
         writeShards = shardEntryGroup.getWriteShards(secondShard.getCreatedTime()+delta);
 
-        assertEquals("Shard size correct", 3, writeShards.size());
-
-        assertTrue("First shard present",  writeShards.contains( firstShard ) );
-
-        assertTrue("Second shard present",  writeShards.contains( secondShard ) );
+        assertEquals("Shard size correct", 1, writeShards.size());
 
         assertTrue("Third shard present",  writeShards.contains( compactedShard ) );
 
@@ -334,13 +324,11 @@ public class ShardEntryGroupTest {
          */
         writeShards = shardEntryGroup.getWriteShards(secondShard.getCreatedTime() +1 + delta);
 
-        assertEquals("Shard size correct", 3, writeShards.size());
+        assertEquals("Shard size correct", 1, writeShards.size());
 
-        assertTrue("First shard present",  writeShards.contains( firstShard ) );
 
-        assertTrue("Second shard present",  writeShards.contains( secondShard ) );
+        assertTrue("Second shard present",  writeShards.contains( compactedShard ) );
 
-        assertTrue("Third shard present",  writeShards.contains( compactedShard ) );
 
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardGroupCompactionTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardGroupCompactionTest.java b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardGroupCompactionTest.java
new file mode 100644
index 0000000..1513e85
--- /dev/null
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardGroupCompactionTest.java
@@ -0,0 +1,226 @@
+/*
+ *
+ *  * 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.graph.serialization.impl.shard;
+
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Set;
+
+import org.hamcrest.BaseMatcher;
+import org.hamcrest.Description;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Matchers;
+
+import org.apache.usergrid.persistence.core.consistency.TimeService;
+import org.apache.usergrid.persistence.core.scope.ApplicationScope;
+import org.apache.usergrid.persistence.core.scope.ApplicationScopeImpl;
+import org.apache.usergrid.persistence.graph.GraphFig;
+import org.apache.usergrid.persistence.graph.SearchByEdgeType;
+import org.apache.usergrid.persistence.graph.serialization.impl.shard.impl.ShardGroupCompactionImpl;
+
+import com.netflix.astyanax.Keyspace;
+
+import static org.apache.usergrid.persistence.graph.test.util.EdgeTestUtils.createId;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Matchers.same;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+
+public class ShardGroupCompactionTest {
+
+    protected GraphFig graphFig;
+    protected ApplicationScope scope;
+
+
+    @Before
+    public void setup() {
+        graphFig = mock( GraphFig.class );
+
+        when( graphFig.getShardAuditWorkerCount() ).thenReturn( 10 );
+
+        when( graphFig.getShardAuditWorkerQueueSize() ).thenReturn( 1000 );
+
+        this.scope = new ApplicationScopeImpl( createId( "application" ) );
+    }
+
+
+    @Test
+    public void shouldNotCompact() {
+
+        final TimeService timeService = mock( TimeService.class );
+
+        final NodeShardAllocation nodeShardAllocation = mock( NodeShardAllocation.class );
+
+        final ShardedEdgeSerialization shardedEdgeSerialization = mock( ShardedEdgeSerialization.class );
+
+        final EdgeColumnFamilies edgeColumnFamilies = mock( EdgeColumnFamilies.class );
+
+        final Keyspace keyspace = mock( Keyspace.class );
+
+        final EdgeShardSerialization edgeShardSerialization = mock( EdgeShardSerialization.class );
+
+        final long delta = 10000;
+
+        final long createTime = 20000;
+
+        //we shouldn't be able to compact, should throw an exception
+        final long timeNow = createTime + delta - 1;
+
+        ShardEntryGroup group = new ShardEntryGroup( delta );
+        group.addShard( new Shard( 2000, createTime, false ) );
+        group.addShard( new Shard( 1000, 5000, true ) );
+
+
+        when( timeService.getCurrentTime() ).thenReturn( timeNow );
+
+        ShardGroupCompactionImpl compaction =
+                new ShardGroupCompactionImpl( timeService, graphFig, nodeShardAllocation, shardedEdgeSerialization,
+                        edgeColumnFamilies, keyspace, edgeShardSerialization );
+
+
+        DirectedEdgeMeta directedEdgeMeta = DirectedEdgeMeta.fromSourceNode( createId("source"), "test" );
+
+        try {
+            compaction.compact( this.scope, directedEdgeMeta, group );
+            fail( "I should not reach this point" );
+        }catch(Throwable t){
+            assertEquals("Correct error message returned", "Compaction cannot be run yet.  Ignoring compaction.", t.getMessage());
+        }
+
+    }
+
+
+//    /**
+//     * Tests that when we copy edges, we do not actually run the compaction, we can only run it after we get nothing
+//     * and the timeout has elapsed
+//     */
+//    @Test
+//    public void shouldOnlyCopy() {
+//
+//        final TimeService timeService = mock( TimeService.class );
+//
+//        final NodeShardAllocation nodeShardAllocation = mock( NodeShardAllocation.class );
+//
+//        final ShardedEdgeSerialization shardedEdgeSerialization = mock( ShardedEdgeSerialization.class );
+//
+//        final EdgeColumnFamilies edgeColumnFamilies = mock( EdgeColumnFamilies.class );
+//
+//        final Keyspace keyspace = mock( Keyspace.class );
+//
+//        final EdgeShardSerialization edgeShardSerialization = mock( EdgeShardSerialization.class );
+//
+//        final long delta = 10000;
+//
+//        final long createTime = 20000;
+//
+//        //we shouldn't be able to compact, should throw an exception
+//        final long timeNow = createTime + delta ;
+//
+//
+//        final Shard targetShard = new Shard( 2000, createTime, false ) ;
+//        final Shard sourceShard =  new Shard( 1000, 5000, true );
+//        ShardEntryGroup group = new ShardEntryGroup( delta );
+//        group.addShard( targetShard );
+//        group.addShard( sourceShard );
+//
+//
+//        when( timeService.getCurrentTime() ).thenReturn( timeNow );
+//
+//        ShardGroupCompaction compaction =
+//                new ShardGroupCompactionImpl( timeService, graphFig, nodeShardAllocation, shardedEdgeSerialization,
+//                        edgeColumnFamilies, keyspace, edgeShardSerialization );
+//
+//
+//        DirectedEdgeMeta directedEdgeMeta = DirectedEdgeMeta.fromSourceNode( createId("source"), "test" );
+//
+//
+//        /**
+//         * Mock up returning edges from the source
+//         */
+//
+//        int count = 100;
+//
+//        for(int i = 0; i < count; i ++){
+//
+//
+//
+//            when(shardedEdgeSerialization.getEdgesFromSource( same(edgeColumnFamilies), same(scope), any(
+//                    SearchByEdgeType.class), Matchers.argThat(new ShardSetMatcher( Collections.singleton( sourceShard ) ))/*any(Set.class)*/ ));
+//            edgeMeta.loadEdges( shardedEdgeSerialization, edgeColumnFamilies, scope,
+//
+//                                Collections.singleton( sourceShard ),  SearchByEdgeType.Order.DESCENDING, Long.MAX_VALUE );
+//        }
+//
+//        try {
+//            compaction.compact( this.scope, directedEdgeMeta, group );
+//            fail( "I should not reach this point" );
+//        }catch(Throwable t){
+//            assertEquals("Correct error message returned", "Compaction cannot be run yet.  Ignoring compaction.", t.getMessage());
+//        }
+//
+//    }
+
+
+    private final class ShardSetMatcher extends BaseMatcher<Collection<Shard>>{
+
+        private final Collection<Shard> expected;
+
+
+        private ShardSetMatcher( final Collection<Shard> expected ) {this.expected = expected;}
+
+
+        @Override
+        public boolean matches( final Object o ) {
+            if(! (o instanceof Collection)){
+                return false;
+            }
+
+
+            Collection<Shard> passedShards = ( Collection<Shard> ) o;
+
+            return passedShards.containsAll( expected );
+        }
+
+
+        @Override
+        public void describeTo( final Description description ) {
+
+           StringBuilder builder = new StringBuilder(  );
+
+            builder.append("Collection of shards with shards {");
+
+            for(Shard shard: expected){
+              builder.append(shard).append( "," );
+            }
+
+            builder.setLength( builder.length()-1 );
+
+           description.appendText( builder.toString() );
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardApproximationTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardApproximationTest.java b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardApproximationTest.java
index 8e9ed5c..da96e33 100644
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardApproximationTest.java
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardApproximationTest.java
@@ -489,6 +489,18 @@ public class NodeShardApproximationTest {
 
 
         @Override
+        public int getShardAuditWorkerCount() {
+            return 0;
+        }
+
+
+        @Override
+        public int getShardAuditWorkerQueueSize() {
+            return 0;
+        }
+
+
+        @Override
         public long getCounterFlushCount() {
             return 100000l;
         }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardEntryGroupIteratorTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardEntryGroupIteratorTest.java b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardEntryGroupIteratorTest.java
index 5b20647..34bc079 100644
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardEntryGroupIteratorTest.java
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardEntryGroupIteratorTest.java
@@ -29,62 +29,86 @@ import java.util.Iterator;
 
 import org.junit.Test;
 
+import org.apache.usergrid.persistence.core.scope.ApplicationScope;
+import org.apache.usergrid.persistence.core.scope.ApplicationScopeImpl;
+import org.apache.usergrid.persistence.graph.serialization.impl.shard.DirectedEdgeMeta;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.Shard;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.ShardEntryGroup;
+import org.apache.usergrid.persistence.graph.serialization.impl.shard.ShardGroupCompaction;
 
 import static junit.framework.TestCase.assertTrue;
+import static org.apache.usergrid.persistence.graph.test.util.EdgeTestUtils.createId;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Matchers.same;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
 
 
 public class ShardEntryGroupIteratorTest {
 
+
     @Test(expected = IllegalArgumentException.class)
-    public void noShards(){
+    public void noShards() {
+
+        final ApplicationScope scope = new ApplicationScopeImpl( createId( "application" ) );
+        final DirectedEdgeMeta directedEdgeMeta = DirectedEdgeMeta.fromSourceNode( createId( "source" ), "test" );
+        final ShardGroupCompaction shardGroupCompaction = mock( ShardGroupCompaction.class );
         final long delta = 10000;
         final Iterator<Shard> noShards = Collections.<Shard>emptyList().iterator();
 
         //should blow up, our iterator is empty
-        new ShardEntryGroupIterator(noShards, delta);
-
+        new ShardEntryGroupIterator( noShards, delta, shardGroupCompaction, scope, directedEdgeMeta );
     }
 
+
     @Test
-    public void existingSingleShard(){
+    public void existingSingleShard() {
 
-        final Shard minShard = new Shard(0, 0, true);
+        final ApplicationScope scope = new ApplicationScopeImpl( createId( "application" ) );
+        final DirectedEdgeMeta directedEdgeMeta = DirectedEdgeMeta.fromSourceNode( createId( "source" ), "test" );
+
+
+        final ShardGroupCompaction shardGroupCompaction = mock( ShardGroupCompaction.class );
+
+        final Shard minShard = new Shard( 0, 0, true );
         final long delta = 10000;
         final Iterator<Shard> noShards = Collections.singleton( minShard ).iterator();
 
-        ShardEntryGroupIterator entryGroupIterator = new ShardEntryGroupIterator(noShards, delta);
+        ShardEntryGroupIterator entryGroupIterator =
+                new ShardEntryGroupIterator( noShards, delta, shardGroupCompaction, scope, directedEdgeMeta );
+
 
-        assertTrue("Root shard always present", entryGroupIterator.hasNext());
+        assertTrue( "Root shard always present", entryGroupIterator.hasNext() );
 
         ShardEntryGroup group = entryGroupIterator.next();
 
-        assertNotNull("Group returned", group);
+        assertNotNull( "Group returned", group );
 
-        Collection<Shard> readShards = group.getReadShards();
+        //verify we ran our compaction check
+        verify( shardGroupCompaction ).evaluateShardGroup( same( scope ), same( directedEdgeMeta ), eq( group ) );
 
-        assertEquals("Min shard present", 1, readShards.size());
 
-        assertTrue("Min shard present", readShards.contains( minShard ));
+        Collection<Shard> readShards = group.getReadShards( );
 
+        assertEquals( "Min shard present", 1, readShards.size() );
 
-        Collection<Shard> writeShards = group.getWriteShards( 0 );
+        assertTrue( "Min shard present", readShards.contains( minShard ) );
 
-        assertEquals("Min shard present", 1, writeShards.size());
 
-        assertTrue("Min shard present", writeShards.contains( minShard ));
+        Collection<Shard> writeShards = group.getWriteShards( 0 );
 
+        assertEquals( "Min shard present", 1, writeShards.size() );
 
-        writeShards = group.getWriteShards( Long.MAX_VALUE );
+        assertTrue( "Min shard present", writeShards.contains( minShard ) );
 
-        assertEquals("Min shard present", 1, writeShards.size());
 
-        assertTrue("Min shard present", writeShards.contains( minShard ));
+        writeShards = group.getWriteShards( Long.MAX_VALUE );
 
+        assertEquals( "Min shard present", 1, writeShards.size() );
 
+        assertTrue( "Min shard present", writeShards.contains( minShard ) );
     }
 
 
@@ -93,140 +117,160 @@ public class ShardEntryGroupIteratorTest {
      * that only the last 1 or 2 groups will actually have more than 1 entry.
      */
     @Test
-    public void boundedShardSets(){
+    public void boundedShardSets() {
+
+        final ApplicationScope scope = new ApplicationScopeImpl( createId( "application" ) );
+        final DirectedEdgeMeta directedEdgeMeta = DirectedEdgeMeta.fromSourceNode( createId( "source" ), "test" );
+
+        final ShardGroupCompaction shardGroupCompaction = mock( ShardGroupCompaction.class );
+
 
         /**
          * Next shard group
          */
-        final Shard shardGroup1Shard1 = new Shard(0, 0, true);
+        final Shard shardGroup1Shard1 = new Shard( 0, 0, true );
 
-        final Shard shardGroup1Shard2 = new Shard(10000, 100, false);
+        final Shard shardGroup1Shard2 = new Shard( 10000, 100, false );
 
-        final Shard shardGroup1Shard3 = new Shard(20000, 200, false);
+        final Shard shardGroup1Shard3 = new Shard( 20000, 200, false );
 
 
         /**
          * Middle shard group
          */
-        final Shard shardGroup2Shard1 = new Shard(30000, 300, true);
+        final Shard shardGroup2Shard1 = new Shard( 30000, 300, true );
 
-        final Shard shardGroup2Shard2 = new Shard(40000, 400, false);
+        final Shard shardGroup2Shard2 = new Shard( 40000, 400, false );
 
 
         /**
          * Highest shard group
          */
 
-        final Shard shardGroup3Shard1 = new Shard(50000, 500, true);
-
-        final Shard shardGroup3Shard2 = new Shard(60000, 600, false);
-
-        final Shard shardGroup3Shard3 = new Shard(70000, 700, false);
+        final Shard shardGroup3Shard1 = new Shard( 50000, 500, true );
 
+        final Shard shardGroup3Shard2 = new Shard( 60000, 600, false );
 
+        final Shard shardGroup3Shard3 = new Shard( 70000, 700, false );
 
 
         final long delta = 10000;
-        final Iterator<Shard> noShards = Arrays.asList(shardGroup3Shard3, shardGroup3Shard2, shardGroup3Shard1, shardGroup2Shard2, shardGroup2Shard1, shardGroup1Shard3, shardGroup1Shard2, shardGroup1Shard1 ).iterator();
-
 
+        final Iterator<Shard> noShards =
+                Arrays.asList( shardGroup3Shard3, shardGroup3Shard2, shardGroup3Shard1, shardGroup2Shard2,
+                        shardGroup2Shard1, shardGroup1Shard3, shardGroup1Shard2, shardGroup1Shard1 ).iterator();
 
 
-        ShardEntryGroupIterator entryGroupIterator = new ShardEntryGroupIterator(noShards, delta);
+        ShardEntryGroupIterator entryGroupIterator =
+                new ShardEntryGroupIterator( noShards, delta, shardGroupCompaction, scope, directedEdgeMeta );
 
-        assertTrue("max group present", entryGroupIterator.hasNext());
+        assertTrue( "max group present", entryGroupIterator.hasNext() );
 
         ShardEntryGroup group = entryGroupIterator.next();
 
-        assertNotNull("Group returned", group);
+        assertNotNull( "Group returned", group );
 
-        Collection<Shard> readShards = group.getReadShards();
+        //verify we ran our compaction check
+        verify( shardGroupCompaction ).evaluateShardGroup( same( scope ), same( directedEdgeMeta ), eq( group ) );
 
-        assertEquals("Min shard present", 3, readShards.size());
+        Collection<Shard> readShards = group.getReadShards( );
 
-        assertTrue("shardGroup3Shard3 shard present", readShards.contains( shardGroup3Shard3 ));
+        assertEquals( "Both shards present", 2, readShards.size() );
 
-        assertTrue("shardGroup3Shard2 shard present", readShards.contains( shardGroup3Shard2 ));
+        assertTrue( "shardGroup3Shard2 shard present", readShards.contains( shardGroup3Shard2 ) );
 
-        assertTrue("shardGroup3Shard1 shard present", readShards.contains( shardGroup3Shard1 ));
+        assertTrue( "shardGroup3Shard1 shard present", readShards.contains( shardGroup3Shard1 ) );
 
 
         Collection<Shard> writeShards = group.getWriteShards( 0 );
 
-        assertEquals("Min shard present", 3, writeShards.size());
+        assertEquals( "Min shard present", 1, writeShards.size() );
 
-        assertTrue("shardGroup3Shard3 shard present", writeShards.contains( shardGroup3Shard3 ));
 
-        assertTrue("shardGroup3Shard2 shard present", writeShards.contains( shardGroup3Shard2 ));
+        assertTrue( "shardGroup3Shard1 shard present", writeShards.contains( shardGroup3Shard1 ) );
 
-        assertTrue("shardGroup3Shard1 shard present", writeShards.contains( shardGroup3Shard1 ));
+        writeShards = group.getWriteShards( shardGroup3Shard3.getCreatedTime() + delta );
 
+        assertEquals( "Min shard present", 1, writeShards.size() );
 
 
+        assertTrue( "shardGroup3Shard2 shard present", readShards.contains( shardGroup3Shard2 ) );
 
+        assertTrue( "shardGroup3Shard1 shard present", writeShards.contains( shardGroup3Shard1 ) );
 
-        assertTrue("middle group present", entryGroupIterator.hasNext());
 
-        group = entryGroupIterator.next();
+        /****
+         * Middle group
+         */
 
-        assertNotNull("Group returned", group);
+        assertTrue( "middle group present", entryGroupIterator.hasNext() );
 
-       readShards = group.getReadShards();
+        group = entryGroupIterator.next();
 
-        assertEquals("Min shard present", 2, readShards.size());
+        assertNotNull( "Group returned", group );
 
-        assertTrue("shardGroup2Shard1 shard present", readShards.contains( shardGroup2Shard1 ));
+        //verify we ran our compaction check
+        verify( shardGroupCompaction ).evaluateShardGroup( same( scope ), same( directedEdgeMeta ), eq( group ) );
 
-        assertTrue("shardGroup2Shard2 shard present", readShards.contains( shardGroup2Shard2 ));
 
+        readShards = group.getReadShards( );
 
 
-        writeShards = group.getWriteShards( 0 );
+        assertEquals( "Both shards present", 2, readShards.size() );
 
-        assertEquals("Min shard present", 2, writeShards.size());
+        assertTrue( "shardGroup2Shard1 shard present", readShards.contains( shardGroup2Shard1 ) );
 
-        assertTrue("shardGroup2Shard1 shard present", writeShards.contains( shardGroup2Shard1 ));
+        assertTrue( "shardGroup2Shard2 shard present", readShards.contains( shardGroup2Shard2 ) );
 
-        assertTrue("shardGroup2Shard2 shard present", writeShards.contains( shardGroup2Shard2 ));
 
+        writeShards = group.getWriteShards( 0 );
 
+        assertEquals( "Min shard present", 1, writeShards.size() );
 
+        assertTrue( "shardGroup2Shard1 shard present", writeShards.contains( shardGroup2Shard1 ) );
 
 
+        writeShards = group.getWriteShards( shardGroup2Shard2.getCreatedTime() + delta +1 );
 
-        assertTrue("min group present", entryGroupIterator.hasNext());
+        assertEquals( "Both shards present", 1, writeShards.size() );
 
-        group = entryGroupIterator.next();
+        assertTrue( "shardGroup2Shard2 shard present", writeShards.contains( shardGroup2Shard2 ) );
 
-        assertNotNull("Group returned", group);
 
-        readShards = group.getReadShards();
+        /*****
+         * Minimum group
+         */
 
-        assertEquals("Min shard present", 3, readShards.size());
+        assertTrue( "min group present", entryGroupIterator.hasNext() );
 
-        assertTrue("shardGroup1Shard3 shard present", readShards.contains( shardGroup1Shard3 ));
+        group = entryGroupIterator.next();
 
-        assertTrue("shardGroup1Shard2 shard present", readShards.contains( shardGroup1Shard2 ));
+        assertNotNull( "Group returned", group );
 
-        assertTrue("shardGroup1Shard1 shard present", readShards.contains( shardGroup1Shard1 ));
+        //verify we ran our compaction check
+        verify( shardGroupCompaction ).evaluateShardGroup( same( scope ), same( directedEdgeMeta ), eq( group ) );
 
 
 
-        writeShards = group.getWriteShards( 0 );
+        readShards = group.getReadShards();
 
-        assertEquals("Min shard present", 3, writeShards.size());
+        assertEquals( "Both shards present", 2, readShards.size() );
 
-        assertTrue("shardGroup1Shard3 shard present", writeShards.contains( shardGroup1Shard3 ));
+        assertTrue( "shardGroup1Shard1 shard present", readShards.contains( shardGroup1Shard1 ) );
+        assertTrue( "shardGroup1Shard2 shard present", readShards.contains( shardGroup1Shard2 ) );
 
-        assertTrue("shardGroup1Shard2 shard present", writeShards.contains( shardGroup1Shard2 ));
 
-        assertTrue("shardGroup1Shard1 shard present", writeShards.contains( shardGroup1Shard1 ));
+        writeShards = group.getWriteShards( 0 );
 
+        assertEquals( "Min shard present", 1, writeShards.size() );
 
+        assertTrue( "shardGroup1Shard1 shard present", writeShards.contains( shardGroup1Shard1 ) );
 
 
+        writeShards = group.getWriteShards( shardGroup1Shard3.getCreatedTime() + delta + 1 );
 
+        assertEquals( "Both shards present", 1, writeShards.size() );
 
+        assertTrue( "shardGroup1Shard2 shard present", writeShards.contains( shardGroup1Shard2 ) );
     }
-
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/comparators/SourceDirectedEdgeDescendingComparatorTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/comparators/SourceDirectedEdgeDescendingComparatorTest.java b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/comparators/SourceDirectedEdgeDescendingComparatorTest.java
new file mode 100644
index 0000000..d0adc1e
--- /dev/null
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/comparators/SourceDirectedEdgeDescendingComparatorTest.java
@@ -0,0 +1,136 @@
+/*
+ *
+ *  * 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.graph.serialization.impl.shard.impl.comparators;
+
+
+import java.util.UUID;
+
+import org.junit.Test;
+
+import org.apache.usergrid.persistence.graph.impl.SimpleMarkedEdge;
+import org.apache.usergrid.persistence.model.entity.Id;
+import org.apache.usergrid.persistence.model.util.UUIDGenerator;
+
+import static org.apache.usergrid.persistence.graph.test.util.EdgeTestUtils.createId;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+
+public class SourceDirectedEdgeDescendingComparatorTest {
+
+    final SourceDirectedEdgeDescendingComparator comp = SourceDirectedEdgeDescendingComparator.INSTANCE;
+
+
+    @Test
+    public void sameEdges() {
+
+        final Id sourceId = createId( "source" );
+        final Id targetId = createId( "target" );
+        final String type = "type";
+        final long timestamp = 10000;
+
+        final SimpleMarkedEdge markedEdge1 = new SimpleMarkedEdge( sourceId, type, targetId, timestamp, true );
+        final SimpleMarkedEdge markedEdge2 = new SimpleMarkedEdge( sourceId, type, targetId, timestamp, true );
+
+
+        int compare = comp.compare( markedEdge1, markedEdge2 );
+
+        assertEquals( 0, compare );
+
+        compare = comp.compare( markedEdge2, markedEdge1 );
+
+        assertEquals( 0, compare );
+    }
+
+
+    @Test
+    public void timestampDifferent() {
+
+        final Id sourceId = createId( "source" );
+        final Id targetId = createId( "target" );
+        final String type = "type";
+        final long timestamp = 10000;
+
+        final SimpleMarkedEdge markedEdge1 = new SimpleMarkedEdge( sourceId, type, targetId, timestamp, true );
+        final SimpleMarkedEdge markedEdge2 = new SimpleMarkedEdge( sourceId, type, targetId, timestamp + 1, true );
+
+
+        //marked edge 1 is less than timestamp, it should be considered "greater"
+        int compare = comp.compare( markedEdge1, markedEdge2 );
+
+        assertEquals( 1, compare );
+
+        compare = comp.compare( markedEdge2, markedEdge1 );
+
+        assertEquals( -1, compare );
+    }
+
+
+    @Test
+    public void uuidDifferent() {
+
+        final Id sourceId1 = createId( "source" );
+        final Id sourceId2 = createId( "source" );
+        final Id targetId = createId( "target" );
+        final String type = "type";
+        final long timestamp = 10000;
+
+        final SimpleMarkedEdge markedEdge1 = new SimpleMarkedEdge( sourceId1, type, targetId, timestamp, true );
+        final SimpleMarkedEdge markedEdge2 = new SimpleMarkedEdge( sourceId2, type, targetId, timestamp, true );
+
+
+        //marked edge 1 uuid is a is less than target uuid timestamp, it should be considered "greater"
+        int compare = comp.compare( markedEdge1, markedEdge2 );
+
+        assertTrue( compare > 0 );
+
+        compare = comp.compare( markedEdge2, markedEdge1 );
+
+        assertTrue( compare < 0 );
+    }
+
+
+    @Test
+    public void idTypeDifferent() {
+
+        final UUID sourceId = UUIDGenerator.newTimeUUID();
+
+        final Id sourceId1 = createId( sourceId,  "source1" );
+        final Id sourceId2 = createId( sourceId,  "source2" );
+        final Id targetId = createId( "target" );
+        final String type = "type";
+        final long timestamp = 10000;
+
+        final SimpleMarkedEdge markedEdge1 = new SimpleMarkedEdge( sourceId2, type, targetId, timestamp, true );
+        final SimpleMarkedEdge markedEdge2 = new SimpleMarkedEdge( sourceId1, type, targetId, timestamp, true );
+
+
+        //marked edge 1 is less than timestamp, it should be considered "greater"
+        int compare = comp.compare( markedEdge1, markedEdge2 );
+
+        assertEquals( 1, compare );
+
+        compare = comp.compare( markedEdge2, markedEdge1 );
+
+        assertEquals( -1, compare );
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/comparators/TargetDirectedEdgeDescendingComparatorTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/comparators/TargetDirectedEdgeDescendingComparatorTest.java b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/comparators/TargetDirectedEdgeDescendingComparatorTest.java
new file mode 100644
index 0000000..15df661
--- /dev/null
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/comparators/TargetDirectedEdgeDescendingComparatorTest.java
@@ -0,0 +1,136 @@
+/*
+ *
+ *  * 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.graph.serialization.impl.shard.impl.comparators;
+
+
+import java.util.UUID;
+
+import org.junit.Test;
+
+import org.apache.usergrid.persistence.graph.impl.SimpleMarkedEdge;
+import org.apache.usergrid.persistence.model.entity.Id;
+import org.apache.usergrid.persistence.model.util.UUIDGenerator;
+
+import static org.apache.usergrid.persistence.graph.test.util.EdgeTestUtils.createId;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+
+public class TargetDirectedEdgeDescendingComparatorTest {
+
+    final TargetDirectedEdgeDescendingComparator comp = TargetDirectedEdgeDescendingComparator.INSTANCE;
+
+
+    @Test
+    public void sameEdges() {
+
+        final Id sourceId = createId( "source" );
+        final Id targetId = createId( "target" );
+        final String type = "type";
+        final long timestamp = 10000;
+
+        final SimpleMarkedEdge markedEdge1 = new SimpleMarkedEdge( sourceId, type, targetId, timestamp, true );
+        final SimpleMarkedEdge markedEdge2 = new SimpleMarkedEdge( sourceId, type, targetId, timestamp, true );
+
+
+        int compare = comp.compare( markedEdge1, markedEdge2 );
+
+        assertEquals( 0, compare );
+
+        compare = comp.compare( markedEdge2, markedEdge1 );
+
+        assertEquals( 0, compare );
+    }
+
+
+    @Test
+    public void timestampDifferent() {
+
+        final Id sourceId = createId( "source" );
+        final Id targetId = createId( "target" );
+        final String type = "type";
+        final long timestamp = 10000;
+
+        final SimpleMarkedEdge markedEdge1 = new SimpleMarkedEdge( sourceId, type, targetId, timestamp, true );
+        final SimpleMarkedEdge markedEdge2 = new SimpleMarkedEdge( sourceId, type, targetId, timestamp + 1, true );
+
+
+        //marked edge 1 is less than timestamp, it should be considered "greater"
+        int compare = comp.compare( markedEdge1, markedEdge2 );
+
+        assertEquals( 1, compare );
+
+        compare = comp.compare( markedEdge2, markedEdge1 );
+
+        assertEquals( -1, compare );
+    }
+
+
+    @Test
+    public void uuidDifferent() {
+
+        final Id sourceId = createId( "source" );
+        final Id targetId1 = createId( "target" );
+        final Id targetId2 = createId( "target" );
+        final String type = "type";
+        final long timestamp = 10000;
+
+        final SimpleMarkedEdge markedEdge1 = new SimpleMarkedEdge( sourceId, type, targetId1, timestamp, true );
+        final SimpleMarkedEdge markedEdge2 = new SimpleMarkedEdge( sourceId, type, targetId2, timestamp, true );
+
+
+        //marked edge 1 uuid is a is less than target uuid timestamp, it should be considered "greater"
+        int compare = comp.compare( markedEdge1, markedEdge2 );
+
+        assertTrue( compare > 0 );
+
+        compare = comp.compare( markedEdge2, markedEdge1 );
+
+        assertTrue( compare < 0 );
+    }
+
+
+    @Test
+    public void idTypeDifferent() {
+
+        final UUID targetId = UUIDGenerator.newTimeUUID();
+
+        final Id sourceId = createId( "source" );
+        final Id targetId1 = createId( targetId, "target1" );
+        final Id targetId2 = createId( targetId, "target2" );
+        final String type = "type";
+        final long timestamp = 10000;
+
+        final SimpleMarkedEdge markedEdge1 = new SimpleMarkedEdge( sourceId, type, targetId2, timestamp, true );
+        final SimpleMarkedEdge markedEdge2 = new SimpleMarkedEdge( sourceId, type, targetId1, timestamp, true );
+
+
+        //marked edge 1 is less than timestamp, it should be considered "greater"
+        int compare = comp.compare( markedEdge1, markedEdge2 );
+
+        assertEquals( 1, compare );
+
+        compare = comp.compare( markedEdge2, markedEdge1 );
+
+        assertEquals( -1, compare );
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/test/util/EdgeTestUtils.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/test/util/EdgeTestUtils.java b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/test/util/EdgeTestUtils.java
index c9507d4..ca82b8d 100644
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/test/util/EdgeTestUtils.java
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/test/util/EdgeTestUtils.java
@@ -168,7 +168,7 @@ public class EdgeTestUtils {
      */
     public static SearchByEdgeType createSearchByEdge( final Id sourceId, final String type, final long maxVersion,
                                                        final Edge last ) {
-        return new SimpleSearchByEdgeType( sourceId, type, maxVersion, last );
+        return new SimpleSearchByEdgeType( sourceId, type, maxVersion, SearchByEdgeType.Order.DESCENDING, last );
     }
 
 
@@ -183,7 +183,7 @@ public class EdgeTestUtils {
      */
     public static SearchByIdType createSearchByEdgeAndId( final Id sourceId, final String type, final long maxVersion,
                                                           final String idType, final Edge last ) {
-        return new SimpleSearchByIdType( sourceId, type, maxVersion, idType, last );
+        return new SimpleSearchByIdType( sourceId, type, maxVersion, SearchByEdgeType.Order.DESCENDING, idType, last );
     }
 
 
@@ -211,7 +211,7 @@ public class EdgeTestUtils {
      */
     public static SearchByEdge createGetByEdge( final Id sourceId, final String type, final Id targetId,
                                                 final long maxVersion, final Edge last ) {
-        return new SimpleSearchByEdge( sourceId, type, targetId, maxVersion, last );
+        return new SimpleSearchByEdge( sourceId, type, targetId, maxVersion, SearchByEdgeType.Order.DESCENDING, last );
     }
 
 //

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/resources/log4j.properties b/stack/corepersistence/graph/src/test/resources/log4j.properties
index 08d897c..f9ea207 100644
--- a/stack/corepersistence/graph/src/test/resources/log4j.properties
+++ b/stack/corepersistence/graph/src/test/resources/log4j.properties
@@ -35,5 +35,6 @@ log4j.logger.cassandra.db=ERROR
 
 log4j.logger.org.apache.usergrid.persistence.graph=TRACE
 log4j.logger.org.apache.usergrid.persistence.core.rx=TRACE
+log4j.logger.org.apache.usergrid.persistence.core.astyanax=TRACE
 #log4j.logger.org.apache.usergrid.persistence.graph.serialization.impl.parse=TRACE
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/test/resources/usergrid-UNIT.properties
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/resources/usergrid-UNIT.properties b/stack/corepersistence/graph/src/test/resources/usergrid-UNIT.properties
index 61612f6..1cb970f 100644
--- a/stack/corepersistence/graph/src/test/resources/usergrid-UNIT.properties
+++ b/stack/corepersistence/graph/src/test/resources/usergrid-UNIT.properties
@@ -13,5 +13,7 @@ collections.keyspace.strategy.options=replication_factor:1
 collections.keyspace.strategy.class=SimpleStrategy
 collection.stage.transient.timeout=60
 
+usergrid.graph.shard.repair.chance=.20
+
 hystrix.threadpool.graph_user.coreSize=8
 hystrix.threadpool.graph_async.coreSize=8


[13/52] [abbrv] git commit: abstract uuid creation

Posted by gr...@apache.org.
abstract uuid creation


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: 1d74ec00ea9b8052f3fce882ccf0ad7112d34c8b
Parents: 64ad13d
Author: Shawn Feldman <sf...@apache.org>
Authored: Tue Aug 26 16:36:18 2014 -0600
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Aug 28 09:30:23 2014 -0600

----------------------------------------------------------------------
 .../usergrid/corepersistence/CpEntityManager.java       | 12 +++---------
 .../usergrid/corepersistence/CpRelationManager.java     |  4 ++--
 .../main/java/org/apache/usergrid/utils/UUIDUtils.java  | 11 +++++++++++
 3 files changed, 16 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1d74ec00/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 f40bc3b..7e1f199 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
@@ -1595,7 +1595,7 @@ public class CpEntityManager implements EntityManager {
             throws Exception {
 
         UUID timestampUuid = UUIDUtils.newTimeUUID();
-        long timestamp = UUIDUtils.getTimestampInMicros( timestampUuid );
+        long timestamp = UUIDUtils.getUUIDLong(timestampUuid);
 
         Map<String, Object> properties = new TreeMap<>( CASE_INSENSITIVE_ORDER );
         properties.put( PROPERTY_TYPE, Role.ENTITY_TYPE );
@@ -2364,13 +2364,7 @@ public class CpEntityManager implements EntityManager {
             return null;
         }
 
-        long timestamp = 0;
-
-        if(UUIDUtils.isTimeBased(timestampUuid)) {
-            timestamp = UUIDUtils.getTimestampInMicros(timestampUuid);
-        }else{
-            timestamp = MurmurHash.hash64(timestampUuid);
-        }
+        long timestamp = UUIDUtils.getUUIDLong(timestampUuid);
 
         UUID itemId = UUIDUtils.newTimeUUID();
 
@@ -2623,7 +2617,7 @@ public class CpEntityManager implements EntityManager {
             boolean removeFromDictionary, UUID timestampUuid )
             throws Exception {
 
-        long timestamp = UUIDUtils.getTimestampInMicros( timestampUuid );
+        long timestamp = UUIDUtils.getUUIDLong(timestampUuid);
 
         // dictionaryName = dictionaryName.toLowerCase();
         if ( elementCoValue == null ) {

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1d74ec00/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
index 9199d19..4131400 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
@@ -28,7 +28,7 @@ import java.util.Map;
 import java.util.Set;
 import java.util.UUID;
 
-import com.clearspring.analytics.hash.MurmurHash;
+import org.apache.usergrid.utils.UUIDUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.util.Assert;
@@ -686,7 +686,7 @@ public class CpRelationManager implements RelationManager {
                 headEntity.getType(), headEntity.getUuid(), 
                 itemRef.getType(), itemRef.getUuid() });
 
-        long uuidHash = MurmurHash.hash64( memberEntity.getId().getUuid());
+        long uuidHash =   UUIDUtils.getUUIDLong( memberEntity.getId().getUuid());
         // create graph edge connection from head entity to member entity
         Edge edge = new SimpleEdge(
             cpHeadEntity.getId(),

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1d74ec00/stack/core/src/main/java/org/apache/usergrid/utils/UUIDUtils.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/utils/UUIDUtils.java b/stack/core/src/main/java/org/apache/usergrid/utils/UUIDUtils.java
index 6d8175c..ecb1f61 100644
--- a/stack/core/src/main/java/org/apache/usergrid/utils/UUIDUtils.java
+++ b/stack/core/src/main/java/org/apache/usergrid/utils/UUIDUtils.java
@@ -25,6 +25,7 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.locks.ReentrantLock;
 
+import com.clearspring.analytics.hash.MurmurHash;
 import com.fasterxml.uuid.EthernetAddress;
 import com.fasterxml.uuid.UUIDComparator;
 
@@ -379,6 +380,16 @@ public class UUIDUtils {
         return tryGetUUID( s.substring( offset, offset + 36 ) );
     }
 
+    public static long getUUIDLong(UUID id){
+        long timestamp = 0;
+        if(UUIDUtils.isTimeBased(id)) {
+            timestamp = UUIDUtils.getTimestampInMicros(id);
+        }else{
+            timestamp = MurmurHash.hash64(id);
+        }
+        return timestamp;
+    }
+
 
     public static String toBase64( UUID id ) {
         if ( id == null ) {


[11/52] [abbrv] git commit: Merge remote-tracking branch 'apache/two-dot-o' into USERGRID-188

Posted by gr...@apache.org.
Merge remote-tracking branch 'apache/two-dot-o' into USERGRID-188

Conflicts:
	stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardApproximationImpl.java
	stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/NodeShardAllocationTest.java
	stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/NodeShardCacheTest.java


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: a4f921f42fe4cd07726935a420ea59e3f16bedf3
Parents: bc70fe7 e745723
Author: Todd Nine <to...@apache.org>
Authored: Thu Aug 28 09:29:27 2014 -0600
Committer: Todd Nine <to...@apache.org>
Committed: Thu Aug 28 09:29:27 2014 -0600

----------------------------------------------------------------------
 .gitignore                                      |    13 +-
 DISCLAIMER                                      |     9 +
 NOTICE                                          |    56 +
 README.md                                       |    20 +-
 bower.json                                      |    39 -
 chop/example/src/main/resources/runner.sh       |    48 +
 chop/example/src/main/resources/stack.json      |     1 +
 .../usergrid/chop/stack/BasicInstanceSpec.java  |    12 +
 .../usergrid/chop/stack/InstanceSpec.java       |     8 +
 .../src/test/resources/install_cassandra.sh     |    19 -
 chop/stack/src/test/resources/install_es.sh     |    19 -
 .../stack/src/test/resources/setup_cassandra.sh |    19 -
 chop/stack/src/test/resources/setup_es.sh       |    19 -
 chop/webapp/chop-webapp                         |   104 +
 chop/webapp/pom.xml                             |    26 +-
 .../webapp/coordinator/CoordinatorUtils.java    |    59 +-
 .../src/main/resources/jettyjam.properties      |    18 -
 portal/Gruntfile.js                             |   132 +-
 portal/README.md                                |    20 +-
 portal/archive/coming_soon.html                 |    31 -
 portal/archive/config.js                        |    72 -
 .../ui-bg_diagonals-thick_90_eeeeee_40x40.png   |   Bin 251 -> 0 bytes
 .../images/ui-bg_flat_100_deedf7_40x100.png     |   Bin 182 -> 0 bytes
 .../images/ui-bg_flat_100_e4f1fb_40x100.png     |   Bin 213 -> 0 bytes
 .../images/ui-bg_flat_100_f2f5f7_40x100.png     |   Bin 212 -> 0 bytes
 .../images/ui-bg_flat_15_cd0a0a_40x100.png      |   Bin 181 -> 0 bytes
 .../images/ui-bg_flat_50_3baae3_40x100.png      |   Bin 182 -> 0 bytes
 .../images/ui-bg_flat_80_d7ebf9_40x100.png      |   Bin 183 -> 0 bytes
 .../ui-bg_highlight-hard_70_000000_1x100.png    |   Bin 118 -> 0 bytes
 .../ui-bg_highlight-soft_25_ffef8f_1x100.png    |   Bin 153 -> 0 bytes
 .../images/ui-icons_000000_256x240.png          |   Bin 4369 -> 0 bytes
 .../images/ui-icons_2694e8_256x240.png          |   Bin 4369 -> 0 bytes
 .../images/ui-icons_2e83ff_256x240.png          |   Bin 4369 -> 0 bytes
 .../images/ui-icons_3d80b3_256x240.png          |   Bin 4369 -> 0 bytes
 .../images/ui-icons_72a7cf_256x240.png          |   Bin 4369 -> 0 bytes
 .../images/ui-icons_ffffff_256x240.png          |   Bin 4369 -> 0 bytes
 .../css/custom-theme/jquery-ui-1.8.9.custom.css |   573 -
 portal/archive/css/jquery-ui-timepicker.css     |    53 -
 portal/archive/css/jquery.ui.statusbar.css      |    25 -
 portal/archive/css/prettify.css                 |    52 -
 portal/archive/css/usergrid-stripped.css        |  5199 ----
 portal/archive/css/usergrid.css                 |  5203 ----
 portal/archive/dash/README.md                   |     3 -
 .../archive/dash/config/testacular-e2e.conf.js  |    22 -
 portal/archive/dash/config/testacular.conf.js   |    20 -
 portal/archive/dash/test/e2e/runner.html        |    10 -
 portal/archive/dash/test/e2e/scenarios.js       |    45 -
 .../dash/test/lib/angular/angular-mocks.js      |  1764 --
 .../dash/test/lib/angular/angular-scenario.js   | 26195 -----------------
 .../archive/dash/test/lib/angular/version.txt   |     1 -
 .../archive/dash/test/unit/controllersSpec.js   |    31 -
 portal/archive/dash/test/unit/directivesSpec.js |    19 -
 portal/archive/dash/test/unit/filtersSpec.js    |    19 -
 portal/archive/dash/test/unit/servicesSpec.js   |    14 -
 portal/archive/images/APNS_cert_upload.png      |   Bin 33956 -> 0 bytes
 portal/archive/images/APNS_certification.png    |   Bin 16855 -> 0 bytes
 portal/archive/images/android-notification.png  |   Bin 41629 -> 0 bytes
 portal/archive/images/android-sdk-download.png  |   Bin 4848 -> 0 bytes
 portal/archive/images/api-activity.gif          |   Bin 10819 -> 0 bytes
 portal/archive/images/apigee-logo.png           |   Bin 3647 -> 0 bytes
 portal/archive/images/apigeetopbar.png          |   Bin 4658 -> 0 bytes
 portal/archive/images/background_one_col.png    |   Bin 3126 -> 0 bytes
 portal/archive/images/btn-copyCurl-up.png       |   Bin 2762 -> 0 bytes
 portal/archive/images/clippy-bg.png             |   Bin 561 -> 0 bytes
 portal/archive/images/close.gif                 |   Bin 718 -> 0 bytes
 portal/archive/images/dotnet-sdk-download.png   |   Bin 7149 -> 0 bytes
 portal/archive/images/down_arrow.png            |   Bin 1285 -> 0 bytes
 portal/archive/images/error.png                 |   Bin 2009 -> 0 bytes
 portal/archive/images/faviconApigee.ico         |   Bin 1150 -> 0 bytes
 .../images/glyphicons-halflings-white.png       |   Bin 4352 -> 0 bytes
 portal/archive/images/glyphicons-halflings.png  |   Bin 4352 -> 0 bytes
 .../glyphicons_halflings_135_wrench-white2.pdn  |   Bin 5400 -> 0 bytes
 .../glyphicons_halflings_135_wrench-white2.png  |   Bin 296 -> 0 bytes
 .../images/glyphicons_halflings_135_wrench.png  |   Bin 228 -> 0 bytes
 .../glyphicons_halflings_135_wrench_white.png   |   Bin 251 -> 0 bytes
 .../glyphicons_halflings_wrench_white.png       |   Bin 1016 -> 0 bytes
 portal/archive/images/google_api_key.png        |   Bin 98118 -> 0 bytes
 portal/archive/images/green_dot.png             |   Bin 3472 -> 0 bytes
 portal/archive/images/grid.png                  |   Bin 166 -> 0 bytes
 portal/archive/images/icons.png                 |   Bin 13132 -> 0 bytes
 portal/archive/images/ios-sdk-download.png      |   Bin 4886 -> 0 bytes
 portal/archive/images/iphone_message.png        |   Bin 90307 -> 0 bytes
 .../archive/images/javascript-sdk-download.png  |   Bin 4618 -> 0 bytes
 portal/archive/images/left_arrow.png            |   Bin 1257 -> 0 bytes
 portal/archive/images/logo-white.png            |   Bin 2014 -> 0 bytes
 portal/archive/images/menuActiveTriangle.png    |   Bin 315 -> 0 bytes
 portal/archive/images/nodejs-sdk-download.png   |   Bin 5273 -> 0 bytes
 portal/archive/images/notice.png                |   Bin 2112 -> 0 bytes
 portal/archive/images/orange-arrow.png          |   Bin 242 -> 0 bytes
 .../archive/images/push_notifications_icon.png  |   Bin 338 -> 0 bytes
 portal/archive/images/red_dot.png               |   Bin 3482 -> 0 bytes
 portal/archive/images/right_arrow.png           |   Bin 1251 -> 0 bytes
 portal/archive/images/ruby-sdk-download.png     |   Bin 6343 -> 0 bytes
 portal/archive/images/step_1.png                |   Bin 1953 -> 0 bytes
 portal/archive/images/step_2.png                |   Bin 2117 -> 0 bytes
 portal/archive/images/step_3.png                |   Bin 2162 -> 0 bytes
 portal/archive/images/success.png               |   Bin 1863 -> 0 bytes
 portal/archive/images/swish_arrow.png           |   Bin 220 -> 0 bytes
 portal/archive/images/topbackground.png         |   Bin 2890 -> 0 bytes
 portal/archive/images/up_arrow.png              |   Bin 1292 -> 0 bytes
 portal/archive/images/user-photo.png            |   Bin 3849 -> 0 bytes
 portal/archive/images/user_profile.png          |   Bin 3775 -> 0 bytes
 portal/archive/images/usergrid_200.png          |   Bin 6397 -> 0 bytes
 portal/archive/images/usergrid_400.png          |   Bin 8746 -> 0 bytes
 portal/archive/images/warning.png               |   Bin 1179 -> 0 bytes
 portal/archive/images/yellow_dot.png            |   Bin 3475 -> 0 bytes
 portal/archive/index-stripped2.html             |  1795 --
 portal/archive/index.html                       |  1932 --
 portal/archive/js/app/app.js                    |   131 -
 portal/archive/js/app/console.js                |  5397 ----
 portal/archive/js/app/helpers.js                |   241 -
 portal/archive/js/app/navigation.js             |   251 -
 portal/archive/js/app/pages.js                  |   161 -
 portal/archive/js/app/params.js                 |    30 -
 portal/archive/js/app/quickLogin.js             |    30 -
 portal/archive/js/app/session.js                |   176 -
 portal/archive/js/app/sso.js                    |   135 -
 portal/archive/js/app/status.js                 |    37 -
 portal/archive/js/app/ui/collections.entity.js  |   320 -
 portal/archive/js/app/ui/collections.user.js    |   120 -
 portal/archive/js/app/ui/ui.js                  |   415 -
 portal/archive/js/app/usergrid.appSDK.js        |  2097 --
 portal/archive/js/app/usergrid.appSDK.orig.js   |  2070 --
 portal/archive/js/lib/MD5.min.js                |     1 -
 portal/archive/js/lib/backbone.js               |  1431 -
 portal/archive/js/lib/bootstrap.min.js          |     7 -
 portal/archive/js/lib/date.min.js               |     2 -
 portal/archive/js/lib/jquery-1.7.2.min.js       |     4 -
 portal/archive/js/lib/jquery-ui-1.8.18.min.js   |    15 -
 portal/archive/js/lib/jquery.dataset.min.js     |     1 -
 portal/archive/js/lib/jquery.dform-0.1.3.min.js |    16 -
 portal/archive/js/lib/jquery.jsonp-2.3.1.min.js |     3 -
 portal/archive/js/lib/jquery.tmpl.min.js        |    10 -
 .../archive/js/lib/jquery.ui.statusbar.min.js   |     1 -
 .../archive/js/lib/jquery.ui.timepicker.min.js  |     1 -
 portal/archive/js/lib/prettify.js               |  1477 -
 portal/archive/js/lib/underscore-min.js         |     5 -
 portal/archive/js/spec/client-tests.js          |   159 -
 portal/archive/js/spec/index.html               |    20 -
 portal/archive/js/spec/qunit-git.css            |   238 -
 portal/archive/js/spec/qunit-git.js             |  1865 --
 portal/archive/js/unit-tests/appSDK-tests.js    |   255 -
 portal/archive/js/unit-tests/ie-jquery-tests.js |   191 -
 portal/archive/js/unit-tests/qunit.css          |   231 -
 portal/archive/js/unit-tests/qunit.js           |  1934 --
 portal/archive/loading.html                     |     9 -
 portal/archive/max/index.html                   |     0
 portal/archive/planned_outage.html              |    48 -
 portal/archive/push/index.html                  |    34 -
 portal/archive/service_down.html                |    48 -
 .../apigee.ui.activities.table_rows.html        |    14 -
 .../templates/apigee.ui.admins.table_rows.html  |     8 -
 .../apigee.ui.applications.table_rows.html      |     4 -
 .../apigee.ui.collection.table_rows.html        |    67 -
 .../apigee.ui.collections.query.indexes.html    |     5 -
 .../apigee.ui.collections.table_rows.html       |     9 -
 .../apigee.ui.collections.user.header.html      |    21 -
 .../templates/apigee.ui.curl.detail.html        |    11 -
 .../templates/apigee.ui.feed.table_rows.html    |    15 -
 .../templates/apigee.ui.groups.table_rows.html  |    14 -
 .../apigee.ui.panels.group.activities.html      |    28 -
 .../apigee.ui.panels.group.details.html         |    97 -
 .../apigee.ui.panels.group.memberships.html     |    40 -
 .../apigee.ui.panels.group.permissions.html     |    99 -
 ...pigee.ui.panels.notifications.configure.html |    14 -
 .../apigee.ui.panels.role.permissions.html      |    58 -
 .../templates/apigee.ui.panels.role.users.html  |    38 -
 .../apigee.ui.panels.user.activities.html       |    40 -
 .../templates/apigee.ui.panels.user.graph.html  |    80 -
 .../apigee.ui.panels.user.memberships.html      |    40 -
 .../apigee.ui.panels.user.permissions.html      |   105 -
 .../apigee.ui.panels.user.profile.html          |   113 -
 .../apigee.ui.role.groups.table_rows.html       |    44 -
 .../templates/apigee.ui.roles.table_rows.html   |    15 -
 .../templates/apigee.ui.users.table_rows.html   |    18 -
 portal/archive/templates/test/modalForm2.html   |    32 -
 portal/archive/test/autocomplete.html           |    25 -
 portal/archive/test/modalForm.html              |    32 -
 portal/bower.json                               |     6 +-
 portal/build.sh                                 |    24 +-
 portal/config.js                                |    49 +-
 portal/css/apigeeGlobalNavigation.css           |   291 -
 portal/css/dash.min.css                         |     1 -
 portal/css/main.css                             |    94 +-
 portal/css/main.min.css                         |     1 +
 portal/dist/usergrid-portal.zip                 |   Bin 0 -> 15544780 bytes
 portal/favicon.ico                              |   Bin 1150 -> 3989 bytes
 portal/helpJson.json                            |    47 +
 portal/img/green_dot.png                        |   Bin 3472 -> 0 bytes
 portal/img/logo.gif                             |   Bin 2279 -> 0 bytes
 portal/img/logo.png                             |   Bin 0 -> 7758 bytes
 portal/img/push/APNS_cert_upload.png            |   Bin 33956 -> 0 bytes
 portal/img/push/APNS_certification.png          |   Bin 16855 -> 0 bytes
 portal/img/push/android-notification.png        |   Bin 41629 -> 0 bytes
 portal/img/push/google_api_key.png              |   Bin 98118 -> 0 bytes
 portal/img/push/iphone_message.png              |   Bin 90307 -> 0 bytes
 portal/img/push/step_1.png                      |   Bin 1953 -> 0 bytes
 portal/img/push/step_2.png                      |   Bin 2117 -> 0 bytes
 portal/img/push/step_3.png                      |   Bin 2162 -> 0 bytes
 portal/img/red_dot.png                          |   Bin 3482 -> 0 bytes
 portal/img/yellow_dot.png                       |   Bin 3475 -> 0 bytes
 portal/index-template.html                      |    44 +-
 portal/js/activities/activities.html            |    56 +-
 .../js/app-overview/app-overview-controller.js  |    61 +-
 portal/js/app-overview/app-overview.html        |    60 +-
 .../js/app-overview/doc-includes/android.html   |   401 +-
 portal/js/app-overview/doc-includes/ios.html    |   364 +-
 .../app-overview/doc-includes/javascript.html   |   216 +-
 portal/js/app-overview/doc-includes/net.html    |    16 +
 portal/js/app-overview/doc-includes/node.html   |    16 +
 portal/js/app-overview/doc-includes/ruby.html   |    16 +
 .../app-overview/getting-started-controller.js  |   107 -
 portal/js/app-overview/getting-started.html     |   119 -
 portal/js/app.js                                |    21 +-
 portal/js/charts/chart-controller.js            |     6 -
 portal/js/charts/chart-directives.js            |   141 -
 portal/js/charts/chart-service.js               |   494 -
 portal/js/charts/highcharts.json                |   329 -
 portal/js/charts/sparklines.js                  |     2 -
 portal/js/data/data.html                        |   261 +-
 portal/js/data/display-generic.html             |   168 +-
 portal/js/data/display-groups.html              |    16 +
 portal/js/data/display-roles.html               |    18 +-
 portal/js/data/display-users.html               |   257 +-
 portal/js/data/entity.html                      |    31 +-
 portal/js/dialogs/modal.html                    |    49 +-
 portal/js/global/app-switcher-directive.js      |    53 -
 portal/js/global/appswitcher-template.html      |    34 -
 portal/js/global/help-service.js                |    22 +-
 portal/js/global/insecure-banner.html           |    30 +-
 portal/js/global/page-controller.js             |    17 +-
 portal/js/global/page-title.html                |    44 +-
 portal/js/global/ug-service.js                  |    45 +-
 portal/js/groups/groups-activities.html         |    44 +-
 portal/js/groups/groups-details.html            |    83 +-
 portal/js/groups/groups-members.html            |   101 +-
 portal/js/groups/groups-roles.html              |   247 +-
 portal/js/groups/groups-tabs.html               |    45 +-
 portal/js/groups/groups.html                    |   196 +-
 portal/js/libs/Highcharts-2.3.5/index.htm       |    79 -
 .../js/adapters/mootools-adapter.js             |    13 -
 .../js/adapters/mootools-adapter.src.js         |   328 -
 .../js/adapters/prototype-adapter.js            |    16 -
 .../js/adapters/prototype-adapter.src.js        |   385 -
 .../libs/Highcharts-2.3.5/js/highcharts-more.js |    35 -
 .../Highcharts-2.3.5/js/highcharts-more.src.js  |  1581 -
 .../js/libs/Highcharts-2.3.5/js/highcharts.js   |   250 -
 .../libs/Highcharts-2.3.5/js/highcharts.src.js  | 15281 ----------
 .../Highcharts-2.3.5/js/modules/canvas-tools.js |   133 -
 .../js/modules/canvas-tools.src.js              |  3113 --
 .../js/libs/Highcharts-2.3.5/js/modules/data.js |    14 -
 .../Highcharts-2.3.5/js/modules/data.src.js     |   512 -
 .../Highcharts-2.3.5/js/modules/exporting.js    |    23 -
 .../js/modules/exporting.src.js                 |   752 -
 .../Highcharts-2.3.5/js/themes/dark-blue.js     |   263 -
 .../Highcharts-2.3.5/js/themes/dark-green.js    |   263 -
 .../js/libs/Highcharts-2.3.5/js/themes/gray.js  |   262 -
 .../js/libs/Highcharts-2.3.5/js/themes/grid.js  |    95 -
 .../js/libs/Highcharts-2.3.5/js/themes/skies.js |    89 -
 portal/js/libs/angular-1.0.5/angular-cookies.js |   183 -
 .../libs/angular-1.0.5/angular-cookies.min.js   |     7 -
 portal/js/libs/angular-1.0.5/angular-loader.js  |   276 -
 .../js/libs/angular-1.0.5/angular-loader.min.js |     7 -
 portal/js/libs/angular-1.0.5/angular-mocks.js   |  1886 --
 .../js/libs/angular-1.0.5/angular-resource.js   |   445 -
 .../libs/angular-1.0.5/angular-resource.min.js  |    10 -
 .../js/libs/angular-1.0.5/angular-sanitize.js   |   535 -
 .../libs/angular-1.0.5/angular-sanitize.min.js  |    13 -
 portal/js/libs/angular-1.0.5/angular.js         | 14733 ---------
 portal/js/libs/angular-1.0.5/angular.min.js     |   161 -
 portal/js/libs/angular-1.0.5/version.txt        |     1 -
 portal/js/libs/angular-1.1.5/angular-1.1.5.js   | 16876 -----------
 .../js/libs/angular-1.1.5/angular-merge.min.js  |     8 -
 .../angular-1.1.5/angular-resource-1.1.5.js     |   537 -
 .../angularitics-0.8.5-google-analytics.js      |     7 -
 .../js/libs/angularitics/angularitics-0.8.5.js  |     6 -
 portal/js/login/forgot-password.html            |    27 +-
 portal/js/login/loading.html                    |    20 +-
 portal/js/login/login.html                      |   114 +-
 portal/js/login/logout.html                     |    18 +-
 portal/js/login/register.html                   |    80 +-
 portal/js/menu.html                             |    32 +-
 portal/js/menus/appMenu.html                    |    88 +-
 portal/js/menus/orgMenu.html                    |    39 +-
 portal/js/org-overview/org-overview.html        |   269 +-
 portal/js/profile/account.html                  |    31 +-
 portal/js/profile/organizations.html            |   136 +-
 portal/js/profile/profile.html                  |   105 +-
 portal/js/roles/roles-groups.html               |    99 +-
 portal/js/roles/roles-settings.html             |   173 +-
 portal/js/roles/roles-tabs.html                 |    48 +-
 portal/js/roles/roles-users.html                |   100 +-
 portal/js/roles/roles.html                      |   184 +-
 portal/js/shell/shell.html                      |    37 +-
 portal/js/users/users-activities.html           |    75 +-
 portal/js/users/users-feed.html                 |    63 +-
 portal/js/users/users-graph.html                |   125 +-
 portal/js/users/users-groups.html               |   116 +-
 portal/js/users/users-profile.html              |   154 +-
 portal/js/users/users-roles.html                |   258 +-
 portal/js/users/users-tabs.html                 |    17 +-
 portal/js/users/users.html                      |   272 +-
 portal/package.json                             |     7 +-
 portal/scripts/e2e-test.bat                     |    15 +
 portal/scripts/e2e-test.sh                      |    15 +
 portal/scripts/test.bat                         |    15 +
 portal/scripts/test.sh                          |    15 +
 portal/scripts/watchr.rb                        |    15 +
 portal/scripts/web-server.js                    |    19 +
 portal/sdk/usergrid.0.10.4.js                   |  1402 -
 portal/sdk/usergrid.0.10.5.js                   |  1755 --
 portal/sdk/usergrid.0.10.7.js                   |  2265 --
 portal/server.js                                |    19 +
 portal/tests/karma.conf.js                      |    23 +-
 portal/tests/protractor-ignore/profile.spec.js  |    97 +
 portal/tests/protractor/applications.spec.js    |    20 +
 portal/tests/protractor/data.spec.js            |    20 +
 portal/tests/protractor/forgotPassword.spec.js  |    20 +
 portal/tests/protractor/login.spec.js           |    20 +
 portal/tests/protractor/organization.spec.js    |    20 +
 portal/tests/protractor/profile.spec.js         |    77 -
 portal/tests/protractor/roles.spec.js           |    20 +
 portal/tests/protractor/shell.spec.js           |    20 +
 portal/tests/protractor/users.spec.js           |    20 +
 portal/tests/protractor/util.js                 |    24 +-
 portal/tests/protractorConf.js                  |    24 +-
 portal/tests/selenium/chromedriver              |   Bin 22034760 -> 0 bytes
 .../selenium-server-standalone-2.37.0.jar       |   Bin 34730734 -> 0 bytes
 portal/tests/unit/sample.spec.js                |    19 +
 release/pom.xml                                 |    65 +
 release/sign-release.sh                         |    30 +
 release/src/main/assembly/source.xml            |    49 +
 sdks/android/.gitignore                         |    20 -
 sdks/android/README.txt                         |     2 +
 sdks/android/dist/jackson-core-asl-1.9.1.jar    |   Bin 228286 -> 0 bytes
 sdks/android/dist/jackson-mapper-asl-1.9.1.jar  |   Bin 764465 -> 0 bytes
 .../dist/spring-android-core-1.0.0.M4.jar       |   Bin 83065 -> 0 bytes
 .../spring-android-rest-template-1.0.0.M4.jar   |   Bin 137368 -> 0 bytes
 sdks/android/doc/allclasses-frame.html          |    27 -
 sdks/android/doc/allclasses-noframe.html        |    27 -
 sdks/android/doc/constant-values.html           |   153 -
 sdks/android/doc/deprecated-list.html           |   117 -
 sdks/android/doc/help-doc.html                  |   222 -
 sdks/android/doc/index-all.html                 |   371 -
 sdks/android/doc/index.html                     |    68 -
 .../apache/usergrid/android/client/Client.html  |   989 -
 .../client/callbacks/ApiResponseCallback.html   |   224 -
 .../client/callbacks/ClientAsyncTask.html       |   338 -
 .../client/callbacks/ClientCallback.html        |   227 -
 .../callbacks/DeviceRegistrationCallback.html   |   220 -
 .../callbacks/GroupsRetrievedCallback.html      |   220 -
 .../client/callbacks/QueryResultsCallback.html  |   220 -
 .../class-use/ApiResponseCallback.html          |   282 -
 .../callbacks/class-use/ClientAsyncTask.html    |   117 -
 .../callbacks/class-use/ClientCallback.html     |   180 -
 .../class-use/DeviceRegistrationCallback.html   |   171 -
 .../class-use/GroupsRetrievedCallback.html      |   160 -
 .../class-use/QueryResultsCallback.html         |   219 -
 .../android/client/callbacks/package-frame.html |    28 -
 .../client/callbacks/package-summary.html       |   166 -
 .../android/client/callbacks/package-tree.html  |   145 -
 .../android/client/callbacks/package-use.html   |   178 -
 .../android/client/class-use/Client.html        |   117 -
 .../usergrid/android/client/package-frame.html  |    20 -
 .../android/client/package-summary.html         |   137 -
 .../usergrid/android/client/package-tree.html   |   134 -
 .../usergrid/android/client/package-use.html    |   117 -
 .../android/client/utils/DeviceUuidFactory.html |   352 -
 .../android/client/utils/ObjectUtils.html       |   258 -
 .../utils/class-use/DeviceUuidFactory.html      |   117 -
 .../client/utils/class-use/ObjectUtils.html     |   117 -
 .../android/client/utils/package-frame.html     |    21 -
 .../android/client/utils/package-summary.html   |   142 -
 .../android/client/utils/package-tree.html      |   131 -
 .../android/client/utils/package-use.html       |   117 -
 sdks/android/doc/overview-frame.html            |    23 -
 sdks/android/doc/overview-summary.html          |   139 -
 sdks/android/doc/overview-tree.html             |   154 -
 sdks/android/doc/package-list                   |     3 -
 sdks/android/doc/resources/background.gif       |   Bin 2313 -> 0 bytes
 sdks/android/doc/resources/tab.gif              |   Bin 291 -> 0 bytes
 sdks/android/doc/resources/titlebar.gif         |   Bin 10701 -> 0 bytes
 sdks/android/doc/resources/titlebar_end.gif     |   Bin 849 -> 0 bytes
 sdks/android/doc/stylesheet.css                 |   474 -
 .../0.0.6/usergrid-java-client-0.0.6.jar        |   Bin 46389 -> 0 bytes
 .../0.0.6/usergrid-java-client-0.0.6.jar.sha1   |     1 -
 .../0.0.6/usergrid-java-client-0.0.6.pom        |    95 -
 .../0.0.6/usergrid-java-client-0.0.6.pom.sha1   |     1 -
 .../maven-metadata-local.xml                    |    12 -
 sdks/android/pom.xml                            |    43 +-
 .../apache/usergrid/android/client/Client.java  |   185 +-
 .../client/callbacks/ApiResponseCallback.java   |    16 +
 .../client/callbacks/ClientAsyncTask.java       |    16 +
 .../client/callbacks/ClientCallback.java        |    16 +
 .../callbacks/DeviceRegistrationCallback.java   |    16 +
 .../callbacks/GroupsRetrievedCallback.java      |    16 +
 .../client/callbacks/QueryResultsCallback.java  |    16 +
 .../android/client/utils/DeviceUuidFactory.java |    16 +
 .../android/client/utils/ObjectUtils.java       |    16 +
 .../LocationDotNetSample/Form1.cs               |    18 +-
 sdks/html5-javascript/README.md                 |    76 +-
 .../examples/all-calls/all-calls.html           |    18 +-
 sdks/html5-javascript/examples/all-calls/app.js |    19 +-
 sdks/html5-javascript/examples/dogs/app.js      |    17 +
 sdks/html5-javascript/examples/dogs/dogs.html   |    19 +-
 sdks/html5-javascript/examples/facebook/app.js  |    17 +
 .../examples/facebook/facebook.html             |    19 +-
 .../examples/facebook/guide.html                |    17 +
 .../examples/persistence/test.html              |    19 +-
 .../examples/persistence/test.js                |    17 +
 sdks/html5-javascript/examples/test/test.html   |    19 +-
 .../extensions/usergrid.validation.js           |    34 +-
 sdks/html5-javascript/index.html                |    17 +
 sdks/html5-javascript/lib/modules/Asset.js      |   168 +-
 sdks/html5-javascript/lib/modules/Client.js     |     8 +-
 sdks/html5-javascript/lib/modules/Entity.js     |   179 +-
 sdks/html5-javascript/lib/modules/Group.js      |     2 +-
 sdks/html5-javascript/tests/mocha/index.html    |    25 +-
 sdks/html5-javascript/tests/mocha/test.js       |    17 +
 .../tests/qunit/apigee_test.html                |    17 +
 sdks/html5-javascript/tests/qunit/tests.js      |    17 +
 sdks/html5-javascript/tests/test.html           |    17 +
 sdks/html5-javascript/tests/test.js             |    17 +
 sdks/html5-javascript/usergrid.js               |   239 +-
 sdks/html5-javascript/usergrid.min.js           |     6 +-
 sdks/ios/Nukefile                               |    17 +
 sdks/ios/UGAPI/v2/UGConnection.h                |    16 +
 sdks/ios/UGAPI/v2/UGConnection.m                |    18 +-
 sdks/ios/UGAPI/v2/UGHTTPClient.h                |    16 +
 sdks/ios/UGAPI/v2/UGHTTPClient.m                |    16 +
 sdks/ios/UGAPI/v2/UGHTTPHelpers.h               |    19 +-
 sdks/ios/UGAPI/v2/UGHTTPHelpers.m               |    17 +-
 sdks/ios/UGAPI/v2/UGHTTPResult.h                |    16 +
 sdks/ios/UGAPI/v2/UGHTTPResult.m                |    16 +
 .../samples/Books/books/AddBookViewController.h |    31 +
 .../samples/Books/books/AddBookViewController.m |    17 +
 sdks/ios/samples/Books/books/AppDelegate.h      |    31 +
 sdks/ios/samples/Books/books/AppDelegate.m      |    17 +
 .../samples/Books/books/BooksViewController.h   |    31 +
 .../samples/Books/books/BooksViewController.m   |    17 +
 .../Books/books/UGSignInViewController.h        |    14 +
 .../Books/books/UGSignInViewController.m        |    17 +
 sdks/ios/samples/Books/books/books-Info.plist   |    18 +
 sdks/ios/samples/Books/books/books-Prefix.pch   |    17 +
 .../Books/books/en.lproj/InfoPlist.strings      |    19 +
 sdks/ios/samples/Books/books/main.m             |    17 +
 .../ios/samples/Browser/browser/UGAppDelegate.h |    14 +
 .../ios/samples/Browser/browser/UGAppDelegate.m |    17 +
 .../Browser/browser/UGAppViewController.h       |    14 +
 .../Browser/browser/UGAppViewController.m       |    17 +
 .../browser/UGCollectionViewController.h        |    14 +
 .../browser/UGCollectionViewController.m        |    17 +
 .../Browser/browser/UGEntityViewController.h    |    14 +
 .../Browser/browser/UGEntityViewController.m    |    17 +
 .../Browser/browser/UGSignInViewController.h    |    14 +
 .../Browser/browser/UGSignInViewController.m    |    17 +
 .../Browser/browser/UGTextViewController.h      |    14 +
 .../Browser/browser/UGTextViewController.m      |    17 +
 .../samples/Browser/browser/browser-Info.plist  |    18 +
 sdks/ios/samples/Browser/browser/main.m         |    17 +
 sdks/ios/samples/parties/parties/AppDelegate.h  |    14 +-
 sdks/ios/samples/parties/parties/AppDelegate.m  |    17 +
 .../parties/parties/PartiesViewController.h     |    14 +-
 .../parties/parties/PartiesViewController.m     |    17 +
 .../parties/parties/PartyViewController.h       |    14 +-
 .../parties/parties/PartyViewController.m       |    17 +
 sdks/ios/samples/parties/parties/main.m         |    17 +
 .../samples/parties/parties/parties-Info.plist  |    18 +
 sdks/ios/test/test_client.nu                    |    17 +
 sdks/ios/test/test_connection.nu                |    17 +
 sdks/java/.gitignore                            |    20 -
 sdks/java/dist/jackson-core-asl-1.9.1.jar       |   Bin 228286 -> 0 bytes
 sdks/java/dist/jackson-mapper-asl-1.9.1.jar     |   Bin 764465 -> 0 bytes
 sdks/java/dist/spring-android-core-1.0.0.M4.jar |   Bin 83065 -> 0 bytes
 .../spring-android-rest-template-1.0.0.M4.jar   |   Bin 137368 -> 0 bytes
 .../usergrid-android-client-0.0.1-SNAPSHOT.jar  |   Bin 66123 -> 0 bytes
 sdks/java/doc/allclasses-frame.html             |    40 -
 sdks/java/doc/allclasses-noframe.html           |    40 -
 sdks/java/doc/constant-values.html              |   731 -
 sdks/java/doc/deprecated-list.html              |   117 -
 sdks/java/doc/help-doc.html                     |   222 -
 sdks/java/doc/index-all.html                    |  1299 -
 sdks/java/doc/index.html                        |    68 -
 .../usergrid/java/client/Client.Query.html      |   238 -
 .../java/client/Client.QueuePosition.html       |   381 -
 .../org/apache/usergrid/java/client/Client.html |  1652 --
 .../java/client/class-use/Client.Query.html     |   246 -
 .../client/class-use/Client.QueuePosition.html  |   192 -
 .../usergrid/java/client/class-use/Client.html  |   175 -
 .../entities/Activity.ActivityCollection.html   |   408 -
 .../entities/Activity.ActivityObject.html       |   720 -
 .../client/entities/Activity.MediaLink.html     |   434 -
 .../usergrid/java/client/entities/Activity.html |  1449 -
 .../usergrid/java/client/entities/Device.html   |   387 -
 .../usergrid/java/client/entities/Entity.html   |   599 -
 .../usergrid/java/client/entities/Group.html    |   427 -
 .../usergrid/java/client/entities/Message.html  |   641 -
 .../usergrid/java/client/entities/User.html     |   707 -
 .../class-use/Activity.ActivityCollection.html  |   117 -
 .../class-use/Activity.ActivityObject.html      |   231 -
 .../entities/class-use/Activity.MediaLink.html  |   191 -
 .../client/entities/class-use/Activity.html     |   203 -
 .../java/client/entities/class-use/Device.html  |   169 -
 .../java/client/entities/class-use/Entity.html  |   415 -
 .../java/client/entities/class-use/Group.html   |   159 -
 .../java/client/entities/class-use/Message.html |   183 -
 .../java/client/entities/class-use/User.html    |   248 -
 .../java/client/entities/package-frame.html     |    28 -
 .../java/client/entities/package-summary.html   |   169 -
 .../java/client/entities/package-tree.html      |   141 -
 .../java/client/entities/package-use.html       |   219 -
 .../java/client/exception/ClientException.html  |   263 -
 .../exception/class-use/ClientException.html    |   117 -
 .../java/client/exception/package-frame.html    |    20 -
 .../java/client/exception/package-summary.html  |   137 -
 .../java/client/exception/package-tree.html     |   142 -
 .../java/client/exception/package-use.html      |   117 -
 .../usergrid/java/client/package-frame.html     |    28 -
 .../usergrid/java/client/package-summary.html   |   167 -
 .../usergrid/java/client/package-tree.html      |   146 -
 .../usergrid/java/client/package-use.html       |   158 -
 .../java/client/response/AggregateCounter.html  |   316 -
 .../client/response/AggregateCounterSet.html    |   444 -
 .../java/client/response/ApiResponse.html       |  1148 -
 .../client/response/ClientCredentialsInfo.html  |   316 -
 .../java/client/response/QueueInfo.html         |   297 -
 .../response/class-use/AggregateCounter.html    |   191 -
 .../response/class-use/AggregateCounterSet.html |   170 -
 .../client/response/class-use/ApiResponse.html  |   365 -
 .../class-use/ClientCredentialsInfo.html        |   170 -
 .../client/response/class-use/QueueInfo.html    |   187 -
 .../java/client/response/package-frame.html     |    24 -
 .../java/client/response/package-summary.html   |   151 -
 .../java/client/response/package-tree.html      |   134 -
 .../java/client/response/package-use.html       |   178 -
 .../usergrid/java/client/utils/JsonUtils.html   |   480 -
 .../usergrid/java/client/utils/MapUtils.html    |   260 -
 .../usergrid/java/client/utils/ObjectUtils.html |   258 -
 .../usergrid/java/client/utils/UrlUtils.html    |   314 -
 .../java/client/utils/class-use/JsonUtils.html  |   117 -
 .../java/client/utils/class-use/MapUtils.html   |   117 -
 .../client/utils/class-use/ObjectUtils.html     |   117 -
 .../java/client/utils/class-use/UrlUtils.html   |   117 -
 .../java/client/utils/package-frame.html        |    23 -
 .../java/client/utils/package-summary.html      |   147 -
 .../java/client/utils/package-tree.html         |   133 -
 .../usergrid/java/client/utils/package-use.html |   117 -
 sdks/java/doc/overview-frame.html               |    25 -
 sdks/java/doc/overview-summary.html             |   147 -
 sdks/java/doc/overview-tree.html                |   184 -
 sdks/java/doc/package-list                      |     5 -
 sdks/java/doc/resources/background.gif          |   Bin 2313 -> 0 bytes
 sdks/java/doc/resources/tab.gif                 |   Bin 291 -> 0 bytes
 sdks/java/doc/resources/titlebar.gif            |   Bin 10701 -> 0 bytes
 sdks/java/doc/resources/titlebar_end.gif        |   Bin 849 -> 0 bytes
 sdks/java/doc/serialized-form.html              |   134 -
 sdks/java/doc/stylesheet.css                    |   474 -
 sdks/java/pom.xml                               |    21 +-
 sdks/nodejs/.gitignore                          |     2 -
 sdks/nodejs/.npmignore                          |     1 -
 sdks/nodejs/lib/usergrid.js                     |   195 +-
 sdks/nodejs/test.js                             |    17 +
 sdks/nodejs/test/client.js                      |    18 +
 sdks/nodejs/test/collection.js                  |    17 +
 sdks/nodejs/test/entity.js                      |    17 +
 sdks/perl/Build.PL                              |    46 +
 sdks/perl/LICENSE                               |   202 +
 sdks/perl/MANIFEST                              |    23 +
 sdks/perl/Makefile.PL                           |    41 +
 sdks/perl/README.md                             |   341 +
 sdks/perl/examples/books.pl                     |    48 +
 sdks/perl/lib/Usergrid/Client.pm                |   492 +
 sdks/perl/lib/Usergrid/Collection.pm            |   212 +
 sdks/perl/lib/Usergrid/Entity.pm                |    92 +
 sdks/perl/lib/Usergrid/Request.pm               |   249 +
 sdks/perl/t/01_init.t                           |    27 +
 sdks/perl/t/02_login.t                          |    64 +
 sdks/perl/t/03_update.t                         |   102 +
 sdks/perl/t/04_collection.t                     |   104 +
 sdks/perl/t/05_query.t                          |   108 +
 sdks/perl/t/06_batch_update.t                   |   107 +
 sdks/perl/t/07_batch_delete.t                   |    87 +
 sdks/perl/t/08_connections.t                    |    94 +
 sdks/perl/t/09_paging.t                         |   140 +
 sdks/perl/t/10_auto_paging.t                    |    94 +
 sdks/php/kessel/config.ini                      |    18 -
 sdks/php/kessel/kessel.rb                       |   188 -
 sdks/ruby-on-rails/.gitignore                   |    18 -
 sdks/ruby-on-rails/.rspec                       |     1 -
 sdks/ruby-on-rails/.rvmrc                       |     2 -
 sdks/usergrid-java-sdk-0.0.6/README.txt         |     5 +
 sdks/usergrid-java-sdk-0.0.6/pom.xml            |   114 +
 .../java/org/usergrid/java/client/Client.java   |  1292 +
 .../usergrid/java/client/entities/Activity.java |   626 +
 .../usergrid/java/client/entities/Device.java   |    68 +
 .../usergrid/java/client/entities/Entity.java   |   191 +
 .../usergrid/java/client/entities/Group.java    |    79 +
 .../usergrid/java/client/entities/Message.java  |   148 +
 .../org/usergrid/java/client/entities/User.java |   158 +
 .../java/client/exception/ClientException.java  |    42 +
 .../java/client/response/AggregateCounter.java  |    52 +
 .../client/response/AggregateCounterSet.java    |   111 +
 .../java/client/response/ApiResponse.java       |   421 +
 .../client/response/ClientCredentialsInfo.java  |    58 +
 .../java/client/response/QueueInfo.java         |    44 +
 .../usergrid/java/client/utils/JsonUtils.java   |   182 +
 .../usergrid/java/client/utils/MapUtils.java    |    39 +
 .../usergrid/java/client/utils/ObjectUtils.java |    36 +
 .../usergrid/java/client/utils/UrlUtils.java    |   124 +
 stack/README.md                                 |    14 +-
 stack/awscluster/assembly.xml                   |    16 +-
 stack/awscluster/aws-sample.properties          |    17 +
 stack/awscluster/src/main/cql/create_locks.cql  |    44 +
 .../awscluster/src/main/cql/create_usergrid.cql |    96 +
 .../main/cql/create_usergrid_applications.cql   |   408 +
 .../src/main/dist/conf/Priam.properties         |    21 -
 .../main/dist/init_instance/create_keyspaces.sh |    39 +
 .../src/main/dist/init_instance/create_raid0.sh |     2 +-
 .../dist/init_instance/create_raid0_2disks.sh   |    54 +
 .../src/main/dist/init_instance/init_cass.sh    |    70 +
 .../main/dist/init_instance/init_db_server.sh   |    19 +-
 .../dist/init_instance/init_graphite_server.sh  |    60 +
 .../main/dist/init_instance/init_rest_server.sh |    90 +-
 .../dist/init_instance/install_cassandra.sh     |    40 +-
 .../dist/init_instance/install_elasticsearch.sh |    23 +-
 .../init_instance/install_opscenter_agent.sh    |    37 +
 .../dist/init_instance/install_oraclejdk.sh     |    15 +-
 .../main/dist/init_instance/install_yourkit.sh  |    39 +
 .../src/main/dist/lib/log4j.properties          |    54 +
 .../src/main/dist/lib/priam-agent-1.2.24.jar    |   Bin 33020 -> 0 bytes
 .../dist/lib/priam-cass-extensions-1.2.24.jar   |   Bin 5478 -> 0 bytes
 stack/awscluster/src/main/dist/update.sh        |     7 +-
 .../awscluster/src/main/dist/webapps/dummy.txt  |     0
 .../src/main/dist/webapps/priam-web-1.2.24.war  |   Bin 31272443 -> 0 bytes
 .../src/main/groovy/NodeRegistry.groovy         |   114 +
 .../src/main/groovy/configure_cassandra.groovy  |    29 +-
 .../main/groovy/configure_elasticsearch.groovy  |    26 +-
 .../groovy/configure_opscenter_agent.groovy     |    50 +
 .../src/main/groovy/configure_priam.groovy      |    60 -
 .../src/main/groovy/configure_usergrid.groovy   |    69 +-
 .../src/main/groovy/get_first_instance.groovy   |    46 +
 .../src/main/groovy/registry_clear.groovy       |    39 -
 .../src/main/groovy/registry_list.groovy        |    21 +-
 .../src/main/groovy/registry_register.groovy    |    33 +-
 .../src/main/groovy/wait_for_instances.groovy   |    51 +-
 stack/awscluster/ugcluster-cf.json              |  1069 +-
 stack/cloudbees.xml                             |    18 +
 .../main/resources/usergrid-default.properties  |   133 +-
 stack/config/src/test/resources/cassandra.yaml  |    25 +-
 .../src/test/resources/usergrid-test.properties |    17 +
 stack/core/pom.xml                              |   126 +-
 .../java/org/apache/usergrid/batch/Job.java     |    12 +-
 .../org/apache/usergrid/batch/JobFactory.java   |     2 +-
 .../usergrid/batch/UsergridJobFactory.java      |     6 +-
 .../batch/service/JobSchedulerService.java      |   302 +-
 .../batch/service/SchedulerServiceImpl.java     |     6 +-
 .../corepersistence/CpEntityManager.java        |   310 +-
 .../corepersistence/CpEntityManagerFactory.java |    36 +-
 .../corepersistence/CpEntityMapUtils.java       |    24 +-
 .../corepersistence/CpManagerCache.java         |     6 +
 .../corepersistence/CpRelationManager.java      |   207 +-
 .../usergrid/corepersistence/CpSetup.java       |    50 +-
 .../HybridEntityManagerFactory.java             |   146 +
 .../usergrid/corepersistence/HybridSetup.java   |    72 +
 .../apache/usergrid/metrics/MetricsFactory.java |   113 +
 .../usergrid/mq/cassandra/QueueManagerImpl.java |    38 +-
 .../mq/cassandra/io/AbstractSearch.java         |     5 +-
 .../mq/cassandra/io/ConsumerTransaction.java    |    12 +-
 .../usergrid/persistence/AbstractEntity.java    |     2 +-
 .../usergrid/persistence/EntityManager.java     |    12 +-
 .../persistence/EntityManagerFactory.java       |     6 +
 .../persistence/MultiQueryIterator.java         |     6 +-
 .../persistence/ObservableIterator.java         |    82 +
 .../persistence/PagingResultsIterator.java      |     7 +-
 .../apache/usergrid/persistence/Results.java    |     1 -
 .../usergrid/persistence/ResultsIterator.java   |    30 +
 .../cassandra/CassandraPersistenceUtils.java    |     9 +-
 .../persistence/cassandra/CassandraService.java |   137 +-
 .../cassandra/EntityManagerFactoryImpl.java     |    15 +-
 .../cassandra/EntityManagerImpl.java            |   126 +-
 .../persistence/cassandra/GeoIndexManager.java  |    25 +-
 .../persistence/cassandra/QueryProcessor.java   |     3 +-
 .../cassandra/RelationManagerImpl.java          |    58 +-
 .../persistence/cassandra/Serializers.java      |    14 +-
 .../persistence/cassandra/SetupImpl.java        |     7 +-
 .../exceptions/NoFullTextIndexException.java    |    51 -
 .../exceptions/NoIndexException.java            |    51 -
 .../exceptions/QueryParseException.java         |    64 -
 .../exceptions/QueryTokenException.java         |    53 -
 .../persistence/hector/CountingMutator.java     |   344 +
 .../usergrid/persistence/query/ir/AllNode.java  |    12 +
 .../persistence/query/ir/BooleanNode.java       |    16 +
 .../query/ir/EmailIdentifierNode.java           |    12 +
 .../query/ir/NameIdentifierNode.java            |    12 +
 .../usergrid/persistence/query/ir/NotNode.java  |    12 +
 .../persistence/query/ir/OrderByNode.java       |    16 +-
 .../persistence/query/ir/QueryNode.java         |    12 +
 .../persistence/query/ir/SliceNode.java         |    12 +
 .../query/ir/UuidIdentifierNode.java            |    12 +
 .../persistence/query/ir/WithinNode.java        |    12 +
 .../ir/result/ConnectionIndexSliceParser.java   |     2 +-
 .../query/ir/result/SubtractionIterator.java    |     8 +-
 .../main/resources/usergrid-core-context.xml    |    27 +-
 .../org/apache/usergrid/AbstractCoreIT.java     |     2 +-
 .../usergrid/ConcurrentCoreIteratorITSuite.java |     6 +-
 .../org/apache/usergrid/CoreITSetupImpl.java    |     6 +-
 .../java/org/apache/usergrid/CoreITSuite.java   |     5 +
 .../apache/usergrid/batch/BulkTestUtils.java    |    10 +-
 .../usergrid/batch/UsergridJobFactoryTest.java  |     3 +-
 .../batch/job/AbstractSchedulerRuntimeIT.java   |    19 +-
 .../usergrid/batch/job/CountdownLatchJob.java   |     6 +
 .../usergrid/batch/job/DelayExecution.java      |     6 +
 .../usergrid/batch/job/DelayHeartbeat.java      |     6 +
 .../batch/job/FailureJobExceuction.java         |    74 -
 .../usergrid/batch/job/FailureJobExecution.java |    87 +
 .../usergrid/batch/job/OnlyOnceExceution.java   |     6 +
 .../job/OnlyOnceUnlockOnFailExceution.java      |     6 +
 .../usergrid/batch/job/SchedulerRuntime1IT.java |     5 +-
 .../usergrid/batch/job/SchedulerRuntime2IT.java |     7 +-
 .../usergrid/batch/job/SchedulerRuntime3IT.java |    35 +-
 .../usergrid/batch/job/SchedulerRuntime4IT.java |    11 +-
 .../usergrid/batch/job/SchedulerRuntime5IT.java |     4 +-
 .../usergrid/batch/job/SchedulerRuntime6IT.java |     5 +-
 .../usergrid/batch/job/SchedulerRuntime7IT.java |    11 +-
 .../usergrid/batch/job/SchedulerRuntime8IT.java |     4 +-
 .../batch/job/SchedulerRuntimeIntervalIT.java   |   115 +
 .../usergrid/batch/job/TestJobListener.java     |    67 +-
 .../usergrid/batch/job/TestJobListenerTest.java |     7 +-
 .../corepersistence/TestGuiceModule.java        |    27 -
 .../usergrid/persistence/CollectionIT.java      |    66 +-
 .../usergrid/persistence/CountingMutatorIT.java |   122 +
 .../usergrid/persistence/EntityManagerIT.java   |     3 +-
 .../org/apache/usergrid/persistence/GeoIT.java  |    14 +-
 .../apache/usergrid/persistence/IndexIT.java    |    21 +-
 .../usergrid/persistence/PathQueryIT.java       |     2 +-
 .../cassandra/QueryProcessorTest.java           |    93 +-
 .../query/AbstractIteratingQueryIT.java         |    12 +-
 .../query/IntersectionTransitivePagingIT.java   |   163 +
 .../query/IntersectionUnionPagingIT.java        |     4 +-
 .../query/MultiOrderByConnectionIT.java         |     2 +-
 .../persistence/query/NotSubPropertyIT.java     |   177 +
 .../SingleOrderByIntersectionCollectionIT.java  |     2 +-
 .../SingleOrderByIntersectionConnectionIT.java  |     2 +-
 stack/core/src/test/resources/cassandra.yaml    |    17 +
 stack/core/src/test/resources/config.properties |    44 -
 .../resources/corepersistence-UNIT.properties   |    17 -
 .../src/test/resources/dynamic-test.properties  |    21 -
 stack/core/src/test/resources/log4j.properties  |    24 +-
 .../core/src/test/resources/project.properties  |    15 +
 .../resources/usergrid-custom-test.properties   |    22 +
 .../resources/usergrid-properties-context.xml   |    40 +
 .../usergrid-scheduler-test.properties          |    20 +-
 .../test/resources/usergrid-test-context.xml    |    80 +-
 .../mvcc/stage/write/WriteCommit.java           |     8 +-
 .../mvcc/stage/write/WriteUniqueVerify.java     |     2 +-
 .../serialization/SerializationFig.java         |     2 +-
 .../mvcc/stage/write/WriteUniqueVerifyIT.java   |     9 +
 .../src/test/resources/dynamic-test.properties  |     4 +-
 .../src/test/resources/log4j.properties         |    22 +-
 .../src/test/resources/usergrid-UNIT.properties |     3 +-
 .../shard/count/NodeShardApproximationTest.java |     3 +
 stack/corepersistence/perftest1/pom.xml         |    71 -
 .../usergrid/persistence/UsergridBootstrap.java |   303 -
 .../src/main/resources/log4j.properties         |    44 -
 .../src/main/resources/project.properties       |     1 -
 .../main/resources/usergrid-test-context.xml    |    39 -
 .../persistence/Usergrid1PerformanceTest.java   |   306 -
 .../persistence/UsergridBootstrapTest.java      |    56 -
 stack/corepersistence/perftest2/pom.xml         |    64 -
 .../main/groovy/perftest2/CreateEntity.groovy   |   100 -
 .../persistence/CorePerformanceTest.java        |   318 -
 .../index/guice/TestIndexModule.java            |    30 -
 stack/corepersistence/pom.xml                   |     2 +-
 .../src/main/java/CpQueryFilter.tokens          |    47 +
 .../usergrid/persistence/index/IndexFig.java    |     9 +-
 .../index/impl/EntityIndexMapUtils.java         |   312 -
 .../index/impl/EsEntityIndexImpl.java           |    81 +-
 .../persistence/index/impl/EsProvider.java      |    64 +-
 .../persistence/index/impl/EsQueryVistor.java   |    84 +-
 .../usergrid/persistence/index/query/Query.java |   113 +-
 .../index/query/tree/CpQueryFilterLexer.java    |  3123 ++
 .../index/query/tree/CpQueryFilterParser.java   |  2501 ++
 .../impl/EntityConnectionIndexImplTest.java     |     1 -
 .../index/impl/EntityIndexMapUtils.java         |   311 +
 .../persistence/index/impl/EntityIndexTest.java |     8 +-
 .../persistence/query/tree/GrammarTreeTest.java |    39 +-
 .../src/test/resources/dynamic-test.properties  |     2 +-
 .../src/test/resources/log4j.properties         |     2 +-
 .../src/test/resources/usergrid-UNIT.properties |     2 +-
 stack/launcher/pom.xml                          |    31 +-
 .../launcher/src/main/resources/cassandra.yaml  |    25 +-
 .../1.5.4/AppleJavaExtensions-1.5.4.jar         |   Bin 23531 -> 0 bytes
 .../1.5.4/AppleJavaExtensions-1.5.4.pom         |     9 -
 .../maven-metadata-local.xml                    |    12 -
 .../recaptcha4j/0.0.8/recaptcha4j-0.0.8.jar     |   Bin 10344 -> 0 bytes
 .../recaptcha4j/0.0.8/recaptcha4j-0.0.8.pom     |     9 -
 .../recaptcha4j/maven-metadata-local.xml        |    12 -
 .../0.0.3/usergrid-java-client-0.0.3.jar        |   Bin 45750 -> 0 bytes
 .../usergrid-java-client-0.0.3.jar.lastUpdated  |     5 -
 .../0.0.3/usergrid-java-client-0.0.3.jar.sha1   |     1 -
 .../0.0.3/usergrid-java-client-0.0.3.pom        |    87 -
 .../usergrid-java-client-0.0.3.pom.lastUpdated  |     5 -
 .../0.0.3/usergrid-java-client-0.0.3.pom.sha1   |     1 -
 .../maven-metadata-local.xml                    |    13 -
 .../test/resources/usergrid-test-context.xml    |    21 +-
 stack/pom.xml                                   |    92 +-
 stack/query-validator/pom.xml                   |    12 -
 stack/rest/pom.xml                              |   179 +-
 .../usergrid/rest/AbstractContextResource.java  |    40 +-
 .../rest/JacksonCustomMapperProvider.java       |     4 +
 .../org/apache/usergrid/rest/RootResource.java  |     1 +
 .../rest/applications/ApplicationResource.java  |    55 +-
 .../rest/applications/ServiceResource.java      |   174 +-
 .../applications/assets/AssetsResource.java     |     9 +-
 .../rest/applications/users/UserResource.java   |     9 +-
 .../rest/applications/users/UsersResource.java  |    63 +-
 .../exceptions/AbstractExceptionMapper.java     |     7 +-
 .../exceptions/JsonParseExceptionMapper.java    |    35 +
 .../exceptions/QueryParseExceptionMapper.java   |     5 +-
 .../exceptions/QueryTokenExceptionMapper.java   |     3 +-
 .../rest/filters/ContentTypeFilter.java         |     6 +-
 .../rest/management/ManagementResource.java     |     5 +-
 .../organizations/OrganizationResource.java     |     6 +-
 .../organizations/OrganizationsResource.java    |    12 +-
 .../applications/ApplicationsResource.java      |     9 +
 .../organizations/users/UsersResource.java      |     2 +-
 .../rest/management/users/UserResource.java     |     2 +
 .../rest/management/users/UsersResource.java    |     2 +-
 .../organizations/OrganizationResource.java     |    21 +-
 .../security/SecuredResourceFilterFactory.java  |     3 +
 .../OAuth2AccessTokenSecurityFilter.java        |    13 +-
 .../rest/test/RefreshIndexResource.java         |    89 +
 .../usergrid/rest/test/ReindexResource.java     |    77 -
 .../resources/usergrid-rest-deploy-context.xml  |     2 -
 stack/rest/src/main/webapp/WEB-INF/web.xml      |    34 +-
 .../apache/usergrid/rest/AbstractRestIT.java    |   133 +-
 .../java/org/apache/usergrid/rest/ITSetup.java  |    57 +-
 .../org/apache/usergrid/rest/RestITSuite.java   |    16 +-
 .../apache/usergrid/rest/TomcatResource.java    |   263 +-
 .../ApplicationRequestCounterIT.java            |     2 +
 .../applications/ApplicationResourceIT.java     |   104 +-
 .../rest/applications/DevicesResourceIT.java    |     8 +
 .../applications/assets/AssetResourceIT.java    |     4 +
 .../collection/BadGrammarQueryTest.java         |     2 +
 .../collection/BrowserCompatibilityTest.java    |     2 +
 .../collection/DuplicateNameIT.java             |    72 +
 .../collection/PagingResourceIT.java            |    50 +-
 .../collection/activities/AndOrQueryTest.java   |    23 +-
 .../collection/activities/OrderByTest.java      |     6 +
 .../activities/PagingEntitiesTest.java          |     7 +-
 .../collection/activities/PutTest.java          |     8 +-
 .../collection/groups/GeoPagingTest.java        |    24 +-
 .../collection/groups/UpdateGroupIT.java        |     4 +
 .../applications/events/EventsResourceIT.java   |    56 +-
 .../queues/QueueResourceLong1IT.java            |     2 +
 .../applications/users/ActivityResourceIT.java  |    15 +-
 .../users/CollectionsResourceIT.java            |    11 +-
 .../users/ConnectionResourceTest.java           |    20 +
 .../applications/users/GroupResourceIT.java     |    24 +
 .../applications/users/MatrixQueryTests.java    |   202 +
 .../applications/users/OwnershipResourceIT.java |    83 +-
 .../users/PermissionsResourceIT.java            |    89 +-
 .../applications/users/RetrieveUsersTest.java   |     4 +
 .../rest/applications/users/UserResourceIT.java |   130 +-
 .../rest/management/ExportResourceIT.java       |   131 +-
 .../rest/management/ManagementResourceIT.java   |    38 +-
 .../rest/management/RegistrationIT.java         |    64 +-
 .../organizations/AdminEmailEncodingIT.java     |     3 +-
 .../organizations/OrganizationResourceIT.java   |     4 +
 .../organizations/OrganizationsResourceIT.java  |    30 +-
 .../applications/ApplicationsIT.java            |     6 +
 .../rest/management/users/MUUserResourceIT.java |   110 +-
 .../rest/test/resource/MatrixResource.java      |    64 +
 .../rest/test/resource/NamedResource.java       |     5 +
 .../rest/test/resource/SetResource.java         |    12 +
 .../rest/test/resource/TestContext.java         |    29 +-
 .../rest/test/resource/ValueResource.java       |    35 +-
 .../rest/test/security/TestAdminUser.java       |     2 -
 stack/rest/src/test/resources/log4j.properties  |    30 +-
 .../rest/src/test/resources/logging.properties  |    28 +
 .../rest/src/test/resources/project.properties  |    17 +
 .../resources/usergrid-custom-test.properties   |    38 +-
 .../resources/usergrid-properties-context.xml   |    40 +
 .../resources/usergrid-rest-deploy-context.xml  |    16 +
 .../test/resources/usergrid-test-context.xml    |    35 +-
 stack/services/pom.xml                          |    29 +-
 .../management/AccountCreationProps.java        |     6 +-
 .../cassandra/ApplicationCreatorImpl.java       |     1 +
 .../cassandra/ManagementServiceImpl.java        |    91 +-
 .../usergrid/management/export/ExportJob.java   |     6 +
 .../management/export/ExportServiceImpl.java    |     6 +-
 .../services/AbstractCollectionService.java     |    17 +-
 .../services/AbstractConnectionsService.java    |     2 +-
 .../usergrid/services/ServiceManager.java       |     4 +-
 .../usergrid/services/ServiceRequest.java       |    11 +-
 .../services/activities/ActivitiesService.java  |     2 +-
 .../applications/ApplicationsService.java       |     4 +-
 .../usergrid/services/assets/AssetsService.java |     6 +-
 .../services/devices/DevicesService.java        |     4 +-
 .../services/devices/users/UsersService.java    |     2 +-
 .../usergrid/services/groups/GroupsService.java |     4 +-
 .../groups/activities/ActivitiesService.java    |     2 +-
 .../services/groups/roles/RolesService.java     |     2 +-
 .../services/groups/users/UsersService.java     |     2 +-
 .../users/activities/ActivitiesService.java     |     2 +-
 .../groups/users/devices/DevicesService.java    |     2 +-
 .../services/messages/MessagesService.java      |     2 +-
 .../usergrid/services/roles/RolesService.java   |     6 +-
 .../services/roles/groups/GroupsService.java    |     2 +-
 .../services/roles/users/UsersService.java      |     2 +-
 .../usergrid/services/users/UsersService.java   |     2 +-
 .../users/activities/ActivitiesService.java     |     2 +-
 .../services/users/devices/DevicesService.java  |     2 +-
 .../services/users/groups/GroupsService.java    |     2 +-
 .../org/apache/usergrid/ServiceITSetupImpl.java |     4 +-
 .../org/apache/usergrid/ServiceITSuite.java     |     4 +
 .../apache/usergrid/management/EmailFlowIT.java |    20 +-
 .../usergrid/management/OrganizationIT.java     |     3 +-
 .../org/apache/usergrid/management/RoleIT.java  |     2 +-
 .../cassandra/ApplicationCreatorIT.java         |     2 +-
 .../management/cassandra/ExportServiceIT.java   |     7 +-
 .../cassandra/ManagementServiceIT.java          |     2 +-
 .../security/providers/FacebookProviderIT.java  |     2 +-
 .../providers/PingIdentityProviderIT.java       |     2 +-
 .../security/tokens/TokenServiceIT.java         |     2 +-
 .../usergrid/services/AbstractServiceIT.java    |     2 +-
 .../usergrid/services/ServiceInvocationIT.java  |     8 +-
 .../usergrid/services/ServiceRequestIT.java     |     2 +-
 .../src/test/resources/log4j.properties         |    21 +-
 .../src/test/resources/project.properties       |     1 +
 .../resources/usergrid-custom-test.properties   |    22 +
 .../resources/usergrid-properties-context.xml   |    40 +
 .../test/resources/usergrid-test-context.xml    |     8 +-
 stack/test-utils/pom.xml                        |    28 +-
 .../org/apache/usergrid/ElasticSearchMain.java  |   107 +
 .../apache/usergrid/ElasticSearchResource.java  |   178 +
 .../java/org/apache/usergrid/TomcatMain.java    |     1 +
 .../usergrid/cassandra/CassandraMain.java       |    70 +
 .../usergrid/cassandra/CassandraResource.java   |   425 +-
 .../src/main/resources/cassandra.yaml           |    25 +-
 .../src/test/resources/project.properties       |    22 +-
 .../resources/usergrid-custom-test.properties   |    18 +
 .../resources/usergrid-properties-context.xml   |    40 +
 .../org/apache/usergrid/tools/AppNameFix.java   |    59 +-
 .../java/org/apache/usergrid/tools/Cli.java     |     2 +-
 .../RepairingMismatchedApplicationMetadata.java |    92 +-
 .../src/main/resources/apidoc/applications.yaml |    21 +-
 .../src/main/resources/apidoc/management.yaml   |    21 +-
 stack/tools/src/main/resources/log4j.properties |    45 +
 949 files changed, 28651 insertions(+), 167836 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a4f921f4/stack/corepersistence/collection/src/test/resources/usergrid-UNIT.properties
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a4f921f4/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardApproximationTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a4f921f4/stack/corepersistence/pom.xml
----------------------------------------------------------------------


[06/52] [abbrv] Updated OrderedMerge to use a faster implementation at runtime. After initialization, it's an O(1) emit operation as long as our produces are fast enough.

Posted by gr...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/RowTypeSerializer.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/RowTypeSerializer.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/RowTypeSerializer.java
deleted file mode 100644
index 2edea56..0000000
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/RowTypeSerializer.java
+++ /dev/null
@@ -1,62 +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.graph.serialization.impl.shard.impl;
-
-
-import org.apache.usergrid.persistence.core.astyanax.CompositeFieldSerializer;
-import org.apache.usergrid.persistence.core.astyanax.IdRowCompositeSerializer;
-import org.apache.usergrid.persistence.graph.serialization.impl.shard.RowKeyType;
-import org.apache.usergrid.persistence.model.entity.Id;
-
-import com.netflix.astyanax.model.CompositeBuilder;
-import com.netflix.astyanax.model.CompositeParser;
-
-
-public class RowTypeSerializer implements CompositeFieldSerializer<RowKeyType> {
-
-    private static final IdRowCompositeSerializer ID_SER = IdRowCompositeSerializer.get();
-
-
-    @Override
-    public void toComposite( final CompositeBuilder builder, final RowKeyType keyType ) {
-
-        //add the row id to the composite
-        ID_SER.toComposite( builder, keyType.nodeId );
-
-        builder.addString( keyType.edgeType );
-        builder.addString( keyType.idType );
-
-        builder.addLong( keyType.shardId );
-    }
-
-
-    @Override
-    public RowKeyType fromComposite( final CompositeParser composite ) {
-
-        final Id id = ID_SER.fromComposite( composite );
-        final String edgeType = composite.readString();
-        final String idType = composite.readString();
-        final long shard = composite.readLong();
-
-        return new RowKeyType( id, edgeType, idType, shard);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardEntryGroupIterator.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardEntryGroupIterator.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardEntryGroupIterator.java
index c8a884b..f1b5108 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardEntryGroupIterator.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardEntryGroupIterator.java
@@ -6,32 +6,51 @@ import java.util.NoSuchElementException;
 
 import org.apache.commons.collections4.iterators.PushbackIterator;
 
+import org.apache.usergrid.persistence.core.scope.ApplicationScope;
+import org.apache.usergrid.persistence.graph.serialization.impl.shard.DirectedEdgeMeta;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.Shard;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.ShardEntryGroup;
+import org.apache.usergrid.persistence.graph.serialization.impl.shard.ShardGroupCompaction;
 
 import com.google.common.base.Preconditions;
 
+import rx.schedulers.Schedulers;
+
 
 /**
- * Utility class that will take an iterator of all shards, and combine them into an iterator
- * of ShardEntryGroups.  These groups can then be used in a distributed system to handle concurrent reads and writes
+ * Utility class that will take an iterator of all shards, and combine them into an iterator of ShardEntryGroups.  These
+ * groups can then be used in a distributed system to handle concurrent reads and writes
  */
 public class ShardEntryGroupIterator implements Iterator<ShardEntryGroup> {
 
 
-    private ShardEntryGroup next;
+    private final ShardGroupCompaction shardGroupCompaction;
     private final PushbackIterator<Shard> sourceIterator;
     private final long minDelta;
+    private final ApplicationScope scope;
+    private final DirectedEdgeMeta directedEdgeMeta;
+
+
+    private ShardEntryGroup next;
 
 
     /**
      * Create a shard iterator
-     * @param shardIterator The iterator of all shards.  Order is expected to be by the  shard index from Long.MAX to Long.MIN
+     *
+     * @param shardIterator The iterator of all shards.  Order is expected to be by the  shard index from Long.MAX to
+     * Long.MIN
      * @param minDelta The minimum delta we allow to consider shards the same group
      */
-    public ShardEntryGroupIterator( final Iterator<Shard> shardIterator, final long minDelta ) {
-        Preconditions.checkArgument(shardIterator.hasNext(), "Shard iterator must have shards present");
+    public ShardEntryGroupIterator( final Iterator<Shard> shardIterator, final long minDelta,
+                                    final ShardGroupCompaction shardGroupCompaction, final ApplicationScope scope,
+                                    final DirectedEdgeMeta directedEdgeMeta ) {
+
+
+        Preconditions.checkArgument( shardIterator.hasNext(), "Shard iterator must have shards present" );
+        this.scope = scope;
+        this.directedEdgeMeta = directedEdgeMeta;
         this.sourceIterator = new PushbackIterator( shardIterator );
+        this.shardGroupCompaction = shardGroupCompaction;
         this.minDelta = minDelta;
     }
 
@@ -78,7 +97,7 @@ public class ShardEntryGroupIterator implements Iterator<ShardEntryGroup> {
          */
         while ( sourceIterator.hasNext() ) {
 
-            if(next == null){
+            if ( next == null ) {
                 next = new ShardEntryGroup( minDelta );
             }
 
@@ -92,9 +111,13 @@ public class ShardEntryGroupIterator implements Iterator<ShardEntryGroup> {
 
 
             sourceIterator.pushback( shard );
+
             break;
         }
 
-
+        //now perform the audit (maybe)
+        if(next != null) {
+            shardGroupCompaction.evaluateShardGroup( scope, directedEdgeMeta, next );
+        }
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupCompactionImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupCompactionImpl.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupCompactionImpl.java
index c566d43..5076424 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupCompactionImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupCompactionImpl.java
@@ -23,21 +23,32 @@ package org.apache.usergrid.persistence.graph.serialization.impl.shard.impl;
 
 
 import java.nio.charset.Charset;
-import java.util.BitSet;
-import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.Iterator;
-import java.util.List;
 import java.util.Random;
 import java.util.Set;
 import java.util.UUID;
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.RejectedExecutionHandler;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicLong;
+
+import javax.annotation.Nullable;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import org.apache.usergrid.persistence.core.consistency.TimeService;
-import org.apache.usergrid.persistence.core.rx.ObservableIterator;
+import org.apache.usergrid.persistence.core.hystrix.HystrixCassandra;
 import org.apache.usergrid.persistence.core.scope.ApplicationScope;
 import org.apache.usergrid.persistence.graph.GraphFig;
 import org.apache.usergrid.persistence.graph.MarkedEdge;
+import org.apache.usergrid.persistence.graph.SearchByEdgeType;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.DirectedEdgeMeta;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.EdgeColumnFamilies;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.EdgeShardSerialization;
@@ -47,20 +58,22 @@ import org.apache.usergrid.persistence.graph.serialization.impl.shard.ShardEntry
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.ShardGroupCompaction;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.ShardedEdgeSerialization;
 import org.apache.usergrid.persistence.model.entity.Id;
+import org.apache.usergrid.persistence.model.util.UUIDGenerator;
 
 import com.google.common.base.Preconditions;
-import com.google.common.hash.HashCode;
 import com.google.common.hash.HashFunction;
 import com.google.common.hash.Hasher;
 import com.google.common.hash.Hashing;
+import com.google.common.hash.PrimitiveSink;
+import com.google.common.util.concurrent.FutureCallback;
+import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.ListeningExecutorService;
+import com.google.common.util.concurrent.MoreExecutors;
 import com.google.inject.Inject;
 import com.google.inject.Singleton;
-
-import rx.Observable;
-import rx.functions.Action0;
-import rx.functions.Action1;
-import rx.functions.Func1;
-import rx.schedulers.Schedulers;
+import com.netflix.astyanax.Keyspace;
+import com.netflix.astyanax.MutationBatch;
 
 
 /**
@@ -70,27 +83,33 @@ import rx.schedulers.Schedulers;
 public class ShardGroupCompactionImpl implements ShardGroupCompaction {
 
 
+    private static final Logger LOG = LoggerFactory.getLogger( ShardGroupCompactionImpl.class );
+
+
     private static final Charset CHARSET = Charset.forName( "UTF-8" );
 
     private static final HashFunction MURMUR_128 = Hashing.murmur3_128();
 
+
+    private final ListeningExecutorService executorService;
     private final TimeService timeService;
     private final GraphFig graphFig;
     private final NodeShardAllocation nodeShardAllocation;
     private final ShardedEdgeSerialization shardedEdgeSerialization;
     private final EdgeColumnFamilies edgeColumnFamilies;
+    private final Keyspace keyspace;
     private final EdgeShardSerialization edgeShardSerialization;
 
-
     private final Random random;
     private final ShardCompactionTaskTracker shardCompactionTaskTracker;
+    private final ShardAuditTaskTracker shardAuditTaskTracker;
 
 
     @Inject
     public ShardGroupCompactionImpl( final TimeService timeService, final GraphFig graphFig,
                                      final NodeShardAllocation nodeShardAllocation,
                                      final ShardedEdgeSerialization shardedEdgeSerialization,
-                                     final EdgeColumnFamilies edgeColumnFamilies,
+                                     final EdgeColumnFamilies edgeColumnFamilies, final Keyspace keyspace,
                                      final EdgeShardSerialization edgeShardSerialization ) {
 
         this.timeService = timeService;
@@ -98,157 +117,343 @@ public class ShardGroupCompactionImpl implements ShardGroupCompaction {
         this.nodeShardAllocation = nodeShardAllocation;
         this.shardedEdgeSerialization = shardedEdgeSerialization;
         this.edgeColumnFamilies = edgeColumnFamilies;
+        this.keyspace = keyspace;
         this.edgeShardSerialization = edgeShardSerialization;
 
         this.random = new Random();
         this.shardCompactionTaskTracker = new ShardCompactionTaskTracker();
+        this.shardAuditTaskTracker = new ShardAuditTaskTracker();
+
+        executorService = MoreExecutors.listeningDecorator(
+                new MaxSizeThreadPool( graphFig.getShardAuditWorkerCount(), graphFig.getShardAuditWorkerQueueSize() ) );
     }
 
 
-    @Override
-    public Set<Shard> compact( final ApplicationScope scope, final DirectedEdgeMeta edgeMeta,
-                               final ShardEntryGroup group ) {
+    /**
+     * Execute the compaction task.  Will return the status the operations performed
+     *
+     * @param group The shard entry group to compact
+     *
+     * @return The result of the compaction operation
+     */
+    public CompactionResult compact( final ApplicationScope scope, final DirectedEdgeMeta edgeMeta,
+                                     final ShardEntryGroup group ) {
+
+
         final long startTime = timeService.getCurrentTime();
 
+
         Preconditions.checkNotNull( group, "group cannot be null" );
         Preconditions.checkArgument( group.isCompactionPending(), "Compaction is pending" );
-        Preconditions.checkArgument( group.shouldCompact( startTime ), "Compaction can now be run" );
+        Preconditions.checkArgument( group.shouldCompact( startTime ),
+                "Compaction cannot be run yet.  Ignoring compaction." );
 
-        /**
-         * It's already compacting, don't do anything
-         */
-        if (!shardCompactionTaskTracker.shouldStartCompaction( scope, edgeMeta, group )){
-            return Collections.emptySet();
-        }
 
+        final CompactionResult.CompactionBuilder resultBuilder = CompactionResult.builder();
 
         final Shard targetShard = group.getCompactionTarget();
 
-        final Collection<Shard> sourceShards = group.getReadShards();
+        final Set<Shard> sourceShards = new HashSet<>( group.getReadShards() );
 
+        //remove the target
+        sourceShards.remove( targetShard );
 
 
-        Observable.create( new ObservableIterator<MarkedEdge>( "Shard_Repair" ) {
-            @Override
-            protected Iterator<MarkedEdge> getIterator() {
-                return edgeMeta.loadEdges( shardedEdgeSerialization, edgeColumnFamilies, scope, group.getReadShards(), Long.MAX_VALUE );
-            }
-        } ).buffer( graphFig.getScanPageSize() ).doOnNext( new Action1<List<MarkedEdge>>() {
-            @Override
-            public void call( final List<MarkedEdge> markedEdges ) {
+        final UUID timestamp = UUIDGenerator.newTimeUUID();
 
-            }
-        }).doOnNext( new Action1<List<MarkedEdge>>() {
-            @Override
-            public void call( final List<MarkedEdge> markedEdges ) {
+        final long newShardPivot = targetShard.getShardIndex();
 
-            }
-        } );
+        final int maxWorkSize = graphFig.getScanPageSize();
 
 
+        final MutationBatch newRowBatch = keyspace.prepareMutationBatch();
+        final MutationBatch deleteRowBatch = keyspace.prepareMutationBatch();
 
+        /**
+         * As we move edges, we want to keep track of it
+         */
+        long edgeCount = 0;
 
 
-        return null;
-    }
+        for ( Shard sourceShard : sourceShards ) {
+            Iterator<MarkedEdge> edges = edgeMeta.loadEdges( shardedEdgeSerialization, edgeColumnFamilies, scope,
+                    Collections.singleton( sourceShard ), Long.MAX_VALUE, SearchByEdgeType.Order.DESCENDING );
 
+            while ( edges.hasNext() ) {
+                final MarkedEdge edge = edges.next();
 
-    @Override
-    public AuditResult evaluateShardGroup( final ApplicationScope scope, final DirectedEdgeMeta edgeMeta,
-                                           final ShardEntryGroup group ) {
+                final long edgeTimestamp = edge.getTimestamp();
 
+                /**
+                 * The edge is within a different shard, break
+                 */
+                if ( edgeTimestamp < newShardPivot ) {
+                    break;
+                }
 
-        final double repairChance = random.nextDouble();
 
-        //don't repair
-        if ( repairChance > graphFig.getShardRepairChance() ) {
-            return AuditResult.NOT_CHECKED;
+                newRowBatch.mergeShallow(
+                        edgeMeta.writeEdge( shardedEdgeSerialization, edgeColumnFamilies, scope, targetShard, edge,
+                                timestamp ) );
+
+                deleteRowBatch.mergeShallow(
+                        edgeMeta.deleteEdge( shardedEdgeSerialization, edgeColumnFamilies, scope, sourceShard, edge,
+                                timestamp ) );
+
+                edgeCount++;
+
+                //if we're at our count, execute the mutation of writing the edges to the new row, then remove them
+                //from the old rows
+                if ( edgeCount % maxWorkSize == 0 ) {
+
+                    try {
+                        HystrixCassandra.async( newRowBatch );
+                        HystrixCassandra.async( deleteRowBatch );
+                    }
+                    catch ( Throwable t ) {
+                        LOG.error( "Unable to move edges from shard {} to shard {}", sourceShard, targetShard );
+                    }
+                }
+            }
         }
 
 
+        try {
+            HystrixCassandra.async( newRowBatch );
+            HystrixCassandra.async( deleteRowBatch );
+        }
+        catch ( Throwable t ) {
+            LOG.error( "Unable to move edges to target shard {}", targetShard );
+        }
+
+
+        LOG.info( "Finished compacting {} shards and moved {} edges", sourceShards, edgeCount );
+
+        resultBuilder.withCopiedEdges( edgeCount ).withSourceShards( sourceShards ).withTargetShard( targetShard );
+
         /**
-         * We don't have a compaction pending.  Run an audit on the shards
+         * We didn't move anything this pass, mark the shard as compacted.  If we move something, it means that we missed it on the first pass
+         * or someone is still not writing to the target shard only.
          */
-        if ( !group.isCompactionPending() ) {
+        if ( edgeCount == 0 ) {
 
-            /**
-             * Check if we should allocate, we may want to
-             */
 
+            //now that we've marked our target as compacted, we can successfully remove any shards that are not
+            // compacted themselves in the sources
+
+            final MutationBatch shardRemovalRollup = keyspace.prepareMutationBatch();
+
+            for ( Shard source : sourceShards ) {
+
+                //if we can't safely delete it, don't do so
+                if ( !group.canBeDeleted( source ) ) {
+                    continue;
+                }
 
-            final boolean created = nodeShardAllocation.auditShard( scope, group, edgeMeta );
+                LOG.info( "Source shards have been fully drained.  Removing shard {}", source );
 
+                final MutationBatch shardRemoval = edgeShardSerialization.removeShardMeta( scope, source, edgeMeta );
+                shardRemovalRollup.mergeShallow( shardRemoval );
 
-            if ( !created ) {
-                return AuditResult.CHECKED_NO_OP;
+                resultBuilder.withRemovedShard( source );
             }
 
 
-            return AuditResult.CHECKED_CREATED;
+            HystrixCassandra.async( shardRemovalRollup );
+
+
+            LOG.info( "Shard has been fully compacted.  Marking shard {} as compacted in Cassandra", targetShard );
+
+            //Overwrite our shard index with a newly created one that has been marked as compacted
+            Shard compactedShard = new Shard( targetShard.getShardIndex(), timeService.getCurrentTime(), true );
+            final MutationBatch updateMark = edgeShardSerialization.writeShardMeta( scope, compactedShard, edgeMeta );
+            HystrixCassandra.async( updateMark );
+
+            resultBuilder.withCompactedShard( compactedShard );
         }
 
-        //check our taskmanager
+        return resultBuilder.build();
+    }
 
 
+    @Override
+    public ListenableFuture<AuditResult> evaluateShardGroup( final ApplicationScope scope,
+                                                             final DirectedEdgeMeta edgeMeta,
+                                                             final ShardEntryGroup group ) {
+
+        final double repairChance = random.nextDouble();
+
+
+        //don't audit, we didn't hit our chance
+        if ( repairChance > graphFig.getShardRepairChance() ) {
+            return Futures.immediateFuture( AuditResult.NOT_CHECKED );
+        }
+
         /**
-         * Do the compaction
+         * Try and submit.  During back pressure, we may not be able to submit, that's ok.  Better to drop than to
+         * hose the system
          */
-        if ( group.shouldCompact( timeService.getCurrentTime() ) ) {
-            compact( scope, edgeMeta, group );
-            return AuditResult.COMPACTING;
-        }
+        ListenableFuture<AuditResult> future = executorService.submit( new Callable<AuditResult>() {
+            @Override
+            public AuditResult call() throws Exception {
+
+
+                /**
+                 * We don't have a compaction pending.  Run an audit on the shards
+                 */
+                if ( !group.isCompactionPending() ) {
+
+                    /**
+                     * Check if we should allocate, we may want to
+                     */
+
+                    /**
+                     * It's already compacting, don't do anything
+                     */
+                    if ( !shardAuditTaskTracker.canStartTask( scope, edgeMeta, group ) ) {
+                        return AuditResult.CHECKED_NO_OP;
+                    }
+
+                    try {
+
+                        final boolean created = nodeShardAllocation.auditShard( scope, group, edgeMeta );
+                        if ( !created ) {
+                            return AuditResult.CHECKED_NO_OP;
+                        }
+                    }
+                    finally {
+                        shardAuditTaskTracker.complete( scope, edgeMeta, group );
+                    }
+
+
+                    return AuditResult.CHECKED_CREATED;
+                }
+
+                //check our taskmanager
+
+
+                /**
+                 * Do the compaction
+                 */
+                if ( group.shouldCompact( timeService.getCurrentTime() ) ) {
+                    /**
+                     * It's already compacting, don't do anything
+                     */
+                    if ( !shardCompactionTaskTracker.canStartTask( scope, edgeMeta, group ) ) {
+                        return AuditResult.COMPACTING;
+                    }
+
+                    /**
+                     * We use a finally b/c we always want to remove the task track
+                     */
+                    try {
+                        CompactionResult result = compact( scope, edgeMeta, group );
+                        LOG.info( "Compaction result for compaction of scope {} with edge meta data of {} and shard group {} is {}", new Object[]{scope, edgeMeta, group, result} );
+                    }
+                    finally {
+                        shardCompactionTaskTracker.complete( scope, edgeMeta, group );
+                    }
+                    return AuditResult.COMPACTED;
+                }
+
+                //no op, there's nothing we need to do to this shard
+                return AuditResult.NOT_CHECKED;
+            }
+        } );
+
+        /**
+         * Log our success or failures for debugging purposes
+         */
+        Futures.addCallback( future, new FutureCallback<AuditResult>() {
+            @Override
+            public void onSuccess( @Nullable final AuditResult result ) {
+                LOG.debug( "Successfully completed audit of task {}", result );
+            }
 
-        //no op, there's nothing we need to do to this shard
-        return AuditResult.NOT_CHECKED;
+
+            @Override
+            public void onFailure( final Throwable t ) {
+                LOG.error( "Unable to perform audit.  Exception is ", t );
+            }
+        } );
+
+        return future;
     }
 
 
-    private static final class ShardCompactionTaskTracker {
-        private BitSet runningTasks = new BitSet();
+    /**
+     * Inner class used to track running tasks per instance
+     */
+    private static abstract class TaskTracker {
+
+        private static final Boolean TRUE = true;
+
+        private ConcurrentHashMap<Long, Boolean> runningTasks = new ConcurrentHashMap<>();
 
 
         /**
          * Sets this data into our scope to signal it's running to stop other threads from attempting to run
-         * @param scope
-         * @param edgeMeta
-         * @param group
-         * @return
          */
-        public boolean shouldStartCompaction( final ApplicationScope scope, final DirectedEdgeMeta edgeMeta,
+        public boolean canStartTask( final ApplicationScope scope, final DirectedEdgeMeta edgeMeta,
                                      ShardEntryGroup group ) {
-            final int hash = doHash( scope, edgeMeta, group ).asInt();
+            final Long hash = doHash( scope, edgeMeta, group ).hash().asLong();
 
-            if(runningTasks.get( hash )){
-                return false;
-            }
-
-            runningTasks.set( hash );
+            final Boolean returned = runningTasks.putIfAbsent( hash, TRUE );
 
-            return true;
+            /**
+             * Someone already put the value
+             */
+            return returned == null;
         }
 
 
         /**
          * Mark this entry group as complete
-         * @param scope
-         * @param edgeMeta
-         * @param group
          */
-        public void complete( final ApplicationScope scope, final DirectedEdgeMeta edgeMeta,
-                                             ShardEntryGroup group ) {
-            final int hash = doHash( scope, edgeMeta, group ).asInt();
-            runningTasks.clear( hash );
+        public void complete( final ApplicationScope scope, final DirectedEdgeMeta edgeMeta, ShardEntryGroup group ) {
+            final long hash = doHash( scope, edgeMeta, group ).hash().asLong();
+            runningTasks.remove( hash );
         }
 
 
+        protected abstract Hasher doHash( final ApplicationScope scope, final DirectedEdgeMeta directedEdgeMeta,
+                                          final ShardEntryGroup shardEntryGroup );
+    }
+
+
+    /**
+     * Task tracker for shard compaction
+     */
+    private static final class ShardCompactionTaskTracker extends ShardAuditTaskTracker {
+
         /**
          * Hash our data into a consistent long
-         * @param scope
-         * @param directedEdgeMeta
-         * @param shardEntryGroup
-         * @return
          */
-        private HashCode doHash( final ApplicationScope scope, final DirectedEdgeMeta directedEdgeMeta,
+        protected Hasher doHash( final ApplicationScope scope, final DirectedEdgeMeta directedEdgeMeta,
+                                 final ShardEntryGroup shardEntryGroup ) {
+
+            final Hasher hasher = super.doHash( scope, directedEdgeMeta, shardEntryGroup );
+
+            //add our compaction target to the hash
+            final Shard compactionTarget = shardEntryGroup.getCompactionTarget();
+
+            hasher.putLong( compactionTarget.getShardIndex() );
+
+
+            return hasher;
+        }
+    }
+
+
+    /**
+     * Task tracker for shard audit
+     */
+    private static class ShardAuditTaskTracker extends TaskTracker {
+
+        /**
+         * Hash our data into a consistent long
+         */
+        protected Hasher doHash( final ApplicationScope scope, final DirectedEdgeMeta directedEdgeMeta,
                                  final ShardEntryGroup shardEntryGroup ) {
 
             final Hasher hasher = MURMUR_128.newHasher();
@@ -273,35 +478,141 @@ public class ShardGroupCompactionImpl implements ShardGroupCompaction {
             }
 
             //add our compaction target to the hash
-            final Shard compactionTarget = shardEntryGroup.getCompactionTarget();
 
-            hasher.putLong( compactionTarget.getShardIndex() );
 
-
-            return hasher.hash();
+            return hasher;
         }
 
 
-        private void addToHash( final Hasher hasher, final Id id ) {
+        protected void addToHash( final PrimitiveSink into, final Id id ) {
 
             final UUID nodeUuid = id.getUuid();
             final String nodeType = id.getType();
 
-            hasher.putLong( nodeUuid.getMostSignificantBits() ).putLong( nodeUuid.getLeastSignificantBits() )
-                  .putString( nodeType, CHARSET );
+            into.putLong( nodeUuid.getMostSignificantBits() ).putLong( nodeUuid.getLeastSignificantBits() )
+                .putString( nodeType, CHARSET );
+        }
+    }
+
+
+    /**
+     * Create a thread pool that will reject work if our audit tasks become overwhelmed
+     */
+    private final class MaxSizeThreadPool extends ThreadPoolExecutor {
+
+        public MaxSizeThreadPool( final int workerSize, final int queueLength ) {
+            super( 1, workerSize, 30, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>( queueLength ),
+                    new CompactionThreadFactory(), new RejectionLogger() );
+        }
+    }
+
+
+    private final class CompactionThreadFactory implements ThreadFactory {
+
+        private final AtomicLong threadCounter = new AtomicLong();
+
+
+        @Override
+        public Thread newThread( final Runnable r ) {
+            final long newValue = threadCounter.incrementAndGet();
+
+            return new Thread( r, "Graph-Shard-Compaction-" + newValue );
         }
     }
 
-    private enum StartResult{
-        /**
-         * Returned if the compaction was started
-         */
 
-        STARTED,
+    private final class RejectionLogger implements RejectedExecutionHandler {
+
+
+        @Override
+        public void rejectedExecution( final Runnable r, final ThreadPoolExecutor executor ) {
+            LOG.warn( "Audit queue full, rejecting audit task {}", r );
+        }
+    }
+
+
+
+    public static final class CompactionResult {
+
+        public final long copiedEdges;
+        public final Shard targetShard;
+        public final Set<Shard> sourceShards;
+        public final Set<Shard> removedShards;
+        public final Shard compactedShard;
+
+
+
+        private CompactionResult( final long copiedEdges, final Shard targetShard, final Set<Shard> sourceShards,
+                                  final Set<Shard> removedShards, final Shard compactedShard ) {
+            this.copiedEdges = copiedEdges;
+            this.targetShard = targetShard;
+            this.compactedShard = compactedShard;
+            this.sourceShards = Collections.unmodifiableSet( sourceShards );
+            this.removedShards = Collections.unmodifiableSet( removedShards );
+        }
+
 
         /**
-         * Returned if we are running the compaction
+         * Create a builder to use to create the result
          */
-        RUNNING;
+        public static CompactionBuilder builder() {
+            return new CompactionBuilder();
+        }
+
+
+        @Override
+        public String toString() {
+            return "CompactionResult{" +
+                    "copiedEdges=" + copiedEdges +
+                    ", targetShard=" + targetShard +
+                    ", sourceShards=" + sourceShards +
+                    ", removedShards=" + removedShards +
+                    ", compactedShard=" + compactedShard +
+                    '}';
+        }
+
+
+        public static final class CompactionBuilder {
+            private long copiedEdges;
+            private Shard targetShard;
+            private Set<Shard> sourceShards;
+            private Set<Shard> removedShards = new HashSet<>();
+            private Shard compactedShard;
+
+
+            public CompactionBuilder withCopiedEdges( final long copiedEdges ) {
+                this.copiedEdges = copiedEdges;
+                return this;
+            }
+
+
+            public CompactionBuilder withTargetShard( final Shard targetShard ) {
+                this.targetShard = targetShard;
+                return this;
+            }
+
+
+            public CompactionBuilder withSourceShards( final Set<Shard> sourceShards ) {
+                this.sourceShards = sourceShards;
+                return this;
+            }
+
+
+            public CompactionBuilder withRemovedShard( final Shard removedShard ) {
+                this.removedShards.add( removedShard );
+                return this;
+            }
+
+
+            public CompactionBuilder withCompactedShard( final Shard compactedShard ) {
+                this.compactedShard = compactedShard;
+                return this;
+            }
+
+
+            public CompactionResult build() {
+                return new CompactionResult( copiedEdges, targetShard, sourceShards, removedShards, compactedShard );
+            }
+        }
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardedEdgeSerializationImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardedEdgeSerializationImpl.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardedEdgeSerializationImpl.java
index 030e4a7..b0523e1 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardedEdgeSerializationImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardedEdgeSerializationImpl.java
@@ -22,9 +22,11 @@ package org.apache.usergrid.persistence.graph.serialization.impl.shard.impl;
 
 
 import java.util.Collection;
+import java.util.Comparator;
 import java.util.Iterator;
 import java.util.UUID;
 
+import javax.annotation.Nullable;
 import javax.inject.Inject;
 
 import org.apache.usergrid.persistence.core.astyanax.CassandraConfig;
@@ -49,9 +51,16 @@ import org.apache.usergrid.persistence.graph.serialization.impl.shard.RowKey;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.RowKeyType;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.Shard;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.ShardedEdgeSerialization;
+import org.apache.usergrid.persistence.graph.serialization.impl.shard.impl.comparators.DescendingTimestampComparator;
+import org.apache.usergrid.persistence.graph.serialization.impl.shard.impl.comparators.OrderedComparator;
+import org.apache.usergrid.persistence.graph.serialization.impl.shard.impl.comparators
+        .SourceDirectedEdgeDescendingComparator;
+import org.apache.usergrid.persistence.graph.serialization.impl.shard.impl.comparators
+        .TargetDirectedEdgeDescendingComparator;
 import org.apache.usergrid.persistence.graph.serialization.util.GraphValidation;
 import org.apache.usergrid.persistence.model.entity.Id;
 
+import com.google.common.base.Function;
 import com.google.common.base.Optional;
 import com.google.inject.Singleton;
 import com.netflix.astyanax.Keyspace;
@@ -256,6 +265,7 @@ public class ShardedEdgeSerializationImpl implements ShardedEdgeSerialization {
                             final Shard shard, final boolean isDeleted ) {
 
                 batch.withRow( columnFamily, ScopedRowKey.fromKey( scope, rowKey ) ).deleteColumn( edge );
+                writeEdgeShardStrategy.increment( scope, shard, -1, directedEdgeMeta );
             }
         }.createBatch( scope, shards, timestamp );
     }
@@ -278,6 +288,7 @@ public class ShardedEdgeSerializationImpl implements ShardedEdgeSerialization {
 
                 batch.withRow( columnFamilies.getSourceNodeTargetTypeCfName(), ScopedRowKey.fromKey( scope, rowKey ) )
                      .deleteColumn( edge );
+                writeEdgeShardStrategy.increment( scope, shard, -1, directedEdgeMeta );
             }
         }.createBatch( scope, shards, timestamp );
     }
@@ -297,6 +308,7 @@ public class ShardedEdgeSerializationImpl implements ShardedEdgeSerialization {
                             final Shard shard, final boolean isDeleted ) {
 
                 batch.withRow( columnFamily, ScopedRowKey.fromKey( scope, rowKey ) ).deleteColumn( edge );
+                writeEdgeShardStrategy.increment( scope, shard, -1, directedEdgeMeta );
             }
         }.createBatch( scope, shards, timestamp );
     }
@@ -319,6 +331,7 @@ public class ShardedEdgeSerializationImpl implements ShardedEdgeSerialization {
 
                 batch.withRow( columnFamilies.getTargetNodeSourceTypeCfName(), ScopedRowKey.fromKey( scope, rowKey ) )
                      .deleteColumn( edge );
+                writeEdgeShardStrategy.increment( scope, shard, -1, directedEdgeMeta );
             }
         }.createBatch( scope, shards, timestamp );
     }
@@ -338,6 +351,7 @@ public class ShardedEdgeSerializationImpl implements ShardedEdgeSerialization {
                             final boolean isDeleted ) {
                 batch.withRow( columnFamilies.getGraphEdgeVersions(), ScopedRowKey.fromKey( scope, rowKey ) )
                      .deleteColumn( column );
+                writeEdgeShardStrategy.increment( scope, shard, -1, directedEdgeMeta );
             }
         }.createBatch( scope, shards, timestamp );
     }
@@ -357,8 +371,16 @@ public class ShardedEdgeSerializationImpl implements ShardedEdgeSerialization {
                 columnFamilies.getGraphEdgeVersions();
         final Serializer<Long> serializer = columnFamily.getColumnSerializer();
 
+
+        final OrderedComparator<MarkedEdge> comparator = new OrderedComparator<>( DescendingTimestampComparator.INSTANCE, search.getOrder());
+
+
+
+
         final EdgeSearcher<EdgeRowKey, Long, MarkedEdge> searcher =
-                new EdgeSearcher<EdgeRowKey, Long, MarkedEdge>( scope, maxTimestamp, search.last(), shards ) {
+                new EdgeSearcher<EdgeRowKey, Long, MarkedEdge>( scope, shards, search.getOrder(),  comparator, maxTimestamp,
+                        search.last().transform( TRANSFORM ) ) {
+
 
                     @Override
                     protected Serializer<Long> getSerializer() {
@@ -367,11 +389,11 @@ public class ShardedEdgeSerializationImpl implements ShardedEdgeSerialization {
 
 
                     @Override
-                    public void setRange( final RangeBuilder builder ) {
+                    public void buildRange( final RangeBuilder builder ) {
 
 
                         if ( last.isPresent() ) {
-                            super.setRange( builder );
+                            super.buildRange( builder );
                             return;
                         }
 
@@ -387,7 +409,7 @@ public class ShardedEdgeSerializationImpl implements ShardedEdgeSerialization {
 
 
                     @Override
-                    protected Long getStartColumn( final Edge last ) {
+                    protected Long createColumn( final MarkedEdge last ) {
                         return last.getTimestamp();
                     }
 
@@ -398,10 +420,7 @@ public class ShardedEdgeSerializationImpl implements ShardedEdgeSerialization {
                     }
 
 
-                    @Override
-                    public int compare( final MarkedEdge o1, final MarkedEdge o2 ) {
-                        return Long.compare( o1.getTimestamp(), o2.getTimestamp() );
-                    }
+
                 };
 
         return new ShardsColumnIterator<>( searcher, columnFamily, keyspace, cassandraConfig.getReadCL(),
@@ -411,23 +430,27 @@ public class ShardedEdgeSerializationImpl implements ShardedEdgeSerialization {
 
     @Override
     public Iterator<MarkedEdge> getEdgesFromSource( final EdgeColumnFamilies columnFamilies,
-                                                    final ApplicationScope scope, final SearchByEdgeType edgeType,
+                                                    final ApplicationScope scope, final SearchByEdgeType search,
                                                     final Collection<Shard> shards ) {
 
         ValidationUtils.validateApplicationScope( scope );
-        GraphValidation.validateSearchByEdgeType( edgeType );
+        GraphValidation.validateSearchByEdgeType( search );
 
-        final Id sourceId = edgeType.getNode();
-        final String type = edgeType.getType();
-        final long maxTimestamp = edgeType.getMaxTimestamp();
+        final Id sourceId = search.getNode();
+        final String type = search.getType();
+        final long maxTimestamp = search.getMaxTimestamp();
         final MultiTennantColumnFamily<ApplicationScope, RowKey, DirectedEdge> columnFamily =
                 columnFamilies.getSourceNodeCfName();
         final Serializer<DirectedEdge> serializer = columnFamily.getColumnSerializer();
 
 
-        final SourceEdgeSearcher<RowKey, DirectedEdge, MarkedEdge> searcher =
-                new SourceEdgeSearcher<RowKey, DirectedEdge, MarkedEdge>( scope, maxTimestamp, edgeType.last(),
-                        shards ) {
+        final OrderedComparator<MarkedEdge> comparator = new OrderedComparator<>( TargetDirectedEdgeDescendingComparator.INSTANCE, search.getOrder());
+
+
+
+        final EdgeSearcher<RowKey, DirectedEdge, MarkedEdge> searcher =
+                new EdgeSearcher<RowKey, DirectedEdge, MarkedEdge>( scope, shards, search.getOrder(), comparator, maxTimestamp,
+                        search.last().transform( TRANSFORM ) ) {
 
 
                     @Override
@@ -443,7 +466,7 @@ public class ShardedEdgeSerializationImpl implements ShardedEdgeSerialization {
 
 
                     @Override
-                    protected DirectedEdge getStartColumn( final Edge last ) {
+                    protected DirectedEdge createColumn( final MarkedEdge last ) {
                         return new DirectedEdge( last.getTargetNode(), last.getTimestamp() );
                     }
 
@@ -463,24 +486,26 @@ public class ShardedEdgeSerializationImpl implements ShardedEdgeSerialization {
     @Override
     public Iterator<MarkedEdge> getEdgesFromSourceByTargetType( final EdgeColumnFamilies columnFamilies,
                                                                 final ApplicationScope scope,
-                                                                final SearchByIdType edgeType,
+                                                                final SearchByIdType search,
                                                                 final Collection<Shard> shards ) {
 
         ValidationUtils.validateApplicationScope( scope );
-        GraphValidation.validateSearchByEdgeType( edgeType );
+        GraphValidation.validateSearchByEdgeType( search );
 
-        final Id targetId = edgeType.getNode();
-        final String type = edgeType.getType();
-        final String targetType = edgeType.getIdType();
-        final long maxTimestamp = edgeType.getMaxTimestamp();
+        final Id targetId = search.getNode();
+        final String type = search.getType();
+        final String targetType = search.getIdType();
+        final long maxTimestamp = search.getMaxTimestamp();
         final MultiTennantColumnFamily<ApplicationScope, RowKeyType, DirectedEdge> columnFamily =
                 columnFamilies.getSourceNodeTargetTypeCfName();
         final Serializer<DirectedEdge> serializer = columnFamily.getColumnSerializer();
 
+        final OrderedComparator<MarkedEdge> comparator = new OrderedComparator<>( TargetDirectedEdgeDescendingComparator.INSTANCE, search.getOrder());
+
 
-        final SourceEdgeSearcher<RowKeyType, DirectedEdge, MarkedEdge> searcher =
-                new SourceEdgeSearcher<RowKeyType, DirectedEdge, MarkedEdge>( scope, maxTimestamp, edgeType.last(),
-                        shards ) {
+        final EdgeSearcher<RowKeyType, DirectedEdge, MarkedEdge> searcher =
+                new EdgeSearcher<RowKeyType, DirectedEdge, MarkedEdge>( scope, shards, search.getOrder(), comparator, maxTimestamp,
+                        search.last().transform( TRANSFORM ) ) {
 
                     @Override
                     protected Serializer<DirectedEdge> getSerializer() {
@@ -495,7 +520,7 @@ public class ShardedEdgeSerializationImpl implements ShardedEdgeSerialization {
 
 
                     @Override
-                    protected DirectedEdge getStartColumn( final Edge last ) {
+                    protected DirectedEdge createColumn( final MarkedEdge last ) {
                         return new DirectedEdge( last.getTargetNode(), last.getTimestamp() );
                     }
 
@@ -513,20 +538,22 @@ public class ShardedEdgeSerializationImpl implements ShardedEdgeSerialization {
 
     @Override
     public Iterator<MarkedEdge> getEdgesToTarget( final EdgeColumnFamilies columnFamilies, final ApplicationScope scope,
-                                                  final SearchByEdgeType edgeType, final Collection<Shard> shards ) {
+                                                  final SearchByEdgeType search, final Collection<Shard> shards ) {
         ValidationUtils.validateApplicationScope( scope );
-        GraphValidation.validateSearchByEdgeType( edgeType );
+        GraphValidation.validateSearchByEdgeType( search );
 
-        final Id targetId = edgeType.getNode();
-        final String type = edgeType.getType();
-        final long maxTimestamp = edgeType.getMaxTimestamp();
+        final Id targetId = search.getNode();
+        final String type = search.getType();
+        final long maxTimestamp = search.getMaxTimestamp();
         final MultiTennantColumnFamily<ApplicationScope, RowKey, DirectedEdge> columnFamily =
                 columnFamilies.getTargetNodeCfName();
         final Serializer<DirectedEdge> serializer = columnFamily.getColumnSerializer();
 
-        final TargetEdgeSearcher<RowKey, DirectedEdge, MarkedEdge> searcher =
-                new TargetEdgeSearcher<RowKey, DirectedEdge, MarkedEdge>( scope, maxTimestamp, edgeType.last(),
-                        shards ) {
+        final OrderedComparator<MarkedEdge> comparator = new OrderedComparator<>( SourceDirectedEdgeDescendingComparator.INSTANCE, search.getOrder());
+
+        final EdgeSearcher<RowKey, DirectedEdge, MarkedEdge> searcher =
+                new EdgeSearcher<RowKey, DirectedEdge, MarkedEdge>( scope, shards, search.getOrder(),comparator,  maxTimestamp,
+                        search.last().transform( TRANSFORM ) ) {
 
                     @Override
                     protected Serializer<DirectedEdge> getSerializer() {
@@ -541,7 +568,7 @@ public class ShardedEdgeSerializationImpl implements ShardedEdgeSerialization {
 
 
                     @Override
-                    protected DirectedEdge getStartColumn( final Edge last ) {
+                    protected DirectedEdge createColumn( final MarkedEdge last ) {
                         return new DirectedEdge( last.getSourceNode(), last.getTimestamp() );
                     }
 
@@ -561,24 +588,26 @@ public class ShardedEdgeSerializationImpl implements ShardedEdgeSerialization {
     @Override
     public Iterator<MarkedEdge> getEdgesToTargetBySourceType( final EdgeColumnFamilies columnFamilies,
                                                               final ApplicationScope scope,
-                                                              final SearchByIdType edgeType,
+                                                              final SearchByIdType search,
                                                               final Collection<Shard> shards ) {
 
         ValidationUtils.validateApplicationScope( scope );
-        GraphValidation.validateSearchByEdgeType( edgeType );
+        GraphValidation.validateSearchByEdgeType( search );
 
-        final Id targetId = edgeType.getNode();
-        final String sourceType = edgeType.getIdType();
-        final String type = edgeType.getType();
-        final long maxTimestamp = edgeType.getMaxTimestamp();
+        final Id targetId = search.getNode();
+        final String sourceType = search.getIdType();
+        final String type = search.getType();
+        final long maxTimestamp = search.getMaxTimestamp();
         final MultiTennantColumnFamily<ApplicationScope, RowKeyType, DirectedEdge> columnFamily =
                 columnFamilies.getTargetNodeSourceTypeCfName();
         final Serializer<DirectedEdge> serializer = columnFamily.getColumnSerializer();
 
+        final OrderedComparator<MarkedEdge> comparator = new OrderedComparator<>( SourceDirectedEdgeDescendingComparator.INSTANCE, search.getOrder());
+
 
-        final TargetEdgeSearcher<RowKeyType, DirectedEdge, MarkedEdge> searcher =
-                new TargetEdgeSearcher<RowKeyType, DirectedEdge, MarkedEdge>( scope, maxTimestamp, edgeType.last(),
-                        shards ) {
+        final EdgeSearcher<RowKeyType, DirectedEdge, MarkedEdge> searcher =
+                new EdgeSearcher<RowKeyType, DirectedEdge, MarkedEdge>( scope, shards, search.getOrder(), comparator, maxTimestamp,
+                        search.last().transform( TRANSFORM ) ) {
                     @Override
                     protected Serializer<DirectedEdge> getSerializer() {
                         return serializer;
@@ -592,7 +621,7 @@ public class ShardedEdgeSerializationImpl implements ShardedEdgeSerialization {
 
 
                     @Override
-                    protected DirectedEdge getStartColumn( final Edge last ) {
+                    protected DirectedEdge createColumn( final MarkedEdge last ) {
                         return new DirectedEdge( last.getTargetNode(), last.getTimestamp() );
                     }
 
@@ -608,51 +637,8 @@ public class ShardedEdgeSerializationImpl implements ShardedEdgeSerialization {
     }
 
 
-    /**
-     * Class for performing searched on rows based on source id
-     */
-    private static abstract class SourceEdgeSearcher<R, C, T extends Edge> extends EdgeSearcher<R, C, T> {
-
-        protected SourceEdgeSearcher( final ApplicationScope scope, final long maxTimestamp, final Optional<Edge> last,
-                                      final Collection<Shard> shards ) {
-            super( scope, maxTimestamp, last, shards );
-        }
 
 
-        public int compare( final T o1, final T o2 ) {
-            int compare = Long.compare( o1.getTimestamp(), o2.getTimestamp() );
-
-            if ( compare == 0 ) {
-                compare = o1.getTargetNode().compareTo( o2.getTargetNode() );
-            }
-
-            return compare;
-        }
-    }
-
-
-    /**
-     * Class for performing searched on rows based on target id
-     */
-    private static abstract class TargetEdgeSearcher<R, C, T extends Edge> extends EdgeSearcher<R, C, T> {
-
-        protected TargetEdgeSearcher( final ApplicationScope scope, final long maxTimestamp, final Optional<Edge> last,
-                                      final Collection<Shard> shards ) {
-            super( scope, maxTimestamp, last, shards );
-        }
-
-
-        public int compare( final T o1, final T o2 ) {
-            int compare = Long.compare( o1.getTimestamp(), o2.getTimestamp() );
-
-            if ( compare == 0 ) {
-                compare = o1.getTargetNode().compareTo( o2.getTargetNode() );
-            }
-
-            return compare;
-        }
-    }
-
 
     /**
      * Simple callback to perform puts and deletes with a common row setup code
@@ -994,4 +980,27 @@ public class ShardedEdgeSerializationImpl implements ShardedEdgeSerialization {
             return isDeleted;
         }
     }
+
+
+
+
+
+
+    private static final Function<Edge, MarkedEdge> TRANSFORM = new Function<Edge, MarkedEdge>() {
+        @Nullable
+        @Override
+        public MarkedEdge apply( @Nullable final Edge input ) {
+
+            if ( input == null ) {
+                return null;
+            }
+
+            if ( input instanceof MarkedEdge ) {
+                return ( MarkedEdge ) input;
+            }
+
+            return new SimpleMarkedEdge( input.getSourceNode(), input.getType(), input.getTargetNode(),
+                    input.getTimestamp(), false );
+        }
+    };
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardsColumnIterator.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardsColumnIterator.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardsColumnIterator.java
index 0c7e5b5..d99d98b 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardsColumnIterator.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardsColumnIterator.java
@@ -8,6 +8,7 @@ import java.util.NoSuchElementException;
 
 import org.apache.usergrid.persistence.core.astyanax.ColumnNameIterator;
 import org.apache.usergrid.persistence.core.astyanax.MultiKeyColumnNameIterator;
+import org.apache.usergrid.persistence.core.astyanax.MultiRowColumnIterator;
 import org.apache.usergrid.persistence.core.astyanax.MultiTennantColumnFamily;
 import org.apache.usergrid.persistence.core.astyanax.ScopedRowKey;
 import org.apache.usergrid.persistence.core.scope.ApplicationScope;
@@ -86,6 +87,7 @@ public class ShardsColumnIterator<R, C, T> implements Iterator<T> {
      */
     private void startIterator() {
 
+
         /**
          * If the edge is present, we need to being seeking from this
          */
@@ -94,7 +96,9 @@ public class ShardsColumnIterator<R, C, T> implements Iterator<T> {
 
 
         //set the range into the search
-        searcher.setRange( rangeBuilder );
+        searcher.buildRange( rangeBuilder );
+
+
 
         /**
          * Get our list of slices
@@ -102,27 +106,22 @@ public class ShardsColumnIterator<R, C, T> implements Iterator<T> {
         final List<ScopedRowKey<ApplicationScope, R>> rowKeys = searcher.getRowKeys();
 
 
-        final List<ColumnNameIterator<C, T>> columnNameIterators = new ArrayList<>( rowKeys.size() );
-
-        for(ScopedRowKey<ApplicationScope, R> rowKey: rowKeys){
-
+        if(rowKeys.size() == 1){
 
+            final  RowQuery<ScopedRowKey<ApplicationScope, R>, C> query =
+                           keyspace.prepareQuery( cf ).setConsistencyLevel( consistencyLevel ).getKey( rowKeys.get( 0 ) )
+                                   .autoPaginate( true ).withColumnRange( rangeBuilder.build() );
 
-           final  RowQuery<ScopedRowKey<ApplicationScope, R>, C> query =
-                    keyspace.prepareQuery( cf ).setConsistencyLevel( consistencyLevel ).getKey( rowKey )
-                            .autoPaginate( true ).withColumnRange( rangeBuilder.build() );
-
-
-            final ColumnNameIterator<C, T> columnNameIterator = new ColumnNameIterator<>( query, searcher, searcher.hasPage() );
+            currentColumnIterator = new ColumnNameIterator<>( query, searcher, searcher.hasPage() );
+        }
 
-            columnNameIterators.add( columnNameIterator );
+        else{
 
+            currentColumnIterator = new MultiRowColumnIterator<>( keyspace, cf,  consistencyLevel, searcher, searcher, searcher.getComparator(), rowKeys, pageSize);
         }
 
 
 
-        currentColumnIterator = new MultiKeyColumnNameIterator<>(columnNameIterators, searcher, pageSize);
-
 
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/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 9050b0a..ddd514b 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
@@ -37,6 +37,10 @@ import org.apache.usergrid.persistence.graph.serialization.impl.shard.EdgeColumn
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.EdgeRowKey;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.RowKey;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.RowKeyType;
+import org.apache.usergrid.persistence.graph.serialization.impl.shard.impl.serialize.EdgeRowKeySerializer;
+import org.apache.usergrid.persistence.graph.serialization.impl.shard.impl.serialize.EdgeSerializer;
+import org.apache.usergrid.persistence.graph.serialization.impl.shard.impl.serialize.RowSerializer;
+import org.apache.usergrid.persistence.graph.serialization.impl.shard.impl.serialize.RowTypeSerializer;
 
 import com.netflix.astyanax.serializers.LongSerializer;
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/comparators/DescendingTimestampComparator.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/comparators/DescendingTimestampComparator.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/comparators/DescendingTimestampComparator.java
new file mode 100644
index 0000000..6e52dd5
--- /dev/null
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/comparators/DescendingTimestampComparator.java
@@ -0,0 +1,43 @@
+/*
+ *
+ *  * 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.graph.serialization.impl.shard.impl.comparators;
+
+
+import java.util.Comparator;
+
+import org.apache.usergrid.persistence.graph.MarkedEdge;
+
+
+/**
+ * Sorts longs from high to low.  High is "less than" the low values;
+ *
+ */
+public class DescendingTimestampComparator implements Comparator<MarkedEdge> {
+
+    public static final DescendingTimestampComparator INSTANCE = new DescendingTimestampComparator();
+
+
+    @Override
+    public int compare( final MarkedEdge o1, final MarkedEdge o2 ) {
+        return Long.compare( o1.getTimestamp(), o2.getTimestamp() )*-1;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/comparators/DirectedEdgeDescendingComparator.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/comparators/DirectedEdgeDescendingComparator.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/comparators/DirectedEdgeDescendingComparator.java
new file mode 100644
index 0000000..6ff65cb
--- /dev/null
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/comparators/DirectedEdgeDescendingComparator.java
@@ -0,0 +1,69 @@
+/*
+ *
+ *  * 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.graph.serialization.impl.shard.impl.comparators;
+
+
+import java.util.Comparator;
+import java.util.UUID;
+
+import org.apache.usergrid.persistence.graph.MarkedEdge;
+import org.apache.usergrid.persistence.model.entity.Id;
+
+import com.fasterxml.uuid.UUIDComparator;
+import com.fasterxml.uuid.impl.UUIDUtil;
+
+
+/**
+ * Comparator for comparing edges in descending order.  The first comparison is the timestamp,
+ * highest value should be first, so is considered "less".  If those are equal, the UUIId is compared.
+ * this will return the UUID to compare.  It will first be descending UUID, then ascending name
+ *
+ */
+public abstract class DirectedEdgeDescendingComparator implements Comparator<MarkedEdge> {
+
+    @Override
+    public int compare( final MarkedEdge first, final MarkedEdge second ) {
+
+        int compare = Long.compare( first.getTimestamp(), second.getTimestamp() ) * -1;
+
+        if(compare == 0){
+            final Id firstId = getId( first );
+            final Id secondId = getId( second );
+
+            compare = UUIDComparator.staticCompare( firstId.getUuid(), secondId.getUuid() ) * -1;
+
+            if(compare == 0){
+                compare = firstId.getType().compareTo( secondId.getType() );
+            }
+        }
+
+        return compare;
+    }
+
+
+    /**
+     * Return the Id to be used in the comparison
+     * @param edge
+     * @return
+     */
+    protected abstract Id getId(final MarkedEdge edge);
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/comparators/OrderedComparator.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/comparators/OrderedComparator.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/comparators/OrderedComparator.java
new file mode 100644
index 0000000..003ed36
--- /dev/null
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/comparators/OrderedComparator.java
@@ -0,0 +1,52 @@
+/*
+ *
+ *  * 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.graph.serialization.impl.shard.impl.comparators;
+
+
+import java.util.Comparator;
+
+import org.apache.usergrid.persistence.graph.SearchByEdgeType;
+
+
+/**
+ * Comparator that will compare in reverse or forward order based on the order type specified.
+ *
+ * Assumes descending uses the default order.  If ASCENDING, the result of the comparator will be reversed
+ */
+public class OrderedComparator<T> implements Comparator<T> {
+
+
+    private final int invert;
+    private final Comparator<T> delegate;
+
+
+    public OrderedComparator( final Comparator<T> delegate, final SearchByEdgeType.Order order ) {
+        this.invert = order == SearchByEdgeType.Order.DESCENDING ? 1 : -1;
+        this.delegate = delegate;
+    }
+
+
+    @Override
+    public int compare( final T o1, final T o2 ) {
+        return delegate.compare( o1, o2 ) * invert;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/comparators/SourceDirectedEdgeDescendingComparator.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/comparators/SourceDirectedEdgeDescendingComparator.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/comparators/SourceDirectedEdgeDescendingComparator.java
new file mode 100644
index 0000000..f067006
--- /dev/null
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/comparators/SourceDirectedEdgeDescendingComparator.java
@@ -0,0 +1,42 @@
+/*
+ *
+ *  * 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.graph.serialization.impl.shard.impl.comparators;
+
+
+import org.apache.usergrid.persistence.graph.MarkedEdge;
+import org.apache.usergrid.persistence.model.entity.Id;
+
+
+/**
+ *
+ * Comparator that uses source Id for comparisons.  Newer times will be "greater".  Newer uuids will be first.
+ *
+ */
+public class SourceDirectedEdgeDescendingComparator extends DirectedEdgeDescendingComparator {
+
+    public static final SourceDirectedEdgeDescendingComparator INSTANCE = new SourceDirectedEdgeDescendingComparator();
+
+    @Override
+    protected Id getId( final MarkedEdge edge ) {
+        return edge.getSourceNode();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/comparators/TargetDirectedEdgeDescendingComparator.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/comparators/TargetDirectedEdgeDescendingComparator.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/comparators/TargetDirectedEdgeDescendingComparator.java
new file mode 100644
index 0000000..115a874
--- /dev/null
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/comparators/TargetDirectedEdgeDescendingComparator.java
@@ -0,0 +1,42 @@
+/*
+ *
+ *  * 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.graph.serialization.impl.shard.impl.comparators;
+
+
+import org.apache.usergrid.persistence.graph.MarkedEdge;
+import org.apache.usergrid.persistence.model.entity.Id;
+
+
+/**
+ *
+ * Comparator that uses source Id for comparisons.  Newer time uuids will be first.
+ *
+ */
+public class TargetDirectedEdgeDescendingComparator extends DirectedEdgeDescendingComparator {
+
+    public static final TargetDirectedEdgeDescendingComparator INSTANCE = new TargetDirectedEdgeDescendingComparator();
+
+    @Override
+    protected Id getId( final MarkedEdge edge ) {
+        return edge.getTargetNode();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/serialize/EdgeRowKeySerializer.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/serialize/EdgeRowKeySerializer.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/serialize/EdgeRowKeySerializer.java
new file mode 100644
index 0000000..f1ae90b
--- /dev/null
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/serialize/EdgeRowKeySerializer.java
@@ -0,0 +1,63 @@
+/*
+ * 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.graph.serialization.impl.shard.impl.serialize;
+
+
+import org.apache.usergrid.persistence.core.astyanax.CompositeFieldSerializer;
+import org.apache.usergrid.persistence.core.astyanax.IdRowCompositeSerializer;
+import org.apache.usergrid.persistence.graph.serialization.impl.shard.EdgeRowKey;
+import org.apache.usergrid.persistence.model.entity.Id;
+
+import com.netflix.astyanax.model.CompositeBuilder;
+import com.netflix.astyanax.model.CompositeParser;
+
+
+/**
+ * Class to perform serialization for row keys from edges
+ */
+
+public class EdgeRowKeySerializer implements CompositeFieldSerializer<EdgeRowKey> {
+
+    private static final IdRowCompositeSerializer ID_SER = IdRowCompositeSerializer.get();
+
+
+    @Override
+    public void toComposite( final CompositeBuilder builder, final EdgeRowKey key ) {
+
+        //add the row id to the composite
+        ID_SER.toComposite( builder, key.sourceId );
+        builder.addString( key.edgeType );
+        ID_SER.toComposite( builder, key.targetId );
+        builder.addLong( key.shardId );
+    }
+
+
+    @Override
+    public EdgeRowKey fromComposite( final CompositeParser composite ) {
+
+        final Id sourceId = ID_SER.fromComposite( composite );
+        final String edgeType = composite.readString();
+        final Id targetId = ID_SER.fromComposite( composite );
+        final long shard = composite.readLong();
+
+        return new EdgeRowKey( sourceId, edgeType, targetId, shard );
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/serialize/EdgeSerializer.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/serialize/EdgeSerializer.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/serialize/EdgeSerializer.java
new file mode 100644
index 0000000..590cf35
--- /dev/null
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/serialize/EdgeSerializer.java
@@ -0,0 +1,77 @@
+/*
+ *
+ *  * 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.graph.serialization.impl.shard.impl.serialize;
+
+
+import java.nio.ByteBuffer;
+
+import org.apache.usergrid.persistence.core.astyanax.IdColDynamicCompositeSerializer;
+import org.apache.usergrid.persistence.graph.serialization.impl.shard.DirectedEdge;
+import org.apache.usergrid.persistence.model.entity.Id;
+
+import com.google.common.base.Preconditions;
+import com.netflix.astyanax.model.DynamicComposite;
+import com.netflix.astyanax.serializers.AbstractSerializer;
+import com.netflix.astyanax.serializers.LongSerializer;
+
+
+/**
+ * Serializes to a source->target edge Note that we cannot set the edge type on de-serialization.  Only the target
+ * Id and version.
+ */
+public class EdgeSerializer extends AbstractSerializer<DirectedEdge> {
+
+    private static final IdColDynamicCompositeSerializer ID_COL_SERIALIZER = IdColDynamicCompositeSerializer.get();
+    private static final LongSerializer LONG_SERIALIZER = LongSerializer.get();
+
+
+    @Override
+    public ByteBuffer toByteBuffer( final DirectedEdge edge ) {
+
+        DynamicComposite composite = new DynamicComposite();
+
+        composite.addComponent( edge.timestamp, LONG_SERIALIZER );
+
+        ID_COL_SERIALIZER.toComposite( composite, edge.id );
+
+        return composite.serialize();
+    }
+
+
+    @Override
+    public DirectedEdge fromByteBuffer( final ByteBuffer byteBuffer ) {
+        DynamicComposite composite = DynamicComposite.fromByteBuffer( byteBuffer );
+
+        Preconditions.checkArgument( composite.size() == 3, "Composite should have 3 elements" );
+
+
+        //return the version
+        final long timestamp = composite.get( 0, LONG_SERIALIZER );
+
+
+        //parse our id
+        final Id id = ID_COL_SERIALIZER.fromComposite( composite, 1 );
+
+
+        return new DirectedEdge( id, timestamp );
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/serialize/EdgeShardRowKeySerializer.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/serialize/EdgeShardRowKeySerializer.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/serialize/EdgeShardRowKeySerializer.java
new file mode 100644
index 0000000..6b1c4e9
--- /dev/null
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/serialize/EdgeShardRowKeySerializer.java
@@ -0,0 +1,103 @@
+/*
+ *
+ *  * 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.graph.serialization.impl.shard.impl.serialize;
+
+
+import org.apache.usergrid.persistence.core.astyanax.CompositeFieldSerializer;
+import org.apache.usergrid.persistence.core.astyanax.IdRowCompositeSerializer;
+import org.apache.usergrid.persistence.graph.serialization.impl.shard.DirectedEdgeMeta;
+import org.apache.usergrid.persistence.graph.serialization.impl.shard.NodeType;
+import org.apache.usergrid.persistence.model.entity.Id;
+
+import com.netflix.astyanax.model.CompositeBuilder;
+import com.netflix.astyanax.model.CompositeParser;
+
+
+public class EdgeShardRowKeySerializer implements CompositeFieldSerializer<DirectedEdgeMeta> {
+
+    private static final IdRowCompositeSerializer ID_SER = IdRowCompositeSerializer.get();
+
+    public static final EdgeShardRowKeySerializer INSTANCE = new EdgeShardRowKeySerializer();
+
+
+    @Override
+    public void toComposite( final CompositeBuilder builder, final DirectedEdgeMeta meta ) {
+
+
+        final DirectedEdgeMeta.NodeMeta[] nodeMeta = meta.getNodes();
+
+        //add the stored value
+        builder.addInteger( meta.getType().getStorageValue() );
+
+        final int length = nodeMeta.length;
+
+        builder.addInteger( length );
+
+
+        for ( DirectedEdgeMeta.NodeMeta node : nodeMeta ) {
+            ID_SER.toComposite( builder, node.getId() );
+            builder.addInteger( node.getNodeType().getStorageValue() );
+        }
+
+        final String[] edgeTypes = meta.getTypes();
+
+        builder.addInteger( edgeTypes.length );
+
+        for ( String type : edgeTypes ) {
+            builder.addString( type );
+        }
+    }
+
+
+    @Override
+    public DirectedEdgeMeta fromComposite( final CompositeParser composite ) {
+
+
+        final int storageType = composite.readInteger();
+
+        final DirectedEdgeMeta.MetaType metaType = DirectedEdgeMeta.MetaType.fromStorage( storageType );
+
+        final int idLength = composite.readInteger();
+
+        final DirectedEdgeMeta.NodeMeta[] nodePairs = new DirectedEdgeMeta.NodeMeta[idLength];
+
+
+        for ( int i = 0; i < idLength; i++ ) {
+            final Id sourceId = ID_SER.fromComposite( composite );
+
+            final NodeType type = NodeType.get( composite.readInteger() );
+
+            nodePairs[i] = new DirectedEdgeMeta.NodeMeta( sourceId, type );
+        }
+
+
+        final int length = composite.readInteger();
+
+        String[] types = new String[length];
+
+        for ( int i = 0; i < length; i++ ) {
+            types[i] = composite.readString();
+        }
+
+        return  DirectedEdgeMeta.fromStorage( metaType, nodePairs, types );
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/serialize/RowSerializer.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/serialize/RowSerializer.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/serialize/RowSerializer.java
new file mode 100644
index 0000000..8376ef1
--- /dev/null
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/serialize/RowSerializer.java
@@ -0,0 +1,63 @@
+/*
+ *
+ *  * 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.graph.serialization.impl.shard.impl.serialize;
+
+
+import org.apache.usergrid.persistence.core.astyanax.CompositeFieldSerializer;
+import org.apache.usergrid.persistence.core.astyanax.IdRowCompositeSerializer;
+import org.apache.usergrid.persistence.graph.serialization.impl.shard.RowKey;
+import org.apache.usergrid.persistence.model.entity.Id;
+
+import com.netflix.astyanax.model.CompositeBuilder;
+import com.netflix.astyanax.model.CompositeParser;
+
+
+/**
+ * Class to perform serialization for row keys from edges
+ */
+public class RowSerializer implements CompositeFieldSerializer<RowKey> {
+
+    private static final IdRowCompositeSerializer ID_SER = IdRowCompositeSerializer.get();
+
+
+    @Override
+    public void toComposite( final CompositeBuilder builder, final RowKey key ) {
+
+        //add the row id to the composite
+        ID_SER.toComposite( builder, key.nodeId );
+
+        builder.addString( key.edgeType );
+        builder.addLong( key.shardId );
+    }
+
+
+    @Override
+    public RowKey fromComposite( final CompositeParser composite ) {
+
+        final Id id = ID_SER.fromComposite( composite );
+        final String edgeType = composite.readString();
+        final long shard = composite.readLong();
+
+
+        return new RowKey( id, edgeType, shard );
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/serialize/RowTypeSerializer.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/serialize/RowTypeSerializer.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/serialize/RowTypeSerializer.java
new file mode 100644
index 0000000..a67c469
--- /dev/null
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/serialize/RowTypeSerializer.java
@@ -0,0 +1,62 @@
+/*
+ *
+ *  * 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.graph.serialization.impl.shard.impl.serialize;
+
+
+import org.apache.usergrid.persistence.core.astyanax.CompositeFieldSerializer;
+import org.apache.usergrid.persistence.core.astyanax.IdRowCompositeSerializer;
+import org.apache.usergrid.persistence.graph.serialization.impl.shard.RowKeyType;
+import org.apache.usergrid.persistence.model.entity.Id;
+
+import com.netflix.astyanax.model.CompositeBuilder;
+import com.netflix.astyanax.model.CompositeParser;
+
+
+public class RowTypeSerializer implements CompositeFieldSerializer<RowKeyType> {
+
+    private static final IdRowCompositeSerializer ID_SER = IdRowCompositeSerializer.get();
+
+
+    @Override
+    public void toComposite( final CompositeBuilder builder, final RowKeyType keyType ) {
+
+        //add the row id to the composite
+        ID_SER.toComposite( builder, keyType.nodeId );
+
+        builder.addString( keyType.edgeType );
+        builder.addString( keyType.idType );
+
+        builder.addLong( keyType.shardId );
+    }
+
+
+    @Override
+    public RowKeyType fromComposite( final CompositeParser composite ) {
+
+        final Id id = ID_SER.fromComposite( composite );
+        final String edgeType = composite.readString();
+        final String idType = composite.readString();
+        final long shard = composite.readLong();
+
+        return new RowKeyType( id, edgeType, idType, shard);
+    }
+}


[16/52] [abbrv] git commit: Updates with merge from master.

Posted by gr...@apache.org.
Updates with merge from master.


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: b2b54bbafdc4b570564ee9fd05241611065b3b22
Parents: a4f921f
Author: Todd Nine <to...@apache.org>
Authored: Thu Aug 28 11:51:39 2014 -0600
Committer: Todd Nine <to...@apache.org>
Committed: Thu Aug 28 11:51:39 2014 -0600

----------------------------------------------------------------------
 .gitignore                                      |  4 +-
 .../corepersistence/CpRelationManager.java      | 27 ++++-----
 .../graph/GraphManagerShardConsistencyIT.java   | 64 ++++++++++----------
 .../graph/GraphManagerShardingIT.java           |  2 +
 stack/corepersistence/pom.xml                   |  2 +-
 5 files changed, 49 insertions(+), 50 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b2b54bba/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index c893b4a..0e504de 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,8 +1,8 @@
 .DS_Store
 .AppleDouble
 .LSOverride
-QueryFilterLexer.java
-QueryFilterParser.java
+stack/core/src/main/java/org/apache/usergrid/persistence/query/tree/QueryFilterParser.java
+stack/core/src/main/java/org/apache/usergrid/persistence/query/tree/QueryFilterLexer.java
 
 target
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b2b54bba/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
index d467682..33b9c21 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
@@ -65,6 +65,7 @@ import org.apache.usergrid.persistence.geo.EntityLocationRef;
 import org.apache.usergrid.persistence.geo.model.Point;
 import org.apache.usergrid.persistence.graph.Edge;
 import org.apache.usergrid.persistence.graph.GraphManager;
+import org.apache.usergrid.persistence.graph.SearchByEdgeType;
 import org.apache.usergrid.persistence.graph.impl.SimpleEdge;
 import org.apache.usergrid.persistence.graph.impl.SimpleSearchByEdge;
 import org.apache.usergrid.persistence.graph.impl.SimpleSearchByEdgeType;
@@ -370,7 +371,7 @@ public class CpRelationManager implements RelationManager {
             String etype = edgeTypes.next();
 
             Observable<Edge> edges = gm.loadEdgesToTarget( new SimpleSearchByEdgeType(
-                cpHeadEntity.getId(), etype, Long.MAX_VALUE, null ));
+                cpHeadEntity.getId(), etype, Long.MAX_VALUE, SearchByEdgeType.Order.DESCENDING, null ));
 
             Iterator<Edge> iter = edges.toBlockingObservable().getIterator();
             while ( iter.hasNext() ) {
@@ -429,7 +430,7 @@ public class CpRelationManager implements RelationManager {
             String etype = edgeTypesToTarget.next();
 
             Observable<Edge> edges = gm.loadEdgesToTarget( new SimpleSearchByEdgeType(
-                cpHeadEntity.getId(), etype, Long.MAX_VALUE, null ));
+                cpHeadEntity.getId(), etype, Long.MAX_VALUE, SearchByEdgeType.Order.DESCENDING,  null ));
 
             // loop through edges of that type
             Iterator<Edge> iter = edges.toBlockingObservable().getIterator();
@@ -499,7 +500,7 @@ public class CpRelationManager implements RelationManager {
                 new SimpleId(headEntity.getUuid(), headEntity.getType()), 
                 edgeType,  
                 entityId, 
-                Long.MAX_VALUE,
+                Long.MAX_VALUE,  SearchByEdgeType.Order.DESCENDING,
                 null));
 
         return edges.toBlockingObservable().firstOrDefault(null) != null;
@@ -527,7 +528,7 @@ public class CpRelationManager implements RelationManager {
                 new SimpleId(headEntity.getUuid(), headEntity.getType()), 
                 edgeType,  
                 entityId, 
-                Long.MAX_VALUE,
+                Long.MAX_VALUE, SearchByEdgeType.Order.DESCENDING,
                 null));
 
         return edges.toBlockingObservable().firstOrDefault(null) != null;
@@ -544,7 +545,7 @@ public class CpRelationManager implements RelationManager {
         Observable<Edge> edgesToTarget = gm.loadEdgesToTarget( new SimpleSearchByEdgeType(
             targetId,
             CpRelationManager.getEdgeTypeFromConnectionType( connectionType, target.getType() ),
-            System.currentTimeMillis(),
+            System.currentTimeMillis(), SearchByEdgeType.Order.DESCENDING,
             null)); // last
 
         Iterator<Edge> iterator = edgesToTarget.toBlockingObservable().getIterator();
@@ -568,18 +569,12 @@ public class CpRelationManager implements RelationManager {
         Observable<Edge> edgesFromSource = gm.loadEdgesFromSource(new SimpleSearchByEdgeType(
             sourceId,
             CpRelationManager.getEdgeTypeFromConnectionType( connectionType, null ),
-            System.currentTimeMillis(),
+            System.currentTimeMillis(),SearchByEdgeType.Order.DESCENDING,
             null)); // last
-        
-        Iterator<Edge> iterator = edgesFromSource.toBlockingObservable().getIterator();
-        int count = 0;
-        while ( iterator.hasNext() ) {
-            iterator.next();
-            if ( count++ > 1 ) { 
-                return true;
-            }
-        } 
-        return false;
+
+        int count = edgesFromSource.take( 2 ).count().toBlocking().last();
+
+        return count > 1;
    } 
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b2b54bba/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerShardConsistencyIT.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerShardConsistencyIT.java b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerShardConsistencyIT.java
index 279e4e1..41248fc 100644
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerShardConsistencyIT.java
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerShardConsistencyIT.java
@@ -43,6 +43,7 @@ import javax.annotation.Nullable;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.ClassRule;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -81,7 +82,7 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.fail;
 
 
-//@Ignore( "A stress test, not part of functional testing" )
+@Ignore( "Kills cassandra, needs to be part of functional testing" )
 public class GraphManagerShardConsistencyIT {
     private static final Logger log = LoggerFactory.getLogger( GraphManagerShardConsistencyIT.class );
 
@@ -119,7 +120,7 @@ public class GraphManagerShardConsistencyIT {
         originalShardDelta = ConfigurationManager.getConfigInstance().getProperty( GraphFig.SHARD_MIN_DELTA );
 
 
-        ConfigurationManager.getConfigInstance().setProperty( GraphFig.SHARD_SIZE, 1000 );
+        ConfigurationManager.getConfigInstance().setProperty( GraphFig.SHARD_SIZE, 500 );
 
 
         final long cacheTimeout = 2000;
@@ -491,35 +492,36 @@ public class GraphManagerShardConsistencyIT {
                                                         .doOnNext( new Action1<Edge>() {
 
 
-
-//                    private Edge last;
-
-
-                    @Override
-                    public void call( final Edge edge ) {
-                        readMeter.mark();
-
-//                        count[0]++;
-//
-//                        /**
-//                         * Added this check as part of the read
-//                         */
-//                        if ( last != null && last.equals(edge) ) {
-//                            fail( String.format( "Expected edges to be in order, however last was %s and current is %s",
-//                                    last, edge ) );
-//                        }
-//
-//                        last = edge;
-//
-//                        if( seen.contains( edge ) ){
-//                            fail( String.format("Returned an edge that was already seen! Edge was %s, last edge was %s", edge, last) );
-//                            duplicate[0]++;
-//                        }
-//
-//                        seen.add( edge );
-
-                    }
-                } )
+                                                            //                    private Edge last;
+
+
+                                                            @Override
+                                                            public void call( final Edge edge ) {
+                                                                readMeter.mark();
+
+                                                                //                        count[0]++;
+                                                                //
+                                                                //                        /**
+                                                                //                         * Added this check as part
+                                                                // of the read
+                                                                //                         */
+                                                                //                        if ( last != null && last
+                                                                // .equals(edge) ) {
+                                                                //                            fail( String.format( "Expected edges to be in order, however last was %s and current is %s",
+                                                                //                                    last, edge ) );
+                                                                //                        }
+                                                                //
+                                                                //                        last = edge;
+                                                                //
+                                                                //                        if( seen.contains( edge ) ){
+                                                                //                            fail( String.format("Returned an edge that was already seen! Edge was %s, last edge was %s", edge, last) );
+                                                                //                            duplicate[0]++;
+                                                                //                        }
+                                                                //
+                                                                //                        seen.add( edge );
+
+                                                            }
+                                                        } )
 
                                                         .longCount().toBlocking().last();
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b2b54bba/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerShardingIT.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerShardingIT.java b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerShardingIT.java
index e6a6d27..ec4fcba 100644
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerShardingIT.java
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerShardingIT.java
@@ -25,6 +25,7 @@ import java.util.concurrent.TimeoutException;
 
 import org.jukito.UseModules;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -49,6 +50,7 @@ import static org.junit.Assert.assertTrue;
 
 @RunWith( ITRunner.class )
 @UseModules( TestGraphModule.class )
+@Ignore("Kills cassandra")
 public class GraphManagerShardingIT {
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b2b54bba/stack/corepersistence/pom.xml
----------------------------------------------------------------------
diff --git a/stack/corepersistence/pom.xml b/stack/corepersistence/pom.xml
index 14a80cf..da3f5d7 100644
--- a/stack/corepersistence/pom.xml
+++ b/stack/corepersistence/pom.xml
@@ -94,7 +94,7 @@
                     <systemPropertyVariables>
                         <archaius.deployment.environment>UNIT</archaius.deployment.environment>
                     </systemPropertyVariables>
-                    <argLine>-Xms2G -Xmx4G</argLine>
+                    <argLine>-Xms4G -Xmx4G</argLine>
                 </configuration>
             </plugin>
 


[48/52] [abbrv] Add some missing headers, and make some header more consistent.

Posted by gr...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/17a9b8c3/ugc/lib/ugc/commands/query.rb
----------------------------------------------------------------------
diff --git a/ugc/lib/ugc/commands/query.rb b/ugc/lib/ugc/commands/query.rb
index 43ca853..edb85b5 100644
--- a/ugc/lib/ugc/commands/query.rb
+++ b/ugc/lib/ugc/commands/query.rb
@@ -1,17 +1,18 @@
-#Licensed to the Apache Software Foundation (ASF) under one or more contributor
-#license agreements.  See the NOTICE.txt 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
+
+# Licensed to the Apache Software Foundation (ASF) under one or more contributor
+# license agreements.  See the NOTICE.txt 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.
+# 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.
 
 desc 'query (uses sql-like syntax)'
 long_desc 'query may contain "from" clause instead of specifying collection_name'

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/17a9b8c3/ugc/lib/ugc/commands/target.rb
----------------------------------------------------------------------
diff --git a/ugc/lib/ugc/commands/target.rb b/ugc/lib/ugc/commands/target.rb
index bdb8a67..8f4ab08 100644
--- a/ugc/lib/ugc/commands/target.rb
+++ b/ugc/lib/ugc/commands/target.rb
@@ -1,17 +1,18 @@
-#Licensed to the Apache Software Foundation (ASF) under one or more contributor
-#license agreements.  See the NOTICE.txt 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
+
+# Licensed to the Apache Software Foundation (ASF) under one or more contributor
+# license agreements.  See the NOTICE.txt 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.
+# 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.
 
 desc 'set the base url, org, and app for the current profile'
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/17a9b8c3/ugc/lib/ugc/helpers/curl.rb
----------------------------------------------------------------------
diff --git a/ugc/lib/ugc/helpers/curl.rb b/ugc/lib/ugc/helpers/curl.rb
index eb10673..409e855 100644
--- a/ugc/lib/ugc/helpers/curl.rb
+++ b/ugc/lib/ugc/helpers/curl.rb
@@ -1,17 +1,18 @@
-#Licensed to the Apache Software Foundation (ASF) under one or more contributor
-#license agreements.  See the NOTICE.txt 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
+
+# Licensed to the Apache Software Foundation (ASF) under one or more contributor
+# license agreements.  See the NOTICE.txt 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.
+# 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.
 
 def puts_curl(command, resource, payload=nil, file=nil)
   headers = resource.options[:headers] || {}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/17a9b8c3/ugc/lib/ugc/helpers/format.rb
----------------------------------------------------------------------
diff --git a/ugc/lib/ugc/helpers/format.rb b/ugc/lib/ugc/helpers/format.rb
index b81ff75..689a168 100644
--- a/ugc/lib/ugc/helpers/format.rb
+++ b/ugc/lib/ugc/helpers/format.rb
@@ -1,17 +1,18 @@
-#Licensed to the Apache Software Foundation (ASF) under one or more contributor
-#license agreements.  See the NOTICE.txt 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
+
+# Licensed to the Apache Software Foundation (ASF) under one or more contributor
+# license agreements.  See the NOTICE.txt 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.
+# 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.
 
 SKIP_ATTRS = %w(metadata uri type)
 INDEX_COL_WIDTH = 2

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/17a9b8c3/ugc/lib/ugc/helpers/history.rb
----------------------------------------------------------------------
diff --git a/ugc/lib/ugc/helpers/history.rb b/ugc/lib/ugc/helpers/history.rb
index a263e70..1c4c539 100644
--- a/ugc/lib/ugc/helpers/history.rb
+++ b/ugc/lib/ugc/helpers/history.rb
@@ -1,17 +1,18 @@
-#Licensed to the Apache Software Foundation (ASF) under one or more contributor
-#license agreements.  See the NOTICE.txt 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
+
+# Licensed to the Apache Software Foundation (ASF) under one or more contributor
+# license agreements.  See the NOTICE.txt 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.
+# 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.
 
 def save_response(response)
   if response && response.multiple_entities? && response.collection.size > 1

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/17a9b8c3/ugc/lib/ugc/helpers/parse.rb
----------------------------------------------------------------------
diff --git a/ugc/lib/ugc/helpers/parse.rb b/ugc/lib/ugc/helpers/parse.rb
index c5ac07f..92e675b 100644
--- a/ugc/lib/ugc/helpers/parse.rb
+++ b/ugc/lib/ugc/helpers/parse.rb
@@ -1,17 +1,18 @@
-#Licensed to the Apache Software Foundation (ASF) under one or more contributor
-#license agreements.  See the NOTICE.txt 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
+
+# Licensed to the Apache Software Foundation (ASF) under one or more contributor
+# license agreements.  See the NOTICE.txt 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.
+# 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.
 
 require 'json'
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/17a9b8c3/ugc/lib/ugc/helpers/rest.rb
----------------------------------------------------------------------
diff --git a/ugc/lib/ugc/helpers/rest.rb b/ugc/lib/ugc/helpers/rest.rb
index 98542a4..65c9552 100644
--- a/ugc/lib/ugc/helpers/rest.rb
+++ b/ugc/lib/ugc/helpers/rest.rb
@@ -1,17 +1,18 @@
-#Licensed to the Apache Software Foundation (ASF) under one or more contributor
-#license agreements.  See the NOTICE.txt 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
+
+# Licensed to the Apache Software Foundation (ASF) under one or more contributor
+# license agreements.  See the NOTICE.txt 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.
+# 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.
 
 def multipart_payload(payload, file)
   payload = payload.is_a?(Hash) ? payload : MultiJson.load(payload)

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/17a9b8c3/ugc/lib/ugc/management.rb
----------------------------------------------------------------------
diff --git a/ugc/lib/ugc/management.rb b/ugc/lib/ugc/management.rb
index 7e67dc2..985a355 100644
--- a/ugc/lib/ugc/management.rb
+++ b/ugc/lib/ugc/management.rb
@@ -1,17 +1,18 @@
-#Licensed to the Apache Software Foundation (ASF) under one or more contributor
-#license agreements.  See the NOTICE.txt 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
+
+# Licensed to the Apache Software Foundation (ASF) under one or more contributor
+# license agreements.  See the NOTICE.txt 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.
+# 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.
 
 module Ugc
   class Management < Usergrid::Management

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/17a9b8c3/ugc/lib/ugc/settings.rb
----------------------------------------------------------------------
diff --git a/ugc/lib/ugc/settings.rb b/ugc/lib/ugc/settings.rb
index 253509e..9ec4c4e 100644
--- a/ugc/lib/ugc/settings.rb
+++ b/ugc/lib/ugc/settings.rb
@@ -1,17 +1,18 @@
-#Licensed to the Apache Software Foundation (ASF) under one or more contributor
-#license agreements.  See the NOTICE.txt 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
+
+# Licensed to the Apache Software Foundation (ASF) under one or more contributor
+# license agreements.  See the NOTICE.txt 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.
+# 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.
 
 module Ugc
   class Settings

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/17a9b8c3/ugc/lib/ugc/version.rb
----------------------------------------------------------------------
diff --git a/ugc/lib/ugc/version.rb b/ugc/lib/ugc/version.rb
index e7161d3..c6b1747 100644
--- a/ugc/lib/ugc/version.rb
+++ b/ugc/lib/ugc/version.rb
@@ -1,17 +1,18 @@
-#Licensed to the Apache Software Foundation (ASF) under one or more contributor
-#license agreements.  See the NOTICE.txt 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
+
+# Licensed to the Apache Software Foundation (ASF) under one or more contributor
+# license agreements.  See the NOTICE.txt 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.
+# 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.
 
 module Ugc
   VERSION = '0.9.10'

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/17a9b8c3/ugc/test/default_test.rb
----------------------------------------------------------------------
diff --git a/ugc/test/default_test.rb b/ugc/test/default_test.rb
index f1865d1..5c6d6bc 100644
--- a/ugc/test/default_test.rb
+++ b/ugc/test/default_test.rb
@@ -1,17 +1,18 @@
-#Licensed to the Apache Software Foundation (ASF) under one or more contributor
-#license agreements.  See the NOTICE.txt 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
+
+# Licensed to the Apache Software Foundation (ASF) under one or more contributor
+# license agreements.  See the NOTICE.txt 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.
+# 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.
 
 require 'test_helper'
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/17a9b8c3/ugc/test/test_helper.rb
----------------------------------------------------------------------
diff --git a/ugc/test/test_helper.rb b/ugc/test/test_helper.rb
index 1cea87f..0d25a78 100644
--- a/ugc/test/test_helper.rb
+++ b/ugc/test/test_helper.rb
@@ -1,17 +1,18 @@
-#Licensed to the Apache Software Foundation (ASF) under one or more contributor
-#license agreements.  See the NOTICE.txt 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
+
+# Licensed to the Apache Software Foundation (ASF) under one or more contributor
+# license agreements.  See the NOTICE.txt 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.
+# 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.
 
 require 'test/unit'
 


[18/52] [abbrv] git commit: More test fixes related to merge from master and previous serialization fix.

Posted by gr...@apache.org.
More test fixes related to merge from master and previous serialization fix.


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: 9ddb53730170977cbf5f3082dedd1fe77197f6e9
Parents: ce8c170
Author: Dave Johnson <dm...@apigee.com>
Authored: Thu Aug 28 15:37:38 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Thu Aug 28 15:37:38 2014 -0400

----------------------------------------------------------------------
 .../usergrid/batch/job/SchedulerRuntime2IT.java | 54 ++++++++++----------
 .../usergrid/batch/job/SchedulerRuntime3IT.java |  2 +
 .../usergrid/persistence/CollectionIT.java      | 17 +++---
 .../persistence/GeoQueryBooleanTest.java        |  2 +
 .../exception/CollectionRuntimeException.java   |  1 -
 .../MvccEntitySerializationStrategyImpl.java    | 16 +++++-
 .../persistence/index/impl/EntityIndexTest.java | 19 +++++++
 .../src/test/resources/log4j.properties         |  6 ++-
 .../test/resources/usergrid-test-context.xml    |  3 +-
 9 files changed, 81 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9ddb5373/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime2IT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime2IT.java b/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime2IT.java
index fdc3c07..fb66427 100644
--- a/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime2IT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime2IT.java
@@ -17,16 +17,17 @@
 package org.apache.usergrid.batch.job;
 
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
 
 import java.util.concurrent.TimeUnit;
+import static org.apache.usergrid.batch.job.AbstractSchedulerRuntimeIT.cassandraResource;
 
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.usergrid.cassandra.Concurrent;
 import org.apache.usergrid.persistence.entities.JobData;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 
 /**
@@ -35,7 +36,6 @@ import org.apache.usergrid.persistence.entities.JobData;
 @Concurrent
 public class SchedulerRuntime2IT extends AbstractSchedulerRuntimeIT {
 	private static final Logger logger = LoggerFactory.getLogger(SchedulerRuntime2IT.class.getName());
-
     /** Test the scheduler ramps up correctly when there are more jobs to be read after a pause */
     @Test
     public void schedulingWithNoJobs() throws InterruptedException {
@@ -50,34 +50,31 @@ public class SchedulerRuntime2IT extends AbstractSchedulerRuntimeIT {
         }
 
         scheduler.refreshIndex();
-
-        // previously:
-        // now wait until everything fires
-        // boolean waited = getJobListener().blockTilDone( getCount(), 15000L );
-        // assertTrue( "Jobs ran", waited );
-        // assertTrue( getCount() + " successful jobs ran", 
-        // getCount() == getJobListener().getSuccessCount() );
         
         // now:
         // note that the waitForCount only wait for job execution. It does NOT wait for job Completion
         boolean waited = counterJob.waitForCount(waitTime, TimeUnit.MILLISECONDS);
-        assertTrue( "Failed to run " 
-                + getCount() + " number of jobs. Waited " + waitTime + " ms.", waited );
+        assertTrue( "Failed to run " + getCount() 
+                + " number of jobs. Waited " + waitTime 
+                + " seconds.", waited );
         
         scheduler.refreshIndex();
-
+        
         // now:
         // blockTilDone look into the JobListener hook and blocked until jobs are completed.
         // TODO : need a retry count so it doesn't reblock forever
         while (!getJobListener().blockTilDone(waitTime)) {
         	logger.warn("Jobs not yet finished after waited {}, block again" , waitTime);
         }
-        assertEquals( "Expected success job: " + getCount()+ ". Actual :" 
-            + getJobListener().getSuccessCount() + ". Total count: " 
-            + getJobListener().getDoneCount() , getCount() , getJobListener().getSuccessCount() );
+        assertEquals( "Expected success job: " + getCount()
+                + ". Actual :" + getJobListener().getSuccessCount() 
+                + ". Total count: " + getJobListener().getDoneCount() , 
+                getCount() , getJobListener().getSuccessCount() );
         
         Thread.sleep( 5000L );
 
+        scheduler.refreshIndex();
+        
         // set the counter job latch size
         counterJob.setLatch( getCount() );
         getJobListener().setExpected( getCount() );
@@ -87,32 +84,35 @@ public class SchedulerRuntime2IT extends AbstractSchedulerRuntimeIT {
         }
 
         scheduler.refreshIndex();
-
+        
         // previously: 
         // now wait until everything fires
         // waited = getJobListener().blockTilDone( 2 * getCount(), 15000L );
         // waited = counterJob.waitForCount(waitTime, TimeUnit.MILLISECONDS );
-        // assertTrue( "Failed to run " + 2* getCount() + " number of jobs. Success count = " 
-        // + getJobListener().getSuccessCount() + ". Waited " + waitTime  + " seconds.", waited );
+        // assertTrue( "Failed to run " + 2* getCount() + " number of jobs. 
+        // Success count = " + getJobListener().getSuccessCount() + ". Waited " + waitTime  + " seconds.", waited );
         // assertTrue( 2 * getCount() + " successful jobs ran",
         //  ( 2 * getCount() ) == getJobListener().getSuccessCount() );
 		
-		// now: note that the waitForCount only wait for job execution. 
-        // It does NOT wait for job Completion
+		// now:
+        // note that the waitForCount only wait for job execution. It does NOT wait for job Completion
         waited = counterJob.waitForCount(waitTime, TimeUnit.MILLISECONDS);
-        assertTrue( "Failed to run " + getCount() + " number of jobs. Waited " + waitTime 
-                + " seconds.", waited );
+        assertTrue( "Failed to run " + getCount() + " number of jobs. Waited " + waitTime + " seconds.", waited );
         
         scheduler.refreshIndex();
-
+        
         // now:
         // blockTilDone look into the JobListener hook and blocked until jobs are completed.
         // TODO : need a retry count so it doesn't reblock forever
         while (!getJobListener().blockTilDone(waitTime)) {
         	logger.warn("Jobs not yet finished after waited {}, block again" , waitTime);
         }
-        assertEquals( "Expected success job: " +2 * getCount()+ ". Actual :" 
-            + getJobListener().getSuccessCount() + ". Total count: " 
-            + getJobListener().getDoneCount(), 2 * getCount() , getJobListener().getSuccessCount());
+
+        scheduler.refreshIndex();
+        
+        assertEquals( "Expected success job: " +2 * getCount()
+                + ". Actual :" + getJobListener().getSuccessCount() 
+                + ". Total count: " + getJobListener().getDoneCount() , 
+                2 * getCount() , getJobListener().getSuccessCount() );
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9ddb5373/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime3IT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime3IT.java b/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime3IT.java
index d9a48c6..2968eda 100644
--- a/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime3IT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime3IT.java
@@ -73,6 +73,8 @@ public class SchedulerRuntime3IT extends AbstractSchedulerRuntimeIT {
         // make sure we're not racing the test
         boolean waited = getJobListener().blockTilDone(waitTime);
 
+        scheduler.refreshIndex();
+
         //we shouldn't trip the latch.  It should fail failCount times, and not run again
         assertTrue( "Jobs ran", waited );
         assertTrue( failCount + " failures resulted", getJobListener().getFailureCount() == failCount );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9ddb5373/stack/core/src/test/java/org/apache/usergrid/persistence/CollectionIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/CollectionIT.java b/stack/core/src/test/java/org/apache/usergrid/persistence/CollectionIT.java
index 8ff14de..57b4940 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/CollectionIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/CollectionIT.java
@@ -850,24 +850,27 @@ public class CollectionIT extends AbstractCoreIT {
         EntityManager em = setup.getEmf().getEntityManager( applicationId );
         assertNotNull( em );
 
+        // create two game entities, each with an array of entities that have subField = 'Foo'
 
-        Map<String, Object> subObject = new LinkedHashMap<String, Object>();
-        subObject.put( "subField", "Foo" );
-
-        Map<String, Object> properties = new LinkedHashMap<String, Object>();
-        properties.put( "subObjectArray", new Map[] { subObject } );
+        Map<String, Object> properties = new LinkedHashMap<String, Object>() {{
+            put( "subObjectArray", new ArrayList<Map<String, Object>>() {{
+                add( new LinkedHashMap<String, Object>() {{
+                    put("subField", "Foo");
+                }});
+            }});
+        }};
 
         Entity entity1 = em.create( "game", properties );
         assertNotNull( entity1 );
 
-
         Entity entity2 = em.create( "game", properties );
         assertNotNull( entity2 );
 
         em.refreshIndex();
 
 
-        // simple not
+        // search for games without sub-field Foo should returned zero entities
+
         Query query = Query.fromQL( "select * where NOT subObjectArray.subField = 'Foo'" ).withLimit( 1 );
         Results r = em.searchCollection( em.getApplicationRef(), "games", query );
         assertEquals( 0, r.size() );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9ddb5373/stack/core/src/test/java/org/apache/usergrid/persistence/GeoQueryBooleanTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/GeoQueryBooleanTest.java b/stack/core/src/test/java/org/apache/usergrid/persistence/GeoQueryBooleanTest.java
index 738a1c6..8ba860a 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/GeoQueryBooleanTest.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/GeoQueryBooleanTest.java
@@ -33,6 +33,7 @@ import org.apache.usergrid.persistence.index.query.Query;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
+import org.junit.Ignore;
 
 
 @Concurrent()
@@ -111,6 +112,7 @@ public class GeoQueryBooleanTest extends AbstractCoreIT {
 
 
     @Test
+    @Ignore // work in progress
     public void testGeoQueryWithNot() throws Exception {
 
         log.info( "GeoQueryBooleanTest.testGeoQueryWithOr" );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9ddb5373/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/exception/CollectionRuntimeException.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/exception/CollectionRuntimeException.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/exception/CollectionRuntimeException.java
index 168aaec..82e1c76 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/exception/CollectionRuntimeException.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/exception/CollectionRuntimeException.java
@@ -19,7 +19,6 @@ package org.apache.usergrid.persistence.collection.exception;
 
 import org.apache.usergrid.persistence.collection.CollectionScope;
 import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
-import org.apache.usergrid.persistence.model.entity.Entity;
 
 
 public class CollectionRuntimeException extends RuntimeException {

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9ddb5373/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImpl.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImpl.java
index 4f8d1f3..a9e087b 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImpl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImpl.java
@@ -45,6 +45,7 @@ import org.apache.usergrid.persistence.model.entity.Entity;
 import org.apache.usergrid.persistence.model.entity.Id;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
 import com.fasterxml.jackson.dataformat.smile.SmileFactory;
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
@@ -64,6 +65,8 @@ import com.netflix.astyanax.serializers.AbstractSerializer;
 import com.netflix.astyanax.serializers.ByteBufferSerializer;
 import com.netflix.astyanax.serializers.BytesArraySerializer;
 import com.netflix.astyanax.serializers.UUIDSerializer;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * @author tnine
@@ -71,6 +74,7 @@ import com.netflix.astyanax.serializers.UUIDSerializer;
 @Singleton
 public class MvccEntitySerializationStrategyImpl implements MvccEntitySerializationStrategy, Migration {
 
+    private static final Logger log =  LoggerFactory.getLogger( MvccLogEntrySerializationStrategyImpl.class );
 
     private static final EntitySerializer SER = new EntitySerializer();
 
@@ -305,7 +309,7 @@ public class MvccEntitySerializationStrategyImpl implements MvccEntitySerializat
 
         public static final SmileFactory f = new SmileFactory(  );
 
-        public static ObjectMapper mapper = new ObjectMapper( f );
+        public static ObjectMapper mapper;
 
         private static byte[] STATE_COMPLETE = new byte[] { 0 };
         private static byte[] STATE_DELETED = new byte[] { 1 };
@@ -317,6 +321,16 @@ public class MvccEntitySerializationStrategyImpl implements MvccEntitySerializat
         //the marker for when we're passed a "null" value
         private static final byte[] EMPTY = new byte[] { 0x0 };
 
+        public EntitySerializer() {
+            try {
+                mapper = new ObjectMapper( f );
+                mapper.enable(SerializationFeature.INDENT_OUTPUT);
+                mapper.enableDefaultTypingAsProperty(ObjectMapper.DefaultTyping.JAVA_LANG_OBJECT, "@class"); 
+            } catch ( Exception e ) {
+                throw new RuntimeException("Error setting up mapper", e);
+            }
+        }
+
         @Override
         public ByteBuffer toByteBuffer( final EntityWrapper wrapper ) {
             if ( wrapper == null ) {

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9ddb5373/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
index 3b40978..2f0def1 100644
--- a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
+++ b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
@@ -178,6 +178,7 @@ public class EntityIndexTest extends BaseIT {
 
     private void testQueries( EntityIndex entityIndex ) {
 
+
         testQuery( entityIndex, "name = 'Morgan Pierce'", 1 );
 
         testQuery( entityIndex, "name = 'morgan pierce'", 1 );
@@ -203,6 +204,24 @@ public class EntityIndexTest extends BaseIT {
         testQuery( entityIndex, "name = 'Morgan* '", 1 );
         
         testQuery( entityIndex, "name = 'Morgan*'", 1 );
+
+        
+        // test a couple of array sub-property queries
+
+        int totalUsers = 102;
+
+        // nobody has a friend named Jack the Ripper
+        testQuery( entityIndex, "friends.name = 'Jack the Ripper'", 0 );
+
+        // everybody doesn't have a friend named Jack the Ripper
+        testQuery( entityIndex, "not (friends.name = 'Jack the Ripper')", totalUsers );
+
+        // one person has a friend named Shari Hahn
+        testQuery( entityIndex, "friends.name = 'Wendy Moody'", 1 );
+
+        // everybody but 1 doesn't have a friend named Shari Hahh
+        testQuery( entityIndex, "not (friends.name = 'Shari Hahn')", totalUsers - 1);
+
     }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9ddb5373/stack/corepersistence/queryindex/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/resources/log4j.properties b/stack/corepersistence/queryindex/src/test/resources/log4j.properties
index 2ff29c6..e84489c 100644
--- a/stack/corepersistence/queryindex/src/test/resources/log4j.properties
+++ b/stack/corepersistence/queryindex/src/test/resources/log4j.properties
@@ -28,8 +28,10 @@ log4j.appender.stdout.layout.ConversionPattern=%d %p (%t) %c{1} - %m%n
 
 log4j.logger.org.apache.usergrid=INFO
 
-#log4j.logger.org.apache.usergrid.persistence.CollectionIT=DEBUG
-#log4j.logger.org.apache.usergrid.persistence.collection=WARN
 #log4j.logger.org.apache.usergrid.persistence.index=DEBUG
+log4j.logger.org.apache.usergrid.persistence.index.impl=DEBUG
+#log4j.logger.org.apache.usergrid.persistence.index.query=DEBUG
+#log4j.logger.org.apache.usergrid.persistence.index.query.tree=DEBUG
+#log4j.logger.org.apache.usergrid.persistence.index.utils=DEBUG
 
 #log4j.logger.org.apache.cassandra.service.StorageProxy=DEBUG, stdout
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9ddb5373/stack/query-validator/src/test/resources/usergrid-test-context.xml
----------------------------------------------------------------------
diff --git a/stack/query-validator/src/test/resources/usergrid-test-context.xml b/stack/query-validator/src/test/resources/usergrid-test-context.xml
index a4f78eb..03bb2e5 100644
--- a/stack/query-validator/src/test/resources/usergrid-test-context.xml
+++ b/stack/query-validator/src/test/resources/usergrid-test-context.xml
@@ -46,7 +46,8 @@
 
     <bean id="binaryStore" class="org.apache.usergrid.services.assets.data.LocalFileBinaryStore"/>
 
-    <bean id="setup" class="org.apache.usergrid.persistence.cassandra.Setup">
+    <bean id="setup" class="org.apache.usergrid.corepersistence.HybridSetup">
+        <constructor-arg ref="properties"/>
         <constructor-arg ref="entityManagerFactory"/>
         <constructor-arg ref="cassandraService"/>
     </bean>


[22/52] [abbrv] git commit: Merge branch 'two-dot-o' of https://github.com/apache/incubator-usergrid into two-dot-o

Posted by gr...@apache.org.
Merge branch 'two-dot-o' of https://github.com/apache/incubator-usergrid into two-dot-o


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: ef707147cb6d0561fe62208f2e9cc1dbaf57ff5f
Parents: c6de849 8b2c1b7
Author: Dave Johnson <dm...@apigee.com>
Authored: Fri Aug 29 09:33:18 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Fri Aug 29 09:33:18 2014 -0400

----------------------------------------------------------------------
 stack/core/pom.xml                              | 51 +++++++++++---------
 .../corepersistence/CpEntityManager.java        | 47 +++++++++---------
 .../corepersistence/CpRelationManager.java      | 10 ++--
 .../java/org/apache/usergrid/mq/Message.java    | 10 ++--
 .../apache/usergrid/persistence/EntityRef.java  |  3 ++
 .../apache/usergrid/persistence/PathQuery.java  |  8 +--
 .../usergrid/persistence/SimpleEntityRef.java   | 36 ++++++++------
 .../org/apache/usergrid/utils/UUIDUtils.java    | 11 +++++
 .../usergrid/persistence/PathQueryIT.java       |  4 +-
 .../persistence/core/util/ValidationUtils.java  |  2 +-
 .../usergrid/persistence/index/query/Query.java |  4 +-
 11 files changed, 106 insertions(+), 80 deletions(-)
----------------------------------------------------------------------



[50/52] [abbrv] git commit: Merge branch 'master' into two-dot-o

Posted by gr...@apache.org.
Merge branch 'master' into two-dot-o

Conflicts:
	stack/mongo-emulator/src/test/resources/usergrid-test-context.xml


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: 479969f7b7bc9a3b84de665a7973a0e155844852
Parents: e395f12 17a9b8c
Author: Dave Johnson <sn...@apache.org>
Authored: Wed Sep 3 12:47:49 2014 -0400
Committer: Dave Johnson <sn...@apache.org>
Committed: Wed Sep 3 12:47:49 2014 -0400

----------------------------------------------------------------------
 LICENSE                                         |   2 -
 NOTICE                                          |  34 -----
 release/src/main/assembly/source.xml            |   2 +
 .../NSubstitute.1.6.0.0/BreakingChanges.txt     | 131 -------------------
 .../packages/NSubstitute.1.6.0.0/CHANGELOG.txt  | 103 ---------------
 .../packages/NSubstitute.1.6.0.0/README.txt     | 119 -----------------
 sdks/dotnet/packages/NUnit.2.6.2/README.txt     |   3 +
 .../packages/Newtonsoft.Json.4.5.11/README.txt  |   3 +
 sdks/dotnet/packages/RestSharp.104.1/README.txt |   3 +
 sdks/dotnet/packages/RestSharp.104.1/readme.txt |  19 ---
 .../packages/Geocoder.0.1.0.0/README.txt        |   3 +
 .../extensions/usergrid.validation.js           |  34 ++---
 sdks/html5-javascript/lib/Module.js             |  19 ++-
 sdks/html5-javascript/lib/Usergrid.js           |  36 +++--
 sdks/html5-javascript/usergrid.js               |  31 ++---
 sdks/html5-javascript/usergrid.min.js           |  31 ++---
 .../test/resources/usergrid-test-context.xml    |  99 +++++++-------
 ugc/features/step_definitions/ugc_steps.rb      |  23 ++--
 ugc/features/support/env.rb                     |  23 ++--
 ugc/lib/ugc.rb                                  |  23 ++--
 ugc/lib/ugc/application.rb                      |  23 ++--
 ugc/lib/ugc/commands/delete.rb                  |  23 ++--
 ugc/lib/ugc/commands/get.rb                     |  23 ++--
 ugc/lib/ugc/commands/logout.rb                  |  16 +++
 ugc/lib/ugc/commands/post.rb                    |  23 ++--
 ugc/lib/ugc/commands/profile.rb                 |  23 ++--
 ugc/lib/ugc/commands/put.rb                     |  23 ++--
 ugc/lib/ugc/commands/query.rb                   |  23 ++--
 ugc/lib/ugc/commands/target.rb                  |  23 ++--
 ugc/lib/ugc/helpers/curl.rb                     |  23 ++--
 ugc/lib/ugc/helpers/format.rb                   |  23 ++--
 ugc/lib/ugc/helpers/history.rb                  |  23 ++--
 ugc/lib/ugc/helpers/parse.rb                    |  23 ++--
 ugc/lib/ugc/helpers/rest.rb                     |  23 ++--
 ugc/lib/ugc/management.rb                       |  23 ++--
 ugc/lib/ugc/settings.rb                         |  23 ++--
 ugc/lib/ugc/version.rb                          |  23 ++--
 ugc/test/default_test.rb                        |  23 ++--
 ugc/test/test_helper.rb                         |  23 ++--
 39 files changed, 408 insertions(+), 763 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/479969f7/stack/mongo-emulator/src/test/resources/usergrid-test-context.xml
----------------------------------------------------------------------
diff --cc stack/mongo-emulator/src/test/resources/usergrid-test-context.xml
index 66850fd,6c0fedb..d066bb2
--- a/stack/mongo-emulator/src/test/resources/usergrid-test-context.xml
+++ b/stack/mongo-emulator/src/test/resources/usergrid-test-context.xml
@@@ -1,51 -1,48 +1,48 @@@
--<?xml version="1.0" encoding="UTF-8"?>
--<!--
- /*
-  * 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.
-  */
- -->
- <beans xmlns="http://www.springframework.org/schema/beans"
- 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
- 	xmlns:context="http://www.springframework.org/schema/context"
- 	xmlns:p="http://www.springframework.org/schema/p"
- 	xsi:schemaLocation="
- 	http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
- 	http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd
- 	http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
- 
- 
- 	<import resource="classpath:/usergrid-services-context.xml"/>
- 
- 	<bean id="properties"
- 		class="org.springframework.beans.factory.config.PropertiesFactoryBean">
- 		<property name="singleton" value="true" />
- 		<property name="ignoreResourceNotFound" value="true" />
- 		<property name="locations">
- 			<list>
- 				<value>classpath:/usergrid-default.properties</value>
- 				<value>classpath:/usergrid-test.properties</value>
- 				<value>${usergrid-custom-spring-test-properties}</value>
- 			</list>
- 		</property>
- 	</bean>
- 	
- 	<bean id="mongoServer" class="org.apache.usergrid.mongo.MongoServer"
- 		init-method="startServer" destroy-method="stopServer" />
- 
- 	<bean id="databaseInitializer" class="org.apache.usergrid.mongo.DatabaseInitializer"
- 		init-method="init" />
- </beans>
 -    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.
 --->
 -<beans xmlns="http://www.springframework.org/schema/beans"
 -	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
 -	xmlns:context="http://www.springframework.org/schema/context"
 -	xmlns:p="http://www.springframework.org/schema/p"
 -	xsi:schemaLocation="
 -	http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
 -	http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd
 -	http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
 -
 -
 -	<import resource="classpath:/usergrid-services-context.xml"/>
 -
 -	<bean id="properties"
 -		class="org.springframework.beans.factory.config.PropertiesFactoryBean">
 -		<property name="singleton" value="true" />
 -		<property name="ignoreResourceNotFound" value="true" />
 -		<property name="locations">
 -			<list>
 -				<value>classpath:/usergrid-default.properties</value>
 -				<value>classpath:/usergrid-test.properties</value>
 -				<value>${usergrid-custom-spring-test-properties}</value>
 -			</list>
 -		</property>
 -	</bean>
 -	
 -	<bean id="mongoServer" class="org.apache.usergrid.mongo.MongoServer"
 -		init-method="startServer" destroy-method="stopServer" />
 -
 -	<bean id="databaseInitializer" class="org.apache.usergrid.mongo.DatabaseInitializer"
 -		init-method="init" />
 -</beans>
++<?xml version="1.0" encoding="UTF-8"?>
++<!--
++    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.
++-->
++<beans xmlns="http://www.springframework.org/schema/beans"
++	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
++	xmlns:context="http://www.springframework.org/schema/context"
++	xmlns:p="http://www.springframework.org/schema/p"
++	xsi:schemaLocation="
++	http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
++	http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd
++	http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
++
++
++	<import resource="classpath:/usergrid-services-context.xml"/>
++
++	<bean id="properties"
++		class="org.springframework.beans.factory.config.PropertiesFactoryBean">
++		<property name="singleton" value="true" />
++		<property name="ignoreResourceNotFound" value="true" />
++		<property name="locations">
++			<list>
++				<value>classpath:/usergrid-default.properties</value>
++				<value>classpath:/usergrid-test.properties</value>
++				<value>${usergrid-custom-spring-test-properties}</value>
++			</list>
++		</property>
++	</bean>
++	
++	<bean id="mongoServer" class="org.apache.usergrid.mongo.MongoServer"
++		init-method="startServer" destroy-method="stopServer" />
++
++	<bean id="databaseInitializer" class="org.apache.usergrid.mongo.DatabaseInitializer"
++		init-method="init" />
++</beans>


[31/52] [abbrv] git commit: Make it possible to deploy a UG 1 WAR.

Posted by gr...@apache.org.
Make it possible to deploy a UG 1 WAR.


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: b0aee9e80671ef85eeb518b450615d00da7ffdd2
Parents: e129513
Author: Dave Johnson <dm...@apigee.com>
Authored: Fri Aug 29 17:28:29 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Fri Aug 29 17:28:29 2014 -0400

----------------------------------------------------------------------
 stack/awscluster/src/main/dist/init_instance/init_rest_server.sh | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b0aee9e8/stack/awscluster/src/main/dist/init_instance/init_rest_server.sh
----------------------------------------------------------------------
diff --git a/stack/awscluster/src/main/dist/init_instance/init_rest_server.sh b/stack/awscluster/src/main/dist/init_instance/init_rest_server.sh
index d18165a..3adfce4 100644
--- a/stack/awscluster/src/main/dist/init_instance/init_rest_server.sh
+++ b/stack/awscluster/src/main/dist/init_instance/init_rest_server.sh
@@ -111,6 +111,8 @@ cd /usr/share/usergrid/scripts
 groovy wait_for_instances.groovy cassandra ${CASSANDRA_NUM_SERVERS}
 groovy wait_for_instances.groovy graphite ${GRAPHITE_NUM_SERVERS}
 
+chmod 660 /usr/share/usergrid/webapps/ROOT.war
+
 rm -rf /var/lib/tomcat7/webapps/*
 ln -s /usr/share/usergrid/webapps/ROOT.war /var/lib/tomcat7/webapps/ROOT.war
 ln -s /usr/share/usergrid/webapps/portal /var/lib/tomcat7/webapps/portal
@@ -118,6 +120,8 @@ ln -s /usr/share/usergrid/webapps/portal /var/lib/tomcat7/webapps/portal
 # configure usergrid
 mkdir -p /usr/share/tomcat7/lib 
 groovy configure_usergrid.groovy > /usr/share/tomcat7/lib/usergrid-custom.properties 
+# create a copy for 1.0 too
+cp /usr/share/tomcat7/lib/usergrid-custom.properties /usr/share/tomcat7/lib/usergrid-deployment.properties  
 groovy configure_portal_new.groovy >> /var/lib/tomcat7/webapps/portal/config.js
 
 # Go


[03/52] [abbrv] git commit: Fix for the way that arrays are serialized by JSON and a test to verify that arrays work as expected.

Posted by gr...@apache.org.
Fix for the way that arrays are serialized by JSON and a test to verify that arrays work as expected.


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: 4e428e364b031d80e6ec1b8cd05f1f148d764a2d
Parents: 9b53e16
Author: Dave Johnson <dm...@apigee.com>
Authored: Wed Aug 27 20:42:04 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Wed Aug 27 20:42:04 2014 -0400

----------------------------------------------------------------------
 .../corepersistence/CpEntityManager.java        |    7 +-
 .../corepersistence/CpEntityMapUtils.java       |    2 +-
 .../corepersistence/CpRelationManager.java      |   26 +-
 .../corepersistence/CpEntityMapUtilsTest.java   |  119 +
 .../persistence/GeoQueryBooleanTest.java        |  178 +
 .../MvccEntitySerializationStrategyImpl.java    |    9 +-
 .../persistence/model/entity/Entity.java        |    2 +-
 .../model/field/value/EntityObject.java         |   12 +-
 stack/corepersistence/pom.xml                   |    2 +-
 .../index/query/tree/CpQueryFilterLexer.java    | 3123 ------------------
 .../index/query/tree/CpQueryFilterParser.java   | 2501 --------------
 11 files changed, 326 insertions(+), 5655 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4e428e36/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 2ce3d56..28124c2 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
@@ -2486,12 +2486,13 @@ public class CpEntityManager implements EntityManager {
         EntityCollectionManager ecm = managerCache.getEntityCollectionManager( collectionScope );
 
         if ( logger.isDebugEnabled() ) {
-            logger.debug( "Writing entity {}:{} into scope\n   app {}\n   owner {}\n   name {}", 
+            logger.debug( "Writing entity {}:{} into scope\n   app {}\n   owner {}\n   name {} data {}", 
                 new Object[] {
                     entity.getType(), entity.getUuid(), 
                     collectionScope.getApplication(), 
                     collectionScope.getOwner(),
-                    collectionScope.getName()
+                    collectionScope.getName(),
+                    CpEntityMapUtils.toMap(cpEntity)
             } );
 //
 //            if ( entity.getType().equals("group")) {
@@ -2750,7 +2751,7 @@ public class CpEntityManager implements EntityManager {
     }
 
 
-    private org.apache.usergrid.persistence.model.entity.Entity entityToCpEntity( Entity entity, UUID importId ) {
+    public static org.apache.usergrid.persistence.model.entity.Entity entityToCpEntity( Entity entity, UUID importId ) {
 
         UUID uuid = importId != null ? importId : entity.getUuid();
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4e428e36/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityMapUtils.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityMapUtils.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityMapUtils.java
index 560f283..18eb7f9 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityMapUtils.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityMapUtils.java
@@ -59,7 +59,7 @@ import org.slf4j.LoggerFactory;
  * Utilities for converting entities to/from maps suitable for Core Persistence.
  * Aware of unique properties via Schema.
  */
-class CpEntityMapUtils {
+public class CpEntityMapUtils {
     private static final Logger logger = LoggerFactory.getLogger( CpEntityMapUtils.class );
 
     public static ObjectMapper objectMapper = new ObjectMapper(  );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4e428e36/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
index d467682..31d32dd 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
@@ -650,7 +650,6 @@ public class CpRelationManager implements RelationManager {
             return null;
         }
 
-
         // load the new member entity to be added to the collection from its default scope
         CollectionScope memberScope = new CollectionScopeImpl( 
             applicationScope.getApplication(), 
@@ -658,28 +657,29 @@ public class CpRelationManager implements RelationManager {
             CpEntityManager.getCollectionScopeNameFromEntityType( itemRef.getType()));
         EntityCollectionManager memberMgr = managerCache.getEntityCollectionManager(memberScope);
 
+        org.apache.usergrid.persistence.model.entity.Entity memberEntity = memberMgr.load(
+            new SimpleId( itemRef.getUuid(), itemRef.getType() )).toBlockingObservable().last();
+
+        if ( memberEntity == null ) {
+            throw new RuntimeException("Unable to load entity uuid=" 
+                + itemRef.getUuid() + " type=" + itemRef.getType());
+        }
+
         if ( logger.isDebugEnabled() ) {
-            logger.debug("Loading member entity {}:{} from scope\n   app {}\n   owner {}\n   name {}", 
+            logger.debug("Loaded member entity {}:{} from scope\n   app {}\n   owner {}\n   name {} data {}", 
                 new Object[] { 
                     itemRef.getType(), 
                     itemRef.getUuid(), 
                     memberScope.getApplication(), 
                     memberScope.getOwner(), 
-                    memberScope.getName() 
+                    memberScope.getName(),
+                    CpEntityMapUtils.toMap(memberEntity)
             });
         }
 
-        org.apache.usergrid.persistence.model.entity.Entity memberEntity = memberMgr.load(
-            new SimpleId( itemRef.getUuid(), itemRef.getType() )).toBlockingObservable().last();
-
-        if ( memberEntity == null ) {
-            throw new RuntimeException("Unable to load entity uuid=" 
-                + itemRef.getUuid() + " type=" + itemRef.getType());
-        }
-
         String edgeType = getEdgeTypeFromCollectionName( collName, memberEntity.getId().getType() );
 
-        logger.debug("createCollection(): Creating edge type {} from {}:{} to {}:{}", 
+        logger.debug("addToCollection(): Creating edge type {} from {}:{} to {}:{}", 
             new Object[] { 
                 edgeType, 
                 headEntity.getType(), headEntity.getUuid(), 
@@ -694,7 +694,7 @@ public class CpRelationManager implements RelationManager {
         GraphManager gm = managerCache.getGraphManager(applicationScope);
         gm.writeEdge(edge).toBlockingObservable().last();
 
-        // index member into entity connection | type scope
+        // index member into entity collection | type scope
         IndexScope collectionIndexScope = new IndexScopeImpl(
             applicationScope.getApplication(), 
             cpHeadEntity.getId(), 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4e428e36/stack/core/src/test/java/org/apache/usergrid/corepersistence/CpEntityMapUtilsTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/corepersistence/CpEntityMapUtilsTest.java b/stack/core/src/test/java/org/apache/usergrid/corepersistence/CpEntityMapUtilsTest.java
new file mode 100644
index 0000000..87f6b46
--- /dev/null
+++ b/stack/core/src/test/java/org/apache/usergrid/corepersistence/CpEntityMapUtilsTest.java
@@ -0,0 +1,119 @@
+/*
+ * Copyright 2014 The Apache Software Foundation.
+ *
+ * Licensed 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.corepersistence;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import org.apache.usergrid.persistence.model.entity.Entity;
+import org.apache.usergrid.persistence.model.entity.SimpleId;
+import org.apache.usergrid.persistence.model.field.ListField;
+import org.apache.usergrid.persistence.model.field.value.EntityObject;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+public class CpEntityMapUtilsTest {
+    private static final Logger log = LoggerFactory.getLogger( CpEntityMapUtilsTest.class );
+
+    @Test
+    public void testToMap() {
+
+        Map<String, Object> properties = new LinkedHashMap<String, Object>() {{
+            put( "username", "bart" );
+            put( "email", "bart@example.com" );
+            put( "block", new ArrayList<Object>() {{
+                add( new LinkedHashMap<String, Object>() {{ put("name", "fred"); }});
+                add( new LinkedHashMap<String, Object>() {{ put("name", "gertrude"); }});
+                add( new LinkedHashMap<String, Object>() {{ put("name", "mina"); }});
+            }});            
+            put( "blockedBy", new ArrayList<Object>() {{
+                add( new LinkedHashMap<String, Object>() {{ put("name", "isabell"); }});
+            }});
+            put( "location", new LinkedHashMap<String, Object>() {{
+                put("latitude", 37.776753 );
+                put("longitude", -122.407846 );
+            }}); 
+        }};
+
+        Entity cpEntity = CpEntityMapUtils.fromMap( properties, "user", true );
+        assertUserWithBlocks( cpEntity );
+    }
+
+        
+    @Test
+    public void testSerialization() throws JsonProcessingException, IOException {
+
+        Map<String, Object> properties = new LinkedHashMap<String, Object>() {{
+            put( "username", "bart" );
+            put( "email", "bart@example.com" );
+            put( "block", new ArrayList<Object>() {{
+                add( new LinkedHashMap<String, Object>() {{ put("name", "fred"); }});
+                add( new LinkedHashMap<String, Object>() {{ put("name", "gertrude"); }});
+                add( new LinkedHashMap<String, Object>() {{ put("name", "mina"); }});
+            }});            
+            put( "blockedBy", new ArrayList<Object>() {{
+                add( new LinkedHashMap<String, Object>() {{ put("name", "isabell"); }});
+            }});
+            put( "location", new LinkedHashMap<String, Object>() {{
+                put("latitude", 37.776753 );
+                put("longitude", -122.407846 );
+            }}); 
+        }};
+
+        org.apache.usergrid.persistence.model.entity.Entity entity = 
+            new org.apache.usergrid.persistence.model.entity.Entity(
+                new SimpleId( "user" ) );
+        entity = CpEntityMapUtils.fromMap( entity, properties, null, true );
+
+        assertUserWithBlocks( entity );
+
+        ObjectMapper mapper = new ObjectMapper();
+        mapper.enable(SerializationFeature.INDENT_OUTPUT);
+        mapper.enableDefaultTypingAsProperty(ObjectMapper.DefaultTyping.JAVA_LANG_OBJECT, "@class");
+
+        String entityString = mapper.writeValueAsString( entity );
+        //log.debug("Serialized to JSON: " + entityString );
+
+        TypeReference<Entity> tr = new TypeReference<Entity>() {};
+        entity = mapper.readValue( entityString, tr );
+        //log.debug("Round-tripped entity: " + CpEntityMapUtils.toMap(entity) );
+
+        assertUserWithBlocks( entity );
+    }
+
+
+    private void assertUserWithBlocks( org.apache.usergrid.persistence.model.entity.Entity e ) {
+        
+        assertTrue( e.getField("block") instanceof ListField );
+        assertTrue( e.getField("block").getValue() instanceof List );
+        List blockList = (List)e.getField("block").getValue();
+
+        EntityObject entityObject = (EntityObject)blockList.get(0);
+        assertEquals("fred", entityObject.getField("name").getValue());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4e428e36/stack/core/src/test/java/org/apache/usergrid/persistence/GeoQueryBooleanTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/GeoQueryBooleanTest.java b/stack/core/src/test/java/org/apache/usergrid/persistence/GeoQueryBooleanTest.java
new file mode 100644
index 0000000..8767a70
--- /dev/null
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/GeoQueryBooleanTest.java
@@ -0,0 +1,178 @@
+/*
+ * 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;
+
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.inject.Injector;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.usergrid.AbstractCoreIT;
+import org.apache.usergrid.cassandra.Concurrent;
+import org.apache.usergrid.corepersistence.CpEntityMapUtils;
+import org.apache.usergrid.corepersistence.CpSetup;
+import org.apache.usergrid.persistence.collection.CollectionScope;
+import org.apache.usergrid.persistence.collection.EntityCollectionManager;
+import org.apache.usergrid.persistence.collection.EntityCollectionManagerFactory;
+import org.apache.usergrid.persistence.collection.impl.CollectionScopeImpl;
+import org.apache.usergrid.persistence.geo.model.Point;
+import org.apache.usergrid.persistence.index.query.Query;
+import org.apache.usergrid.persistence.model.entity.SimpleId;
+import org.apache.usergrid.persistence.model.field.ListField;
+import org.apache.usergrid.persistence.model.field.value.EntityObject;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+
+@Concurrent()
+public class GeoQueryBooleanTest extends AbstractCoreIT {
+    private static final Logger log = LoggerFactory.getLogger( GeoQueryBooleanTest.class );
+
+
+    public GeoQueryBooleanTest() {
+        super();
+    }
+
+
+    @Test
+    public void testGeoQueryWithOr() throws Exception {
+
+        log.info( "GeoQueryBooleanTest.testGeoQueryWithOr" );
+
+        UUID applicationId = setup.createApplication( "testOrganization", "testGeoQueryWithOr" );
+        assertNotNull( applicationId );
+
+        EntityManager em = setup.getEmf().getEntityManager( applicationId );
+        assertNotNull( em );
+
+        // create two users at a location
+
+        Map<String, Object> properties = new LinkedHashMap<String, Object>() {{
+            put( "username", "ed" );
+            put( "employer", "Apigee" );
+            put( "email", "ed@example.com" );
+            put( "location", new LinkedHashMap<String, Object>() {{
+                put("latitude", 37.776753 );
+                put("longitude", -122.407846 );
+            }} ); 
+        }};
+
+        Entity user1 = em.create( "user", properties );
+        assertNotNull( user1 );
+
+        properties = new LinkedHashMap<String, Object>() {{
+            put( "username", "fred" );
+            put( "employer", "Microsoft" );
+            put( "email", "fred@example.com" );
+            put( "location", new LinkedHashMap<String, Object>() {{
+                put("latitude", 37.776753 );
+                put("longitude", -122.407846 );
+            }} ); 
+        }};
+
+        Entity user2 = em.create( "user", properties );
+        assertNotNull( user2 );
+
+        em.refreshIndex();
+
+        // define center point about 300m from that location
+        Point center = new Point( 37.774277, -122.404744 );
+
+        Query query = Query.fromQL( "select * where location within 400 of " 
+                                    + center.getLat() + "," + center.getLon());
+        Results listResults = em.searchCollection( em.getApplicationRef(), "users", query );
+        assertEquals( 2, listResults.size() );
+
+        query = Query.fromQL( "select * where employer='Apigee' or location within 100 of " 
+                                    + center.getLat() + "," + center.getLon());
+        listResults = em.searchCollection( em.getApplicationRef(), "users", query );
+
+        // no results because geo filter applied after query even in the case or 'or'
+        assertEquals( 0, listResults.size() );
+
+        query = Query.fromQL( "select * where employer='Apigee' or location within 400 of " 
+                                    + center.getLat() + "," + center.getLon());
+        listResults = em.searchCollection( em.getApplicationRef(), "users", query );
+
+        // only one result because geo filter applied after query even in the case or 'or'
+        assertEquals( 1, listResults.size() );
+    }
+
+
+    @Test
+    public void testGeoQueryWithNot() throws Exception {
+
+        log.info( "GeoQueryBooleanTest.testGeoQueryWithOr" );
+
+        UUID applicationId = setup.createApplication( "testOrganization", "testGeoQueryWithOr" );
+        assertNotNull( applicationId );
+
+        EntityManager em = setup.getEmf().getEntityManager( applicationId );
+        assertNotNull( em );
+
+        Map<String, Object> properties = new LinkedHashMap<String, Object>() {{
+            put( "username", "bart" );
+            put( "email", "bart@example.com" );
+            put( "block", new ArrayList<Object>() {{
+                add( new LinkedHashMap<String, Object>() {{ put("name", "fred"); }});
+                add( new LinkedHashMap<String, Object>() {{ put("name", "gertrude"); }});
+                add( new LinkedHashMap<String, Object>() {{ put("name", "mina"); }});
+            }});            
+            put( "blockedBy", new ArrayList<Object>() {{
+                add( new LinkedHashMap<String, Object>() {{ put("name", "isabell"); }});
+            }});
+            put( "location", new LinkedHashMap<String, Object>() {{
+                put("latitude", 37.776753 );
+                put("longitude", -122.407846 );
+            }}); 
+        }};
+
+        Entity userBart = em.create( "user", properties );
+        assertNotNull( userBart );
+//
+//        properties = new LinkedHashMap<String, Object>() {{
+//            put( "username", "fred" );
+//            put( "email", "fred@example.com" );
+//            put( "block", new ArrayList<Object>() {{
+//                add( new LinkedHashMap<String, Object>() {{ put("name", "steve"); }});
+//                add( new LinkedHashMap<String, Object>() {{ put("name", "mina"); }});
+//            }});
+//            put( "blockedBy", new ArrayList<Object>() {{
+//                add( new LinkedHashMap<String, Object>() {{ put("name", "bart"); }});
+//            }});
+//            put( "location", new LinkedHashMap<String, Object>() {{
+//                put("latitude", 37.776753 );
+//                put("longitude", -122.407846 );
+//            }} ); 
+//        }};
+//
+//        Entity userFred = em.create( "user", properties );
+//        assertNotNull( userFred );
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4e428e36/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImpl.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImpl.java
index cbc1c8c..4f8d1f3 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImpl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImpl.java
@@ -366,9 +366,8 @@ public class MvccEntitySerializationStrategyImpl implements MvccEntitySerializat
 
             byte[] state = parser.read( BYTES_ARRAY_SERIALIZER );
 
-            /**
-             * It's been deleted, remove it
-             */
+            // it's been deleted, remove it
+
             if ( Arrays.equals( STATE_DELETED, state ) ) {
                 return new EntityWrapper( MvccEntity.Status.COMPLETE, Optional.<Entity>absent() );
             }
@@ -381,7 +380,7 @@ public class MvccEntitySerializationStrategyImpl implements MvccEntitySerializat
             int length = jsonBytes.remaining();
 
             try {
-                storedEntity = mapper.readValue( array,start,length,Entity.class);
+                storedEntity = mapper.readValue( array, start, length, Entity.class );
             }
             catch ( Exception e ) {
                 throw new RuntimeException(e.getMessage());
@@ -393,7 +392,7 @@ public class MvccEntitySerializationStrategyImpl implements MvccEntitySerializat
                 return new EntityWrapper( MvccEntity.Status.COMPLETE, entity );
             }
 
-            //it's partial by default
+            // it's partial by default
             return new EntityWrapper( MvccEntity.Status.PARTIAL, entity );
         }
     }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4e428e36/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/entity/Entity.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/entity/Entity.java b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/entity/Entity.java
index 4287626..c5089dc 100644
--- a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/entity/Entity.java
+++ b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/entity/Entity.java
@@ -34,7 +34,7 @@ import com.google.common.base.Preconditions;
  * Equality is based both on id an on version.
  */
 @JsonIgnoreProperties(ignoreUnknown = true)
-@JsonTypeInfo( use= JsonTypeInfo.Id.CLASS,include= JsonTypeInfo.As.WRAPPER_OBJECT,property="@class" )
+@JsonTypeInfo( use=JsonTypeInfo.Id.CLASS, include=JsonTypeInfo.As.PROPERTY, property="@class" )
 public class Entity extends EntityObject {
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4e428e36/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/value/EntityObject.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/value/EntityObject.java b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/value/EntityObject.java
index 2443776..12915e2 100644
--- a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/value/EntityObject.java
+++ b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/value/EntityObject.java
@@ -41,7 +41,7 @@ public class EntityObject implements Serializable {
     /**
      * Fields the users can set
      */
-    @JsonTypeInfo( use= JsonTypeInfo.Id.CLASS,include= JsonTypeInfo.As.WRAPPER_OBJECT,property="@class" )
+    @JsonTypeInfo( use=JsonTypeInfo.Id.CLASS, include=JsonTypeInfo.As.PROPERTY, property="@class" )
     private final Map<String, Field> fields = new HashMap<String, Field>();
 
     /**
@@ -66,12 +66,14 @@ public class EntityObject implements Serializable {
 
     //@JsonAnySetter
     public void setFields(ArrayList al) {
-        if(al.size() == 0)
+
+        if ( al.isEmpty()) {
             return;
+        }
 
         for(int i = 0; i < al.size(); i++) {
             String str = al.get( i ).toString();
-            if(str.contains( "version" )){
+            if ( str.contains( "version" )) {
                 continue;
             }
             Field fd = ( Field ) al.get( i );
@@ -79,10 +81,6 @@ public class EntityObject implements Serializable {
         }
     }
 
-
-    public void getFields( String name) {
-        fields.get( name );
-    }
     /**
      * Get all fields in the entity
      */

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4e428e36/stack/corepersistence/pom.xml
----------------------------------------------------------------------
diff --git a/stack/corepersistence/pom.xml b/stack/corepersistence/pom.xml
index 5a5c20c..7dad18c 100644
--- a/stack/corepersistence/pom.xml
+++ b/stack/corepersistence/pom.xml
@@ -94,7 +94,7 @@
                     <systemPropertyVariables>
                         <archaius.deployment.environment>UNIT</archaius.deployment.environment>
                     </systemPropertyVariables>
-                    <argLine>-Xms2G -Xmx4G</argLine>
+                    <argLine>-Xms2G -Xmx4G -Dlog4j.debug=true -Dlog4j.configuration=file://${project.basedir}/src/test/resources/log4j.properties</argLine>
                 </configuration>
             </plugin>
 


[46/52] [abbrv] git commit: Merge branch 'master' into two-dot-o

Posted by gr...@apache.org.
Merge branch 'master' into two-dot-o

Conflicts:
	.gitignore
	stack/core/pom.xml
	stack/pom.xml
	stack/rest/pom.xml
	stack/services/pom.xml
	stack/test-utils/pom.xml


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: e395f1218f7e57561b9a9c99c84cefc9ef1e22cc
Parents: c9fd821 ac68da7
Author: Dave Johnson <sn...@apache.org>
Authored: Wed Sep 3 09:41:37 2014 -0400
Committer: Dave Johnson <sn...@apache.org>
Committed: Wed Sep 3 09:41:37 2014 -0400

----------------------------------------------------------------------
 .gitignore                                      |  4 ++-
 LICENSE                                         | 28 +++++++++++++++++
 NOTICE                                          | 33 ++------------------
 release/pom.xml                                 |  2 +-
 release/sign-release.sh                         |  2 +-
 release/src/main/assembly/source.xml            |  6 ++++
 stack/core/pom.xml                              |  5 ++-
 .../apache/usergrid/launcher/AppleUtils.java    | 21 +++++++------
 stack/mongo-emulator/pom.xml                    |  2 +-
 stack/pom.xml                                   |  8 ++---
 stack/query-validator/pom.xml                   |  2 +-
 stack/rest/pom.xml                              |  4 +--
 stack/services/pom.xml                          | 10 +++---
 stack/test-utils/pom.xml                        |  2 +-
 stack/tools/pom.xml                             |  2 +-
 stack/websocket/pom.xml                         |  2 +-
 16 files changed, 72 insertions(+), 61 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e395f121/.gitignore
----------------------------------------------------------------------
diff --cc .gitignore
index 4f7205a,47ed041..34ab44c
--- a/.gitignore
+++ b/.gitignore
@@@ -80,4 -59,5 +80,6 @@@ portal/js/templates.j
  /release/target/
  
  /portal/seleniumLog.txt
- !/stack/corepersistence/common/src/test/resources/usergrid-UNIT.properties
+ /stack/core/src/main/java/org/apache/usergrid/persistence/query/tree/QueryFilterLexer.java
 -/stack/core/src/main/java/org/apache/usergrid/persistence/query/tree/QueryFilterParser.java
++/stack/core/src/main/java/org/apache/usergrid/persistence/query/tree/QueryFilterParser.java
++!/stack/corepersistence/common/src/test/resources/usergrid-UNIT.properties

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e395f121/stack/core/pom.xml
----------------------------------------------------------------------
diff --cc stack/core/pom.xml
index 08c8c1c,df764c7..709d9aa
--- a/stack/core/pom.xml
+++ b/stack/core/pom.xml
@@@ -65,11 -64,11 +65,10 @@@
                  <suite.concurrency>${core.it.suite.concurrency}</suite.concurrency>
                </systemPropertyVariables>
  
 -              <parallel>both</parallel>
 +              <parallel>${core.it.parallel}</parallel>
                <forkCount>${core.it.forkCount}</forkCount>
 -              <reuseForks>false</reuseForks>
 -
 +              <reuseForks>${core.it.reuseForks}</reuseForks>
- 				
-               <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar
+               <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline}
                </argLine>
  
                <includes>
@@@ -168,10 -253,8 +167,10 @@@
              <storage-config>${basedir}/src/test/conf</storage-config>
              <target.directory>${project.build.directory}</target.directory>
            </systemPropertyVariables>
 -          <forkMode>once</forkMode>
 +          <parallel>classes</parallel>
 +          <forkCount>${core.it.forkCount}</forkCount>
 +          <reuseForks>${core.it.reuseForks}</reuseForks>
-           <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar</argLine>
+           <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline}</argLine>
  
            <includes>
              <include>**/*ConcurrentCoreITSuite.java</include>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e395f121/stack/mongo-emulator/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e395f121/stack/pom.xml
----------------------------------------------------------------------
diff --cc stack/pom.xml
index 63c9143,843b72f..c5e3eca
--- a/stack/pom.xml
+++ b/stack/pom.xml
@@@ -1664,11 -1609,7 +1665,10 @@@
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.15</version>
            <configuration>
 -            <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline}</argLine>
 +              <parallel>${usergrid.it.parallel}</parallel>
 +              <forkCount>${usergrid.it.forkCount}</forkCount>
 +              <reuseForks>${usergrid.it.reuseForks}</reuseForks>
-           	
-             <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar</argLine>
++              <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline}</argLine>
            </configuration>
          </plugin>
  

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e395f121/stack/query-validator/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e395f121/stack/rest/pom.xml
----------------------------------------------------------------------
diff --cc stack/rest/pom.xml
index 6fb977d,cadf14b..4f6ff9c
--- a/stack/rest/pom.xml
+++ b/stack/rest/pom.xml
@@@ -17,416 -17,573 +17,416 @@@
  -->
  <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 -  <modelVersion>4.0.0</modelVersion>
 -  <parent>
 -    <groupId>org.apache.usergrid</groupId>
 -    <artifactId>usergrid</artifactId>
 -    <version>1.0.0</version>
 -    <relativePath>../</relativePath>
 -  </parent>
 -
 -  <artifactId>usergrid-rest</artifactId>
 -  <packaging>war</packaging>
 -  <name>Usergrid REST</name>
 -  <description>REST web services for Usergrid system.</description>
 -
 -  <!-- Override these properties in an active profile within your settings.xml -->
 -  <properties>
 -    <!-- If you got the resources, max parallelism = 6 forks -->
 -    <rest.it.forkCount>3</rest.it.forkCount>
 -  </properties>
 -
 -  <profiles>
 -    <profile>
 -      <id>unit</id>
 -      <activation>
 -        <property>
 -          <name>unit</name>
 -          <value>true</value>
 -        </property>
 -      </activation>
 -      <build>
 -        <plugins>
 -          <plugin>
 -            <groupId>org.apache.maven.plugins</groupId>
 -            <artifactId>maven-surefire-plugin</artifactId>
 -            <configuration>
 -              <systemPropertyVariables>
 -                <storage-config>${basedir}/src/test/conf</storage-config>
 -                <target.directory>${project.build.directory}</target.directory>
 -              </systemPropertyVariables>
 -              <forkMode>once</forkMode>
 -              <!-- TODO: make this into a small configuration but based on settings.xml -->
 -              <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline}</argLine>
 -
 -              <includes>
 -                <include>**/RestTestSuite.java</include>
 -                <include>**/*Test.java</include>
 -              </includes>
 -              <excludes>
 -                <exclude>**/*IT.java</exclude>
 -                <exclude>**/*ITSuite.java</exclude>
 -                <!-- TODO - add these suites too -->
 -                <!-- <exclude>**/*Test.java</exclude> -->
 -                <exclude>**/ConcurrentRest*Suite.java</exclude>
 -              </excludes>
 -            </configuration>
 -          </plugin>
 -        </plugins>
 -      </build>
 -    </profile>
 -
 -    <profile>
 -      <id>default</id>
 -      <activation>
 -        <activeByDefault>true</activeByDefault>
 -      </activation>
 -      <build>
 -        <plugins>
 -          <plugin>
 -            <groupId>org.apache.maven.plugins</groupId>
 -            <artifactId>maven-surefire-plugin</artifactId>
 -            <configuration>
 -              <systemPropertyVariables>
 -                <storage-config>${basedir}/src/test/conf</storage-config>
 -                <target.directory>${project.build.directory}</target.directory>
 -              </systemPropertyVariables>
 -
 -              <parallel>classes</parallel>
 -              <forkCount>${rest.it.forkCount}</forkCount>
 -              <reuseForks>false</reuseForks>
 -              <perCoreThreadCount>false</perCoreThreadCount>
 -              <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline}
 -              </argLine>
 -
 -              <includes>
 -                <include>**/RestTestSuite.java</include>
 -                <include>**/RestITSuite.java</include>
 -                <include>**/*IT.java</include>
 -                <include>**/*Test.java</include>
 -              </includes>
 -              <excludes>
 -                <exclude>**/*Concurrent*Suite.java</exclude>
 -                <exclude>**/ActivityResourceIT.java</exclude>
 -                <exclude>**/AdminEmailEncodingIT.java</exclude>
 -                <exclude>**/ApplicationRequestCounterIT.java</exclude>
 -                <exclude>**/AssetResourceIT.java</exclude>
 -                <exclude>**/BasicIT.java</exclude>
 -                <exclude>**/CollectionsResourceIT.java</exclude>
 -                <exclude>**/ContentTypeResourceIT.java</exclude>
 -                <exclude>**/DevicesResourceIT.java</exclude>
 -                <exclude>**/EventsResourceIT.java</exclude>
 -                <exclude>**/GroupResourceIT.java</exclude>
 -                <exclude>**/OrganizationResourceIT.java</exclude>
 -                <exclude>**/OrganizationsResourceIT.java</exclude>
 -                <exclude>**/OwnershipResourceIT.java</exclude>
 -                <exclude>**/PagingResourceIT.java</exclude>
 -                <exclude>**/PermissionsResourceIT.java</exclude>
 -                <exclude>**/UserResourceIT.java</exclude>
 -                <exclude>**/UsersOrganizationsResourceIT.java</exclude>
 -              </excludes>
 -            </configuration>
 -          </plugin>
 -        </plugins>
 -      </build>
 -    </profile>
 -
 -    <profile>
 -      <id>scott</id>
 -      <activation>
 -        <property>
 -          <name>unit-concurrent</name>
 -          <value>true</value>
 -        </property>
 -      </activation>
 -      <build>
 -        <plugins>
 -          <plugin>
 -            <groupId>org.apache.maven.plugins</groupId>
 -            <artifactId>maven-surefire-plugin</artifactId>
 -            <configuration>
 -              <systemPropertyVariables>
 -                <storage-config>${basedir}/src/test/conf</storage-config>
 -                <target.directory>${project.build.directory}</target.directory>
 -              </systemPropertyVariables>
 -
 -              <parallel>classes</parallel>
 -              <forkCount>${rest.it.forkCount}</forkCount>
 -              <reuseForks>false</reuseForks>
 -              <perCoreThreadCount>false</perCoreThreadCount>
 -              <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline}
 -              </argLine>
 -
 -              <includes>
 -                <include>**/RestTestSuite.java</include>
 -                <include>**/RestITSuite.java</include>
 -                <include>**/ManagementResourceIT.java</include>
 -                <include>**/ApplicationResourceIT.java</include>
 -              </includes>
 -              <excludes>
 -                <exclude>**/*Test.java</exclude>
 -                <exclude>**/*Concurrent*Suite.java</exclude>
 -              </excludes>
 -            </configuration>
 -          </plugin>
 -        </plugins>
 -      </build>
 -    </profile>
 -
 -    <profile>
 -      <id>unit-concurrent</id>
 -      <activation>
 -        <property>
 -          <name>unit-concurrent</name>
 -          <value>true</value>
 -        </property>
 -      </activation>
 -      <build>
 -        <plugins>
 -          <plugin>
 -            <groupId>org.apache.maven.plugins</groupId>
 -            <artifactId>maven-surefire-plugin</artifactId>
 -            <configuration>
 -              <systemPropertyVariables>
 -                <storage-config>${basedir}/src/test/conf</storage-config>
 -                <target.directory>${project.build.directory}</target.directory>
 -              </systemPropertyVariables>
 -              <forkMode>once</forkMode>
 -              <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline}</argLine>
 -
 -              <includes>
 -                <include>**/ConcurrentRestTestSuite.java</include>
 -              </includes>
 -              <excludes>
 -                <exclude>**/*IT.java</exclude>
 -                <exclude>**/*Test.java</exclude>
 -                <exclude>**/RestITSuite.java</exclude>
 -                <exclude>**/RestTestSuite.java</exclude>
 -                <exclude>**/ConcurrentRestITSuite.java</exclude>
 -              </excludes>
 -            </configuration>
 -          </plugin>
 -        </plugins>
 -      </build>
 -    </profile>
 -
 -    <profile>
 -      <id>integ-concurrent</id>
 -      <activation>
 -        <property>
 -          <name>integ-concurrent</name>
 -          <value>true</value>
 -        </property>
 -      </activation>
 -      <build>
 +    <modelVersion>4.0.0</modelVersion>
 +    <parent>
 +        <groupId>org.apache.usergrid</groupId>
 +        <artifactId>usergrid</artifactId>
 +        <version>2.0.0-SNAPSHOT</version>
 +    </parent>
 +
 +    <artifactId>usergrid-rest</artifactId>
 +    <packaging>war</packaging>
 +    <name>Usergrid REST</name>
 +    <description>REST web services for Usergrid system.</description>
 +
 +    <!-- Override these properties in an active profile within your settings.xml -->
 +    <properties>
 +        <!-- If you got the resources, max parallelism = 6 forks -->
 +        <rest.it.forkCount>2</rest.it.forkCount>
 +        <rest.it.reuseForks>false</rest.it.reuseForks>
 +        <rest.it.parallel>suites</rest.it.parallel>
 +    </properties>
 +
 +    <profiles>
 +
 +        <profile>
 +            <id>default</id>
 +            <activation>
 +                <activeByDefault>true</activeByDefault>
 +            </activation>
 +            <build>
 +                <plugins>
 +                    <plugin>
 +                        <groupId>org.apache.maven.plugins</groupId>
 +                        <artifactId>maven-surefire-plugin</artifactId>
 +                        <configuration>
 +
 +                            <systemPropertyVariables>
 +                                <storage-config>${basedir}/src/test/conf</storage-config>
 +                                <target.directory>${project.build.directory}</target.directory>
 +                            </systemPropertyVariables>
 +
 +                            <forkCount>${rest.it.forkCount}</forkCount>
 +                            <reuseForks>${rest.it.reuseForks}</reuseForks>
 +
 +                            <parallel>${rest.it.parallel}</parallel>
 +
-                             <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar -Djava.util.logging.config.file=src/test/resources/logging.properties</argLine>
++                            <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar -Djava.util.logging.config.file=src/test/resources/logging.properties ${ug.argline}</argLine>
 +
 +                            <additionalClasspathElements>
 +                                <additionalClasspathElement>./target/classes/jsp/WEB_002dINF/jsp</additionalClasspathElement>
 +                            </additionalClasspathElements>
 +
 +                            <includes>
 +<!--                                <include>**/RestTestSuite.java</include>
 +                                <include>**/RestITSuite.java</include>-->
 +                                <include>**/*IT.java</include>
 +                                <include>**/*Test.java</include>
 +                            </includes>
 +                            <excludes>
 +<!--                                <exclude>**/*Concurrent*Suite.java</exclude>
 +                                <exclude>**/ActivityResourceIT.java</exclude>
 +                                <exclude>**/AdminEmailEncodingIT.java</exclude>
 +                                <exclude>**/ApplicationRequestCounterIT.java</exclude>
 +                                <exclude>**/AssetResourceIT.java</exclude>
 +                                <exclude>**/BasicIT.java</exclude>
 +                                <exclude>**/CollectionsResourceIT.java</exclude>
 +                                <exclude>**/ContentTypeResourceIT.java</exclude>
 +                                <exclude>**/DevicesResourceIT.java</exclude>
 +                                <exclude>**/EventsResourceIT.java</exclude>
 +                                <exclude>**/GroupResourceIT.java</exclude>
 +                                <exclude>**/OrganizationResourceIT.java</exclude>
 +                                <exclude>**/OrganizationsResourceIT.java</exclude>
 +                                <exclude>**/OwnershipResourceIT.java</exclude>
 +                                <exclude>**/PagingResourceIT.java</exclude>
 +                                <exclude>**/PermissionsResourceIT.java</exclude>
 +                                <exclude>**/UserResourceIT.java</exclude>
 +                                <exclude>**/UsersOrganizationsResourceIT.java</exclude>-->
 +                            </excludes>
 +                        </configuration>
 +                    </plugin>
 +                </plugins>
 +            </build>
 +        </profile>
 +
 +    </profiles>
 +
 +    <build>
 +        <finalName>ROOT</finalName>
 +
 +        <resources>
 +            <resource>
 +                <directory>src/main/resources</directory>
 +                <filtering>true</filtering>
 +                <includes>
 +                    <include>**/*.xml</include>
 +                    <include>**/*.json</include>
 +                </includes>
 +            </resource>
 +        </resources>
 +
 +        <testResources>
 +            <testResource>
 +                <directory>src/test/resources</directory>
 +                <filtering>true</filtering>
 +                <includes>
 +                    <include>**/*</include>
 +                </includes>
 +            </testResource>
 +        </testResources>
 +
          <plugins>
 -          <plugin>
 -            <groupId>org.apache.maven.plugins</groupId>
 -            <artifactId>maven-surefire-plugin</artifactId>
 -            <configuration>
 -              <systemPropertyVariables>
 -                <storage-config>${basedir}/src/test/conf</storage-config>
 -                <target.directory>${project.build.directory}</target.directory>
 -              </systemPropertyVariables>
 -              <forkMode>once</forkMode>
 -              <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline}</argLine>
 -
 -              <includes>
 -                <include>**/ConcurrentRestITSuite.java</include>
 -                <include>**/LongRunningNotInSuiteIT.java</include>
 -                <!-- an example -->
 -              </includes>
 -              <excludes>
 -                <exclude>**/*IT.java</exclude>
 -                <exclude>**/*Test.java</exclude>
 -                <exclude>**/RestITSuite.java</exclude>
 -                <exclude>**/RestTestSuite.java</exclude>
 -              </excludes>
 -            </configuration>
 -          </plugin>
 +            <plugin>
 +                <groupId>org.apache.maven.plugins</groupId>
 +                <artifactId>maven-surefire-plugin</artifactId>
 +                <configuration>
 +        			<parallel>${rest.it.parallel}</parallel>
 +                    <forkCount>${rest.it.forkCount}</forkCount>
 +                    <reuseForks>${rest.it.reuseForks}</reuseForks>
-                     <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar</argLine>
++                    <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline}</argLine>
 +                </configuration>
 +            </plugin>
 +
 +            <plugin>
 +                <groupId>org.apache.maven.plugins</groupId>
 +                <artifactId>maven-war-plugin</artifactId>
 +                <version>2.3</version>
 +            </plugin>
 +
 +            <plugin>
 +                <groupId>org.jasig.mojo.jspc</groupId>
 +                <artifactId>jspc-maven-plugin</artifactId>
 +                <version>2.0.0</version>
 +                <configuration>
 +                    <includeInProject>false</includeInProject>
 +                    <webFragmentFile>${project.build.directory}/web-fragment.xml.txt</webFragmentFile>
 +                </configuration>
 +                <executions>
 +                    <execution>
 +                        <id>jspc</id>
 +                        <goals>
 +                            <goal>compile</goal>
 +                        </goals>
 +                    </execution>
 +                </executions>
 +                <dependencies>
 +                    <dependency>
 +                        <groupId>org.jasig.mojo.jspc</groupId>
 +                        <artifactId>jspc-compiler-tomcat6</artifactId>
 +                        <version>2.0.0</version>
 +                    </dependency>
 +                </dependencies>
 +            </plugin>
 +
 +            <plugin>
 +                <groupId>org.apache.maven.plugins</groupId>
 +                <artifactId>maven-jar-plugin</artifactId>
 +                <version>2.3.2</version>
 +                <configuration>
 +                    <finalName>${project.artifactId}-${project.version}</finalName>
 +                </configuration>
 +                <executions>
 +                    <execution>
 +                        <id>make-a-jar</id>
 +                        <phase>package</phase>
 +                        <goals>
 +                            <goal>jar</goal>
 +                        </goals>
 +                        <configuration>
 +                            <classifier>classes</classifier>
 +                        </configuration>
 +                    </execution>
 +                    <execution>
 +                        <id>jsp-jar-execution</id>
 +                        <phase>package</phase>
 +                        <goals>
 +                            <goal>jar</goal>
 +                        </goals>
 +                        <configuration>
 +                            <classifier>compiled-jsp</classifier>
 +                            <classesDirectory>${project.build.directory}/jsp-source</classesDirectory>
 +                        </configuration>
 +                    </execution>
 +                    <execution>
 +                        <goals>
 +                            <goal>test-jar</goal>
 +                        </goals>
 +                    </execution>
 +                </executions>
 +            </plugin>
 +
 +            <plugin>
 +                <groupId>org.apache.maven.plugins</groupId>
 +                <artifactId>maven-install-plugin</artifactId>
 +                <version>2.5.1</version>
 +            </plugin>
 +
          </plugins>
 -      </build>
 -    </profile>
 -  </profiles>
 -
 -  <build>
 -    <finalName>ROOT</finalName>
 -
 -    <resources>
 -      <resource>
 -        <directory>src/main/resources</directory>
 -        <filtering>true</filtering>
 -        <includes>
 -          <include>**/*.xml</include>
 -          <include>**/*.json</include>
 -        </includes>
 -      </resource>
 -    </resources>
 -
 -    <testResources>
 -      <testResource>
 -        <directory>src/test/resources</directory>
 -        <filtering>true</filtering>
 -        <includes>
 -          <include>**/*</include>
 -        </includes>
 -      </testResource>
 -    </testResources>
 -
 -    <plugins>
 -      <plugin>
 -        <groupId>org.apache.maven.plugins</groupId>
 -        <artifactId>maven-surefire-plugin</artifactId>
 -        <configuration>
 -          <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline}</argLine>
 -        </configuration>
 -      </plugin>
 -
 -      <plugin>
 -        <groupId>org.apache.maven.plugins</groupId>
 -        <artifactId>maven-war-plugin</artifactId>
 -        <version>2.3</version>
 -      </plugin>
 -
 -      <plugin>
 -        <groupId>org.jasig.mojo.jspc</groupId>
 -        <artifactId>jspc-maven-plugin</artifactId>
 -        <version>2.0.0</version>
 -        <configuration>
 -          <includeInProject>false</includeInProject>
 -          <webFragmentFile>${project.build.directory}/web-fragment.xml.txt</webFragmentFile>
 -        </configuration>
 -        <executions>
 -          <execution>
 -            <id>jspc</id>
 -            <goals>
 -              <goal>compile</goal>
 -            </goals>
 -          </execution>
 -        </executions>
 -        <dependencies>
 -          <dependency>
 -            <groupId>org.jasig.mojo.jspc</groupId>
 -            <artifactId>jspc-compiler-tomcat6</artifactId>
 -            <version>2.0.0</version>
 -          </dependency>
 -        </dependencies>
 -      </plugin>
 -
 -      <plugin>
 -        <groupId>org.apache.maven.plugins</groupId>
 -        <artifactId>maven-jar-plugin</artifactId>
 -        <version>2.3.2</version>
 -        <configuration>
 -          <finalName>${project.artifactId}-${project.version}</finalName>
 -        </configuration>
 -        <executions>
 -          <execution>
 -            <id>make-a-jar</id>
 -            <phase>package</phase>
 -            <goals>
 -              <goal>jar</goal>
 -            </goals>
 -            <configuration>
 -              <classifier>classes</classifier>
 -            </configuration>
 -          </execution>
 -          <execution>
 -            <id>jsp-jar-execution</id>
 -            <phase>package</phase>
 -            <goals>
 -              <goal>jar</goal>
 -            </goals>
 -            <configuration>
 -              <classifier>compiled-jsp</classifier>
 -              <classesDirectory>${project.build.directory}/jsp-source</classesDirectory>
 -            </configuration>
 -          </execution>
 -          <execution>
 -            <goals>
 -              <goal>test-jar</goal>
 -            </goals>
 -          </execution>
 -        </executions>
 -      </plugin>
 -
 -      <plugin>
 -        <groupId>org.apache.maven.plugins</groupId>
 -        <artifactId>maven-install-plugin</artifactId>
 -        <version>2.5.1</version>
 -      </plugin>
 -    </plugins>
 -  </build>
 -
 -  <dependencies>
 -
 -    <!-- Usergrid Dependencies -->
 -
 -    <dependency>
 -      <groupId>org.apache.usergrid</groupId>
 -      <artifactId>usergrid-config</artifactId>
 -      <version>${project.version}</version>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>org.apache.usergrid</groupId>
 -      <artifactId>usergrid-core</artifactId>
 -      <version>${project.version}</version>
 -      <exclusions>
 -        <exclusion>
 -          <artifactId>commons-logging</artifactId>
 -          <groupId>commons-logging</groupId>
 -        </exclusion>
 -      </exclusions>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>org.apache.usergrid</groupId>
 -      <artifactId>usergrid-mongo-emulator</artifactId>
 -      <version>${project.version}</version>
 -    </dependency>
 -
 -    <!-- Apache Dependencies -->
 -
 -    <dependency>
 -      <groupId>commons-collections</groupId>
 -      <artifactId>commons-collections</artifactId>
 -    </dependency>
 -
 -    <!-- SUN, Javax Package, and Other Com Dependencies -->
 -
 -
 -    <dependency>
 -        <groupId>javax.servlet</groupId>
 -        <artifactId>javax.servlet-api</artifactId>
 -        <scope>provided</scope>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>javax.servlet</groupId>
 -      <artifactId>jstl</artifactId>
 -    </dependency>
 -
 -
 -    <dependency>
 -      <groupId>com.sun.jersey.contribs</groupId>
 -      <artifactId>jersey-multipart</artifactId>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>com.sun.jersey</groupId>
 -      <artifactId>jersey-json</artifactId>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>com.yammer.metrics</groupId>
 -      <artifactId>metrics-spring</artifactId>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>com.sun.jersey</groupId>
 -      <artifactId>jersey-client</artifactId>
 -    </dependency>
 -
 -      <dependency>
 -        <groupId>com.google.code.maven-play-plugin.net.tanesha.recaptcha4j</groupId>
 -        <artifactId>recaptcha4j</artifactId>
 -      </dependency>
 -
 -    <dependency>
 -      <groupId>com.sun.jersey</groupId>
 -      <artifactId>jersey-server</artifactId>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>com.sun.jersey.contribs</groupId>
 -      <artifactId>jersey-spring</artifactId>
 -    </dependency>
 -
 -    <!-- Codehaus, Spring, and Other Org Dependencies -->
 -
 -    <dependency>
 -      <groupId>org.springframework</groupId>
 -      <artifactId>spring-webmvc</artifactId>
 -    </dependency>
 -
 -    <dependency>
 -      <!-- TODO - should not scope be 'test' ? -->
 -      <groupId>org.slf4j</groupId>
 -      <artifactId>jcl-over-slf4j</artifactId>
 -    </dependency>
 -
 -    <dependency>
 -      <!-- TODO - should not scope be 'test' ? -->
 -      <groupId>org.slf4j</groupId>
 -      <artifactId>jul-to-slf4j</artifactId>
 -    </dependency>
 -      <dependency>
 -          <groupId>org.slf4j</groupId>
 -          <artifactId>slf4j-log4j12</artifactId>
 -      </dependency>
 -
 -      <dependency>
 -          <groupId>log4j</groupId>
 -          <artifactId>log4j</artifactId>
 -      </dependency>
 -
 -
 -      <!-- Testing and Logging Dependencies -->
 -
 -    <dependency>
 -      <groupId>org.apache.usergrid</groupId>
 -      <artifactId>usergrid-config</artifactId>
 -      <version>${project.version}</version>
 -      <scope>test</scope>
 -      <classifier>tests</classifier>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>org.apache.usergrid</groupId>
 -      <artifactId>usergrid-test-utils</artifactId>
 -      <version>${project.version}</version>
 -      <scope>test</scope>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>org.apache.usergrid</groupId>
 -      <artifactId>usergrid-core</artifactId>
 -      <version>${project.version}</version>
 -      <scope>test</scope>
 -      <classifier>tests</classifier>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>org.springframework</groupId>
 -      <artifactId>spring-test</artifactId>
 -      <scope>test</scope>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>junit</groupId>
 -      <artifactId>junit</artifactId>
 -      <scope>test</scope>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>org.jvnet.mock-javamail</groupId>
 -      <artifactId>mock-javamail</artifactId>
 -      <scope>test</scope>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>org.hectorclient</groupId>
 -      <artifactId>hector-test</artifactId>
 -      <scope>test</scope>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>org.apache.tomcat.embed</groupId>
 -      <artifactId>tomcat-embed-core</artifactId>
 -      <scope>test</scope>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>org.apache.tomcat.embed</groupId>
 -      <artifactId>tomcat-embed-logging-juli</artifactId>
 -      <scope>test</scope>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>org.apache.tomcat.embed</groupId>
 -      <artifactId>tomcat-embed-jasper</artifactId>
 -      <scope>test</scope>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>org.apache.tomcat</groupId>
 -      <artifactId>tomcat-jasper-el</artifactId>
 -      <scope>test</scope>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>org.apache.tomcat</groupId>
 -      <artifactId>tomcat-jsp-api</artifactId>
 -      <scope>test</scope>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>org.apache.tomcat</groupId>
 -      <artifactId>juli</artifactId>
 -      <scope>test</scope>
 -    </dependency>
 -
 -    <!--  use the external test client.  Just depend on the maven jetty plugin to launch jetty -->
 -    <dependency>
 -      <groupId>com.sun.jersey.jersey-test-framework</groupId>
 -      <artifactId>jersey-test-framework-external</artifactId>
 -      <scope>test</scope>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>com.sun.jersey.jersey-test-framework</groupId>
 -      <artifactId>jersey-test-framework-core</artifactId>
 -      <scope>test</scope>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>org.usergrid</groupId>
 -      <artifactId>usergrid-java-client</artifactId>
 -      <scope>test</scope>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>org.apache.usergrid</groupId>
 -      <artifactId>usergrid-services</artifactId>
 -      <version>${project.version}</version>
 -      <scope>test</scope>
 -      <classifier>tests</classifier>
 -    </dependency>
 -
 -  </dependencies>
 +    </build>
 +
 +    <dependencies>
 +
 +        <!-- Usergrid Dependencies -->
 +
 +        <dependency>
 +            <groupId>org.apache.usergrid</groupId>
 +            <artifactId>usergrid-config</artifactId>
 +            <version>${project.version}</version>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>org.apache.usergrid</groupId>
 +            <artifactId>usergrid-core</artifactId>
 +            <version>${project.version}</version>
 +            <exclusions>
 +                <exclusion>
 +                    <artifactId>commons-logging</artifactId>
 +                    <groupId>commons-logging</groupId>
 +                </exclusion>
 +            </exclusions>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>org.apache.usergrid</groupId>
 +            <artifactId>usergrid-mongo-emulator</artifactId>
 +            <version>${project.version}</version>
 +        </dependency>
 +
 +        <!-- Apache Dependencies -->
 +
 +        <dependency>
 +            <groupId>commons-collections</groupId>
 +            <artifactId>commons-collections</artifactId>
 +        </dependency>
 +
 +        <!-- SUN, Javax Package, and Other Com Dependencies -->
 +
 +        <dependency>
 +            <groupId>javax.servlet</groupId>
 +            <artifactId>javax.servlet-api</artifactId>
 +            <scope>provided</scope>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>javax.servlet</groupId>
 +            <artifactId>jstl</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>com.sun.jersey.contribs</groupId>
 +            <artifactId>jersey-multipart</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>com.sun.jersey</groupId>
 +            <artifactId>jersey-json</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>com.fasterxml.jackson.jaxrs</groupId>
 +            <artifactId>jackson-jaxrs-json-provider</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>com.yammer.metrics</groupId>
 +            <artifactId>metrics-spring</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>com.sun.jersey</groupId>
 +            <artifactId>jersey-client</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>com.google.code.maven-play-plugin.net.tanesha.recaptcha4j</groupId>
 +            <artifactId>recaptcha4j</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>com.sun.jersey</groupId>
 +            <artifactId>jersey-server</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>com.sun.jersey.contribs</groupId>
 +            <artifactId>jersey-spring</artifactId>
 +        </dependency>
 +
 +        <!-- Codehaus, Spring, and Other Org Dependencies -->
 +
 +        <dependency>
 +            <groupId>org.springframework</groupId>
 +            <artifactId>spring-webmvc</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <!-- TODO - should not scope be 'test' ? -->
 +            <groupId>org.slf4j</groupId>
 +            <artifactId>jcl-over-slf4j</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <!-- TODO - should not scope be 'test' ? -->
 +            <groupId>org.slf4j</groupId>
 +            <artifactId>jul-to-slf4j</artifactId>
 +        </dependency>
 +
 +        <!-- Testing and Logging Dependencies -->
 +
 +        <dependency>
 +            <groupId>org.apache.usergrid</groupId>
 +            <artifactId>usergrid-config</artifactId>
 +            <version>${project.version}</version>
 +            <scope>test</scope>
 +            <classifier>tests</classifier>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>org.apache.usergrid</groupId>
 +            <artifactId>usergrid-test-utils</artifactId>
 +            <version>${project.version}</version>
 +            <scope>test</scope>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>org.apache.usergrid</groupId>
 +            <artifactId>usergrid-core</artifactId>
 +            <version>${project.version}</version>
 +            <scope>test</scope>
 +            <classifier>tests</classifier>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>org.springframework</groupId>
 +            <artifactId>spring-test</artifactId>
 +            <scope>test</scope>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>junit</groupId>
 +            <artifactId>junit</artifactId>
 +            <scope>test</scope>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>org.jvnet.mock-javamail</groupId>
 +            <artifactId>mock-javamail</artifactId>
 +            <scope>test</scope>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>org.hectorclient</groupId>
 +            <artifactId>hector-test</artifactId>
 +            <scope>test</scope>
 +        </dependency>
 +
 +<!--        <dependency>
 +            <groupId>org.apache.tomcat.embed</groupId>
 +            <artifactId>tomcat-embed-core</artifactId>
 +            <scope>test</scope>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>org.apache.tomcat.embed</groupId>
 +            <artifactId>tomcat-embed-logging-juli</artifactId>
 +            <scope>test</scope>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>org.apache.tomcat.embed</groupId>
 +            <artifactId>tomcat-embed-jasper</artifactId>
 +            <scope>test</scope>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>org.apache.tomcat</groupId>
 +            <artifactId>tomcat-jasper-el</artifactId>
 +            <scope>test</scope>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>org.apache.tomcat</groupId>
 +            <artifactId>tomcat-jsp-api</artifactId>
 +            <scope>test</scope>
 +        </dependency>-->
 +
 +        <!--  use the external test client.  Just depend on the maven jetty plugin to launch jetty -->
 +        <dependency>
 +            <groupId>com.sun.jersey.jersey-test-framework</groupId>
 +            <artifactId>jersey-test-framework-external</artifactId>
 +            <scope>test</scope>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>com.sun.jersey.jersey-test-framework</groupId>
 +            <artifactId>jersey-test-framework-core</artifactId>
 +            <scope>test</scope>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>org.apache.usergrid</groupId>
 +            <artifactId>usergrid-java-client</artifactId>
 +            <scope>test</scope>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>org.apache.usergrid</groupId>
 +            <artifactId>usergrid-services</artifactId>
 +            <version>2.0.0-SNAPSHOT</version>
 +            <scope>test</scope>
 +            <classifier>tests</classifier>
 +        </dependency>
 +
 +    </dependencies>
  
  </project>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e395f121/stack/services/pom.xml
----------------------------------------------------------------------
diff --cc stack/services/pom.xml
index 08e8f59,1a387f4..38692d6
--- a/stack/services/pom.xml
+++ b/stack/services/pom.xml
@@@ -65,11 -64,9 +65,11 @@@
                  <storage-config>${basedir}/src/test/conf</storage-config>
                  <target.directory>${project.build.directory}</target.directory>
                </systemPropertyVariables>
 -              <forkMode>once</forkMode>
 +			<parallel>${services.it.parallel}</parallel>
 +            <forkCount>${services.it.forkCount}</forkCount>
 +            <reuseForks>${services.it.reuseForks}</reuseForks>
                <!-- TODO: make this into a small configuration but based on settings.xml -->
-               <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar</argLine>
+               <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline}</argLine>
  
                <includes>
                  <include>**/ServiceTestSuite.java</include>
@@@ -104,11 -101,11 +104,11 @@@
                  <target.directory>${project.build.directory}</target.directory>
                </systemPropertyVariables>
  
 -              <parallel>both</parallel>
 -              <forkCount>${services.it.forkCount}</forkCount>
 -              <reuseForks>false</reuseForks>
 +			<parallel>${services.it.parallel}</parallel>
 +            <forkCount>${services.it.forkCount}</forkCount>
 +            <reuseForks>${services.it.reuseForks}</reuseForks>
  
-               <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8</argLine>
+               <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 ${ug.argline}</argLine>
                <argLine>
                  <!-- -javaagent:${settings.localRepository}/org/powermock/powermock-module-javaagent/1.5.1/powermock-module-javaagent-1.5.1.jar -->
                  -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar
@@@ -168,10 -164,8 +168,10 @@@
                  <storage-config>${basedir}/src/test/conf</storage-config>
                  <target.directory>${project.build.directory}</target.directory>
                </systemPropertyVariables>
 -              <forkMode>once</forkMode>
 +			<parallel>${services.it.parallel}</parallel>
 +            <forkCount>${services.it.forkCount}</forkCount>
 +            <reuseForks>${services.it.reuseForks}</reuseForks>
-               <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8</argLine>
+               <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 ${ug.argline}</argLine>
                <argLine>
                 <!--  -javaagent:${settings.localRepository}/org/powermock/powermock-module-javaagent/1.5.1/powermock-module-javaagent-1.5.1.jar-->
  			   -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar
@@@ -212,10 -206,8 +212,10 @@@
                  <storage-config>${basedir}/src/test/conf</storage-config>
                  <target.directory>${project.build.directory}</target.directory>
                </systemPropertyVariables>
 -              <forkMode>once</forkMode>
 +			<parallel>${services.it.parallel}</parallel>
 +            <forkCount>${services.it.forkCount}</forkCount>
 +            <reuseForks>${services.it.reuseForks}</reuseForks>
-               <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8</argLine>
+               <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 ${ug.argline}</argLine>
                <argLine>
                  <!-- -javaagent:${settings.localRepository}/org/powermock/powermock-module-javaagent/1.5.1/powermock-module-javaagent-1.5.1.jar -->
  				-javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar
@@@ -277,11 -269,11 +277,11 @@@
              <target.directory>${project.build.directory}</target.directory>
            </systemPropertyVariables>
  
 -          <parallel>both</parallel>
 -          <forkCount>${services.it.forkCount}</forkCount>
 -          <reuseForks>false</reuseForks>
 +			<parallel>${services.it.parallel}</parallel>
 +            <forkCount>${services.it.forkCount}</forkCount>
 +            <reuseForks>${services.it.reuseForks}</reuseForks>
  
-           <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8</argLine>
+           <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 ${ug.argline}</argLine>
            <argLine>
              <!-- -javaagent:${settings.localRepository}/org/powermock/powermock-module-javaagent/1.5.1/powermock-module-javaagent-1.5.1.jar-->
  			-javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e395f121/stack/test-utils/pom.xml
----------------------------------------------------------------------
diff --cc stack/test-utils/pom.xml
index a548b1e,961ac2f..9b242e6
--- a/stack/test-utils/pom.xml
+++ b/stack/test-utils/pom.xml
@@@ -17,263 -17,254 +17,263 @@@
  -->
  <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 -  <modelVersion>4.0.0</modelVersion>
 -  <parent>
 -    <groupId>org.apache.usergrid</groupId>
 -    <artifactId>usergrid</artifactId>
 -    <version>1.0.0</version>
 -    <relativePath>../</relativePath>
 -  </parent>
 -
 -  <artifactId>usergrid-test-utils</artifactId>
 -  <name>Usergrid Test Utils</name>
 -  <description>Test Utilities for Usergrid system.</description>
 -  <packaging>jar</packaging>
 -
 -  <build>
 -    <testResources>
 -      <testResource>
 -        <directory>src/test/resources</directory>
 -        <filtering>true</filtering>
 -        <includes>
 -          <include>**/*.properties</include>
 -          <include>**/*.xml</include>
 -        </includes>
 -      </testResource>
 -    </testResources>
 -
 -    <plugins>
 -      <plugin>
 -        <groupId>org.apache.maven.plugins</groupId>
 -        <artifactId>maven-surefire-plugin</artifactId>
 -
 -        <configuration>
 -          <systemPropertyVariables>
 -            <storage-config>${basedir}/src/test/conf</storage-config>
 -            <target-directory>${project.build.directory}</target-directory>
 -          </systemPropertyVariables>
 -          <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline}</argLine>
 -
 -          <includes>
 -            <include>**/CassandraResourceITSuite.java</include>
 -            <!-- <include>**/CassandraResourceTest.java</include>-->
 -          </includes>
 -          <excludes>
 -            <exclude>**/CassandraRunnerTest.java</exclude>
 -            <exclude>**/OtherRunnerTest.java</exclude>
 -          </excludes>
 -        </configuration>
 -      </plugin>
 -    </plugins>
 -  </build>
 -
 -  <dependencies>
 -    <dependency>
 -      <groupId>org.apache.usergrid</groupId>
 -      <artifactId>usergrid-config</artifactId>
 -      <version>${project.version}</version>
 -    </dependency>
 -
 -    <!--<dependency>-->
 -    <!--<groupId>org.apache.usergrid</groupId>-->
 -    <!--<artifactId>usergrid-services</artifactId>-->
 -    <!--<version>${project.version}</version>-->
 -    <!--</dependency>-->
 -
 -    <!-- Apache Dependencies -->
 -
 -    <dependency>
 -      <groupId>org.apache.cassandra</groupId>
 -      <artifactId>cassandra-all</artifactId>
 -      <!-- Exclude the old and problematic Snappy -->
 -      <exclusions>
 -        <exclusion>
 -          <artifactId>snappy-java</artifactId>
 -          <groupId>org.xerial.snappy</groupId>
 -        </exclusion>
 -      </exclusions>
 -    </dependency>
 -
 -    <!-- Include the slighly newer and less problematic snappy -->
 -    <dependency>
 -      <artifactId>snappy-java</artifactId>
 -      <groupId>org.xerial.snappy</groupId>
 -      <version>1.0.5</version>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>jline</groupId>
 -      <artifactId>jline</artifactId>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>org.antlr</groupId>
 -      <artifactId>antlr-runtime</artifactId>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>org.apache.cassandra</groupId>
 -      <artifactId>cassandra-thrift</artifactId>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>commons-logging</groupId>
 -      <artifactId>commons-logging</artifactId>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>commons-lang</groupId>
 -      <artifactId>commons-lang</artifactId>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>commons-cli</groupId>
 -      <artifactId>commons-cli</artifactId>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>commons-codec</groupId>
 -      <artifactId>commons-codec</artifactId>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>com.yammer.metrics</groupId>
 -      <artifactId>metrics-core</artifactId>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>commons-io</groupId>
 -      <artifactId>commons-io</artifactId>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>org.apache.shiro</groupId>
 -      <artifactId>shiro-core</artifactId>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>org.apache.shiro</groupId>
 -      <artifactId>shiro-spring</artifactId>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>org.apache.shiro</groupId>
 -      <artifactId>shiro-web</artifactId>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>org.yaml</groupId>
 -      <artifactId>snakeyaml</artifactId>
 -    </dependency>
 -
 -    <!-- Spring and Other Dependencies -->
 -
 -    <dependency>
 -      <groupId>org.springframework</groupId>
 -      <artifactId>spring-core</artifactId>
 -      <exclusions>
 -        <exclusion>
 -          <artifactId>commons-logging</artifactId>
 -          <groupId>commons-logging</groupId>
 -        </exclusion>
 -      </exclusions>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>org.springframework</groupId>
 -      <artifactId>spring-expression</artifactId>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>org.springframework</groupId>
 -      <artifactId>spring-beans</artifactId>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>org.springframework</groupId>
 -      <artifactId>spring-aop</artifactId>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>org.springframework</groupId>
 -      <artifactId>spring-context</artifactId>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>org.springframework</groupId>
 -      <artifactId>spring-context-support</artifactId>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>org.codehaus.jackson</groupId>
 -      <artifactId>jackson-core-asl</artifactId>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>org.codehaus.jackson</groupId>
 -      <artifactId>jackson-mapper-asl</artifactId>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>org.slf4j</groupId>
 -      <artifactId>slf4j-api</artifactId>
 -    </dependency>
 -
 -    <dependency>
 -      <!-- TODO - should not scope be 'test' ? -->
 -      <groupId>org.slf4j</groupId>
 -      <artifactId>slf4j-log4j12</artifactId>
 -    </dependency>
 -
 -    <dependency>
 -      <!-- TODO - should not scope be 'test' ? -->
 -      <groupId>log4j</groupId>
 -      <artifactId>log4j</artifactId>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>com.google.guava</groupId>
 -      <artifactId>guava</artifactId>
 -    </dependency>
 -
 -    <dependency>
 -      <groupId>junit</groupId>
 -      <artifactId>junit-dep</artifactId>
 -    </dependency>
 -
 -    <!-- Test Dependencies -->
 -
 -    <dependency>
 -      <groupId>org.springframework</groupId>
 -      <artifactId>spring-test</artifactId>
 -      <scope>test</scope>
 -    </dependency>
 -
 -    <!--<dependency>-->
 -    <!--<groupId>org.slf4j</groupId>-->
 -    <!--<artifactId>slf4j-log4j12</artifactId>-->
 -    <!--<scope>test</scope>-->
 -    <!--</dependency>-->
 -
 -    <!--<dependency>-->
 -    <!--<groupId>log4j</groupId>-->
 -    <!--<artifactId>log4j</artifactId>-->
 -    <!--<scope>test</scope>-->
 -    <!--</dependency>-->
 -
 -    <dependency>
 -      <groupId>junit</groupId>
 -      <artifactId>junit</artifactId>
 -      <scope>test</scope>
 -    </dependency>
 -  </dependencies>
 +    <modelVersion>4.0.0</modelVersion>
 +    <parent>
 +        <groupId>org.apache.usergrid</groupId>
 +        <artifactId>usergrid</artifactId>
 +        <version>2.0.0-SNAPSHOT</version>
 +    </parent>
 +
 +    <artifactId>usergrid-test-utils</artifactId>
 +    <name>Usergrid Test Utils</name>
 +    <description>Test Utilities for Usergrid system.</description>
 +    <packaging>jar</packaging>
 +
 +    <build>
 +        <testResources>
 +            <testResource>
 +                <directory>src/test/resources</directory>
 +                <filtering>true</filtering>
 +                <includes>
 +                    <include>**/*.properties</include>
 +                    <include>**/*.xml</include>
 +                </includes>
 +            </testResource>
 +        </testResources>
 +
 +        <plugins>
 +            <plugin>
 +                <groupId>org.apache.maven.plugins</groupId>
 +                <artifactId>maven-surefire-plugin</artifactId>
 +
 +                <configuration>
 +                    <systemPropertyVariables>
 +                        <storage-config>${basedir}/src/test/conf</storage-config>
 +                        <target-directory>${project.build.directory}</target-directory>
 +                    </systemPropertyVariables>
-                     <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar</argLine>
++                    <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline}</argLine>
 +
 +                    <includes>
 +                        <include>**/CassandraResourceITSuite.java</include>
 +                        <!-- <include>**/CassandraResourceTest.java</include>-->
 +                    </includes>
 +                    <excludes>
 +                        <exclude>**/CassandraRunnerTest.java</exclude>
 +                        <exclude>**/OtherRunnerTest.java</exclude>
 +                    </excludes>
 +                </configuration>
 +            </plugin>
 +        </plugins>
 +    </build>
 +
 +    <dependencies>
 +
 +        <dependency>
 +            <groupId>org.apache.usergrid</groupId>
 +            <artifactId>usergrid-config</artifactId>
 +            <version>${project.version}</version>
 +        </dependency>
 +
 +        <!-- Apache Dependencies -->
 +
 +        <dependency>
 +            <groupId>org.apache.cassandra</groupId>
 +            <artifactId>cassandra-all</artifactId>
 +            <!-- Exclude the old and problematic Snappy -->
 +            <exclusions>
 +                <exclusion>
 +                    <artifactId>snappy-java</artifactId>
 +                    <groupId>org.xerial.snappy</groupId>
 +                </exclusion>
 +            </exclusions>
 +        </dependency>
 +
 +        <!-- Include the slighly newer and less problematic snappy -->
 +        <dependency>
 +            <artifactId>snappy-java</artifactId>
 +            <groupId>org.xerial.snappy</groupId>
 +            <version>1.0.5</version>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>jline</groupId>
 +            <artifactId>jline</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>org.antlr</groupId>
 +            <artifactId>antlr-runtime</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>org.apache.cassandra</groupId>
 +            <artifactId>cassandra-thrift</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>commons-logging</groupId>
 +            <artifactId>commons-logging</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>commons-lang</groupId>
 +            <artifactId>commons-lang</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>commons-cli</groupId>
 +            <artifactId>commons-cli</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>commons-codec</groupId>
 +            <artifactId>commons-codec</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>com.yammer.metrics</groupId>
 +            <artifactId>metrics-core</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>commons-io</groupId>
 +            <artifactId>commons-io</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>org.apache.shiro</groupId>
 +            <artifactId>shiro-core</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>org.apache.shiro</groupId>
 +            <artifactId>shiro-spring</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>org.apache.shiro</groupId>
 +            <artifactId>shiro-web</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>org.yaml</groupId>
 +            <artifactId>snakeyaml</artifactId>
 +        </dependency>
 +
 +        <!-- Spring and Other Dependencies -->
 +
 +        <dependency>
 +            <groupId>org.springframework</groupId>
 +            <artifactId>spring-core</artifactId>
 +            <exclusions>
 +                <exclusion>
 +                    <artifactId>commons-logging</artifactId>
 +                    <groupId>commons-logging</groupId>
 +                </exclusion>
 +            </exclusions>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>org.springframework</groupId>
 +            <artifactId>spring-expression</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>org.springframework</groupId>
 +            <artifactId>spring-beans</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>org.springframework</groupId>
 +            <artifactId>spring-aop</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>org.springframework</groupId>
 +            <artifactId>spring-context</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>org.springframework</groupId>
 +            <artifactId>spring-context-support</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>org.slf4j</groupId>
 +            <artifactId>slf4j-api</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <!-- TODO - should not scope be 'test' ? -->
 +            <groupId>org.slf4j</groupId>
 +            <artifactId>slf4j-log4j12</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <!-- TODO - should not scope be 'test' ? -->
 +            <groupId>log4j</groupId>
 +            <artifactId>log4j</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>com.google.guava</groupId>
 +            <artifactId>guava</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>junit</groupId>
 +            <artifactId>junit-dep</artifactId>
 +        </dependency>
 +
 +        <!-- Test Dependencies -->
 +
 +        <dependency>
 +            <groupId>org.springframework</groupId>
 +            <artifactId>spring-test</artifactId>
 +            <scope>test</scope>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>junit</groupId>
 +            <artifactId>junit</artifactId>
 +            <scope>test</scope>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>org.codehaus.jackson</groupId>
 +            <artifactId>jackson-mapper-asl</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>org.elasticsearch</groupId>
 +            <artifactId>elasticsearch</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>org.apache.tomcat.embed</groupId>
 +            <artifactId>tomcat-embed-core</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>org.apache.tomcat.embed</groupId>
 +            <artifactId>tomcat-embed-logging-juli</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>org.apache.tomcat.embed</groupId>
 +            <artifactId>tomcat-embed-jasper</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>org.apache.tomcat</groupId>
 +            <artifactId>tomcat-jasper-el</artifactId>
 +        </dependency>
 +
 +        <dependency>
 +            <groupId>org.apache.tomcat</groupId>
 +            <artifactId>tomcat-jsp-api</artifactId>
 +        </dependency>
 +
 +    </dependencies>
 +
  </project>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e395f121/stack/tools/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e395f121/stack/websocket/pom.xml
----------------------------------------------------------------------


[25/52] [abbrv] git commit: Fixed obscelete tests

Posted by gr...@apache.org.
Fixed obscelete tests


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: b1c70510b2ae2ef10236177772e334c6e23e1a80
Parents: 70b6739
Author: Todd Nine <to...@apache.org>
Authored: Fri Aug 29 11:30:56 2014 -0600
Committer: Todd Nine <to...@apache.org>
Committed: Fri Aug 29 11:30:56 2014 -0600

----------------------------------------------------------------------
 .../collection/mvcc/entity/impl/MvccLogEntryImpl.java |  3 ++-
 .../collection/mvcc/stage/delete/MarkStartTest.java   |  3 +++
 .../collection/mvcc/stage/load/LoadTest.java          |  7 +++++++
 .../collection/util/InvalidIdGenerator.java           | 14 --------------
 4 files changed, 12 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1c70510/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccLogEntryImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccLogEntryImpl.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccLogEntryImpl.java
index 574a461..a50eeac 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccLogEntryImpl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccLogEntryImpl.java
@@ -23,6 +23,7 @@ import java.util.UUID;
 
 import org.apache.usergrid.persistence.collection.mvcc.entity.MvccLogEntry;
 import org.apache.usergrid.persistence.collection.mvcc.entity.Stage;
+import org.apache.usergrid.persistence.core.util.ValidationUtils;
 import org.apache.usergrid.persistence.model.entity.Id;
 
 import com.google.common.base.Preconditions;
@@ -43,7 +44,7 @@ public class MvccLogEntryImpl implements MvccLogEntry {
 
     public MvccLogEntryImpl( final Id entityId, final UUID version, final Stage stage, final State state ) {
         Preconditions.checkNotNull( entityId, "entity id is required" );
-        Preconditions.checkNotNull( version, "version id is required" );
+        ValidationUtils.verifyTimeUuid( version, "version" );
         Preconditions.checkNotNull( stage, "entity  is required" );
         Preconditions.checkNotNull( state, "state  is required" );
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1c70510/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/MarkStartTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/MarkStartTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/MarkStartTest.java
index ed870a3..1b04022 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/MarkStartTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/MarkStartTest.java
@@ -92,6 +92,9 @@ public class MarkStartTest extends AbstractIdStageTest {
 
         UUIDService uuidService = mock( UUIDService.class );
 
+        //generate the random uuid, not a time uuid, should fail tests
+        when(uuidService.newTimeUUID()).thenReturn( UUID.randomUUID() );
+
         new MarkStart( logStrategy, uuidService ).call( event );
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1c70510/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/load/LoadTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/load/LoadTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/load/LoadTest.java
index cb5dd64..3643bd1 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/load/LoadTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/load/LoadTest.java
@@ -347,6 +347,13 @@ public class LoadTest  extends AbstractIdStageTest {
     @Override
     protected void validateStage( final CollectionIoEvent<Id> event ) {
         final UUIDService uuidService = mock(UUIDService.class);
+
+        /**
+         * Mock up wrong UUID type
+         */
+        when(uuidService.newTimeUUID()).thenReturn( UUID.randomUUID() );
+
+
         final MvccEntitySerializationStrategy serializationStrategy = mock(MvccEntitySerializationStrategy.class);
 
         new Load(uuidService, serializationStrategy).call( event );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1c70510/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidIdGenerator.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidIdGenerator.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidIdGenerator.java
index 98c382c..fec72e9 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidIdGenerator.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidIdGenerator.java
@@ -110,25 +110,11 @@ public class InvalidIdGenerator {
         public List<PotentialAssignment> getValueSources( final ParameterSignature sig ) {
 
             final List<PotentialAssignment> result = new ArrayList<PotentialAssignment>();
-            result.add( PotentialAssignment.forValue( "wrongEntityUuidType", wrongEntityUuidType() ) );
             result.add( PotentialAssignment.forValue( "wrongEntityTypeLength", wrongEntityTypeLength() ) );
 
             return result;
         }
 
-        /**
-         * Incorrect fields
-         */
-        private static Id wrongEntityUuidType() {
-
-            final Id entityId = mock( Id.class );
-
-            //set this to a non time uuid
-            when( entityId.getUuid() ).thenReturn( UUID.randomUUID() );
-            when( entityId.getType() ).thenReturn( "test" );
-
-            return entityId;
-        }
 
         private static Id wrongEntityTypeLength() {
 


[43/52] [abbrv] git commit: Preparing for RC5 which will exclude the Portal's bower_components, node_modules and other giti-gnored files.

Posted by gr...@apache.org.
Preparing for RC5 which will exclude the Portal's bower_components, node_modules and other giti-gnored files.


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: 8efa278b5dd7ba1dc540071066fc95ff75cef24d
Parents: bb5dc2e
Author: Dave Johnson <sn...@apache.org>
Authored: Wed Sep 3 07:32:20 2014 -0400
Committer: Dave Johnson <sn...@apache.org>
Committed: Wed Sep 3 07:32:20 2014 -0400

----------------------------------------------------------------------
 .gitignore                           | 2 ++
 release/pom.xml                      | 2 +-
 release/sign-release.sh              | 2 +-
 release/src/main/assembly/source.xml | 6 ++++++
 4 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/8efa278b/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index b0a497d..47ed041 100644
--- a/.gitignore
+++ b/.gitignore
@@ -59,3 +59,5 @@ portal/js/templates.js
 /release/target/
 
 /portal/seleniumLog.txt
+/stack/core/src/main/java/org/apache/usergrid/persistence/query/tree/QueryFilterLexer.java
+/stack/core/src/main/java/org/apache/usergrid/persistence/query/tree/QueryFilterParser.java
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/8efa278b/release/pom.xml
----------------------------------------------------------------------
diff --git a/release/pom.xml b/release/pom.xml
index c797e5b..5abea58 100644
--- a/release/pom.xml
+++ b/release/pom.xml
@@ -29,7 +29,7 @@
 
     <artifactId>apache-usergrid-incubating</artifactId>
     <packaging>pom</packaging>
-    <version>1.0.0-rc3</version>
+    <version>1.0.0</version>
 
     <name>Usergrid Release Assembly</name>
     <description>Assembles Usergrid into a distribution package</description>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/8efa278b/release/sign-release.sh
----------------------------------------------------------------------
diff --git a/release/sign-release.sh b/release/sign-release.sh
index 59f19af..766a0d5 100755
--- a/release/sign-release.sh
+++ b/release/sign-release.sh
@@ -18,7 +18,7 @@
 
 pushd target 
 
-export rcstring="-rc2"
+export rcstring=""
 export vstring="1.0.0"
 
 gpg --armor --detach-sig apache-usergrid-incubating-${vstring}${rcstring}-source.zip

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/8efa278b/release/src/main/assembly/source.xml
----------------------------------------------------------------------
diff --git a/release/src/main/assembly/source.xml b/release/src/main/assembly/source.xml
index 367d858..4a46254 100644
--- a/release/src/main/assembly/source.xml
+++ b/release/src/main/assembly/source.xml
@@ -41,6 +41,12 @@
 				<exclude>**/.classpath</exclude>
 				<exclude>**/.project</exclude>
 				<exclude>**/.settings/**</exclude>
+				<exclude>**/bower_compoments/**</exclude>
+				<exclude>**/node_modules/**</exclude>
+				<exclude>**/dist/**</exclude>
+				<exclude>**/dist_cov/**</exclude>
+				<exclude>**/portal/index.html</exclude>
+				<exclude>**/portal/index-debug.html</exclude>
 			</excludes>
 		</fileSet>
 	</fileSets>


[33/52] [abbrv] git commit: Merge branch 'pr/73'. This closes #73

Posted by gr...@apache.org.
Merge branch 'pr/73'.  This closes #73

Conflicts:
	.gitignore


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: cd4915a9ee4ee9ff5a50a0d5bd28f3b164934427
Parents: 676520c b6100f3
Author: Dave Johnson <sn...@apache.org>
Authored: Fri Aug 29 17:35:50 2014 -0400
Committer: Dave Johnson <sn...@apache.org>
Committed: Fri Aug 29 17:35:50 2014 -0400

----------------------------------------------------------------------
 .gitignore          | 2 ++
 portal/Gruntfile.js | 4 ----
 2 files changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cd4915a9/.gitignore
----------------------------------------------------------------------
diff --cc .gitignore
index 2dc1df4,df2938f..b0a497d
--- a/.gitignore
+++ b/.gitignore
@@@ -56,4 -54,5 +56,6 @@@ portal/js/templates.j
  /portal/js/generated/
  
  /portal/js/generated-templates/
 +/release/target/
+ 
+ /portal/seleniumLog.txt

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cd4915a9/portal/Gruntfile.js
----------------------------------------------------------------------


[47/52] [abbrv] git commit: Exclude all DLL files from the release, and add a README file to each directory that formerly contained DLLs to explain that.

Posted by gr...@apache.org.
Exclude all DLL files from the release, and add a README file to each directory that formerly contained DLLs to explain that.


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: db32c1551610e3734578a38600bca66d4bd447c0
Parents: ac68da7
Author: Dave Johnson <sn...@apache.org>
Authored: Wed Sep 3 12:34:09 2014 -0400
Committer: Dave Johnson <sn...@apache.org>
Committed: Wed Sep 3 12:34:09 2014 -0400

----------------------------------------------------------------------
 LICENSE                                         |   2 -
 NOTICE                                          |  34 -----
 release/src/main/assembly/source.xml            |   2 +
 .../NSubstitute.1.6.0.0/BreakingChanges.txt     | 131 -------------------
 .../packages/NSubstitute.1.6.0.0/CHANGELOG.txt  | 103 ---------------
 .../packages/NSubstitute.1.6.0.0/README.txt     | 119 -----------------
 sdks/dotnet/packages/NUnit.2.6.2/README.txt     |   3 +
 .../packages/Newtonsoft.Json.4.5.11/README.txt  |   3 +
 sdks/dotnet/packages/RestSharp.104.1/README.txt |   3 +
 sdks/dotnet/packages/RestSharp.104.1/readme.txt |  19 ---
 .../packages/Geocoder.0.1.0.0/README.txt        |   3 +
 11 files changed, 14 insertions(+), 408 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/db32c155/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index 1d90c5c..64c7ebc 100644
--- a/LICENSE
+++ b/LICENSE
@@ -289,5 +289,3 @@ This product bundles jquery-1.9.1 Licensed under MIT license.
 
 This product bundles mocha. All rights reserved. Licensed under MIT.
 Copyright (c) 2011-2014 TJ Holowaychuk <tj...@vision-media.ca>
-
-This product bundles NSubstitute v1.6.0.0. Licensed under the BSD 2-Clause License.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/db32c155/NOTICE
----------------------------------------------------------------------
diff --git a/NOTICE b/NOTICE
index 9b0902f..1fc37a4 100644
--- a/NOTICE
+++ b/NOTICE
@@ -1,40 +1,6 @@
 Apache Usergrid_
 Copyright 2014 The Apache Software Foundation.
 
-This product bundles NUnit v2.6.2.
-Portions Copyright © 2002-2012 Charlie Poole or Copyright © 2002-2004 
-James W. Newkirk, Michael C. Two, Alexei A. Vorontsov or Copyright © 2000-2002 Philip A. Craig
-
-This product bundles a number of files within the /sdks/ios
-package.
-
- Copyright (C) 2009 Stig Brautaset. All rights reserved.
- 
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 
- * Redistributions of source code must retain the above copyright notice, this
-   list of conditions and the following disclaimer.
- 
- * Redistributions in binary form must reproduce the above copyright notice,
-   this list of conditions and the following disclaimer in the documentation
-   and/or other materials provided with the distribution.
- 
- * Neither the name of the author nor the names of its contributors may be used
-   to endorse or promote products derived from this software without specific
-   prior written permission.
- 
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
 This product bundles SSToolkit Copyright (c) 2009-2011 Sam Soffes. All rights reserved.
 These files can be located within the /sdks/ios package.
  
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/db32c155/release/src/main/assembly/source.xml
----------------------------------------------------------------------
diff --git a/release/src/main/assembly/source.xml b/release/src/main/assembly/source.xml
index 4a46254..d462985 100644
--- a/release/src/main/assembly/source.xml
+++ b/release/src/main/assembly/source.xml
@@ -47,6 +47,8 @@
 				<exclude>**/dist_cov/**</exclude>
 				<exclude>**/portal/index.html</exclude>
 				<exclude>**/portal/index-debug.html</exclude>
+				<exclude>**/*.nupkg</exclude>
+				<exclude>**/*.dll</exclude>
 			</excludes>
 		</fileSet>
 	</fileSets>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/db32c155/sdks/dotnet/packages/NSubstitute.1.6.0.0/BreakingChanges.txt
----------------------------------------------------------------------
diff --git a/sdks/dotnet/packages/NSubstitute.1.6.0.0/BreakingChanges.txt b/sdks/dotnet/packages/NSubstitute.1.6.0.0/BreakingChanges.txt
deleted file mode 100644
index 7cbb7ca..0000000
--- a/sdks/dotnet/packages/NSubstitute.1.6.0.0/BreakingChanges.txt
+++ /dev/null
@@ -1,131 +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.
-
-================================================================================================
-1.5.0 Release
-================================================================================================
-
-The base object methods (Equals, GetHashCode and ToString) for substitute objects of classes that
-extend those methods now return the result of calling the actual implementation of those methods
-rather than the default value for the return type. This means that places where you relied on
-.Equals returning false, .ToString returning null and .GetHashCode returning 0 because the actual
-methods weren't called will now call the actual implementation.
-
-Reason:
-Substitute objects of classes that overrode those methods that were used as parameters for
-setting up return values or checking received calls weren't able to be directly used within the
-call, e.g. instead of:
-
-someObject.SomeCall(aSubstitute).Returns(1);
-
-You previously needed to have:
-
-someObject.SomeCall(Arg.Is<TypeBeingSubstituted>(a => a == aSubstitute)).Returns(1);
-
-However, now you can use the former, which is much more terse and consistent with the way other
-Returns or Received calls work.
-
-This means that substitute objects will now always work like .NET objects rather than being
-inconsistent when the class being substituted overrode any of those base object methods.
-
-Fix:
-There is no workaround to change the behaviour of .Equals, .GetHashCode or .ToString. If you have
-a use case to change the behaviour of these methods please lodge an issue at the NSubstitute
-Github site.
-
-------------------------------------------------------------------------------------------------
-
-In rare cases the new `Returns()` and `ReturnsForAnyArgs()` overloads can cause compilation to fail due to the call being ambiguous (CS0121). 
-
-Reason:
-The new overloads allow a sequence of callbacks to be used for return values. A common example is return several values, then throwing an exception.
-
-Fix:
-Remove the ambiguity by explicitly casting the arguments types or by using lambda syntax.
-e.g. sub.Call().Returns(x => null, x => null);
-
-================================================================================================
-1.4.0 Release
-================================================================================================
-
-Auto-substitute from substitutes of `Func` delegates (following the same rules as auto-subbing
-for methods and properties). So the delegate returned from `Substitute.For<Func<IFoo>>()` will 
-return a substitute of `IFoo`. This means some substitutes for delegates that used to return
-null will now return a new substitute.
-
-Reason:
-Reduced setup when substituting for `Func` delegates, and consistency with behaviour for 
-properties and methods. 
-
-Fix:
-Explicitly return null from substitute delegates when required for a test.
-e.g. subFunc().Returns(x => null);
-
-
-================================================================================================
-1.2.0 Release
-================================================================================================
-
-Auto-substitute for pure virtual classes (in addition to interfaces and delegate types), which
-means some methods and properties on substitutes that used to return null by default will now
-return a new substitute of that type.
-
-Reason:
-Cut down the code required to configure substitute members that return interface-like types
-(e.g. ASP.NET web abstractions like HttpContextBase) which are safe to create and proxy.
-
-Safe classes are those with all their public methods and properties defined as virtual or 
-abstract, and containing a default, parameterless constructor defined as public or protected.
-
-Fix:
-Explicitly return null from methods and property getters when required for a test.
-e.g. sub.Method().Returns(x => null);
-
-
-================================================================================================
-0.9.5 Release
-================================================================================================
-
-Raise.Event<TEventArgs>(...) methods renamed to Raise.EventWith<TEventArgs()
-
-Reason:
-The Raise.Event<TEventArgs>() signature would often conflict with the
-Raise.Event<THandler>() method which is used to raise all types of events.
-
-Raise.Event<THandler>() will now always work for any event type, while
-Raise.EventWith<TEventArgs>() can be used as a shortcut to raise
-EventHandler-style events with a particular argument.
-
-Fix:
-Replace Raise.Event<TEventArgs>() calls with equivalent Raise.EventWith<TEventArgs>() call.
-
-------------------------------------------------------------------------------------------------
-Raise.Action() methods removed
-
-Reason:
-The Raise.Event<THandler>() method can be used to raise all delegate events, including Actions.
-Raise.Action() was removed so there is a consistent way of raising all delegate events.
-
-Fix:
-- Replace Raise.Action() calls with Raise.Event<Action>().
-- Replace Raise.Action<T>(T arg) calls with Raise.Event<Action<T>>(arg).
-- Replace Raise.Action<T1,T2>(T1 x, T2 y) calls with Raise.Event<Action<T1,T2>>(x, y).
-
-
-================================================================================================
-0.9.0 Release
-================================================================================================
-
-No breaking changes.

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/db32c155/sdks/dotnet/packages/NSubstitute.1.6.0.0/CHANGELOG.txt
----------------------------------------------------------------------
diff --git a/sdks/dotnet/packages/NSubstitute.1.6.0.0/CHANGELOG.txt b/sdks/dotnet/packages/NSubstitute.1.6.0.0/CHANGELOG.txt
deleted file mode 100644
index ca0de57..0000000
--- a/sdks/dotnet/packages/NSubstitute.1.6.0.0/CHANGELOG.txt
+++ /dev/null
@@ -1,103 +0,0 @@
-1.6.0 (April 2013)
-* [NEW] .AndDoes() method for chaining a callback after a Returns(). (#98)
-* [FIX] Handling calls with params argument of value types, thanks to Eric Winkler.
-* [FIX] Can now substitute for interfaces implementing System.Windows.IDataObject, thanks to Johan Appelgren.
-* [UPDATE] Improved XML doc comments, thanks to David Gardiner.
-
-1.5.0 (January 2013)
-* [EXPERIMENTAL] Asserting ordered call sequences
-* [FIX] Arg.Invoke with four arguments now passes fourth arg correctly (#88). Thanks to Ville Salonen (@VilleSalonen) for finding and patching this.
-* [FIX] Substitute objects now use actual implementation for base object methods (Equals, GetHashCode, ToString). Thanks to Robert Moore (@robdmoore) for this contribution. (#77)
-* [NEW] Auto-substitute for Task/Task<T>. Task<T> will use substitute rules that T would use. Thanks to Jake Ginnivan (@JakeGinnivan) for this contribution.
-* [NEW] Match derived types for generic calls (#97). Thanks to Iain Ballard for this contribution.
-* [NEW] Returns now supports passing multiple callbacks, which makes it easier to combine stubbing multiple return values followed by throwing an exception (#99). Thanks to Alexandr Nikitin for this contribution.
-
-1.4.3 (August 2012)
-* [FIX] Updated to Castle.Core 3.1.0 to fix an issue proxying generic methods with a struct constraint (#83).
-
-1.4.2 (July 2012)
-* [FIX] Issue using NET40 build on Mono (due to NET45 build tools incompatibility)
-
-1.4.1 (June 2012)
-* [FIX] Fix matching Nullable<T> arguments when arg value is null. Thanks to Magnus Olstad Hansen (@maggedotno) for this contribution. (#78)
-* [UPDATE] Updated to Castle.Core 3.0.0.
-
-1.4.0 (May 2012)
-* [NEW] [BREAKING] Auto-substitute for types returned from substitutes of delegates/Funcs (follows same auto-substitute rules as for methods and properties). Thanks to Sauli T�hk�p�� for implementing this feature. (#52)
-* [NEW] Show details of params arguments when displaying received calls. Thanks to Sauli T�hk�p�� for implementing this feature. (#65)
-* [FIX] Race condition between checking received calls and building the exception could cause nonsensical exception messages like "Expected 5, actually received 5" when called concurrently. (#64)
-
-1.3.0 (Nov 2011)
-* [NEW] Support for Received(times) to assert a call was received a certain number of times. Thanks to Abi Bellamkonda for this contribution. (#63)
-* [FIX] Improved support for calling substitutes from multiple threads. (#62)
-
-1.2.1 (Oct 2011)
-* [FIX] Some combinations of Arg.Do and Returns() caused incorrect values to be returned. (#59)
-* [UPDATE] WCF ServiceContractAttribute no longer applied to proxies. (#60)
-* [FIX] Passing null could cause argument actions to fail. (#61)
-* [FIX] Calls to virtual methods from constructors of classes being substituted for are no longer recorded, to prevent non-obvious behaviour when calling Returns() on an auto-substituted value. (#57)
-
-1.2.0 (Sep 2011)
-* [NEW] Arg.Do() syntax for capturing arguments passed to a method and performing some action with them whenever the method is called.
-* [NEW] Arg.Invoke() syntax for invoking callbacks passed as arguments to a method whenever the method is called.
-* [NEW] Basic support for setting out/ref parameters.
-* [FIX] Property behaviour for indexed properties (Issue #53)
-* [UPDATE] [BREAKING] Auto-substitute for pure virtual classes, including common ASP.NET web abstractions. Use .Returns(x=>null) to explicitly return null from these members if required. Thanks to Tatham Oddie for original idea and patch, and Krzysztof Kozmic for suggesting and defining which classes would be safe to automatically proxy.
-* [UPDATE] Changed layout of package for eventual support for multiple framework targets.
-* [FIX] Failure to match calls with ref arguments using ReceivedWithAnyArgs().
-* [FIX] Incorrect ambiguous args exception when supplying value type arg specs for object arguments.
-
-1.1.0 (May 2011)
-* [UPDATE] Updated to Castle.Core 2.5.3.
-* [FIX] Fixed bug when raising a delegate event with a null argument.
-* [FIX] CallInfo.Arg<T>() now works more reliably, including for null arguments.
-* [FIX] Better exception when accidentally calling substitute extension method with a null reference (e.g. foo.Received().Call() when foo is null)
-* [UPDATE] Exceptions thrown in custom argument matchers (Arg.Is<T>(x => ...)) will now silently fail to match the argument, rather than allowing exceptions to bubble up.
-* [NEW] Support for test fixtures run in parallel.
-
-1.0.0 (Dec 2010)
-* [FIX] Using Returns(null) for value types throws, rather than returning default(T).
-
-0.9.5 Release Candidate
-* [FIX] Fixed bug when trying to return null from a call to a substitute.
-* [FIX] Equals() for class substitutes fixed by not intercepting Object methods Equals(), ToString() and GetHashCode().
-* [NEW] Raise.Event<THandler>() methods to raise any type of event, including delegates.
-* [BREAKING] Raise.Action() methods removed. Use Raise.Event<THandler>() (e.g. Raise.Event<Action>>()).
-* [BREAKING] Renamed Raise.Event<TEventArgs>() methods to Raise.EventWith<TEventArgs>().
-* [UPDATE] Arg matchers can be specified using more specific, compatible type (Arg.Is<string>(..) for arg of type object).
-* [NEW] NSubstitute website and documentation http://nsubstitute.github.com
-* [FIX] Formating for argument matchers that take predicate functions.
-* [FIX] Match single argument matcher passed to params arg (#34)
-* [FIX] Detect ambiguous arg matchers in additional case (#31)
-* [FIX] Can modify event handler subscriptions from within event callback
-* [UPDATE] Update to Castle.Core 2.5.2
-* [FIX] Can substitute for SynchronizationContext in .NET4 (fixed in Castle.Core)
-* [NEW] NSubstitute available as NuPack package
-
-0.9.0 Beta 1
-* [FIX] Now handles argument specifiers used for params arguments correctly
-* [UPDATE] Updated to Castle.Core 2.5 final.
-
-0.1.3 alpha 4
-* [NEW] Support auto/recursive substituting for members that return interfaces or delegates.
-* [NEW] Support auto substituting for members that return arrays and strings (return empty values rather than null).
-* [NEW] Raise.Event<TEventArgs>() will now attempt to construct arguments with default ctors, so in most cases they will not need to be explictly provided.
-* [UPDATE] Added support for raising events with custom delegate types.
-* [UPDATE] Formatting for event subscription and unsubscription calls in call received/not received exceptions.
-* [UPDATE] Updated to pre-release build of Castle.Core 2.5 to get dynamic proxy to support modopts.
-* [FIX] Throw correct exception when raising an event and event handler throws. (Fix by Rodrigo Perera)
-* [FIX] Record call as received when it throws an exception from the When..Do callback.
-
-0.1.2 alpha 3
-* [NEW] Marked non-matching parameters in the actual calls listed for CallNotReceivedException messages.
-* [NEW] Added WhenForAnyArgs..Do syntax for callbacks.
-* [UPDATE] Updated arg matching to be smarter when matchers are not used for all args.
-* [FIX] Fixed bug when substituting for delegates with multiple parameters.
-* [FIX] Removed redundant cast operator which sometimes caused the compiler trouble in resolving Raise.Event().
-
-0.1.1 alpha 2
-* [NEW] Added ReturnsForAnyArgs() extension methods
-* [FIX] Compiled for Any CPU to run on x64 platforms
-
-0.1.0 alpha
-* Initial release

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/db32c155/sdks/dotnet/packages/NSubstitute.1.6.0.0/README.txt
----------------------------------------------------------------------
diff --git a/sdks/dotnet/packages/NSubstitute.1.6.0.0/README.txt b/sdks/dotnet/packages/NSubstitute.1.6.0.0/README.txt
index 8d7e842..e69de29 100644
--- a/sdks/dotnet/packages/NSubstitute.1.6.0.0/README.txt
+++ b/sdks/dotnet/packages/NSubstitute.1.6.0.0/README.txt
@@ -1,119 +0,0 @@
-NSubstitute
-========
-
-Visit the [NSubstitute website](http://nsubstitute.github.com) for more information.
-
-### What is it?
-
-NSubstitute is designed as a friendly substitute for .NET mocking libraries.  
-
-It is an attempt to satisfy our craving for a mocking library with a succinct syntax that helps us keep the focus on the intention of our tests, rather than on the configuration of our test doubles. We've tried to make the most frequently required operations obvious and easy to use, keeping less usual scenarios discoverable and accessible, and all the while maintaining as much natural language as possible.
-
-Perfect for those new to testing, and for others who would just like to to get their tests written with less noise and fewer lambdas.
-
-### Getting help
-
-If you have questions or feedback on NSubstitute, head on over to the [NSubstitute discussion group](http://groups.google.com/group/nsubstitute).
-
-### Basic use
-
-Let's say we have a basic calculator interface:
-
-
-    public interface ICalculator
-    {
-        int Add(int a, int b);
-        string Mode { get; set; }
-        event Action PoweringUp;
-    }
-
-
-
-We can ask NSubstitute to create a substitute instance for this type. We could ask for a stub, mock, fake, spy, test double etc., but why bother when we just want to substitute an instance we have some control over?
-
-
-    _calculator = Substitute.For<ICalculator>();
-
-
-Now we can tell our substitute to return a value for a call:
-
-
-    _calculator.Add(1, 2).Returns(3);
-    Assert.That(_calculator.Add(1, 2), Is.EqualTo(3));
-
-
-We can check that our substitute received a call, and did not receive others:
-
-
-    _calculator.Add(1, 2);
-    _calculator.Received().Add(1, 2);
-    _calculator.DidNotReceive().Add(5, 7);
-
-
-If our Received() assertion fails, NSubstitute tries to give us some help as to what the problem might be:
-
-
-    NSubstitute.Exceptions.ReceivedCallsException : Expected to receive a call matching:
-        Add(1, 2)
-    Actually received no matching calls.
-    Received 2 non-matching calls (non-matching arguments indicated with '*' characters):
-        Add(1, *5*)
-        Add(*4*, *7*)
-
-We can also work with properties using the Returns syntax we use for methods, or just stick with plain old property setters (for read/write properties):
-
-
-    _calculator.Mode.Returns("DEC");
-    Assert.That(_calculator.Mode, Is.EqualTo("DEC"));
-
-    _calculator.Mode = "HEX";
-    Assert.That(_calculator.Mode, Is.EqualTo("HEX"));
-
-
-NSubstitute supports argument matching for setting return values and asserting a call was received:
-
-
-    _calculator.Add(10, -5);
-    _calculator.Received().Add(10, Arg.Any<int>());
-    _calculator.Received().Add(10, Arg.Is<int>(x => x < 0));
-
-
-We can use argument matching as well as passing a function to Returns() to get some more behaviour out of our substitute (possibly too much, but that's your call):
-
-
-    _calculator
-       .Add(Arg.Any<int>(), Arg.Any<int>())
-       .Returns(x => (int)x[0] + (int)x[1]);
-    Assert.That(_calculator.Add(5, 10), Is.EqualTo(15));
-
-
-Returns() can also be called with multiple arguments to set up a sequence of return values.
-
-
-    _calculator.Mode.Returns("HEX", "DEC", "BIN");
-    Assert.That(_calculator.Mode, Is.EqualTo("HEX"));
-    Assert.That(_calculator.Mode, Is.EqualTo("DEC"));
-    Assert.That(_calculator.Mode, Is.EqualTo("BIN"));
-
-
-Finally, we can raise events on our substitutes (unfortunately C# dramatically restricts the extent to which this syntax can be cleaned up):
-
-
-    bool eventWasRaised = false;
-    _calculator.PoweringUp += () => eventWasRaised = true;
-
-    _calculator.PoweringUp += Raise.Event<Action>();
-    Assert.That(eventWasRaised);
-
-
-### Building
-
-If you have Visual Studio 2008 or 2010 you should be able to compile NSubstitute and run the unit tests using the NUnit GUI or console test runner (see the ThirdParty directory).
-To do full builds you'll also need Ruby and rake to run the rakefile.
-
-### NOTE: Framework Multi-Targeting
-
-[Brendan](https://github.com/shiftkey) is updating the build process to [support multiple framework versions](https://github.com/nsubstitute/NSubstitute/wiki/Silverlight-port), including Silverlight. See the [Silverlight port](https://github.com/nsubstitute/NSubstitute/wiki/Silverlight-port) wiki page for current status.
-
-
-

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/db32c155/sdks/dotnet/packages/NUnit.2.6.2/README.txt
----------------------------------------------------------------------
diff --git a/sdks/dotnet/packages/NUnit.2.6.2/README.txt b/sdks/dotnet/packages/NUnit.2.6.2/README.txt
new file mode 100644
index 0000000..930ec73
--- /dev/null
+++ b/sdks/dotnet/packages/NUnit.2.6.2/README.txt
@@ -0,0 +1,3 @@
+Apache Software Foundation policy prevents us from including DLLs and other binary files in our releases.
+
+You will have to download this package and place it in this directory yourself. 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/db32c155/sdks/dotnet/packages/Newtonsoft.Json.4.5.11/README.txt
----------------------------------------------------------------------
diff --git a/sdks/dotnet/packages/Newtonsoft.Json.4.5.11/README.txt b/sdks/dotnet/packages/Newtonsoft.Json.4.5.11/README.txt
new file mode 100644
index 0000000..930ec73
--- /dev/null
+++ b/sdks/dotnet/packages/Newtonsoft.Json.4.5.11/README.txt
@@ -0,0 +1,3 @@
+Apache Software Foundation policy prevents us from including DLLs and other binary files in our releases.
+
+You will have to download this package and place it in this directory yourself. 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/db32c155/sdks/dotnet/packages/RestSharp.104.1/README.txt
----------------------------------------------------------------------
diff --git a/sdks/dotnet/packages/RestSharp.104.1/README.txt b/sdks/dotnet/packages/RestSharp.104.1/README.txt
new file mode 100644
index 0000000..930ec73
--- /dev/null
+++ b/sdks/dotnet/packages/RestSharp.104.1/README.txt
@@ -0,0 +1,3 @@
+Apache Software Foundation policy prevents us from including DLLs and other binary files in our releases.
+
+You will have to download this package and place it in this directory yourself. 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/db32c155/sdks/dotnet/packages/RestSharp.104.1/readme.txt
----------------------------------------------------------------------
diff --git a/sdks/dotnet/packages/RestSharp.104.1/readme.txt b/sdks/dotnet/packages/RestSharp.104.1/readme.txt
deleted file mode 100644
index dca2fa6..0000000
--- a/sdks/dotnet/packages/RestSharp.104.1/readme.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-*** IMPORTANT CHANGE IN RESTSHARP VERSION 103 ***
-
-In 103.0, JSON.NET was removed as a dependency. 
-
-If this is still installed in your project and no other libraries depend on 
-it you may remove it from your installed packages.
-
-There is one breaking change: the default Json*Serializer* is no longer 
-compatible with Json.NET. To use Json.NET for serialization, copy the code 
-from https://github.com/restsharp/RestSharp/blob/86b31f9adf049d7fb821de8279154f41a17b36f7/RestSharp/Serializers/JsonSerializer.cs 
-and register it with your client:
-
-var client = new RestClient();
-client.JsonSerializer = new YourCustomSerializer();
-
-The default Json*Deserializer* should be 100% compatible.
-
-If you run into any compatibility issues with deserialization, 
-please report it to http://groups.google.com/group/restsharp
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/db32c155/sdks/dotnet/samples/locationSample/packages/Geocoder.0.1.0.0/README.txt
----------------------------------------------------------------------
diff --git a/sdks/dotnet/samples/locationSample/packages/Geocoder.0.1.0.0/README.txt b/sdks/dotnet/samples/locationSample/packages/Geocoder.0.1.0.0/README.txt
new file mode 100644
index 0000000..930ec73
--- /dev/null
+++ b/sdks/dotnet/samples/locationSample/packages/Geocoder.0.1.0.0/README.txt
@@ -0,0 +1,3 @@
+Apache Software Foundation policy prevents us from including DLLs and other binary files in our releases.
+
+You will have to download this package and place it in this directory yourself. 
\ No newline at end of file


[26/52] [abbrv] git commit: More JSON serialization fixes: EntityRef and CredentialsInfo should not be serialized with type info.

Posted by gr...@apache.org.
More JSON serialization fixes: EntityRef and CredentialsInfo should not be serialized with type info.


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: dc12e8b60bad2709fc53c63ab7d92eed158a0144
Parents: b09b154
Author: Dave Johnson <dm...@apigee.com>
Authored: Fri Aug 29 13:47:13 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Fri Aug 29 13:47:13 2014 -0400

----------------------------------------------------------------------
 .../usergrid/persistence/CredentialsInfo.java   |  13 +-
 .../apache/usergrid/persistence/EntityRef.java  |   4 -
 .../persistence/GeoQueryBooleanTest.java        |  64 ++--
 .../common/src/test/resources/log4j.properties  |  29 ++
 .../persistence/model/field/AbstractField.java  |   2 +-
 .../usergrid/persistence/model/field/Field.java |   2 +-
 .../model/src/test/resources/log4j.properties   |  29 ++
 .../usergrid/persistence/index/query/Query.java |  15 +-
 .../persistence/index/utils/JsonUtils.java      | 329 -------------------
 9 files changed, 120 insertions(+), 367 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/dc12e8b6/stack/core/src/main/java/org/apache/usergrid/persistence/CredentialsInfo.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/CredentialsInfo.java b/stack/core/src/main/java/org/apache/usergrid/persistence/CredentialsInfo.java
index edfffcf..957f8a8 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/CredentialsInfo.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/CredentialsInfo.java
@@ -17,23 +17,16 @@
 package org.apache.usergrid.persistence;
 
 
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import java.io.Serializable;
 import java.util.Map;
 import java.util.TreeMap;
-
 import javax.xml.bind.annotation.XmlRootElement;
 
-//import org.codehaus.jackson.annotate.JsonAnyGetter;
-//import org.codehaus.jackson.annotate.JsonAnySetter;
-//import org.codehaus.jackson.annotate.JsonTypeInfo;
-//import org.codehaus.jackson.map.annotate.JsonSerialize;
-//import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion;
-import com.fasterxml.jackson.annotation.*;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-
 
 @XmlRootElement
-@JsonTypeInfo( use= JsonTypeInfo.Id.CLASS,include= JsonTypeInfo.As.WRAPPER_OBJECT,property="@class" )
 public class CredentialsInfo implements Comparable<CredentialsInfo>,Serializable {
 
     boolean recoverable;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/dc12e8b6/stack/core/src/main/java/org/apache/usergrid/persistence/EntityRef.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/EntityRef.java b/stack/core/src/main/java/org/apache/usergrid/persistence/EntityRef.java
index 8133840..56c75cc 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/EntityRef.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/EntityRef.java
@@ -16,12 +16,8 @@
  */
 package org.apache.usergrid.persistence;
 
-
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-
 import java.util.UUID;
 
-@JsonTypeInfo( use= JsonTypeInfo.Id.CLASS,include= JsonTypeInfo.As.WRAPPER_OBJECT,property="@class" )
 public interface EntityRef {
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/dc12e8b6/stack/core/src/test/java/org/apache/usergrid/persistence/GeoQueryBooleanTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/GeoQueryBooleanTest.java b/stack/core/src/test/java/org/apache/usergrid/persistence/GeoQueryBooleanTest.java
index 8ba860a..0d9810f 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/GeoQueryBooleanTest.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/GeoQueryBooleanTest.java
@@ -123,6 +123,8 @@ public class GeoQueryBooleanTest extends AbstractCoreIT {
         EntityManager em = setup.getEmf().getEntityManager( applicationId );
         assertNotNull( em );
 
+        // define two users at a location 
+
         Map<String, Object> properties = new LinkedHashMap<String, Object>() {{
             put( "username", "bart" );
             put( "email", "bart@example.com" );
@@ -132,6 +134,7 @@ public class GeoQueryBooleanTest extends AbstractCoreIT {
                 add( new LinkedHashMap<String, Object>() {{ put("name", "mina"); }});
             }});            
             put( "blockedBy", new ArrayList<Object>() {{
+                add( new LinkedHashMap<String, Object>() {{ put("name", "gertrude"); }});
                 add( new LinkedHashMap<String, Object>() {{ put("name", "isabell"); }});
             }});
             put( "location", new LinkedHashMap<String, Object>() {{
@@ -142,25 +145,46 @@ public class GeoQueryBooleanTest extends AbstractCoreIT {
 
         Entity userBart = em.create( "user", properties );
         assertNotNull( userBart );
-//
-//        properties = new LinkedHashMap<String, Object>() {{
-//            put( "username", "fred" );
-//            put( "email", "fred@example.com" );
-//            put( "block", new ArrayList<Object>() {{
-//                add( new LinkedHashMap<String, Object>() {{ put("name", "steve"); }});
-//                add( new LinkedHashMap<String, Object>() {{ put("name", "mina"); }});
-//            }});
-//            put( "blockedBy", new ArrayList<Object>() {{
-//                add( new LinkedHashMap<String, Object>() {{ put("name", "bart"); }});
-//            }});
-//            put( "location", new LinkedHashMap<String, Object>() {{
-//                put("latitude", 37.776753 );
-//                put("longitude", -122.407846 );
-//            }} ); 
-//        }};
-//
-//        Entity userFred = em.create( "user", properties );
-//        assertNotNull( userFred );
-    }
+
+        properties = new LinkedHashMap<String, Object>() {{
+            put( "username", "fred" );
+            put( "email", "fred@example.com" );
+            put( "block", new ArrayList<Object>() {{
+                add( new LinkedHashMap<String, Object>() {{ put("name", "steve"); }});
+                add( new LinkedHashMap<String, Object>() {{ put("name", "mina"); }});
+            }});
+            put( "blockedBy", new ArrayList<Object>() {{
+                add( new LinkedHashMap<String, Object>() {{ put("name", "bart"); }});
+                add( new LinkedHashMap<String, Object>() {{ put("name", "beth"); }});
+            }});
+            put( "location", new LinkedHashMap<String, Object>() {{
+                put("latitude", 37.776753 );
+                put("longitude", -122.407846 );
+            }} ); 
+        }};
+
+        Entity userFred = em.create( "user", properties );
+        assertNotNull( userFred );
+
+        em.refreshIndex();
+
+        // define center point about 300m from that location
+        Point center = new Point( 37.774277, -122.404744 );
+
+        // one user within 400 meters IS NOT blocked by bart
+        Query query = Query.fromQL( 
+            "select * where NOT blockedBy.name='bart' and location within 400 of " 
+               + center.getLat() + "," + center.getLon());
+        Results listResults = em.searchCollection( em.getApplicationRef(), "users", query );
+        assertEquals( 2, listResults.size() );
+
+        // one user within 400 meters IS blocked by bart
+        query = Query.fromQL( 
+            "select * where blockedBy.name='bart' and location within 400 of " 
+               + center.getLat() + "," + center.getLon());
+        listResults = em.searchCollection( em.getApplicationRef(), "users", query );
+        assertEquals( 2, listResults.size() );
+
+     }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/dc12e8b6/stack/corepersistence/common/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/test/resources/log4j.properties b/stack/corepersistence/common/src/test/resources/log4j.properties
new file mode 100644
index 0000000..6f6d1be
--- /dev/null
+++ b/stack/corepersistence/common/src/test/resources/log4j.properties
@@ -0,0 +1,29 @@
+# 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.
+
+# for production, you should probably set the root to INFO
+# and the pattern to %c instead of %l.  (%l is slower.)
+
+# output messages into a rolling log file as well as stdout
+log4j.rootLogger=INFO,stdout
+
+# stdout
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+#log4j.appender.stdout.layout=org.apache.log4j.SimpleLayout
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d %p (%t) %c{1} - %m%n
+
+log4j.logger.org.apache.usergrid=INFO

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/dc12e8b6/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/AbstractField.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/AbstractField.java b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/AbstractField.java
index 17af18c..0283277 100644
--- a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/AbstractField.java
+++ b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/AbstractField.java
@@ -25,7 +25,7 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo;
 /**
  * Base class for data information
  */
-@JsonTypeInfo( use= JsonTypeInfo.Id.CLASS,include= JsonTypeInfo.As.WRAPPER_OBJECT,property="@class" )
+@JsonTypeInfo( use=JsonTypeInfo.Id.CLASS, include=JsonTypeInfo.As.PROPERTY, property="@class" )
 public abstract class AbstractField<T> implements Field<T> {
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/dc12e8b6/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/Field.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/Field.java b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/Field.java
index 8419b6b..9da0d4e 100644
--- a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/Field.java
+++ b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/Field.java
@@ -29,7 +29,7 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo;
  * (in the java runtime) The V is the value of the field
  * @param <T>
  */
-@JsonTypeInfo( use= JsonTypeInfo.Id.CLASS,include= JsonTypeInfo.As.WRAPPER_OBJECT,property="@class" )
+@JsonTypeInfo( use=JsonTypeInfo.Id.CLASS, include=JsonTypeInfo.As.PROPERTY, property="@class" )
 public interface Field<T> extends Serializable {
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/dc12e8b6/stack/corepersistence/model/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/stack/corepersistence/model/src/test/resources/log4j.properties b/stack/corepersistence/model/src/test/resources/log4j.properties
new file mode 100644
index 0000000..6f6d1be
--- /dev/null
+++ b/stack/corepersistence/model/src/test/resources/log4j.properties
@@ -0,0 +1,29 @@
+# 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.
+
+# for production, you should probably set the root to INFO
+# and the pattern to %c instead of %l.  (%l is slower.)
+
+# output messages into a rolling log file as well as stdout
+log4j.rootLogger=INFO,stdout
+
+# stdout
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+#log4j.appender.stdout.layout=org.apache.log4j.SimpleLayout
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d %p (%t) %c{1} - %m%n
+
+log4j.logger.org.apache.usergrid=INFO

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/dc12e8b6/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/Query.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/Query.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/Query.java
index 569c08d..f845e63 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/Query.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/Query.java
@@ -30,6 +30,8 @@ import java.util.Set;
 import java.util.UUID;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import java.io.IOException;
 import org.antlr.runtime.ANTLRStringStream;
 import org.antlr.runtime.ClassicToken;
 import org.antlr.runtime.CommonTokenStream;
@@ -55,7 +57,6 @@ import org.apache.usergrid.persistence.index.query.tree.Operand;
 import org.apache.usergrid.persistence.index.query.tree.QueryVisitor;
 import org.apache.usergrid.persistence.index.utils.ClassUtils;
 import org.apache.usergrid.persistence.index.utils.ConversionUtils;
-import org.apache.usergrid.persistence.index.utils.JsonUtils;
 import org.apache.usergrid.persistence.index.utils.ListUtils;
 import org.apache.usergrid.persistence.index.utils.MapUtils;
 import org.elasticsearch.index.query.FilterBuilder;
@@ -102,6 +103,9 @@ public class Query {
     private String collection;
     private String ql;
 
+    private static ObjectMapper mapper = new ObjectMapper();
+
+
     List<Operand> filterClauses = new ArrayList<Operand>();
 
     public Query() {
@@ -232,7 +236,14 @@ public class Query {
 
 
     public static Query fromJsonString( String json ) throws QueryParseException {
-        Object o = JsonUtils.parse( json );
+
+        Object o;
+        try {
+            o = mapper.readValue( json, Object.class );
+        } catch (IOException ex) {
+            throw new QueryParseException("Error parsing JSON query string " + json, ex);
+        }
+
         if ( o instanceof Map ) {
             @SuppressWarnings({ "unchecked", "rawtypes" }) Map<String, List<String>> params =
                     ClassUtils.cast( MapUtils.toMapList( ( Map ) o ) );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/dc12e8b6/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/utils/JsonUtils.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/utils/JsonUtils.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/utils/JsonUtils.java
deleted file mode 100644
index f44be17..0000000
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/utils/JsonUtils.java
+++ /dev/null
@@ -1,329 +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.utils;
-
-
-import java.io.File;
-import java.math.BigInteger;
-import java.nio.ByteBuffer;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.usergrid.persistence.index.exceptions.JsonReadException;
-import org.apache.usergrid.persistence.index.exceptions.JsonWriteException;
-
-import com.fasterxml.jackson.core.io.JsonStringEncoder;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import com.fasterxml.jackson.dataformat.smile.SmileFactory;
-
-//import org.codehaus.jackson.JsonNode;
-//import org.codehaus.jackson.io.JsonStringEncoder;
-//import org.codehaus.jackson.map.ObjectMapper;
-//import org.codehaus.jackson.map.SerializationConfig.Feature;
-//import org.codehaus.jackson.smile.SmileFactory;
-
-
-public class JsonUtils {
-
-    private static final Logger LOG = LoggerFactory.getLogger( JsonUtils.class );
-
-    static ObjectMapper mapper = new ObjectMapper();
-
-    static SmileFactory smile = new SmileFactory();
-
-    static ObjectMapper smileMapper = new ObjectMapper( smile );
-
-    private static ObjectMapper indentObjectMapper = new ObjectMapper();
-
-
-    static {
-        indentObjectMapper.getSerializationConfig().with( SerializationFeature.INDENT_OUTPUT);
-    }
-
-
-    /** Converts object to JSON string, throws runtime exception JsonWriteException on failure. */
-    public static String mapToJsonString( Object obj ) {
-        try {
-            return mapper.writeValueAsString( obj );
-        }
-        catch ( Throwable t ) {
-            LOG.debug( "Error generating JSON", t );
-            throw new JsonWriteException( "Error generating JSON", t );
-        }
-    }
-
-
-    /** Converts object to JSON string, throws runtime exception JsonWriteException on failure. */
-    public static String mapToFormattedJsonString( Object obj ) {
-        try {
-            return indentObjectMapper.writeValueAsString( obj );
-        }
-        catch ( Throwable t ) {
-            LOG.debug( "Error generating JSON", t );
-            throw new JsonWriteException( "Error generating JSON", t );
-        }
-    }
-
-
-    /** Parses JSON string  and returns object, throws runtime exception JsonReadException on failure. */
-    public static Object parse( String json ) {
-        try {
-            return mapper.readValue( json, Object.class );
-        }
-        catch ( Throwable t ) {
-            LOG.debug( "Error parsing JSON", t );
-            throw new JsonReadException( "Error parsing JSON", t );
-        }
-    }
-
-
-    public static String quoteString( String s ) {
-        JsonStringEncoder encoder = new JsonStringEncoder();
-        return new String( encoder.quoteAsUTF8( s ) );
-    }
-
-
-    public static ByteBuffer toByteBuffer( Object obj ) {
-        if ( obj == null ) {
-            return null;
-        }
-
-        byte[] bytes = null;
-        try {
-            bytes = smileMapper.writeValueAsBytes( obj );
-        }
-        catch ( Exception e ) {
-            LOG.error( "Error getting SMILE bytes", e );
-        }
-        if ( bytes != null ) {
-            return ByteBuffer.wrap( bytes );
-        }
-        return null;
-    }
-
-
-    public static Object fromByteBuffer( ByteBuffer byteBuffer ) {
-        return fromByteBuffer( byteBuffer, Object.class );
-    }
-
-
-    public static Object fromByteBuffer( ByteBuffer byteBuffer, Class<?> clazz ) {
-        if ( ( byteBuffer == null ) || !byteBuffer.hasRemaining() ) {
-            return null;
-        }
-        if ( clazz == null ) {
-            clazz = Object.class;
-        }
-
-        Object obj = null;
-        try {
-            obj = smileMapper.readValue( byteBuffer.array(), byteBuffer.arrayOffset() + byteBuffer.position(),
-                    byteBuffer.remaining(), clazz );
-        }
-        catch ( Exception e ) {
-            LOG.error( "Error parsing SMILE bytes", e );
-        }
-        return obj;
-    }
-
-
-    public static JsonNode toJsonNode( Object obj ) {
-        if ( obj == null ) {
-            return null;
-        }
-        return mapper.convertValue( obj, JsonNode.class );
-    }
-
-
-    @SuppressWarnings("unchecked")
-    public static Map<String, Object> toJsonMap( Object obj ) {
-        if ( obj == null ) {
-            return null;
-        }
-
-        return ( Map<String, Object> ) mapper.convertValue( obj, Map.class );
-    }
-
-
-    private static UUID tryConvertToUUID( Object o ) {
-        if ( o instanceof String ) {
-            String s = ( String ) o;
-            if ( s.length() == 36 ) {
-                try {
-                    return UUID.fromString( s );
-                }
-                catch ( IllegalArgumentException e ) {
-                    LOG.warn( "Argument to UUID.fromString({}) was invalid.", s, e );
-                }
-            }
-        }
-        return null;
-    }
-
-
-    public static Object normalizeJsonTree( Object obj ) {
-        if ( obj instanceof Map ) {
-            @SuppressWarnings("unchecked") Map<Object, Object> m = ( Map<Object, Object> ) obj;
-            Object o;
-            UUID uuid;
-            for ( Object k : m.keySet() ) {
-                if ( k instanceof String && ( ( String ) k ).equalsIgnoreCase( "name" ) ) {
-                    continue;
-                }
-
-                o = m.get( k );
-                uuid = tryConvertToUUID( o );
-                if ( uuid != null ) {
-                    m.put( k, uuid );
-                }
-                else if ( o instanceof Integer ) {
-                    m.put( k, ( ( Integer ) o ).longValue() );
-                }
-                else if ( o instanceof BigInteger ) {
-                    m.put( k, ( ( BigInteger ) o ).longValue() );
-                }
-            }
-        }
-        else if ( obj instanceof List ) {
-            @SuppressWarnings("unchecked") List<Object> l = ( List<Object> ) obj;
-            Object o;
-            UUID uuid;
-            for ( int i = 0; i < l.size(); i++ ) {
-                o = l.get( i );
-                uuid = tryConvertToUUID( o );
-                if ( uuid != null ) {
-                    l.set( i, uuid );
-                }
-                else if ( ( o instanceof Map ) || ( o instanceof List ) ) {
-                    normalizeJsonTree( o );
-                }
-                else if ( o instanceof Integer ) {
-                    l.set( i, ( ( Integer ) o ).longValue() );
-                }
-                else if ( o instanceof BigInteger ) {
-                    l.set( i, ( ( BigInteger ) o ).longValue() );
-                }
-            }
-        }
-        else if ( obj instanceof String ) {
-            UUID uuid = tryConvertToUUID( obj );
-            if ( uuid != null ) {
-                return uuid;
-            }
-        }
-        else if ( obj instanceof Integer ) {
-            return ( ( Integer ) obj ).longValue();
-        }
-        else if ( obj instanceof BigInteger ) {
-            return ( ( BigInteger ) obj ).longValue();
-        }
-        else if ( obj instanceof JsonNode ) {
-            return mapper.convertValue( obj, Object.class );
-        }
-        return obj;
-    }
-
-
-//    public static Object select( Object obj, String path ) {
-//        return select( obj, path, false );
-//    }
-//
-//
-//    public static Object select( Object obj, String path, boolean buildResultTree ) {
-//
-//        if ( obj == null ) {
-//            return null;
-//        }
-//
-//        if ( org.apache.commons.lang.StringUtils.isBlank( path ) ) {
-//            return obj;
-//        }
-//
-//        String segment = stringOrSubstringBeforeFirst( path, '.' );
-//        String remaining = substringAfter( path, "." );
-//
-//        if ( obj instanceof Map ) {
-//            Map<?, ?> map = ( Map<?, ?> ) obj;
-//            Object child = map.get( segment );
-//            Object result = select( child, remaining, buildResultTree );
-//            if ( result != null ) {
-//                if ( buildResultTree ) {
-//                    Map<Object, Object> results = new LinkedHashMap<Object, Object>();
-//                    results.put( segment, result );
-//                    return results;
-//                }
-//                else {
-//                    return result;
-//                }
-//            }
-//            return null;
-//        }
-//        if ( obj instanceof List ) {
-//            List<Object> results = new ArrayList<Object>();
-//            List<?> list = ( List<?> ) obj;
-//            for ( Object i : list ) {
-//                Object result = select( i, path, buildResultTree );
-//                if ( result != null ) {
-//                    results.add( result );
-//                }
-//            }
-//            if ( !results.isEmpty() ) {
-//                return results;
-//            }
-//            return null;
-//        }
-//
-//        if ( obj instanceof Entity ) {
-//            Object child = ( ( Entity ) obj ).getProperty( segment );
-//            Object result = select( child, remaining, buildResultTree );
-//            if ( result != null ) {
-//                if ( buildResultTree ) {
-//                    Map<Object, Object> results = new LinkedHashMap<Object, Object>();
-//                    results.put( segment, result );
-//                    return results;
-//                }
-//                else {
-//                    return result;
-//                }
-//            }
-//            else {
-//                return result;
-//            }
-//        }
-//
-//        return obj;
-//    }
-
-
-    public static Object loadFromFilesystem( String filename ) {
-        Object json = null;
-        try {
-            File file = new File( filename );
-            json = mapper.readValue( file, Object.class );
-        }
-        catch ( Exception e ) {
-            LOG.error( "Error loading JSON", e );
-        }
-        return json;
-    }
-}


[23/52] [abbrv] git commit: Reverting previous change; jumped the gun on that one.

Posted by gr...@apache.org.
Reverting previous change; jumped the gun on that one.


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: b09b154a0880017569a3b1f21cedcfa9856fdd66
Parents: ef70714
Author: Dave Johnson <dm...@apigee.com>
Authored: Fri Aug 29 10:06:31 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Fri Aug 29 10:06:31 2014 -0400

----------------------------------------------------------------------
 .../main/java/org/apache/usergrid/utils/JsonUtils.java  | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b09b154a/stack/core/src/main/java/org/apache/usergrid/utils/JsonUtils.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/utils/JsonUtils.java b/stack/core/src/main/java/org/apache/usergrid/utils/JsonUtils.java
index f81d6bf..4db2ce2 100644
--- a/stack/core/src/main/java/org/apache/usergrid/utils/JsonUtils.java
+++ b/stack/core/src/main/java/org/apache/usergrid/utils/JsonUtils.java
@@ -42,12 +42,6 @@ import com.fasterxml.jackson.dataformat.smile.SmileFactory;
 import static org.apache.commons.lang.StringUtils.substringAfter;
 import static org.apache.usergrid.utils.StringUtils.stringOrSubstringBeforeFirst;
 
-//import org.codehaus.jackson.JsonNode;
-//import org.codehaus.jackson.io.JsonStringEncoder;
-//import org.codehaus.jackson.map.ObjectMapper;
-//import org.codehaus.jackson.map.SerializationConfig.Feature;
-//import org.codehaus.jackson.smile.SmileFactory;
-
 
 public class JsonUtils {
 
@@ -63,8 +57,8 @@ public class JsonUtils {
 
 
     static {
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.enableDefaultTypingAsProperty(ObjectMapper.DefaultTyping.JAVA_LANG_OBJECT, "@class");
+        //indentObjectMapper.getSerializationConfig().set( Feature.INDENT_OUTPUT, true );
+        indentObjectMapper.getSerializationConfig().with( SerializationFeature.INDENT_OUTPUT );
     }
 
 
@@ -83,7 +77,7 @@ public class JsonUtils {
     /** Converts object to JSON string, throws runtime exception JsonWriteException on failure. */
     public static String mapToFormattedJsonString( Object obj ) {
         try {
-            return indentObjectMapper.writeValueAsString( obj );
+            return mapper.writeValueAsString( obj );
         }
         catch ( Throwable t ) {
             LOG.debug( "Error generating JSON", t );


[45/52] [abbrv] git commit: Change to allow Launcher to compile with AppleJavaExtensions v1.4

Posted by gr...@apache.org.
Change to allow Launcher to compile with AppleJavaExtensions v1.4


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: ac68da74f1146698a2099b0e68b13bf64913dc0d
Parents: e433064
Author: Dave Johnson <sn...@apache.org>
Authored: Wed Sep 3 08:49:28 2014 -0400
Committer: Dave Johnson <sn...@apache.org>
Committed: Wed Sep 3 08:49:28 2014 -0400

----------------------------------------------------------------------
 .../apache/usergrid/launcher/AppleUtils.java    | 21 +++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ac68da74/stack/launcher/src/main/java/org/apache/usergrid/launcher/AppleUtils.java
----------------------------------------------------------------------
diff --git a/stack/launcher/src/main/java/org/apache/usergrid/launcher/AppleUtils.java b/stack/launcher/src/main/java/org/apache/usergrid/launcher/AppleUtils.java
index bea8104..a09b720 100644
--- a/stack/launcher/src/main/java/org/apache/usergrid/launcher/AppleUtils.java
+++ b/stack/launcher/src/main/java/org/apache/usergrid/launcher/AppleUtils.java
@@ -18,7 +18,7 @@ package org.apache.usergrid.launcher;
 
 
 import javax.swing.ImageIcon;
-import javax.swing.JOptionPane;
+//import javax.swing.JOptionPane;
 
 
 public class AppleUtils {
@@ -27,13 +27,16 @@ public class AppleUtils {
         com.apple.eawt.Application macApp = com.apple.eawt.Application.getApplication();
         macApp.setDockIconImage( new ImageIcon( App.class.getResource( "dock_icon.png" ) ).getImage() );
 
-        macApp.setAboutHandler( new com.apple.eawt.AboutHandler() {
-            @Override
-            public void handleAbout( com.apple.eawt.AppEvent.AboutEvent evt ) {
-                JOptionPane.showMessageDialog( null,
-                        "Apache Usergrid Standalone Server Launcher\nApache Software Foundation",
-                        "About Apache Usergrid Launcher", JOptionPane.INFORMATION_MESSAGE );
-            }
-        } );
+        // commented out to allow launcher to compile with the old AppleJavaExcentions 1.4
+        // (because that is the newest version available via Maven)
+
+//        macApp.setAboutHandler( new com.apple.eawt.AboutHandler() {
+//            @Override
+//            public void handleAbout( com.apple.eawt.AppEvent.AboutEvent evt ) {
+//                JOptionPane.showMessageDialog( null,
+//                        "Apache Usergrid Standalone Server Launcher\nApache Software Foundation",
+//                        "About Apache Usergrid Launcher", JOptionPane.INFORMATION_MESSAGE );
+//            }
+//        } );
     }
 }


[29/52] [abbrv] git commit: Fork count of two seems to work for me.

Posted by gr...@apache.org.
Fork count of two seems to work for me.


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: 8c89e3cea5a23ab10c9b4a2d48b9eedaf48d8082
Parents: 9855727
Author: Dave Johnson <dm...@apigee.com>
Authored: Fri Aug 29 17:27:39 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Fri Aug 29 17:27:39 2014 -0400

----------------------------------------------------------------------
 stack/rest/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/8c89e3ce/stack/rest/pom.xml
----------------------------------------------------------------------
diff --git a/stack/rest/pom.xml b/stack/rest/pom.xml
index 0befc50..6fb977d 100644
--- a/stack/rest/pom.xml
+++ b/stack/rest/pom.xml
@@ -32,7 +32,7 @@
     <!-- Override these properties in an active profile within your settings.xml -->
     <properties>
         <!-- If you got the resources, max parallelism = 6 forks -->
-        <rest.it.forkCount>1</rest.it.forkCount>
+        <rest.it.forkCount>2</rest.it.forkCount>
         <rest.it.reuseForks>false</rest.it.reuseForks>
         <rest.it.parallel>suites</rest.it.parallel>
     </properties>


[04/52] [abbrv] Updated OrderedMerge to use a faster implementation at runtime. After initialization, it's an O(1) emit operation as long as our produces are fast enough.

Posted by gr...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/model/src/test/java/org/apache/usergrid/persistence/model/entity/SimpleIdTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/model/src/test/java/org/apache/usergrid/persistence/model/entity/SimpleIdTest.java b/stack/corepersistence/model/src/test/java/org/apache/usergrid/persistence/model/entity/SimpleIdTest.java
new file mode 100644
index 0000000..82a7b9a
--- /dev/null
+++ b/stack/corepersistence/model/src/test/java/org/apache/usergrid/persistence/model/entity/SimpleIdTest.java
@@ -0,0 +1,73 @@
+/*
+ *
+ *  * 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.model.entity;
+
+
+import java.util.UUID;
+
+import org.junit.Test;
+
+import org.apache.usergrid.persistence.model.util.UUIDGenerator;
+
+import static org.junit.Assert.assertTrue;
+
+
+public class SimpleIdTest {
+
+    @Test
+    public void uuidComparison() {
+
+        final UUID firstId = UUIDGenerator.newTimeUUID();
+        final UUID secondId = UUIDGenerator.newTimeUUID();
+
+        final String type = "test";
+
+        SimpleId first = new SimpleId( firstId, type );
+        SimpleId second = new SimpleId( secondId, type );
+
+        assertTrue( first.compareTo( second ) < 0 );
+
+        assertTrue( first.compareTo( first ) == 0 );
+
+        assertTrue( second.compareTo( first ) > 0 );
+    }
+
+
+    @Test
+    public void typeComparison() {
+
+        final UUID uuid = UUIDGenerator.newTimeUUID();
+
+        final String firstType = "test1";
+        final String secondType = "test2";
+
+
+        SimpleId first = new SimpleId( uuid, firstType );
+        SimpleId second = new SimpleId( uuid, secondType );
+
+        assertTrue( first.compareTo( second ) < 0 );
+
+        assertTrue( first.compareTo( first ) == 0 );
+
+        assertTrue( second.compareTo( first ) > 0 );
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/pom.xml
----------------------------------------------------------------------
diff --git a/stack/corepersistence/pom.xml b/stack/corepersistence/pom.xml
index a9223f9..8080b4e 100644
--- a/stack/corepersistence/pom.xml
+++ b/stack/corepersistence/pom.xml
@@ -36,7 +36,7 @@
 
         <antlr.version>3.4</antlr.version>
         <archaius.version>0.5.12</archaius.version>
-        <astyanax.version>1.56.49-SNAPSHOT-UG-1</astyanax.version>
+        <astyanax.version>1.56.49</astyanax.version>
         <cassandra.version>1.2.15</cassandra.version>
 <!--        <chop.version>1.0</chop.version>-->
         <commons.codec.version>1.6</commons.codec.version>


[40/52] [abbrv] git commit: Test fixes for tests that seem to fail intermittently on machines with lots of cores.

Posted by gr...@apache.org.
Test fixes for tests that seem to fail intermittently on machines with lots of cores.


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: 193d0cd4a1d9c3f67339bcbb70fe111965b2f164
Parents: 2b1f735
Author: Dave Johnson <dm...@apigee.com>
Authored: Tue Sep 2 16:01:10 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Tue Sep 2 16:01:10 2014 -0400

----------------------------------------------------------------------
 .../apache/usergrid/rest/applications/utils/UserRepo.java   | 9 +++++++++
 .../java/org/apache/usergrid/management/OrganizationIT.java | 2 ++
 2 files changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/193d0cd4/stack/rest/src/test/java/org/apache/usergrid/rest/applications/utils/UserRepo.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/utils/UserRepo.java b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/utils/UserRepo.java
index 6ca20e5..b214549 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/utils/UserRepo.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/utils/UserRepo.java
@@ -24,6 +24,8 @@ import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.UUID;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 import javax.ws.rs.core.MediaType;
 import static org.apache.usergrid.utils.MapUtils.hashMap;
 import org.apache.usergrid.utils.UUIDUtils;
@@ -42,9 +44,16 @@ public enum UserRepo {
             return;
         }
 
+        // pause between creation to insure entities are created in order
+
         createUser( "user1", "user1@apigee.com", "user1", "Jane Smith 1", resource, accessToken );
+        try { Thread.sleep(200); } catch (InterruptedException ex) { }
+
         createUser( "user2", "user2@apigee.com", "user2", "John Smith 2", resource, accessToken );
+        try { Thread.sleep(200); } catch (InterruptedException ex) { }
+
         createUser( "user3", "user3@apigee.com", "user3", "John Smith 3", resource, accessToken );
+        try { Thread.sleep(200); } catch (InterruptedException ex) { }
     }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/193d0cd4/stack/services/src/test/java/org/apache/usergrid/management/OrganizationIT.java
----------------------------------------------------------------------
diff --git a/stack/services/src/test/java/org/apache/usergrid/management/OrganizationIT.java b/stack/services/src/test/java/org/apache/usergrid/management/OrganizationIT.java
index 509ca22..02db523 100644
--- a/stack/services/src/test/java/org/apache/usergrid/management/OrganizationIT.java
+++ b/stack/services/src/test/java/org/apache/usergrid/management/OrganizationIT.java
@@ -85,6 +85,8 @@ public class OrganizationIT {
 
         setup.getMgmtSvc().activateOrganization( organization2 );
 
+        setup.getEmf().getEntityManager( setup.getSmf().getManagementAppId() ).refreshIndex();
+
         UserInfo u = setup.getMgmtSvc().verifyAdminUserPasswordCredentials( user.getUuid().toString(), "test" );
         assertNotNull( u );
 


[09/52] [abbrv] git commit: Fixes bug with multirow iterator and empty pages

Posted by gr...@apache.org.
Fixes bug with multirow iterator and empty pages


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: bc70fe7e1c6c493b6b1abca8b2e9c1db2c468f50
Parents: e040fdf
Author: Todd Nine <to...@apache.org>
Authored: Wed Aug 27 21:45:20 2014 -0600
Committer: Todd Nine <to...@apache.org>
Committed: Wed Aug 27 21:45:20 2014 -0600

----------------------------------------------------------------------
 .../core/astyanax/MultiRowColumnIterator.java   |   4 +-
 .../astyanax/MultiRowColumnIteratorTest.java    | 133 +++++++++++++++++--
 .../graph/GraphManagerShardConsistencyIT.java   |   2 +-
 .../src/test/resources/usergrid-UNIT.properties |   2 +-
 4 files changed, 129 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bc70fe7e/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/MultiRowColumnIterator.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/MultiRowColumnIterator.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/MultiRowColumnIterator.java
index 155ce84..0a7cca5 100644
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/MultiRowColumnIterator.java
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/MultiRowColumnIterator.java
@@ -238,7 +238,9 @@ public class MultiRowColumnIterator<R, C, T> implements Iterator<T> {
         //we've parsed everything truncate to the first pageSize, it's all we can ensure is correct without another
         //trip back to cassandra
 
-        startColumn = mergedResults.last();
+        if(!mergedResults.isEmpty()) {
+            startColumn = mergedResults.last();
+        }
 
         moreToFollow = mergedResults.size() == pageSize;
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bc70fe7e/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/astyanax/MultiRowColumnIteratorTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/astyanax/MultiRowColumnIteratorTest.java b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/astyanax/MultiRowColumnIteratorTest.java
index 8a8d0b0..c9eeb07 100644
--- a/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/astyanax/MultiRowColumnIteratorTest.java
+++ b/stack/corepersistence/common/src/test/java/org/apache/usergrid/persistence/core/astyanax/MultiRowColumnIteratorTest.java
@@ -48,11 +48,11 @@ import com.netflix.astyanax.util.RangeBuilder;
 
 import rx.Observable;
 import rx.Observer;
-import rx.Subscription;
 import rx.functions.Action1;
 import rx.functions.Func1;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 
 
 public class MultiRowColumnIteratorTest {
@@ -207,6 +207,121 @@ public class MultiRowColumnIteratorTest {
 
 
     @Test
+    public void multiIteratorPageBoundary() throws InterruptedException {
+
+        final String rowKey1 = UUIDGenerator.newTimeUUID().toString();
+
+        final String rowKey2 = UUIDGenerator.newTimeUUID().toString();
+
+        final String rowKey3 = UUIDGenerator.newTimeUUID().toString();
+
+
+        final long maxValue = 200;
+
+        final CountDownLatch latch = new CountDownLatch( 3 );
+
+
+        //only write with 1 row key to simulate ending on a page break the last iteration
+        writeData( latch, rowKey1, maxValue, 1 );
+        writeData( latch, rowKey2, maxValue, 2 );
+        writeData( latch, rowKey3, maxValue, 10 );
+
+
+        latch.await();
+
+
+        //create 3 iterators
+
+
+        final ColumnParser<Long, Long> longParser = new ColumnParser<Long, Long>() {
+            @Override
+            public Long parseColumn( final Column<Long> column ) {
+                return column.getName();
+            }
+        };
+
+
+        final ColumnSearch<Long> ascendingSearch = new ColumnSearch<Long>() {
+            @Override
+            public void buildRange( final RangeBuilder rangeBuilder, final Long value ) {
+                rangeBuilder.setStart( value );
+            }
+
+
+            @Override
+            public void buildRange( final RangeBuilder rangeBuilder ) {
+
+            }
+        };
+
+
+        final Comparator<Long> ascendingComparator = new Comparator<Long>() {
+
+            @Override
+            public int compare( final Long o1, final Long o2 ) {
+                return Long.compare( o1, o2 );
+            }
+        };
+
+
+        final Collection<String> rowKeys = Arrays.asList( rowKey1, rowKey2, rowKey3 );
+
+        MultiRowColumnIterator<String, Long, Long> ascendingItr =
+                new MultiRowColumnIterator<>( keyspace, COLUMN_FAMILY, ConsistencyLevel.CL_QUORUM, longParser,
+                        ascendingSearch, ascendingComparator, rowKeys, ( int ) maxValue / 2 );
+
+
+        //ensure we have to make several trips, purposefully set to a nonsensical value to ensure we make all the
+        // trips required
+
+
+        for ( long i = 0; i < maxValue; i++ ) {
+            assertEquals( i, ascendingItr.next().longValue() );
+        }
+
+        //now advance one more time. There should be no values
+
+        assertFalse( "Should not throw exception", ascendingItr.hasNext() );
+
+
+        final ColumnSearch<Long> descendingSearch = new ColumnSearch<Long>() {
+            @Override
+            public void buildRange( final RangeBuilder rangeBuilder, final Long value ) {
+                rangeBuilder.setStart( value );
+                buildRange( rangeBuilder );
+            }
+
+
+            @Override
+            public void buildRange( final RangeBuilder rangeBuilder ) {
+                rangeBuilder.setReversed( true );
+            }
+        };
+
+
+        final Comparator<Long> descendingComparator = new Comparator<Long>() {
+
+            @Override
+            public int compare( final Long o1, final Long o2 ) {
+                return ascendingComparator.compare( o1, o2 ) * -1;
+            }
+        };
+
+
+        MultiRowColumnIterator<String, Long, Long> descendingItr =
+                new MultiRowColumnIterator<>( keyspace, COLUMN_FAMILY, ConsistencyLevel.CL_QUORUM, longParser,
+                        descendingSearch, descendingComparator, rowKeys, 712 );
+
+        for ( long i = maxValue - 1; i > -1; i-- ) {
+            assertEquals( i, descendingItr.next().longValue() );
+        }
+        //now advance one more time. There should be no values
+
+        assertFalse( "Should not throw exception", ascendingItr.hasNext() );
+    }
+
+
+    @Test
     public void singleIterator() {
 
         final String rowKey1 = UUIDGenerator.newTimeUUID().toString();
@@ -334,7 +449,7 @@ public class MultiRowColumnIteratorTest {
     }
 
 
-    private void writeData(final CountDownLatch latch, final String rowKey, final long maxValue, final long mod){
+    private void writeData( final CountDownLatch latch, final String rowKey, final long maxValue, final long mod ) {
 
         Observable.just( rowKey ).doOnNext( new Action1<String>() {
             @Override
@@ -349,13 +464,13 @@ public class MultiRowColumnIteratorTest {
                     }
 
                     if ( i % 1000 == 0 ) {
-                                               try {
-                                                   batch.execute();
-                                               }
-                                               catch ( ConnectionException e ) {
-                                                   throw new RuntimeException( e );
-                                               }
-                                           }
+                        try {
+                            batch.execute();
+                        }
+                        catch ( ConnectionException e ) {
+                            throw new RuntimeException( e );
+                        }
+                    }
                 }
 
                 try {

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bc70fe7e/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerShardConsistencyIT.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerShardConsistencyIT.java b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerShardConsistencyIT.java
index c01d157..279e4e1 100644
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerShardConsistencyIT.java
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerShardConsistencyIT.java
@@ -122,7 +122,7 @@ public class GraphManagerShardConsistencyIT {
         ConfigurationManager.getConfigInstance().setProperty( GraphFig.SHARD_SIZE, 1000 );
 
 
-        final long cacheTimeout = 5000;
+        final long cacheTimeout = 2000;
         //set our cache timeout to the above value
         ConfigurationManager.getConfigInstance().setProperty( GraphFig.SHARD_CACHE_TIMEOUT, cacheTimeout );
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bc70fe7e/stack/corepersistence/graph/src/test/resources/usergrid-UNIT.properties
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/resources/usergrid-UNIT.properties b/stack/corepersistence/graph/src/test/resources/usergrid-UNIT.properties
index 1cb970f..b4761fd 100644
--- a/stack/corepersistence/graph/src/test/resources/usergrid-UNIT.properties
+++ b/stack/corepersistence/graph/src/test/resources/usergrid-UNIT.properties
@@ -6,7 +6,7 @@ cassandra.hosts=localhost
 cassandra.cluster_name=Usergrid
 collections.keyspace=Usergrid_Collections
 cassandra.timeout=5000
-#cassandra.embedded=true
+cassandra.embedded=true
 
 
 collections.keyspace.strategy.options=replication_factor:1


[28/52] [abbrv] git commit: Portal - updated grunt to remove old task types

Posted by gr...@apache.org.
Portal - updated grunt to remove old task types


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: b6100f3ef5cadf5e3ceddd85139a3e00255431d5
Parents: 6130345
Author: Rod Simpson <ro...@apigee.com>
Authored: Fri Aug 29 12:38:57 2014 -0600
Committer: Rod Simpson <ro...@apigee.com>
Committed: Fri Aug 29 12:38:57 2014 -0600

----------------------------------------------------------------------
 .gitignore          | 2 ++
 portal/Gruntfile.js | 4 ----
 2 files changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b6100f3e/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 4203d92..df2938f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -54,3 +54,5 @@ portal/js/templates.js
 /portal/js/generated/
 
 /portal/js/generated-templates/
+
+/portal/seleniumLog.txt

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b6100f3e/portal/Gruntfile.js
----------------------------------------------------------------------
diff --git a/portal/Gruntfile.js b/portal/Gruntfile.js
index 5fa1a68..6d8af6c 100644
--- a/portal/Gruntfile.js
+++ b/portal/Gruntfile.js
@@ -382,10 +382,6 @@ module.exports = function (grunt) {
   grunt.registerTask('e2e-coverage', ['clean:coverage', 'connect:e2e-coverage','protractor:coverage']);
   grunt.registerTask('e2e-coverage-chrome', ['clean:coverage', 'connect:e2e-coverage-chrome','protractor:chrome', 'makeReport']);
   grunt.registerTask('e2e-firefox', ['connect:e2e-firefox','protractor:firefox']);
-  grunt.registerTask('e2e-prod', ['protractor:prod']);
-  grunt.registerTask('e2e-mars', ['protractor:mars']);
-
-
   grunt.registerTask('no-monitoring', ['build','clean:perf','karma:unit']);
 
 };


[35/52] [abbrv] git commit: configurable surefire arglines

Posted by gr...@apache.org.
configurable surefire arglines

Added additional configurable surefire argline parameters with a default for headless build to avoid constant pop-ups of the surefire ForkedBooter


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: aaedb9af952ab4051088abe13b9e5dd07c1b6aa9
Parents: 62de58f
Author: Ed Anuff <ed...@anuff.com>
Authored: Fri Aug 29 22:48:01 2014 -0700
Committer: Ed Anuff <ed...@anuff.com>
Committed: Fri Aug 29 22:48:01 2014 -0700

----------------------------------------------------------------------
 stack/core/pom.xml            |  6 +++---
 stack/mongo-emulator/pom.xml  |  2 +-
 stack/pom.xml                 |  7 ++++---
 stack/query-validator/pom.xml |  2 +-
 stack/rest/pom.xml            | 12 ++++++------
 stack/services/pom.xml        | 10 +++++-----
 stack/test-utils/pom.xml      |  2 +-
 stack/tools/pom.xml           |  2 +-
 stack/websocket/pom.xml       |  2 +-
 9 files changed, 23 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/aaedb9af/stack/core/pom.xml
----------------------------------------------------------------------
diff --git a/stack/core/pom.xml b/stack/core/pom.xml
index 8936326..df764c7 100644
--- a/stack/core/pom.xml
+++ b/stack/core/pom.xml
@@ -68,7 +68,7 @@
               <forkCount>${core.it.forkCount}</forkCount>
               <reuseForks>false</reuseForks>
 
-              <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar
+              <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline}
               </argLine>
 
               <includes>
@@ -152,7 +152,7 @@
               <forkCount>${core.it.forkCount}</forkCount>
               <reuseForks>false</reuseForks>
 
-              <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar
+              <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline}
               </argLine>
 
               <includes>
@@ -254,7 +254,7 @@
             <target.directory>${project.build.directory}</target.directory>
           </systemPropertyVariables>
           <forkMode>once</forkMode>
-          <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar</argLine>
+          <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline}</argLine>
 
           <includes>
             <include>**/*ConcurrentCoreITSuite.java</include>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/aaedb9af/stack/mongo-emulator/pom.xml
----------------------------------------------------------------------
diff --git a/stack/mongo-emulator/pom.xml b/stack/mongo-emulator/pom.xml
index f1ac2cf..a787d89 100644
--- a/stack/mongo-emulator/pom.xml
+++ b/stack/mongo-emulator/pom.xml
@@ -70,7 +70,7 @@
             <storage-config>${basedir}/src/test/conf</storage-config>
           </systemPropertyVariables>
           <forkMode>always</forkMode>
-          <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar</argLine>
+          <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline}</argLine>
         </configuration>
       </plugin>
     </plugins>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/aaedb9af/stack/pom.xml
----------------------------------------------------------------------
diff --git a/stack/pom.xml b/stack/pom.xml
index c7cf26d..878f82c 100644
--- a/stack/pom.xml
+++ b/stack/pom.xml
@@ -85,8 +85,9 @@
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 
     <!-- you can override these via MAVEN_OPTS -->
-    <ug.heapmax>1024m</ug.heapmax>
-    <ug.heapmin>1024m</ug.heapmin>
+    <ug.heapmax>2048m</ug.heapmax>
+    <ug.heapmin>2048m</ug.heapmin>
+	<ug.argline>-Djava.awt.headless=true</ug.argline>
 
     <usergrid-custom-spring-properties>classpath:/usergrid-custom.properties</usergrid-custom-spring-properties>
     <usergrid-custom-spring-test-properties>classpath:/usergrid-custom-test.properties</usergrid-custom-spring-test-properties>
@@ -1608,7 +1609,7 @@
           <artifactId>maven-surefire-plugin</artifactId>
           <version>2.15</version>
           <configuration>
-            <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar</argLine>
+            <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline}</argLine>
           </configuration>
         </plugin>
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/aaedb9af/stack/query-validator/pom.xml
----------------------------------------------------------------------
diff --git a/stack/query-validator/pom.xml b/stack/query-validator/pom.xml
index f0173d0..ca43177 100644
--- a/stack/query-validator/pom.xml
+++ b/stack/query-validator/pom.xml
@@ -56,7 +56,7 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
-                    <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8</argLine>
+                    <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 ${ug.argline}</argLine>
 
                     <includes>
                         <include>**/*Suite.java</include>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/aaedb9af/stack/rest/pom.xml
----------------------------------------------------------------------
diff --git a/stack/rest/pom.xml b/stack/rest/pom.xml
index e5d8d3e..cadf14b 100644
--- a/stack/rest/pom.xml
+++ b/stack/rest/pom.xml
@@ -57,7 +57,7 @@
               </systemPropertyVariables>
               <forkMode>once</forkMode>
               <!-- TODO: make this into a small configuration but based on settings.xml -->
-              <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar</argLine>
+              <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline}</argLine>
 
               <includes>
                 <include>**/RestTestSuite.java</include>
@@ -96,7 +96,7 @@
               <forkCount>${rest.it.forkCount}</forkCount>
               <reuseForks>false</reuseForks>
               <perCoreThreadCount>false</perCoreThreadCount>
-              <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar
+              <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline}
               </argLine>
 
               <includes>
@@ -154,7 +154,7 @@
               <forkCount>${rest.it.forkCount}</forkCount>
               <reuseForks>false</reuseForks>
               <perCoreThreadCount>false</perCoreThreadCount>
-              <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar
+              <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline}
               </argLine>
 
               <includes>
@@ -192,7 +192,7 @@
                 <target.directory>${project.build.directory}</target.directory>
               </systemPropertyVariables>
               <forkMode>once</forkMode>
-              <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar</argLine>
+              <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline}</argLine>
 
               <includes>
                 <include>**/ConcurrentRestTestSuite.java</include>
@@ -229,7 +229,7 @@
                 <target.directory>${project.build.directory}</target.directory>
               </systemPropertyVariables>
               <forkMode>once</forkMode>
-              <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar</argLine>
+              <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline}</argLine>
 
               <includes>
                 <include>**/ConcurrentRestITSuite.java</include>
@@ -278,7 +278,7 @@
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
-          <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar</argLine>
+          <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline}</argLine>
         </configuration>
       </plugin>
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/aaedb9af/stack/services/pom.xml
----------------------------------------------------------------------
diff --git a/stack/services/pom.xml b/stack/services/pom.xml
index d0a9e5a..1a387f4 100644
--- a/stack/services/pom.xml
+++ b/stack/services/pom.xml
@@ -66,7 +66,7 @@
               </systemPropertyVariables>
               <forkMode>once</forkMode>
               <!-- TODO: make this into a small configuration but based on settings.xml -->
-              <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar</argLine>
+              <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline}</argLine>
 
               <includes>
                 <include>**/ServiceTestSuite.java</include>
@@ -105,7 +105,7 @@
               <forkCount>${services.it.forkCount}</forkCount>
               <reuseForks>false</reuseForks>
 
-              <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8</argLine>
+              <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 ${ug.argline}</argLine>
               <argLine>
                 <!-- -javaagent:${settings.localRepository}/org/powermock/powermock-module-javaagent/1.5.1/powermock-module-javaagent-1.5.1.jar -->
                 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar
@@ -165,7 +165,7 @@
                 <target.directory>${project.build.directory}</target.directory>
               </systemPropertyVariables>
               <forkMode>once</forkMode>
-              <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8</argLine>
+              <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 ${ug.argline}</argLine>
               <argLine>
                <!--  -javaagent:${settings.localRepository}/org/powermock/powermock-module-javaagent/1.5.1/powermock-module-javaagent-1.5.1.jar-->
 			   -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar
@@ -207,7 +207,7 @@
                 <target.directory>${project.build.directory}</target.directory>
               </systemPropertyVariables>
               <forkMode>once</forkMode>
-              <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8</argLine>
+              <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 ${ug.argline}</argLine>
               <argLine>
                 <!-- -javaagent:${settings.localRepository}/org/powermock/powermock-module-javaagent/1.5.1/powermock-module-javaagent-1.5.1.jar -->
 				-javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar
@@ -273,7 +273,7 @@
           <forkCount>${services.it.forkCount}</forkCount>
           <reuseForks>false</reuseForks>
 
-          <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8</argLine>
+          <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 ${ug.argline}</argLine>
           <argLine>
             <!-- -javaagent:${settings.localRepository}/org/powermock/powermock-module-javaagent/1.5.1/powermock-module-javaagent-1.5.1.jar-->
 			-javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/aaedb9af/stack/test-utils/pom.xml
----------------------------------------------------------------------
diff --git a/stack/test-utils/pom.xml b/stack/test-utils/pom.xml
index 92a2226..961ac2f 100644
--- a/stack/test-utils/pom.xml
+++ b/stack/test-utils/pom.xml
@@ -52,7 +52,7 @@
             <storage-config>${basedir}/src/test/conf</storage-config>
             <target-directory>${project.build.directory}</target-directory>
           </systemPropertyVariables>
-          <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar</argLine>
+          <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline}</argLine>
 
           <includes>
             <include>**/CassandraResourceITSuite.java</include>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/aaedb9af/stack/tools/pom.xml
----------------------------------------------------------------------
diff --git a/stack/tools/pom.xml b/stack/tools/pom.xml
index c15582a..71e12bf 100644
--- a/stack/tools/pom.xml
+++ b/stack/tools/pom.xml
@@ -68,7 +68,7 @@
             <storage-config>${basedir}/src/test/conf</storage-config>
           </systemPropertyVariables>
           <forkMode>always</forkMode>
-          <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar</argLine>
+          <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline}</argLine>
         </configuration>
       </plugin>
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/aaedb9af/stack/websocket/pom.xml
----------------------------------------------------------------------
diff --git a/stack/websocket/pom.xml b/stack/websocket/pom.xml
index 71280a9..6e46819 100644
--- a/stack/websocket/pom.xml
+++ b/stack/websocket/pom.xml
@@ -70,7 +70,7 @@
             <storage-config>${basedir}/src/test/conf</storage-config>
           </systemPropertyVariables>
           <forkMode>always</forkMode>
-          <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar</argLine>
+          <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline}</argLine>
         </configuration>
       </plugin>
     </plugins>


[21/52] [abbrv] git commit: Fix JSON mapper to use same setup as we do in Collections module serializer.

Posted by gr...@apache.org.
Fix JSON mapper to use same setup as we do in Collections module serializer.


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: c6de8494daf3ea7207b5ef8d6572acaa68026bd3
Parents: 9ddb537
Author: Dave Johnson <dm...@apigee.com>
Authored: Fri Aug 29 09:32:27 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Fri Aug 29 09:32:27 2014 -0400

----------------------------------------------------------------------
 .../core/src/main/java/org/apache/usergrid/utils/JsonUtils.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c6de8494/stack/core/src/main/java/org/apache/usergrid/utils/JsonUtils.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/utils/JsonUtils.java b/stack/core/src/main/java/org/apache/usergrid/utils/JsonUtils.java
index 4f71c83..f81d6bf 100644
--- a/stack/core/src/main/java/org/apache/usergrid/utils/JsonUtils.java
+++ b/stack/core/src/main/java/org/apache/usergrid/utils/JsonUtils.java
@@ -63,8 +63,8 @@ public class JsonUtils {
 
 
     static {
-        //indentObjectMapper.getSerializationConfig().set( Feature.INDENT_OUTPUT, true );
-        indentObjectMapper.getSerializationConfig().with( SerializationFeature.INDENT_OUTPUT );
+        mapper.enable(SerializationFeature.INDENT_OUTPUT);
+        mapper.enableDefaultTypingAsProperty(ObjectMapper.DefaultTyping.JAVA_LANG_OBJECT, "@class");
     }
 
 


[41/52] [abbrv] git commit: refreshIndex() fixes counting mutator test.

Posted by gr...@apache.org.
refreshIndex() fixes counting mutator test.


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: 350489c77f2b326464e3083944902f58300021f8
Parents: 193d0cd
Author: Dave Johnson <dm...@apigee.com>
Authored: Tue Sep 2 16:30:54 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Tue Sep 2 16:30:54 2014 -0400

----------------------------------------------------------------------
 .../java/org/apache/usergrid/persistence/CountingMutatorIT.java   | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/350489c7/stack/core/src/test/java/org/apache/usergrid/persistence/CountingMutatorIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/CountingMutatorIT.java b/stack/core/src/test/java/org/apache/usergrid/persistence/CountingMutatorIT.java
index cb1371b..83a00f3 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/CountingMutatorIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/CountingMutatorIT.java
@@ -75,11 +75,10 @@ public class CountingMutatorIT extends AbstractCoreIT {
         properties.put( "username", "testuser" );
         properties.put( "email", "test@foo.bar" );
         Entity created = em.create( "user", properties );
+        em.refreshIndex();
 
         Entity returned = em.get( created.getUuid() );
 
-
-
         int writeSize = ( int ) ( CountingMutator.MAX_SIZE*2.5);
 
         for(int i = 0; i < writeSize; i ++){


[10/52] [abbrv] git commit: Fixes for new tests brought in for master.

Posted by gr...@apache.org.
Fixes for new tests brought in for master.


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: 9c47aee00a52b917ab03043cfb0f70a10f86f3f6
Parents: 4e428e3
Author: Dave Johnson <dm...@apigee.com>
Authored: Thu Aug 28 11:06:34 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Thu Aug 28 11:06:34 2014 -0400

----------------------------------------------------------------------
 .../usergrid/batch/job/SchedulerRuntime3IT.java     |  4 +++-
 .../usergrid/batch/job/SchedulerRuntime6IT.java     |  9 +++++++--
 .../usergrid/batch/job/SchedulerRuntime7IT.java     |  5 ++++-
 .../apache/usergrid/persistence/CollectionIT.java   |  2 ++
 .../usergrid/persistence/CountingMutatorIT.java     |  8 +++-----
 .../usergrid/persistence/GeoQueryBooleanTest.java   | 16 +---------------
 .../applications/users/PermissionsResourceIT.java   |  1 +
 7 files changed, 21 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9c47aee0/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime3IT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime3IT.java b/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime3IT.java
index 1346e3b..d9a48c6 100644
--- a/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime3IT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime3IT.java
@@ -55,6 +55,8 @@ public class SchedulerRuntime3IT extends AbstractSchedulerRuntimeIT {
         JobData returned = scheduler.createJob( 
                 "failureJobExceuction", System.currentTimeMillis(), new JobData() );
 
+        scheduler.refreshIndex();
+
         final long waitTime = ( failCount + 2 ) * sleepTime + 5000L ;
 
         boolean jobInvoked = job.waitForCount( waitTime, TimeUnit.MILLISECONDS);
@@ -65,6 +67,7 @@ public class SchedulerRuntime3IT extends AbstractSchedulerRuntimeIT {
 
         assertTrue( "dead job signaled", deadInvoked );
 
+        scheduler.refreshIndex();
 
         // sleep until the job should have failed. We sleep 1 extra cycle just to
         // make sure we're not racing the test
@@ -75,7 +78,6 @@ public class SchedulerRuntime3IT extends AbstractSchedulerRuntimeIT {
         assertTrue( failCount + " failures resulted", getJobListener().getFailureCount() == failCount );
         assertTrue( 1 + " success resulted", getJobListener().getSuccessCount() == 1 );
 
-
         JobStat stat = scheduler.getStatsForJob( returned.getJobName(), returned.getUuid() );
 
         // we should have only marked this as run fail+1 times

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9c47aee0/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime6IT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime6IT.java b/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime6IT.java
index 7628f91..4c74f20 100644
--- a/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime6IT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime6IT.java
@@ -55,8 +55,10 @@ public class SchedulerRuntime6IT extends AbstractSchedulerRuntimeIT {
         job.setLatch( numberOfRuns );
         job.setDelay( sleepTime );
 
-        JobData returned = scheduler.createJob( 
-                "onlyOnceExceution", System.currentTimeMillis(), new JobData() );
+
+        getJobListener().setExpected(1);
+
+        JobData returned = scheduler.createJob( "onlyOnceExceution", System.currentTimeMillis(), new JobData() );
 
         scheduler.refreshIndex();
 
@@ -87,12 +89,15 @@ public class SchedulerRuntime6IT extends AbstractSchedulerRuntimeIT {
 
         assertTrue( "Job slept", slept );
 
+        scheduler.refreshIndex();
 
         //now wait again to see if the job fires one more time, it shouldn't
         waited = getJobListener().blockTilDone( customRetry * numberOfRuns * 2 );
 
         assertFalse( "Job ran twice", waited );
 
+        scheduler.refreshIndex();
+
         stat = scheduler.getStatsForJob( returned.getJobName(), returned.getUuid() );
 
         // we should have only marked this as run once since we delayed further execution

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9c47aee0/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime7IT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime7IT.java b/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime7IT.java
index befe5bf..c133f1a 100644
--- a/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime7IT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime7IT.java
@@ -24,7 +24,6 @@ import org.apache.usergrid.persistence.entities.JobStat;
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
 
@@ -58,10 +57,14 @@ public class SchedulerRuntime7IT extends AbstractSchedulerRuntimeIT {
         JobData returned =
                 scheduler.createJob( "onlyOnceUnlockOnFailExceution", System.currentTimeMillis(), new JobData() );
 
+        scheduler.refreshIndex();
+
         // sleep until the job should have failed. We sleep 1 extra cycle just to make sure we're not racing the test
 
         boolean waited = getJobListener().blockTilDone( runLoop * numberOfRuns * 2 + 5000L );
 
+        scheduler.refreshIndex();
+
         assertTrue( "Both runs executed" , waited);
         assertTrue( "Job failed", getJobListener().getFailureCount() == 1 );
         assertTrue( "No Job succeeded", getJobListener().getSuccessCount() == 1 );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9c47aee0/stack/core/src/test/java/org/apache/usergrid/persistence/CollectionIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/CollectionIT.java b/stack/core/src/test/java/org/apache/usergrid/persistence/CollectionIT.java
index d39c794..8ff14de 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/CollectionIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/CollectionIT.java
@@ -864,6 +864,8 @@ public class CollectionIT extends AbstractCoreIT {
         Entity entity2 = em.create( "game", properties );
         assertNotNull( entity2 );
 
+        em.refreshIndex();
+
 
         // simple not
         Query query = Query.fromQL( "select * where NOT subObjectArray.subField = 'Foo'" ).withLimit( 1 );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9c47aee0/stack/core/src/test/java/org/apache/usergrid/persistence/CountingMutatorIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/CountingMutatorIT.java b/stack/core/src/test/java/org/apache/usergrid/persistence/CountingMutatorIT.java
index ddf2dc9..cb1371b 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/CountingMutatorIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/CountingMutatorIT.java
@@ -91,12 +91,10 @@ public class CountingMutatorIT extends AbstractCoreIT {
 
 
             Entity connectedEntity = em.create( "user", connectedProps );
+            em.refreshIndex();
 
-            /*Connect from our new entity to our root one so it's updated when paging
-            /
-             */
-
-                 em.createConnection( connectedEntity, "following", returned );
+            // Connect from our new entity to our root one so it's updated when paging
+            em.createConnection( connectedEntity, "following", returned );
         }
 
         //now verify our connections were created properly

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9c47aee0/stack/core/src/test/java/org/apache/usergrid/persistence/GeoQueryBooleanTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/GeoQueryBooleanTest.java b/stack/core/src/test/java/org/apache/usergrid/persistence/GeoQueryBooleanTest.java
index 8767a70..738a1c6 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/GeoQueryBooleanTest.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/GeoQueryBooleanTest.java
@@ -17,12 +17,8 @@
 package org.apache.usergrid.persistence;
 
 
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.inject.Injector;
 import java.util.ArrayList;
 import java.util.LinkedHashMap;
-import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 
@@ -32,21 +28,11 @@ import org.slf4j.LoggerFactory;
 
 import org.apache.usergrid.AbstractCoreIT;
 import org.apache.usergrid.cassandra.Concurrent;
-import org.apache.usergrid.corepersistence.CpEntityMapUtils;
-import org.apache.usergrid.corepersistence.CpSetup;
-import org.apache.usergrid.persistence.collection.CollectionScope;
-import org.apache.usergrid.persistence.collection.EntityCollectionManager;
-import org.apache.usergrid.persistence.collection.EntityCollectionManagerFactory;
-import org.apache.usergrid.persistence.collection.impl.CollectionScopeImpl;
 import org.apache.usergrid.persistence.geo.model.Point;
 import org.apache.usergrid.persistence.index.query.Query;
-import org.apache.usergrid.persistence.model.entity.SimpleId;
-import org.apache.usergrid.persistence.model.field.ListField;
-import org.apache.usergrid.persistence.model.field.value.EntityObject;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
 
 
 @Concurrent()
@@ -129,7 +115,7 @@ public class GeoQueryBooleanTest extends AbstractCoreIT {
 
         log.info( "GeoQueryBooleanTest.testGeoQueryWithOr" );
 
-        UUID applicationId = setup.createApplication( "testOrganization", "testGeoQueryWithOr" );
+        UUID applicationId = setup.createApplication( "testOrganization", "testGeoQueryWithNot" );
         assertNotNull( applicationId );
 
         EntityManager em = setup.getEmf().getEntityManager( applicationId );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9c47aee0/stack/rest/src/test/java/org/apache/usergrid/rest/applications/users/PermissionsResourceIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/users/PermissionsResourceIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/users/PermissionsResourceIT.java
index 3d5034a..6855549 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/users/PermissionsResourceIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/users/PermissionsResourceIT.java
@@ -265,6 +265,7 @@ public class PermissionsResourceIT extends AbstractRestIT {
                 .type( MediaType.APPLICATION_JSON_TYPE ).delete( String.class ));
 
         assertNull( getError( node ) );
+        refreshIndex(orgname, applicationName);
 
         // grant the perms to reviewer
         addPermission( orgname, applicationName, adminToken, "reviewer", "get,put,post:/reviews/**" );


[15/52] [abbrv] git commit: add uuid long method

Posted by gr...@apache.org.
add uuid long method


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: efdc08d7c177fcf4613a9135ee7d35ed8a2dfcfc
Parents: 78ce124
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Aug 28 10:23:14 2014 -0600
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Aug 28 10:23:14 2014 -0600

----------------------------------------------------------------------
 .../core/src/main/java/org/apache/usergrid/mq/Message.java  | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/efdc08d7/stack/core/src/main/java/org/apache/usergrid/mq/Message.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/mq/Message.java b/stack/core/src/main/java/org/apache/usergrid/mq/Message.java
index b48fe74..73c8f7d 100644
--- a/stack/core/src/main/java/org/apache/usergrid/mq/Message.java
+++ b/stack/core/src/main/java/org/apache/usergrid/mq/Message.java
@@ -485,13 +485,8 @@ public class Message {
 
 
     public void setUuid( UUID uuid ) {
-        //if ( isTimeBased( uuid ) ) {
-            properties.put( MESSAGE_ID, uuid );
-            properties.put( MESSAGE_TIMESTAMP, MurmurHash.hash64(uuid));
-//        }
-//        else {
-//            throw new IllegalArgumentException( "Not a time-based UUID" );
-//        }
+        properties.put(MESSAGE_ID, uuid);
+        properties.put(MESSAGE_TIMESTAMP, UUIDUtils.getUUIDLong(uuid));
     }
 
 


[30/52] [abbrv] git commit: Don't build the launcher until we have a fix for the Apple ext jar issue.

Posted by gr...@apache.org.
Don't build the launcher until we have a fix for the Apple ext jar issue.


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: e129513400db991654c04f1a081ff158b4d8fb1d
Parents: 8c89e3c
Author: Dave Johnson <dm...@apigee.com>
Authored: Fri Aug 29 17:28:01 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Fri Aug 29 17:28:01 2014 -0400

----------------------------------------------------------------------
 stack/pom.xml | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e1295134/stack/pom.xml
----------------------------------------------------------------------
diff --git a/stack/pom.xml b/stack/pom.xml
index 1656d24..67ce19c 100644
--- a/stack/pom.xml
+++ b/stack/pom.xml
@@ -200,7 +200,11 @@
     <module>rest</module>
     <module>tools</module>
     <module>websocket</module>
+    <!--
+    Re-enable when we have a fix for the AppleJavaExtensions jar issue
+    https://issues.apache.org/jira/browse/USERGRID-224
     <module>launcher</module>
+    -->
     <module>mongo-emulator</module>
     <!--  
     Re-enable when query-validator updated to work with Core Persistence.


[24/52] [abbrv] git commit: Merge remote-tracking branch 'apache/two-dot-o' into USERGRID-188

Posted by gr...@apache.org.
Merge remote-tracking branch 'apache/two-dot-o' into USERGRID-188

Conflicts:
	stack/corepersistence/pom.xml


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: 70b6739372c3dfb9663a3a3dbf966e01461aca91
Parents: b0c2598 b09b154
Author: Todd Nine <to...@apache.org>
Authored: Fri Aug 29 10:09:20 2014 -0600
Committer: Todd Nine <to...@apache.org>
Committed: Fri Aug 29 10:09:20 2014 -0600

----------------------------------------------------------------------
 stack/core/pom.xml                              |   51 +-
 .../corepersistence/CpEntityManager.java        |   54 +-
 .../corepersistence/CpEntityMapUtils.java       |    2 +-
 .../corepersistence/CpRelationManager.java      |   36 +-
 .../java/org/apache/usergrid/mq/Message.java    |   10 +-
 .../apache/usergrid/persistence/EntityRef.java  |    3 +
 .../apache/usergrid/persistence/PathQuery.java  |    8 +-
 .../usergrid/persistence/SimpleEntityRef.java   |   36 +-
 .../org/apache/usergrid/utils/JsonUtils.java    |    8 +-
 .../org/apache/usergrid/utils/UUIDUtils.java    |   11 +
 .../usergrid/batch/job/SchedulerRuntime2IT.java |   54 +-
 .../usergrid/batch/job/SchedulerRuntime3IT.java |    6 +-
 .../usergrid/batch/job/SchedulerRuntime6IT.java |    9 +-
 .../usergrid/batch/job/SchedulerRuntime7IT.java |    5 +-
 .../corepersistence/CpEntityMapUtilsTest.java   |  119 +
 .../usergrid/persistence/CollectionIT.java      |   19 +-
 .../usergrid/persistence/CountingMutatorIT.java |    8 +-
 .../org/apache/usergrid/persistence/GeoIT.java  |   95 +-
 .../persistence/GeoQueryBooleanTest.java        |  166 +
 .../usergrid/persistence/PathQueryIT.java       |    4 +-
 .../exception/CollectionRuntimeException.java   |    1 -
 .../MvccEntitySerializationStrategyImpl.java    |   25 +-
 ...MvccEntitySerializationStrategyImplTest.java |   13 +-
 .../persistence/core/util/ValidationUtils.java  |    2 +-
 .../persistence/model/entity/Entity.java        |    2 +-
 .../persistence/model/field/ArrayField.java     |    4 +
 .../persistence/model/field/SetField.java       |    1 +
 .../model/field/value/EntityObject.java         |   12 +-
 stack/corepersistence/pom.xml                   |    4 +-
 .../usergrid/persistence/index/query/Query.java |    4 +-
 .../index/query/tree/CpQueryFilterLexer.java    | 3123 ------------------
 .../index/query/tree/CpQueryFilterParser.java   | 2501 --------------
 .../persistence/index/impl/EntityIndexTest.java |   19 +
 .../src/test/resources/log4j.properties         |    6 +-
 stack/pom.xml                                   |    6 +-
 .../test/resources/usergrid-test-context.xml    |    3 +-
 .../users/PermissionsResourceIT.java            |    1 +
 37 files changed, 589 insertions(+), 5842 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/70b67393/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/70b67393/stack/corepersistence/pom.xml
----------------------------------------------------------------------
diff --cc stack/corepersistence/pom.xml
index da3f5d7,7dad18c..e2b87b9
--- a/stack/corepersistence/pom.xml
+++ b/stack/corepersistence/pom.xml
@@@ -94,7 -94,7 +94,7 @@@
                      <systemPropertyVariables>
                          <archaius.deployment.environment>UNIT</archaius.deployment.environment>
                      </systemPropertyVariables>
-                     <argLine>-Xms4G -Xmx4G</argLine>
 -                    <argLine>-Xms2G -Xmx4G -Dlog4j.debug=true -Dlog4j.configuration=file://${project.basedir}/src/test/resources/log4j.properties</argLine>
++                    <argLine>-Xms2G -Xmx4G</argLine>
                  </configuration>
              </plugin>
  


[07/52] [abbrv] Updated OrderedMerge to use a faster implementation at runtime. After initialization, it's an O(1) emit operation as long as our produces are fast enough.

Posted by gr...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/GraphFig.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/GraphFig.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/GraphFig.java
index d434db7..0a6ecfa 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/GraphFig.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/GraphFig.java
@@ -35,8 +35,15 @@ public interface GraphFig extends GuicyFig {
 
     public static final String REPAIR_CONCURRENT_SIZE = "usergrid.graph.repair.concurrent.size";
 
+    /**
+     * The size of the shards.  This is approximate, and should be set lower than what you would like your max to be
+     */
     public static final String SHARD_SIZE = "usergrid.graph.shard.size";
 
+
+    /**
+     * Number of shards we can cache.
+     */
     public static final String SHARD_CACHE_SIZE = "usergrid.graph.shard.cache.size";
 
 
@@ -45,17 +52,33 @@ public interface GraphFig extends GuicyFig {
      */
     public static final String SHARD_CACHE_TIMEOUT = "usergrid.graph.shard.cache.timeout";
 
+    /**
+     * Number of worker threads to refresh the cache
+     */
     public static final String SHARD_CACHE_REFRESH_WORKERS = "usergrid.graph.shard.refresh.worker.count";
 
-    public static final String SHARD_REPAIR_CHANCE = "usergrid.graph.shard.repair.chance";
 
+    /**
+     * The size of the worker count for shard auditing
+     */
+    public static final String SHARD_AUDIT_QUEUE_SIZE = "usergrid.graph.shard.audit.worker.queue.size";
 
 
     /**
-     * The minimum amount of time than can occur (in millis) between shard allocation.  Must be at least 2x the cache timeout.
+     * The size of the worker count for shard auditing
+     */
+    public static final String SHARD_AUDIT_WORKERS = "usergrid.graph.shard.audit.worker.count";
+
+
+    public static final String SHARD_REPAIR_CHANCE = "usergrid.graph.shard.repair.chance";
+
+
+    /**
+     * The minimum amount of time than can occur (in millis) between shard allocation and compaction.  Must be at least 2x the cache
+     * timeout. Set to 2.5x the cache timeout to be safe
      *
-     * Note that you should also pad this for node clock drift.  A good value for this would be 2x the shard cache timeout + 30 seconds,
-     * assuming you have NTP and allow a max drift of 30 seconds
+     * Note that you should also pad this for node clock drift.  A good value for this would be 2x the shard cache
+     * timeout + 30 seconds, assuming you have NTP and allow a max drift of 30 seconds
      */
     public static final String SHARD_MIN_DELTA = "usergrid.graph.shard.min.delta";
 
@@ -67,26 +90,23 @@ public interface GraphFig extends GuicyFig {
     public static final String COUNTER_WRITE_FLUSH_QUEUE_SIZE = "usergrid.graph.shard.counter.queue.size";
 
 
-
-
     @Default("1000")
     @Key(SCAN_PAGE_SIZE)
     int getScanPageSize();
 
 
-
     @Default("5")
     @Key(REPAIR_CONCURRENT_SIZE)
     int getRepairConcurrentSize();
 
 
     @Default( ".10" )
-    @Key( SHARD_REPAIR_CHANCE  )
+    @Key( SHARD_REPAIR_CHANCE )
     double getShardRepairChance();
 
 
-    @Default("500000")
-    @Key(SHARD_SIZE)
+    @Default( "500000" )
+    @Key( SHARD_SIZE )
     long getShardSize();
 
 
@@ -95,31 +115,40 @@ public interface GraphFig extends GuicyFig {
     long getShardCacheTimeout();
 
     @Default("60000")
-    @Key( SHARD_MIN_DELTA )
+    @Key(SHARD_MIN_DELTA)
     long getShardMinDelta();
 
 
-    @Default( "250000" )
-    @Key( SHARD_CACHE_SIZE )
+    @Default("250000")
+    @Key(SHARD_CACHE_SIZE)
     long getShardCacheSize();
 
 
-    @Default( "2" )
-    @Key( SHARD_CACHE_REFRESH_WORKERS )
+    @Default("2")
+    @Key(SHARD_CACHE_REFRESH_WORKERS)
     int getShardCacheRefreshWorkerCount();
 
 
-    @Default( "10000" )
-    @Key( COUNTER_WRITE_FLUSH_COUNT )
+    @Default( "10" )
+    @Key( SHARD_AUDIT_WORKERS )
+    int getShardAuditWorkerCount();
+
+    @Default( "1000" )
+    @Key( SHARD_AUDIT_QUEUE_SIZE )
+    int getShardAuditWorkerQueueSize();
+
+
+    @Default("10000")
+    @Key(COUNTER_WRITE_FLUSH_COUNT)
     long getCounterFlushCount();
 
 
-    @Default( "30000" )
-    @Key( COUNTER_WRITE_FLUSH_INTERVAL )
+    @Default("30000")
+    @Key(COUNTER_WRITE_FLUSH_INTERVAL)
     long getCounterFlushInterval();
 
-    @Default( "1000" )
-    @Key(COUNTER_WRITE_FLUSH_QUEUE_SIZE  )
+    @Default("1000")
+    @Key(COUNTER_WRITE_FLUSH_QUEUE_SIZE)
     int getCounterFlushQueueSize();
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/SearchByEdge.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/SearchByEdge.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/SearchByEdge.java
index 7e589f2..114440f 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/SearchByEdge.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/SearchByEdge.java
@@ -65,4 +65,10 @@ public interface SearchByEdge {
      */
     Optional<Edge> last();
 
+    /**
+     * Get the sort order
+     * @return
+     */
+    SearchByEdgeType.Order getOrder();
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/SearchByEdgeType.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/SearchByEdgeType.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/SearchByEdgeType.java
index 29cc3f5..749130b 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/SearchByEdgeType.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/SearchByEdgeType.java
@@ -59,4 +59,20 @@ public interface SearchByEdgeType {
      */
     Optional<Edge> last();
 
+    /**
+     * Get the direction we're seeking
+     * @return
+     */
+    Order getOrder();
+
+
+    /**
+     * Options for ordering.  By default, we want to perform descending for common use cases and read speed.  This is our our data
+     * is optimized in cassandra
+     */
+    public enum Order {
+        DESCENDING,
+        ASCENDING
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/guice/GraphModule.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/guice/GraphModule.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/guice/GraphModule.java
index 64f0fbb..f0e954b 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/guice/GraphModule.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/guice/GraphModule.java
@@ -48,6 +48,7 @@ import org.apache.usergrid.persistence.graph.serialization.impl.shard.EdgeShardS
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.NodeShardAllocation;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.NodeShardApproximation;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.NodeShardCache;
+import org.apache.usergrid.persistence.graph.serialization.impl.shard.ShardGroupCompaction;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.ShardedEdgeSerialization;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.count.NodeShardApproximationImpl;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.count.NodeShardCounterSerialization;
@@ -55,6 +56,7 @@ import org.apache.usergrid.persistence.graph.serialization.impl.shard.count.Node
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.impl.EdgeShardSerializationImpl;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.impl.NodeShardAllocationImpl;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.impl.NodeShardCacheImpl;
+import org.apache.usergrid.persistence.graph.serialization.impl.shard.impl.ShardGroupCompactionImpl;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.impl.ShardedEdgeSerializationImpl;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.impl.SizebasedEdgeColumnFamilies;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.impl.SizebasedEdgeShardStrategy;
@@ -119,6 +121,8 @@ public class GraphModule extends AbstractModule {
 
         bind( EdgeColumnFamilies.class ).to( SizebasedEdgeColumnFamilies.class );
 
+        bind( ShardGroupCompaction.class).to( ShardGroupCompactionImpl.class);
+
 
         /**
          * Bind our implementation

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/guice/MergedProxy.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/guice/MergedProxy.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/guice/MergedProxy.java
deleted file mode 100644
index 20bc637..0000000
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/guice/MergedProxy.java
+++ /dev/null
@@ -1,34 +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.graph.guice;
-
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import com.google.inject.BindingAnnotation;
-
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD })
-@BindingAnnotation
-public @interface MergedProxy {}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/SimpleMarkedEdge.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/SimpleMarkedEdge.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/SimpleMarkedEdge.java
index 12192fc..9fcb816 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/SimpleMarkedEdge.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/SimpleMarkedEdge.java
@@ -70,7 +70,6 @@ public class SimpleMarkedEdge extends  SimpleEdge implements MarkedEdge {
             return false;
         }
 
-
         return true;
     }
 
@@ -90,3 +89,4 @@ public class SimpleMarkedEdge extends  SimpleEdge implements MarkedEdge {
                 "} " + super.toString();
     }
 }
+

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/SimpleSearchByEdge.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/SimpleSearchByEdge.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/SimpleSearchByEdge.java
index e8971f6..d40efc0 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/SimpleSearchByEdge.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/SimpleSearchByEdge.java
@@ -23,10 +23,12 @@ package org.apache.usergrid.persistence.graph.impl;
 import org.apache.usergrid.persistence.core.util.ValidationUtils;
 import org.apache.usergrid.persistence.graph.Edge;
 import org.apache.usergrid.persistence.graph.SearchByEdge;
+import org.apache.usergrid.persistence.graph.SearchByEdgeType;
 import org.apache.usergrid.persistence.graph.serialization.util.GraphValidation;
 import org.apache.usergrid.persistence.model.entity.Id;
 
 import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
 
 
 /**
@@ -40,6 +42,7 @@ public class SimpleSearchByEdge implements SearchByEdge {
     private final String type;
     private final long maxTimestamp;
     private final Optional<Edge> last;
+    private final SearchByEdgeType.Order order;
 
 
     /**
@@ -50,17 +53,20 @@ public class SimpleSearchByEdge implements SearchByEdge {
      * @param maxTimestamp The maximum timestamp to seek from
      * @param last The value to start seeking from.  Must be >= this value
      */
-    public SimpleSearchByEdge( final Id sourceNode, final String type, final Id targetNode, final long maxTimestamp, final Edge last ) {
+    public SimpleSearchByEdge( final Id sourceNode, final String type, final Id targetNode, final long maxTimestamp, final SearchByEdgeType.Order order, final Edge last ) {
+
         ValidationUtils.verifyIdentity(sourceNode);
         ValidationUtils.verifyIdentity(targetNode);
         ValidationUtils.verifyString( type, "type" );
         GraphValidation.validateTimestamp( maxTimestamp, "maxTimestamp" );
+        Preconditions.checkNotNull(order, "order must not be null");
 
 
         this.sourceNode = sourceNode;
         this.targetNode = targetNode;
         this.type = type;
         this.maxTimestamp = maxTimestamp;
+        this.order = order;
         this.last = Optional.fromNullable(last);
     }
 
@@ -93,4 +99,10 @@ public class SimpleSearchByEdge implements SearchByEdge {
     public Optional<Edge> last() {
         return last;
     }
+
+
+    @Override
+    public SearchByEdgeType.Order getOrder() {
+        return order;
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/SimpleSearchByEdgeType.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/SimpleSearchByEdgeType.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/SimpleSearchByEdgeType.java
index 9e7dcde..6bc8b1b 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/SimpleSearchByEdgeType.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/SimpleSearchByEdgeType.java
@@ -27,6 +27,7 @@ import org.apache.usergrid.persistence.graph.serialization.util.GraphValidation;
 import org.apache.usergrid.persistence.model.entity.Id;
 
 import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
 
 
 /**
@@ -39,6 +40,7 @@ public class SimpleSearchByEdgeType implements SearchByEdgeType{
     private final String type;
     private final long maxTimestamp;
     private final Optional<Edge> last;
+    private final Order order;
 
 
     /**
@@ -46,9 +48,14 @@ public class SimpleSearchByEdgeType implements SearchByEdgeType{
      * @param node The node to search from
      * @param type The edge type
      * @param maxTimestamp The maximum timestamp to return
+     * @param order The order order.  Descending is most efficient
      * @param last The value to start seeking from.  Must be >= this value
+     * @param order
      */
-    public SimpleSearchByEdgeType( final Id node, final String type, final long maxTimestamp, final Edge last ) {
+    public SimpleSearchByEdgeType( final Id node, final String type, final long maxTimestamp, final Order order, final Edge last
+                                   ) {
+
+        Preconditions.checkNotNull( order, "order is required");
         ValidationUtils.verifyIdentity(node);
         ValidationUtils.verifyString( type, "type" );
         GraphValidation.validateTimestamp( maxTimestamp, "maxTimestamp" );
@@ -57,6 +64,7 @@ public class SimpleSearchByEdgeType implements SearchByEdgeType{
         this.node = node;
         this.type = type;
         this.maxTimestamp = maxTimestamp;
+        this.order = order;
         this.last = Optional.fromNullable(last);
     }
 
@@ -86,6 +94,12 @@ public class SimpleSearchByEdgeType implements SearchByEdgeType{
 
 
     @Override
+    public Order getOrder() {
+        return order;
+    }
+
+
+    @Override
     public boolean equals( final Object o ) {
         if ( this == o ) {
             return true;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/SimpleSearchByIdType.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/SimpleSearchByIdType.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/SimpleSearchByIdType.java
index 4249ae7..4b73347 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/SimpleSearchByIdType.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/SimpleSearchByIdType.java
@@ -44,8 +44,8 @@ public class SimpleSearchByIdType extends SimpleSearchByEdgeType implements Sear
      * @param last The value to start seeking from.  Must be >= this value
 
      */
-    public SimpleSearchByIdType( final Id node, final String type, final long maxTimestamp, final String idType, final Edge last  ) {
-        super( node, type, maxTimestamp, last );
+    public SimpleSearchByIdType( final Id node, final String type, final long maxTimestamp, final Order order, final String idType, final Edge last  ) {
+        super( node, type, maxTimestamp, order, last );
 
         ValidationUtils.verifyString( idType, "idType" );
         this.idType = idType;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/stage/EdgeDeleteRepairImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/stage/EdgeDeleteRepairImpl.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/stage/EdgeDeleteRepairImpl.java
index 5be3541..0137ba4 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/stage/EdgeDeleteRepairImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/stage/EdgeDeleteRepairImpl.java
@@ -32,14 +32,13 @@ import org.apache.usergrid.persistence.core.scope.ApplicationScope;
 import org.apache.usergrid.persistence.graph.Edge;
 import org.apache.usergrid.persistence.graph.GraphFig;
 import org.apache.usergrid.persistence.graph.MarkedEdge;
-import org.apache.usergrid.persistence.graph.exception.GraphRuntimeException;
+import org.apache.usergrid.persistence.graph.SearchByEdgeType;
 import org.apache.usergrid.persistence.graph.impl.SimpleSearchByEdge;
 import org.apache.usergrid.persistence.graph.serialization.EdgeSerialization;
 
 import com.google.common.base.Preconditions;
 import com.google.inject.Inject;
 import com.netflix.astyanax.Keyspace;
-import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
 
 import rx.Observable;
 import rx.functions.Action1;
@@ -116,7 +115,7 @@ public class EdgeDeleteRepairImpl implements EdgeDeleteRepair {
 
                 final SimpleSearchByEdge search =
                         new SimpleSearchByEdge( edge.getSourceNode(), edge.getType(), edge.getTargetNode(),
-                                edge.getTimestamp(), null );
+                                edge.getTimestamp(), SearchByEdgeType.Order.DESCENDING, null );
 
                 return serialization.getEdgeVersions( scope, search );
             }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/stage/EdgeMetaRepairImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/stage/EdgeMetaRepairImpl.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/stage/EdgeMetaRepairImpl.java
index 055b867..7e09eca 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/stage/EdgeMetaRepairImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/stage/EdgeMetaRepairImpl.java
@@ -33,7 +33,7 @@ import org.apache.usergrid.persistence.core.scope.ApplicationScope;
 import org.apache.usergrid.persistence.core.util.ValidationUtils;
 import org.apache.usergrid.persistence.graph.GraphFig;
 import org.apache.usergrid.persistence.graph.MarkedEdge;
-import org.apache.usergrid.persistence.graph.exception.GraphRuntimeException;
+import org.apache.usergrid.persistence.graph.SearchByEdgeType;
 import org.apache.usergrid.persistence.graph.impl.SimpleSearchByIdType;
 import org.apache.usergrid.persistence.graph.impl.SimpleSearchIdType;
 import org.apache.usergrid.persistence.graph.serialization.EdgeMetadataSerialization;
@@ -46,7 +46,6 @@ import com.google.inject.Inject;
 import com.google.inject.Singleton;
 import com.netflix.astyanax.Keyspace;
 import com.netflix.astyanax.MutationBatch;
-import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
 
 import rx.Observable;
 import rx.functions.Action1;
@@ -286,7 +285,7 @@ public class EdgeMetaRepairImpl implements EdgeMetaRepair {
                 @Override
                 protected Iterator<MarkedEdge> getIterator() {
                     return storageEdgeSerialization.getEdgesToTargetBySourceType( scope,
-                            new SimpleSearchByIdType( nodeId, edgeType, maxTimestamp, subType, null ) );
+                            new SimpleSearchByIdType( nodeId, edgeType, maxTimestamp, SearchByEdgeType.Order.DESCENDING, subType,   null ) );
                 }
             } );
         }
@@ -332,7 +331,7 @@ public class EdgeMetaRepairImpl implements EdgeMetaRepair {
                 @Override
                 protected Iterator<MarkedEdge> getIterator() {
                     return storageEdgeSerialization.getEdgesFromSourceByTargetType( scope,
-                            new SimpleSearchByIdType( nodeId, edgeType, maxTimestamp, subType, null ) );
+                            new SimpleSearchByIdType( nodeId, edgeType, maxTimestamp, SearchByEdgeType.Order.DESCENDING, subType, null ) );
                 }
             } );
         }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/stage/NodeDeleteListenerImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/stage/NodeDeleteListenerImpl.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/stage/NodeDeleteListenerImpl.java
index 962da21..2be6c55 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/stage/NodeDeleteListenerImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/stage/NodeDeleteListenerImpl.java
@@ -33,8 +33,8 @@ import org.apache.usergrid.persistence.core.rx.ObservableIterator;
 import org.apache.usergrid.persistence.core.scope.ApplicationScope;
 import org.apache.usergrid.persistence.graph.GraphFig;
 import org.apache.usergrid.persistence.graph.MarkedEdge;
+import org.apache.usergrid.persistence.graph.SearchByEdgeType;
 import org.apache.usergrid.persistence.graph.SearchEdgeType;
-import org.apache.usergrid.persistence.graph.exception.GraphRuntimeException;
 import org.apache.usergrid.persistence.graph.impl.SimpleSearchByEdgeType;
 import org.apache.usergrid.persistence.graph.impl.SimpleSearchEdgeType;
 import org.apache.usergrid.persistence.graph.serialization.EdgeMetadataSerialization;
@@ -46,7 +46,6 @@ import com.google.common.base.Optional;
 import com.google.inject.Inject;
 import com.netflix.astyanax.Keyspace;
 import com.netflix.astyanax.MutationBatch;
-import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
 
 import rx.Observable;
 import rx.functions.Action0;
@@ -160,7 +159,7 @@ public class NodeDeleteListenerImpl implements NodeDeleteListener {
                             @Override
                             protected Iterator<MarkedEdge> getIterator() {
                                 return storageSerialization.getEdgesToTarget( scope,
-                                        new SimpleSearchByEdgeType( node, edgeType, maxVersion, null ) );
+                                        new SimpleSearchByEdgeType( node, edgeType, maxVersion, SearchByEdgeType.Order.DESCENDING, null ) );
                             }
                         } );
                     }
@@ -177,7 +176,7 @@ public class NodeDeleteListenerImpl implements NodeDeleteListener {
                             @Override
                             protected Iterator<MarkedEdge> getIterator() {
                                 return storageSerialization.getEdgesFromSource( scope,
-                                        new SimpleSearchByEdgeType( node, edgeType, maxVersion, null ) );
+                                        new SimpleSearchByEdgeType( node, edgeType, maxVersion, SearchByEdgeType.Order.DESCENDING, null ) );
                             }
                         } );
                     }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/DirectedEdgeMeta.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/DirectedEdgeMeta.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/DirectedEdgeMeta.java
index 92f2548..6bb467f 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/DirectedEdgeMeta.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/DirectedEdgeMeta.java
@@ -28,6 +28,7 @@ import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.UUID;
 
 import org.apache.usergrid.persistence.core.scope.ApplicationScope;
 import org.apache.usergrid.persistence.graph.MarkedEdge;
@@ -38,6 +39,8 @@ import org.apache.usergrid.persistence.graph.impl.SimpleSearchByEdgeType;
 import org.apache.usergrid.persistence.graph.impl.SimpleSearchByIdType;
 import org.apache.usergrid.persistence.model.entity.Id;
 
+import com.netflix.astyanax.MutationBatch;
+
 
 /**
  * A bean to define directed edge meta data.  This is used to encapsulate the meta data around a source or target node,
@@ -151,14 +154,52 @@ public abstract class DirectedEdgeMeta {
     }
 
 
+    @Override
+    public String toString() {
+        return "DirectedEdgeMeta{" +
+                "nodes=" + Arrays.toString( nodes ) +
+                ", types=" + Arrays.toString( types ) +
+                '}';
+    }
+
+
     /**
      * Given the edge serialization, load all shard in the shard group
      */
     public abstract Iterator<MarkedEdge> loadEdges( final ShardedEdgeSerialization serialization,
                                                     final EdgeColumnFamilies edgeColumnFamilies,
                                                     final ApplicationScope scope, final Collection<Shard> shards,
-                                                    final long maxValue );
+                                                    final long maxValue, final SearchByEdgeType.Order order );
+
+
+    /**
+     * Write the edge for this meta data to the target edge
+     * @param shardedEdgeSerialization
+     * @param edgeColumnFamilies
+     * @param scope
+     * @param targetShard
+     * @param edge
+     * @param timestamp The timestamp on the operation
+     * @return
+     */
+    public abstract MutationBatch writeEdge( final ShardedEdgeSerialization shardedEdgeSerialization,
+                                             final EdgeColumnFamilies edgeColumnFamilies, final ApplicationScope scope,
+                                             final Shard targetShard, final MarkedEdge edge, final UUID timestamp );
+
 
+    /**
+     * Delete the edge for this meta data from the shard
+     * @param shardedEdgeSerialization
+     * @param edgeColumnFamilies
+     * @param scope
+     * @param sourceShard
+     * @param edge
+     * @param timestamp The timestamp on the operation
+     * @return
+     */
+    public abstract MutationBatch deleteEdge( final ShardedEdgeSerialization shardedEdgeSerialization,
+                                              final EdgeColumnFamilies edgeColumnFamilies, final ApplicationScope scope,
+                                              final Shard sourceShard, final MarkedEdge edge, final UUID timestamp );
 
 
     /**
@@ -225,19 +266,39 @@ public abstract class DirectedEdgeMeta {
             @Override
             public Iterator<MarkedEdge> loadEdges( final ShardedEdgeSerialization serialization,
                                                    final EdgeColumnFamilies edgeColumnFamilies,
-                                                   final ApplicationScope scope, final Collection<Shard>  shards,
-                                                   final long maxValue ) {
+                                                   final ApplicationScope scope, final Collection<Shard> shards,
+                                                   final long maxValue, final SearchByEdgeType.Order order ) {
 
                 final Id sourceId = nodes[0].id;
                 final String edgeType = types[0];
 
-                final SearchByEdgeType search = new SimpleSearchByEdgeType( sourceId, edgeType, maxValue, null );
+                final SearchByEdgeType search = new SimpleSearchByEdgeType( sourceId, edgeType, maxValue, order, null);
 
                 return serialization.getEdgesFromSource( edgeColumnFamilies, scope, search, shards );
             }
 
 
             @Override
+            public MutationBatch writeEdge( final ShardedEdgeSerialization shardedEdgeSerialization,
+                                            final EdgeColumnFamilies edgeColumnFamilies, final ApplicationScope scope,
+                                            final Shard targetShard, final MarkedEdge edge, final UUID timestamp ) {
+                return shardedEdgeSerialization
+                        .writeEdgeFromSource( edgeColumnFamilies, scope, edge, Collections.singleton( targetShard ),
+                                this, timestamp );
+            }
+
+
+            @Override
+            public MutationBatch deleteEdge( final ShardedEdgeSerialization shardedEdgeSerialization,
+                                             final EdgeColumnFamilies edgeColumnFamilies, final ApplicationScope scope,
+                                             final Shard sourceShard, final MarkedEdge edge, final UUID timestamp ) {
+                return shardedEdgeSerialization
+                        .deleteEdgeFromSource( edgeColumnFamilies, scope, edge, Collections.singleton( sourceShard ),
+                                this, timestamp );
+            }
+
+
+            @Override
             public MetaType getType() {
                 return MetaType.SOURCE;
             }
@@ -264,19 +325,39 @@ public abstract class DirectedEdgeMeta {
 
             @Override
             public Iterator<MarkedEdge> loadEdges( final ShardedEdgeSerialization serialization,
-                                                   final EdgeColumnFamilies edgeColumnFamilies,
-                                                   final ApplicationScope scope, final Collection<Shard>shards,
-                                                   final long maxValue ) {
-//
+                                                             final EdgeColumnFamilies edgeColumnFamilies,
+                                                             final ApplicationScope scope, final Collection<Shard> shards,
+                                                             final long maxValue, final SearchByEdgeType.Order order ) {
+                //
                 final Id sourceId = nodes[0].id;
                 final String edgeType = types[0];
                 final String targetType = types[1];
 
                 final SearchByIdType search =
-                        new SimpleSearchByIdType( sourceId, edgeType, maxValue, targetType, null );
+                        new SimpleSearchByIdType( sourceId, edgeType, maxValue, order, targetType,  null );
+
+                return serialization.getEdgesFromSourceByTargetType( edgeColumnFamilies, scope, search, shards );
+            }
 
-                return serialization.getEdgesFromSourceByTargetType( edgeColumnFamilies, scope, search, shards);
 
+
+
+
+            @Override
+            public MutationBatch writeEdge( final ShardedEdgeSerialization shardedEdgeSerialization,
+                                            final EdgeColumnFamilies edgeColumnFamilies, final ApplicationScope scope,
+                                            final Shard targetShard, final MarkedEdge edge, final UUID timestamp ) {
+                return shardedEdgeSerialization.writeEdgeFromSourceWithTargetType( edgeColumnFamilies, scope, edge,
+                        Collections.singleton( targetShard ), this, timestamp );
+            }
+
+
+            @Override
+            public MutationBatch deleteEdge( final ShardedEdgeSerialization shardedEdgeSerialization,
+                                             final EdgeColumnFamilies edgeColumnFamilies, final ApplicationScope scope,
+                                             final Shard sourceShard, final MarkedEdge edge, final UUID timestamp ) {
+                return shardedEdgeSerialization.deleteEdgeFromSourceWithTargetType( edgeColumnFamilies, scope, edge,
+                        Collections.singleton( sourceShard ), this, timestamp );
             }
 
 
@@ -304,20 +385,40 @@ public abstract class DirectedEdgeMeta {
             @Override
             public Iterator<MarkedEdge> loadEdges( final ShardedEdgeSerialization serialization,
                                                    final EdgeColumnFamilies edgeColumnFamilies,
-                                                   final ApplicationScope scope, final Collection<Shard>  shards,
-                                                   final long maxValue ) {
+                                                   final ApplicationScope scope, final Collection<Shard> shards,
+                                                   final long maxValue, final SearchByEdgeType.Order order ) {
 
 
                 final Id targetId = nodes[0].id;
                 final String edgeType = types[0];
 
-                final SearchByEdgeType search = new SimpleSearchByEdgeType( targetId, edgeType, maxValue, null );
+                final SearchByEdgeType search = new SimpleSearchByEdgeType( targetId, edgeType, maxValue, order, null);
 
                 return serialization.getEdgesToTarget( edgeColumnFamilies, scope, search, shards );
             }
 
 
             @Override
+            public MutationBatch writeEdge( final ShardedEdgeSerialization shardedEdgeSerialization,
+                                            final EdgeColumnFamilies edgeColumnFamilies, final ApplicationScope scope,
+                                            final Shard targetShard, final MarkedEdge edge, final UUID timestamp ) {
+                return shardedEdgeSerialization
+                        .writeEdgeToTarget( edgeColumnFamilies, scope, edge, Collections.singleton( targetShard ),
+                                this, timestamp );
+            }
+
+
+            @Override
+            public MutationBatch deleteEdge( final ShardedEdgeSerialization shardedEdgeSerialization,
+                                             final EdgeColumnFamilies edgeColumnFamilies, final ApplicationScope scope,
+                                             final Shard sourceShard, final MarkedEdge edge, final UUID timestamp ) {
+                return shardedEdgeSerialization
+                        .deleteEdgeToTarget( edgeColumnFamilies, scope, edge, Collections.singleton( sourceShard ),
+                                this, timestamp );
+            }
+
+
+            @Override
             public MetaType getType() {
                 return MetaType.TARGET;
             }
@@ -339,11 +440,13 @@ public abstract class DirectedEdgeMeta {
     private static DirectedEdgeMeta fromTargetNodeSourceType( final NodeMeta[] nodes, final String[] types ) {
         return new DirectedEdgeMeta( nodes, types ) {
 
+
             @Override
             public Iterator<MarkedEdge> loadEdges( final ShardedEdgeSerialization serialization,
                                                    final EdgeColumnFamilies edgeColumnFamilies,
                                                    final ApplicationScope scope, final Collection<Shard> shards,
-                                                   final long maxValue ) {
+                                                   final long maxValue, final SearchByEdgeType.Order order ) {
+
 
                 final Id targetId = nodes[0].id;
                 final String edgeType = types[0];
@@ -351,9 +454,27 @@ public abstract class DirectedEdgeMeta {
 
 
                 final SearchByIdType search =
-                        new SimpleSearchByIdType( targetId, edgeType, maxValue, sourceType, null );
+                        new SimpleSearchByIdType( targetId, edgeType, maxValue, order, sourceType,  null );
+
+                return serialization.getEdgesToTargetBySourceType( edgeColumnFamilies, scope, search, shards );
+            }
+
 
-                return serialization.getEdgesToTargetBySourceType( edgeColumnFamilies, scope, search, shards);
+            @Override
+            public MutationBatch writeEdge( final ShardedEdgeSerialization shardedEdgeSerialization,
+                                            final EdgeColumnFamilies edgeColumnFamilies, final ApplicationScope scope,
+                                            final Shard targetShard, final MarkedEdge edge, final UUID timestamp ) {
+                return shardedEdgeSerialization.writeEdgeToTargetWithSourceType( edgeColumnFamilies, scope, edge,
+                        Collections.singleton( targetShard ), this, timestamp );
+            }
+
+
+            @Override
+            public MutationBatch deleteEdge( final ShardedEdgeSerialization shardedEdgeSerialization,
+                                             final EdgeColumnFamilies edgeColumnFamilies, final ApplicationScope scope,
+                                             final Shard sourceShard, final MarkedEdge edge, final UUID timestamp ) {
+                return shardedEdgeSerialization.deleteEdgeToTargetWithSourceType( edgeColumnFamilies, scope, edge,
+                        Collections.singleton( sourceShard ), this, timestamp );
             }
 
 
@@ -385,18 +506,37 @@ public abstract class DirectedEdgeMeta {
             @Override
             public Iterator<MarkedEdge> loadEdges( final ShardedEdgeSerialization serialization,
                                                    final EdgeColumnFamilies edgeColumnFamilies,
-                                                   final ApplicationScope scope, final Collection<Shard>  shards,
-                                                   final long maxValue ) {
+                                                   final ApplicationScope scope, final Collection<Shard> shards,
+                                                   final long maxValue, final SearchByEdgeType.Order order ) {
 
                 final Id sourceId = nodes[0].id;
                 final Id targetId = nodes[1].id;
                 final String edgeType = types[0];
 
                 final SimpleSearchByEdge search =
-                        new SimpleSearchByEdge( sourceId, edgeType, targetId, maxValue, null );
+                        new SimpleSearchByEdge( sourceId, edgeType, targetId, maxValue, order, null );
+
+                return serialization.getEdgeVersions( edgeColumnFamilies, scope, search, shards );
+            }
 
-                return serialization.getEdgeVersions( edgeColumnFamilies, scope, search, shards);
 
+            @Override
+            public MutationBatch writeEdge( final ShardedEdgeSerialization shardedEdgeSerialization,
+                                            final EdgeColumnFamilies edgeColumnFamilies, final ApplicationScope scope,
+                                            final Shard targetShard, final MarkedEdge edge, final UUID timestamp ) {
+                return shardedEdgeSerialization
+                        .writeEdgeVersions( edgeColumnFamilies, scope, edge, Collections.singleton( targetShard ),
+                                this, timestamp );
+            }
+
+
+            @Override
+            public MutationBatch deleteEdge( final ShardedEdgeSerialization shardedEdgeSerialization,
+                                             final EdgeColumnFamilies edgeColumnFamilies, final ApplicationScope scope,
+                                             final Shard sourceShard, final MarkedEdge edge, final UUID timestamp ) {
+                return shardedEdgeSerialization
+                        .deleteEdgeVersions( edgeColumnFamilies, scope, edge, Collections.singleton( sourceShard ),
+                                this, timestamp );
             }
 
 
@@ -408,16 +548,15 @@ public abstract class DirectedEdgeMeta {
     }
 
 
-
     /**
      * Create a directed edge from the stored meta data
+     *
      * @param metaType The meta type stored
      * @param nodes The metadata of the nodes
      * @param types The types in the meta data
-     *
-     *
      */
-    public static DirectedEdgeMeta fromStorage( final  MetaType metaType, final NodeMeta[] nodes, final String[] types ) {
+    public static DirectedEdgeMeta fromStorage( final MetaType metaType, final NodeMeta[] nodes,
+                                                final String[] types ) {
         switch ( metaType ) {
             case SOURCE:
                 return fromSourceNode( nodes, types );
@@ -428,7 +567,7 @@ public abstract class DirectedEdgeMeta {
             case TARGETSOURCE:
                 return fromTargetNodeSourceType( nodes, types );
             case VERSIONS:
-                return fromEdge(nodes, types);
+                return fromEdge( nodes, types );
             default:
                 throw new UnsupportedOperationException( "No supported meta type found" );
         }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/RowKey.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/RowKey.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/RowKey.java
index 9bd9937..74f7ffc 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/RowKey.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/RowKey.java
@@ -42,4 +42,14 @@ public class RowKey {
         this.edgeType = edgeType;
         this.shardId = shardId;
     }
+
+
+    @Override
+    public String toString() {
+        return "RowKey{" +
+                "nodeId=" + nodeId +
+                ", edgeType='" + edgeType + '\'' +
+                ", shardId=" + shardId +
+                '}';
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/RowKeyType.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/RowKeyType.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/RowKeyType.java
index 6e69bbf..3368c40 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/RowKeyType.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/RowKeyType.java
@@ -57,5 +57,10 @@ public class RowKeyType extends RowKey {
     }
 
 
-
+    @Override
+    public String toString() {
+        return "RowKeyType{" +
+                "idType='" + idType + '\'' +
+                "} " + super.toString();
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/Shard.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/Shard.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/Shard.java
index 38fe51c..9ca6cbe 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/Shard.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/Shard.java
@@ -137,6 +137,7 @@ public class Shard implements Comparable<Shard> {
         return "Shard{" +
                 "shardIndex=" + shardIndex +
                 ", createdTime=" + createdTime +
-                "} ";
+                ", compacted=" + compacted +
+                '}';
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardEntryGroup.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardEntryGroup.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardEntryGroup.java
index 70569fd..11bf7a4 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardEntryGroup.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardEntryGroup.java
@@ -20,10 +20,15 @@ package org.apache.usergrid.persistence.graph.serialization.impl.shard;
 
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import com.google.common.base.Preconditions;
 
 
@@ -36,6 +41,7 @@ import com.google.common.base.Preconditions;
  */
 public class ShardEntryGroup {
 
+    private static final Logger LOG = LoggerFactory.getLogger( ShardEntryGroup.class );
 
     private List<Shard> shards;
 
@@ -45,6 +51,8 @@ public class ShardEntryGroup {
 
     private Shard compactionTarget;
 
+    private Shard rootShard;
+
 
     /**
      * The max delta we accept in milliseconds for create time to be considered a member of this group
@@ -85,10 +93,13 @@ public class ShardEntryGroup {
         //shard is not compacted, or it's predecessor isn't, we should include it in this group
         if ( !minShard.isCompacted() ) {
             addShardInternal( shard );
+
             return true;
         }
 
 
+
+
         return false;
     }
 
@@ -124,10 +135,26 @@ public class ShardEntryGroup {
      * Get the entries that we should read from.
      */
     public Collection<Shard> getReadShards() {
-        return shards;
+
+
+        final Shard staticShard = getRootShard();
+        final Shard compactionTarget = getCompactionTarget();
+
+
+
+        if(compactionTarget != null){
+            LOG.debug( "Returning shards {} and {} as read shards", compactionTarget, staticShard );
+            return Arrays.asList( compactionTarget, staticShard );
+        }
+
+
+        LOG.debug( "Returning shards {} read shard", staticShard );
+        return  Collections.singleton( staticShard );
     }
 
 
+
+
     /**
      * Get the entries, with the max shard time being first. We write to all shards until they're migrated
      */
@@ -138,11 +165,22 @@ public class ShardEntryGroup {
          * adding data to other shards
          */
         if ( !isTooSmallToCompact() && shouldCompact( currentTime ) ) {
-            return Collections.singleton( getCompactionTarget() );
+
+            final Shard compactionTarget = getCompactionTarget();
+
+            LOG.debug( "Returning shard {} as write shard", compactionTarget);
+
+            return Collections.singleton( compactionTarget  );
+
         }
 
+        final Shard staticShard = getRootShard();
+
+
+        LOG.debug( "Returning shard {} as write shard", staticShard);
+
+        return Collections.singleton( staticShard );
 
-        return shards;
     }
 
 
@@ -155,6 +193,24 @@ public class ShardEntryGroup {
 
 
     /**
+     * Get the root shard that was created in this group
+     * @return
+     */
+    private Shard getRootShard(){
+        if(rootShard != null){
+            return rootShard;
+        }
+
+        final Shard rootCandidate = shards.get( shards.size() -1 );
+
+        if(rootCandidate.isCompacted()){
+            rootShard = rootCandidate;
+        }
+
+        return rootShard;
+    }
+
+    /**
      * Get the shard all compactions should write to.  Null indicates we cannot find a shard that could be used as a
      * compaction target.  Note that this shard may not have surpassed the delta yet You should invoke "shouldCompact"
      * first to ensure all criteria are met before initiating compaction

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardGroupCompaction.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardGroupCompaction.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardGroupCompaction.java
index bf4d3c9..4fe1a63 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardGroupCompaction.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardGroupCompaction.java
@@ -22,38 +22,32 @@
 package org.apache.usergrid.persistence.graph.serialization.impl.shard;
 
 
+import java.util.Collections;
+import java.util.HashSet;
 import java.util.Set;
 
 import org.apache.usergrid.persistence.core.scope.ApplicationScope;
 
-import rx.Observable;
+import com.google.common.util.concurrent.ListenableFuture;
 
 
 /**
  * Defines tasks for running compaction
- *
- *
  */
 public interface ShardGroupCompaction {
 
-
-    /**
-     * Execute the compaction task.  Will return the number of edges that have
-     * @param group The shard entry group to compact
-     * @return The shards that were compacted
-     */
-    public Set<Shard> compact(final ApplicationScope scope, final DirectedEdgeMeta edgeMeta, final ShardEntryGroup group);
-
     /**
-     * Possibly audit the shard entry group.  This is asynchronous and returns immediately
-     * @param group
-     * @return
+     * Possibly audit the shard entry group.  This is asynchronous and returns the future that will
+     * report the operations performed (if any) upon completion.
+     *
+     * @return A ListenableFuture with the result.  Note that some
      */
-    public AuditResult evaluateShardGroup( final ApplicationScope scope, final DirectedEdgeMeta edgeMeta,
-                                           final ShardEntryGroup group );
+    public ListenableFuture<AuditResult> evaluateShardGroup( final ApplicationScope scope,
+                                                             final DirectedEdgeMeta edgeMeta,
+                                                             final ShardEntryGroup group );
 
 
-    public enum AuditResult{
+    public enum AuditResult {
         /**
          * We didn't check this shard
          */
@@ -68,11 +62,10 @@ public interface ShardGroupCompaction {
          */
         CHECKED_CREATED,
 
-        /**
+        COMPACTED, /**
          * The shard group is already compacting
          */
         COMPACTING
     }
 
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardCounterSerializationImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardCounterSerializationImpl.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardCounterSerializationImpl.java
index ed3daaf..749416c 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardCounterSerializationImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardCounterSerializationImpl.java
@@ -39,10 +39,9 @@ import org.apache.usergrid.persistence.core.hystrix.HystrixCassandra;
 import org.apache.usergrid.persistence.core.scope.ApplicationScope;
 import org.apache.usergrid.persistence.core.scope.ApplicationScopeImpl;
 import org.apache.usergrid.persistence.graph.GraphFig;
-import org.apache.usergrid.persistence.graph.exception.GraphRuntimeException;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.DirectedEdgeMeta;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.Shard;
-import org.apache.usergrid.persistence.graph.serialization.impl.shard.impl.EdgeShardRowKeySerializer;
+import org.apache.usergrid.persistence.graph.serialization.impl.shard.impl.serialize.EdgeShardRowKeySerializer;
 import org.apache.usergrid.persistence.model.entity.Id;
 
 import com.google.common.base.Preconditions;
@@ -51,7 +50,6 @@ import com.google.inject.Singleton;
 import com.netflix.astyanax.Keyspace;
 import com.netflix.astyanax.MutationBatch;
 import com.netflix.astyanax.connectionpool.OperationResult;
-import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
 import com.netflix.astyanax.connectionpool.exceptions.NotFoundException;
 import com.netflix.astyanax.model.Column;
 import com.netflix.astyanax.model.CompositeBuilder;
@@ -127,7 +125,10 @@ public class NodeShardCounterSerializationImpl implements NodeShardCounterSerial
         }
         //column not found, return 0
         catch ( RuntimeException re ) {
-            if(re.getCause().getCause() instanceof NotFoundException) {
+
+            final Throwable cause = re.getCause();
+
+            if(cause != null && cause.getCause() instanceof NotFoundException) {
                 return 0;
             }
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/EdgeRowKeySerializer.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/EdgeRowKeySerializer.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/EdgeRowKeySerializer.java
deleted file mode 100644
index 90b264c..0000000
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/EdgeRowKeySerializer.java
+++ /dev/null
@@ -1,63 +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.graph.serialization.impl.shard.impl;
-
-
-import org.apache.usergrid.persistence.core.astyanax.CompositeFieldSerializer;
-import org.apache.usergrid.persistence.core.astyanax.IdRowCompositeSerializer;
-import org.apache.usergrid.persistence.graph.serialization.impl.shard.EdgeRowKey;
-import org.apache.usergrid.persistence.model.entity.Id;
-
-import com.netflix.astyanax.model.CompositeBuilder;
-import com.netflix.astyanax.model.CompositeParser;
-
-
-/**
- * Class to perform serialization for row keys from edges
- */
-
-public class EdgeRowKeySerializer implements CompositeFieldSerializer<EdgeRowKey> {
-
-    private static final IdRowCompositeSerializer ID_SER = IdRowCompositeSerializer.get();
-
-
-    @Override
-    public void toComposite( final CompositeBuilder builder, final EdgeRowKey key ) {
-
-        //add the row id to the composite
-        ID_SER.toComposite( builder, key.sourceId );
-        builder.addString( key.edgeType );
-        ID_SER.toComposite( builder, key.targetId );
-        builder.addLong( key.shardId );
-    }
-
-
-    @Override
-    public EdgeRowKey fromComposite( final CompositeParser composite ) {
-
-        final Id sourceId = ID_SER.fromComposite( composite );
-        final String edgeType = composite.readString();
-        final Id targetId = ID_SER.fromComposite( composite );
-        final long shard = composite.readLong();
-
-        return new EdgeRowKey( sourceId, edgeType, targetId, shard );
-    }
-
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/EdgeSearcher.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/EdgeSearcher.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/EdgeSearcher.java
index 27862d0..413c2a3 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/EdgeSearcher.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/EdgeSearcher.java
@@ -4,16 +4,16 @@ package org.apache.usergrid.persistence.graph.serialization.impl.shard.impl;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Comparator;
-import java.util.Iterator;
 import java.util.List;
-import java.util.Set;
 
 import org.apache.usergrid.persistence.core.astyanax.ColumnParser;
+import org.apache.usergrid.persistence.core.astyanax.ColumnSearch;
 import org.apache.usergrid.persistence.core.astyanax.ScopedRowKey;
 import org.apache.usergrid.persistence.core.scope.ApplicationScope;
 import org.apache.usergrid.persistence.graph.Edge;
+import org.apache.usergrid.persistence.graph.MarkedEdge;
+import org.apache.usergrid.persistence.graph.SearchByEdgeType;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.Shard;
-import org.apache.usergrid.persistence.graph.serialization.impl.shard.ShardEntryGroup;
 
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
@@ -30,23 +30,26 @@ import com.netflix.astyanax.util.RangeBuilder;
  * @param <C> The column type
  * @param <T> The parsed return type
  */
-public abstract class EdgeSearcher<R, C, T> implements ColumnParser<C, T>, Comparator<T> {
+public abstract class EdgeSearcher<R, C, T> implements ColumnParser<C, T>, ColumnSearch<T>{
 
-    protected final Optional<Edge> last;
+    protected final Optional<T> last;
     protected final long maxTimestamp;
     protected final ApplicationScope scope;
     protected final Collection<Shard> shards;
+    protected final SearchByEdgeType.Order order;
+    protected final Comparator<T> comparator;
 
 
-    protected EdgeSearcher( final ApplicationScope scope, final long maxTimestamp, final Optional<Edge> last,
-                            final Collection<Shard> shards ) {
+    protected EdgeSearcher( final ApplicationScope scope, final Collection<Shard> shards,  final SearchByEdgeType.Order order, final Comparator<T> comparator,  final long maxTimestamp, final Optional<T> last) {
 
         Preconditions.checkArgument(shards.size() > 0 , "Cannot search with no possible shards");
 
         this.scope = scope;
         this.maxTimestamp = maxTimestamp;
-        this.last = last;
+        this.order = order;
         this.shards = shards;
+        this.last = last;
+        this.comparator = comparator;
     }
 
 
@@ -69,20 +72,6 @@ public abstract class EdgeSearcher<R, C, T> implements ColumnParser<C, T>, Compa
 
 
 
-    /**
-     * Set the range on a search
-     */
-    public void setRange( final RangeBuilder builder ) {
-
-        //set our start range since it was supplied to us
-        if ( last.isPresent() ) {
-            C sourceEdge = getStartColumn( last.get() );
-
-
-            builder.setStart( sourceEdge, getSerializer() );
-        }
-
-    }
 
 
     public boolean hasPage() {
@@ -98,6 +87,50 @@ public abstract class EdgeSearcher<R, C, T> implements ColumnParser<C, T>, Compa
     }
 
 
+    @Override
+    public void buildRange( final RangeBuilder rangeBuilder, final T value ) {
+
+        C edge = createColumn( value );
+
+        rangeBuilder.setStart( edge, getSerializer() );
+
+        setRangeOptions( rangeBuilder );
+    }
+
+
+    @Override
+    public void buildRange( final RangeBuilder rangeBuilder ) {
+
+        //set our start range since it was supplied to us
+        if ( last.isPresent() ) {
+            C sourceEdge = createColumn( last.get() );
+
+
+            rangeBuilder.setStart( sourceEdge, getSerializer() );
+        }
+
+
+        setRangeOptions(rangeBuilder);
+
+
+    }
+
+    private void setRangeOptions(final RangeBuilder rangeBuilder){
+            //if we're ascending, this is opposite what cassandra sorts, so set the reversed flag
+        final boolean reversed = order == SearchByEdgeType.Order.ASCENDING;
+
+        rangeBuilder.setReversed( reversed );
+    }
+
+
+    /**
+     * Get the comparator
+     * @return
+     */
+    public Comparator<T> getComparator() {
+        return comparator;
+    }
+
 
     /**
      * Get the column's serializer
@@ -116,7 +149,7 @@ public abstract class EdgeSearcher<R, C, T> implements ColumnParser<C, T>, Compa
     /**
      * Set the start column to begin searching from.  The last is provided
      */
-    protected abstract C getStartColumn( final Edge last );
+    protected abstract C createColumn( final T last );
 
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/EdgeSerializer.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/EdgeSerializer.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/EdgeSerializer.java
deleted file mode 100644
index d93f679..0000000
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/EdgeSerializer.java
+++ /dev/null
@@ -1,77 +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.graph.serialization.impl.shard.impl;
-
-
-import java.nio.ByteBuffer;
-
-import org.apache.usergrid.persistence.core.astyanax.IdColDynamicCompositeSerializer;
-import org.apache.usergrid.persistence.graph.serialization.impl.shard.DirectedEdge;
-import org.apache.usergrid.persistence.model.entity.Id;
-
-import com.google.common.base.Preconditions;
-import com.netflix.astyanax.model.DynamicComposite;
-import com.netflix.astyanax.serializers.AbstractSerializer;
-import com.netflix.astyanax.serializers.LongSerializer;
-
-
-/**
- * Serializes to a source->target edge Note that we cannot set the edge type on de-serialization.  Only the target
- * Id and version.
- */
-public class EdgeSerializer extends AbstractSerializer<DirectedEdge> {
-
-    private static final IdColDynamicCompositeSerializer ID_COL_SERIALIZER = IdColDynamicCompositeSerializer.get();
-    private static final LongSerializer LONG_SERIALIZER = LongSerializer.get();
-
-
-    @Override
-    public ByteBuffer toByteBuffer( final DirectedEdge edge ) {
-
-        DynamicComposite composite = new DynamicComposite();
-
-        composite.addComponent( edge.timestamp, LONG_SERIALIZER );
-
-        ID_COL_SERIALIZER.toComposite( composite, edge.id );
-
-        return composite.serialize();
-    }
-
-
-    @Override
-    public DirectedEdge fromByteBuffer( final ByteBuffer byteBuffer ) {
-        DynamicComposite composite = DynamicComposite.fromByteBuffer( byteBuffer );
-
-        Preconditions.checkArgument( composite.size() == 3, "Composite should have 3 elements" );
-
-
-        //return the version
-        final long timestamp = composite.get( 0, LONG_SERIALIZER );
-
-
-        //parse our id
-        final Id id = ID_COL_SERIALIZER.fromComposite( composite, 1 );
-
-
-        return new DirectedEdge( id, timestamp );
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/EdgeShardRowKeySerializer.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/EdgeShardRowKeySerializer.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/EdgeShardRowKeySerializer.java
deleted file mode 100644
index 0451d68..0000000
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/EdgeShardRowKeySerializer.java
+++ /dev/null
@@ -1,103 +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.graph.serialization.impl.shard.impl;
-
-
-import org.apache.usergrid.persistence.core.astyanax.CompositeFieldSerializer;
-import org.apache.usergrid.persistence.core.astyanax.IdRowCompositeSerializer;
-import org.apache.usergrid.persistence.graph.serialization.impl.shard.DirectedEdgeMeta;
-import org.apache.usergrid.persistence.graph.serialization.impl.shard.NodeType;
-import org.apache.usergrid.persistence.model.entity.Id;
-
-import com.netflix.astyanax.model.CompositeBuilder;
-import com.netflix.astyanax.model.CompositeParser;
-
-
-public class EdgeShardRowKeySerializer implements CompositeFieldSerializer<DirectedEdgeMeta> {
-
-    private static final IdRowCompositeSerializer ID_SER = IdRowCompositeSerializer.get();
-
-    public static final EdgeShardRowKeySerializer INSTANCE = new EdgeShardRowKeySerializer();
-
-
-    @Override
-    public void toComposite( final CompositeBuilder builder, final DirectedEdgeMeta meta ) {
-
-
-        final DirectedEdgeMeta.NodeMeta[] nodeMeta = meta.getNodes();
-
-        //add the stored value
-        builder.addInteger( meta.getType().getStorageValue() );
-
-        final int length = nodeMeta.length;
-
-        builder.addInteger( length );
-
-
-        for ( DirectedEdgeMeta.NodeMeta node : nodeMeta ) {
-            ID_SER.toComposite( builder, node.getId() );
-            builder.addInteger( node.getNodeType().getStorageValue() );
-        }
-
-        final String[] edgeTypes = meta.getTypes();
-
-        builder.addInteger( edgeTypes.length );
-
-        for ( String type : edgeTypes ) {
-            builder.addString( type );
-        }
-    }
-
-
-    @Override
-    public DirectedEdgeMeta fromComposite( final CompositeParser composite ) {
-
-
-        final int storageType = composite.readInteger();
-
-        final DirectedEdgeMeta.MetaType metaType = DirectedEdgeMeta.MetaType.fromStorage( storageType );
-
-        final int idLength = composite.readInteger();
-
-        final DirectedEdgeMeta.NodeMeta[] nodePairs = new DirectedEdgeMeta.NodeMeta[idLength];
-
-
-        for ( int i = 0; i < idLength; i++ ) {
-            final Id sourceId = ID_SER.fromComposite( composite );
-
-            final NodeType type = NodeType.get( composite.readInteger() );
-
-            nodePairs[i] = new DirectedEdgeMeta.NodeMeta( sourceId, type );
-        }
-
-
-        final int length = composite.readInteger();
-
-        String[] types = new String[length];
-
-        for ( int i = 0; i < length; i++ ) {
-            types[i] = composite.readString();
-        }
-
-        return  DirectedEdgeMeta.fromStorage( metaType, nodePairs, types );
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/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 8233d0d..3b1f37a 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
@@ -40,6 +40,7 @@ import org.apache.usergrid.persistence.graph.GraphFig;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.DirectedEdgeMeta;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.EdgeShardSerialization;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.Shard;
+import org.apache.usergrid.persistence.graph.serialization.impl.shard.impl.serialize.EdgeShardRowKeySerializer;
 import org.apache.usergrid.persistence.graph.serialization.util.GraphValidation;
 
 import com.google.common.base.Optional;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardAllocationImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardAllocationImpl.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardAllocationImpl.java
index b919ad7..832d9b0 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardAllocationImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardAllocationImpl.java
@@ -32,6 +32,7 @@ import org.apache.usergrid.persistence.core.scope.ApplicationScope;
 import org.apache.usergrid.persistence.core.util.ValidationUtils;
 import org.apache.usergrid.persistence.graph.GraphFig;
 import org.apache.usergrid.persistence.graph.MarkedEdge;
+import org.apache.usergrid.persistence.graph.SearchByEdgeType;
 import org.apache.usergrid.persistence.graph.exception.GraphRuntimeException;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.DirectedEdgeMeta;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.EdgeColumnFamilies;
@@ -40,16 +41,15 @@ import org.apache.usergrid.persistence.graph.serialization.impl.shard.NodeShardA
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.NodeShardApproximation;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.Shard;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.ShardEntryGroup;
+import org.apache.usergrid.persistence.graph.serialization.impl.shard.ShardGroupCompaction;
 import org.apache.usergrid.persistence.graph.serialization.impl.shard.ShardedEdgeSerialization;
 import org.apache.usergrid.persistence.graph.serialization.util.GraphValidation;
-import org.apache.usergrid.persistence.model.util.UUIDGenerator;
 
-import com.fasterxml.uuid.impl.UUIDUtil;
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import com.google.inject.Inject;
 import com.netflix.astyanax.MutationBatch;
-import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
+import com.netflix.astyanax.util.TimeUUIDUtils;
 
 
 /**
@@ -68,6 +68,7 @@ public class NodeShardAllocationImpl implements NodeShardAllocation {
     private final NodeShardApproximation nodeShardApproximation;
     private final TimeService timeService;
     private final GraphFig graphFig;
+    private final ShardGroupCompaction shardGroupCompaction;
 
 
     @Inject
@@ -75,13 +76,14 @@ public class NodeShardAllocationImpl implements NodeShardAllocation {
                                     final EdgeColumnFamilies edgeColumnFamilies,
                                     final ShardedEdgeSerialization shardedEdgeSerialization,
                                     final NodeShardApproximation nodeShardApproximation, final TimeService timeService,
-                                    final GraphFig graphFig ) {
+                                    final GraphFig graphFig, final ShardGroupCompaction shardGroupCompaction ) {
         this.edgeShardSerialization = edgeShardSerialization;
         this.edgeColumnFamilies = edgeColumnFamilies;
         this.shardedEdgeSerialization = shardedEdgeSerialization;
         this.nodeShardApproximation = nodeShardApproximation;
         this.timeService = timeService;
         this.graphFig = graphFig;
+        this.shardGroupCompaction = shardGroupCompaction;
     }
 
 
@@ -113,7 +115,8 @@ public class NodeShardAllocationImpl implements NodeShardAllocation {
             existingShards = Collections.singleton( MIN_SHARD ).iterator();
         }
 
-        return new ShardEntryGroupIterator( existingShards, graphFig.getShardMinDelta() );
+        return new ShardEntryGroupIterator( existingShards, graphFig.getShardMinDelta(), shardGroupCompaction, scope,
+                directedEdgeMeta );
     }
 
 
@@ -158,18 +161,31 @@ public class NodeShardAllocationImpl implements NodeShardAllocation {
 
         final long count = nodeShardApproximation.getCount( scope, shard, directedEdgeMeta );
 
+        final long shardSize = graphFig.getShardSize();
 
-        if ( count < graphFig.getShardSize() ) {
+
+        if ( count < shardSize ) {
             return false;
         }
 
+        /**
+         * We want to allocate a new shard as close to the max value as possible.  This way if we're filling up a shard rapidly, we split it near the head of the values.
+         * Further checks to this group will result in more splits, similar to creating a tree type structure and splitting each node.
+         *
+         * This means that the lower shard can be re-split later if it is still too large.  We do the division to truncate
+         * to a split point < what our current max is that would be approximately be our pivot ultimately if we split from the
+         * lower bound and moved forward.  Doing this will stop the current shard from expanding and avoid a point where we cannot
+         * ultimately compact to the correct shard size.
+         */
+
 
         /**
          * Allocate the shard
          */
 
         final Iterator<MarkedEdge> edges = directedEdgeMeta
-                .loadEdges( shardedEdgeSerialization, edgeColumnFamilies, scope, shardEntryGroup.getReadShards(), Long.MAX_VALUE );
+                .loadEdges( shardedEdgeSerialization, edgeColumnFamilies, scope, shardEntryGroup.getReadShards(), 0,
+                        SearchByEdgeType.Order.ASCENDING );
 
 
         if ( !edges.hasNext() ) {
@@ -178,14 +194,41 @@ public class NodeShardAllocationImpl implements NodeShardAllocation {
             return false;
         }
 
-        //we have a next, allocate it based on the max
 
-        MarkedEdge marked = edges.next();
+        MarkedEdge marked = null;
+
+        /**
+         * Advance to the pivot point we should use.  Once it's compacted, we can split again.
+         * We either want to take the first one (unlikely) or we take our total count - the shard size.
+         * If this is a negative number, we're approaching our max count for this shard, so the first
+         * element will suffice.
+         */
+
+
+        for(long i = 1;  edges.hasNext(); i++){
+            //we hit a pivot shard, set it since it could be the last one we encounter
+            if(i% shardSize == 0){
+                marked = edges.next();
+            }
+            else{
+                edges.next();
+            }
+        }
+
+
+        /**
+         * Sanity check in case our counters become severely out of sync with our edge state in cassandra.
+         */
+        if(marked == null){
+            LOG.warn( "Incorrect shard count for shard group {}", shardEntryGroup );
+            return false;
+        }
 
         final long createTimestamp = timeService.getCurrentTime();
 
         final Shard newShard = new Shard( marked.getTimestamp(), createTimestamp, false );
 
+        LOG.info( "Allocating new shard {} for edge meta {}", newShard, directedEdgeMeta );
 
         final MutationBatch batch = this.edgeShardSerialization.writeShardMeta( scope, newShard, directedEdgeMeta );
 
@@ -220,22 +263,30 @@ public class NodeShardAllocationImpl implements NodeShardAllocation {
      */
     private boolean isNewNode( DirectedEdgeMeta directedEdgeMeta ) {
 
+
+        //TODO: TN this is broken....
         //The timeout is in milliseconds.  Time for a time uuid is 1/10000 of a milli, so we need to get the units correct
-        final long uuidDelta =  graphFig.getShardCacheTimeout()  * 10000;
+        final long timeoutDelta = graphFig.getShardCacheTimeout() ;
+
+        final long timeNow = timeService.getCurrentTime();
 
-        final long timeNow = UUIDGenerator.newTimeUUID().timestamp();
+        boolean isNew = true;
 
         for ( DirectedEdgeMeta.NodeMeta node : directedEdgeMeta.getNodes() ) {
 
-            final long uuidTime = node.getId().getUuid().timestamp();
+            //short circuit
+            if(!isNew){
+                return false;
+            }
 
-            final long uuidTimeDelta = uuidTime + uuidDelta;
+            final long uuidTime =   TimeUUIDUtils.getTimeFromUUID( node.getId().getUuid());
 
-            if ( uuidTimeDelta < timeNow ) {
-                return true;
-            }
+            final long newExpirationTimeout = uuidTime + timeoutDelta;
+
+            //our expiration is after our current time, treat it as new
+            isNew = isNew && newExpirationTimeout >  timeNow;
         }
 
-        return false;
+        return isNew;
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardCacheImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardCacheImpl.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardCacheImpl.java
index d444eec..36a7bc1 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardCacheImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardCacheImpl.java
@@ -299,13 +299,13 @@ public class NodeShardCacheImpl implements NodeShardCache {
 
 
         /**
-         * Get all shards <= this one in decending order
+         * Get all shards <= this one in descending order
          */
         public Iterator<ShardEntryGroup> getShards( final Long maxShard ) {
 
             final Long firstKey = shards.floorKey( maxShard );
 
-            return shards.headMap( firstKey, true ).descendingMap().values().iterator();
+            return Collections.unmodifiableCollection( shards.headMap( firstKey, true ).descendingMap().values()).iterator();
         }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e040fdf4/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/RowSerializer.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/RowSerializer.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/RowSerializer.java
deleted file mode 100644
index 1edaf21..0000000
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/RowSerializer.java
+++ /dev/null
@@ -1,63 +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.graph.serialization.impl.shard.impl;
-
-
-import org.apache.usergrid.persistence.core.astyanax.CompositeFieldSerializer;
-import org.apache.usergrid.persistence.core.astyanax.IdRowCompositeSerializer;
-import org.apache.usergrid.persistence.graph.serialization.impl.shard.RowKey;
-import org.apache.usergrid.persistence.model.entity.Id;
-
-import com.netflix.astyanax.model.CompositeBuilder;
-import com.netflix.astyanax.model.CompositeParser;
-
-
-/**
- * Class to perform serialization for row keys from edges
- */
-public class RowSerializer implements CompositeFieldSerializer<RowKey> {
-
-    private static final IdRowCompositeSerializer ID_SER = IdRowCompositeSerializer.get();
-
-
-    @Override
-    public void toComposite( final CompositeBuilder builder, final RowKey key ) {
-
-        //add the row id to the composite
-        ID_SER.toComposite( builder, key.nodeId );
-
-        builder.addString( key.edgeType );
-        builder.addLong( key.shardId );
-    }
-
-
-    @Override
-    public RowKey fromComposite( final CompositeParser composite ) {
-
-        final Id id = ID_SER.fromComposite( composite );
-        final String edgeType = composite.readString();
-        final long shard = composite.readLong();
-
-
-        return new RowKey( id, edgeType, shard );
-    }
-}


[34/52] [abbrv] git commit: Merge branch 'master' into two-dot-o

Posted by gr...@apache.org.
Merge branch 'master' into two-dot-o


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: e6c3f08fa308a354408046f7d2b6826a3cd56148
Parents: b0aee9e cd4915a
Author: Dave Johnson <sn...@apache.org>
Authored: Fri Aug 29 17:39:23 2014 -0400
Committer: Dave Johnson <sn...@apache.org>
Committed: Fri Aug 29 17:39:23 2014 -0400

----------------------------------------------------------------------
 .gitignore          | 2 ++
 portal/Gruntfile.js | 4 ----
 release/pom.xml     | 2 +-
 stack/pom.xml       | 2 +-
 4 files changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e6c3f08f/.gitignore
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e6c3f08f/stack/pom.xml
----------------------------------------------------------------------


[52/52] [abbrv] git commit: Fixed notification errors

Posted by gr...@apache.org.
Fixed notification errors


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: cb668d2a2f4f9c814084d5ee8f62ffa85b717d5f
Parents: 1d8dd2f
Author: grey <gr...@apigee.com>
Authored: Wed Sep 3 15:02:48 2014 -0700
Committer: grey <gr...@apigee.com>
Committed: Wed Sep 3 15:02:48 2014 -0700

----------------------------------------------------------------------
 .../usergrid/services/notifications/NotificationBatchJob.java   | 5 +++++
 .../apache/usergrid/services/notifications/NotificationJob.java | 3 +++
 .../services/notifications/NotificationsQueueManager.java       | 2 +-
 .../usergrid/services/notifications/NotificationsService.java   | 2 +-
 .../org/apache/usergrid/services/notifications/QueueJob.java    | 4 ++++
 5 files changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cb668d2a/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationBatchJob.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationBatchJob.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationBatchJob.java
index 05fd360..b9ea73e 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationBatchJob.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationBatchJob.java
@@ -122,4 +122,9 @@ public class NotificationBatchJob implements Job {
         logger.info( "execute NotificationBatch completed normally" );
     }
 
+
+    @Override
+    public void dead( final JobExecution execution ) throws Exception {
+
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cb668d2a/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationJob.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationJob.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationJob.java
index 4cf8c2f..35051bc 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationJob.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationJob.java
@@ -125,5 +125,8 @@ public class NotificationJob extends OnlyOnceJob {
     }
 
 
+    @Override
+    public void dead( final JobExecution execution ) throws Exception {
 
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cb668d2a/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsQueueManager.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsQueueManager.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsQueueManager.java
index f36a3de..8a15090 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsQueueManager.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsQueueManager.java
@@ -98,7 +98,7 @@ public class NotificationsQueueManager implements NotificationServiceProxy {
                     Query query = new Query();
                     query.setCollection("notifiers");
                     query.setLimit(100);
-                    PathQuery<Notifier> pathQuery = new PathQuery<Notifier>(em.getApplicationRef(), query);
+                    PathQuery<Notifier> pathQuery = new PathQuery<Notifier>((SimpleEntityRef)em.getApplicationRef(), query);
                     Iterator<Notifier> notifierIterator = pathQuery.iterator(em);
                     while (notifierIterator.hasNext()) {
                         Notifier notifier = notifierIterator.next();

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cb668d2a/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
index ae289ed..e347f98 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
@@ -157,7 +157,7 @@ public class NotificationsService extends AbstractCollectionService {
             query.setCollection(collection);
 
             if (pathQuery == null) {
-                pathQuery = new PathQuery(em.getApplicationRef(), query);
+                pathQuery = new PathQuery((SimpleEntityRef)em.getApplicationRef(), query);
             } else {
                 pathQuery = pathQuery.chain(query);
             }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cb668d2a/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueJob.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueJob.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueJob.java
index e34c816..9f756a4 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueJob.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueJob.java
@@ -124,4 +124,8 @@ public class QueueJob extends OnlyOnceJob {
     }
 
 
+    @Override
+    public void dead( final JobExecution execution ) throws Exception {
+
+    }
 }


[38/52] [abbrv] git commit: Get permissions right, who knows who that WAR came from.

Posted by gr...@apache.org.
Get permissions right, who knows who that WAR came from.


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: f7e8f26d585190d55ddb104e92b9250da7cf023a
Parents: e6c3f08
Author: Dave Johnson <dm...@apigee.com>
Authored: Tue Sep 2 11:19:03 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Tue Sep 2 11:19:03 2014 -0400

----------------------------------------------------------------------
 .../awscluster/src/main/dist/init_instance/init_rest_server.sh  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f7e8f26d/stack/awscluster/src/main/dist/init_instance/init_rest_server.sh
----------------------------------------------------------------------
diff --git a/stack/awscluster/src/main/dist/init_instance/init_rest_server.sh b/stack/awscluster/src/main/dist/init_instance/init_rest_server.sh
index 3adfce4..3464ea7 100644
--- a/stack/awscluster/src/main/dist/init_instance/init_rest_server.sh
+++ b/stack/awscluster/src/main/dist/init_instance/init_rest_server.sh
@@ -111,11 +111,12 @@ cd /usr/share/usergrid/scripts
 groovy wait_for_instances.groovy cassandra ${CASSANDRA_NUM_SERVERS}
 groovy wait_for_instances.groovy graphite ${GRAPHITE_NUM_SERVERS}
 
-chmod 660 /usr/share/usergrid/webapps/ROOT.war
-
+# link WAR and Portal into Tomcat's webapps dir
 rm -rf /var/lib/tomcat7/webapps/*
 ln -s /usr/share/usergrid/webapps/ROOT.war /var/lib/tomcat7/webapps/ROOT.war
 ln -s /usr/share/usergrid/webapps/portal /var/lib/tomcat7/webapps/portal
+chown -R tomcat7 /usr/share/usergrid/webapps
+chown -R tomcat7 /var/lib/tomcat7/webapps
 
 # configure usergrid
 mkdir -p /usr/share/tomcat7/lib 


[37/52] [abbrv] git commit: Fixed queries in tests

Posted by gr...@apache.org.
Fixed queries in tests


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: 646b98c0e20571784d048251fc3347fa8ef18798
Parents: 8a20936
Author: grey <gr...@apigee.com>
Authored: Sat Aug 30 13:52:45 2014 -0700
Committer: grey <gr...@apigee.com>
Committed: Sat Aug 30 13:52:45 2014 -0700

----------------------------------------------------------------------
 .../apns/NotificationsServiceIT.java            | 34 ++++++++++++--------
 1 file changed, 20 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/646b98c0/stack/services/src/test/java/org/apache/usergrid/services/notifications/apns/NotificationsServiceIT.java
----------------------------------------------------------------------
diff --git a/stack/services/src/test/java/org/apache/usergrid/services/notifications/apns/NotificationsServiceIT.java b/stack/services/src/test/java/org/apache/usergrid/services/notifications/apns/NotificationsServiceIT.java
index ed15eeb..cba47c4 100644
--- a/stack/services/src/test/java/org/apache/usergrid/services/notifications/apns/NotificationsServiceIT.java
+++ b/stack/services/src/test/java/org/apache/usergrid/services/notifications/apns/NotificationsServiceIT.java
@@ -225,26 +225,31 @@ public class NotificationsServiceIT extends AbstractServiceNotificationIT {
         ns.addDevice(notification, device);
 
         // verify Query for CREATED state
-        Query query = new Query();
-        query.addEqualityFilter("state", Notification.State.STARTED.toString());
+        Query query = Query.fromQL("select * where type = 'notification'");
+//        Query query = new Query();
+//        query.addEqualityFilter("state", Notification.State.STARTED.toString());
         Results results = app.getEm().searchCollection(
                 app.getEm().getApplicationRef(), "notifications", query);
-        Entity entity = results.getEntitiesMap().get(notification.getUuid());
-        assertNotNull(entity);
+        Notification note = (Notification) results.getEntitiesMap().get(notification.getUuid());
+        assertEquals(Notification.State.STARTED,note.getState());
 
         // perform push //
 
         ns.getQueueManager().processBatchAndReschedule(notification, null);
 
+        //app.getEm().refreshIndex();
         // verify Query for FINISHED state
-        query = new Query();
-        query.addEqualityFilter("state", Notification.State.FINISHED.toString());
+        query = Query.fromQL("select * where type = 'notification'");
+
+//        query = new Query();
+//        query.addEqualityFilter("state", Notification.State.FINISHED.toString());
         results = app.getEm().searchCollection(app.getEm().getApplicationRef(),
                 "notifications", query);
-        entity = results.getEntitiesMap().get(notification.getUuid());
-        assertNotNull(entity);
 
-        notification = (Notification) entity.toTypedEntity();
+        note = (Notification) results.getEntitiesMap().get(notification.getUuid());
+        assertEquals(Notification.State.FINISHED,note.getState());
+
+        notification = note;
         checkReceipts(notification, 0);
         checkStatistics(notification, 0, 0);
     }
@@ -277,13 +282,14 @@ public class NotificationsServiceIT extends AbstractServiceNotificationIT {
         Thread.sleep(500);
 
         // verify Query for SCHEDULED state
-        Query query = new Query();
-        query.addEqualityFilter("state",
-                Notification.State.SCHEDULED.toString());
+        Query query = Query.fromQL("select * where type = 'notification'");
+//        Query query = new Query();
+//        query.addEqualityFilter("state",
+//                Notification.State.SCHEDULED.toString());
         Results results = app.getEm().searchCollection(
                 app.getEm().getApplicationRef(), "notifications", query);
-        Entity entity = results.getEntitiesMap().get(notification.getUuid());
-        assertNotNull(entity);
+        Notification note = (Notification)results.getEntitiesMap().get(notification.getUuid());
+        assertNotNull(note);
 
         try {
             e = app.testRequest(ServiceAction.DELETE, 1, "notifications",


[20/52] [abbrv] git commit: Fixes incorrect exception thrown during errors

Posted by gr...@apache.org.
Fixes incorrect exception thrown during errors


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: b0c25987a35bcdce7885ed331727b200e26affa9
Parents: b2b54bb
Author: Todd Nine <to...@apache.org>
Authored: Thu Aug 28 18:28:56 2014 -0600
Committer: Todd Nine <to...@apache.org>
Committed: Thu Aug 28 18:28:56 2014 -0600

----------------------------------------------------------------------
 .../exception/WriteUniqueVerifyException.java     | 18 ------------------
 .../mvcc/stage/write/WriteUniqueVerify.java       |  7 ++-----
 2 files changed, 2 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b0c25987/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/exception/WriteUniqueVerifyException.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/exception/WriteUniqueVerifyException.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/exception/WriteUniqueVerifyException.java
index 710c429..64ca777 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/exception/WriteUniqueVerifyException.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/exception/WriteUniqueVerifyException.java
@@ -38,24 +38,6 @@ public class WriteUniqueVerifyException extends CollectionRuntimeException {
         this.violations = violations;
     }
 
-
-    public WriteUniqueVerifyException( MvccEntity entity, CollectionScope scope,
-            final String message, final Throwable cause ) {
-        super( entity, scope, message, cause );
-    }
-
-
-    public WriteUniqueVerifyException( MvccEntity entity, CollectionScope scope, final Throwable cause ) {
-        super( entity, scope, cause );
-    }
-
-
-    public WriteUniqueVerifyException( MvccEntity entity, CollectionScope scope,
-            final String message, final Throwable cause, final boolean enableSuppression,
-            final boolean writableStackTrace ) {
-        super( entity, scope, message, cause, enableSuppression, writableStackTrace );
-    }
-
     /**
      * Get map of Fields in violation, keyed by field name.
      */

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b0c25987/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java
index abec0c9..aa878cb 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java
@@ -119,9 +119,7 @@ public class WriteUniqueVerify implements
                             mb.execute();
                         }
                         catch ( ConnectionException ex ) {
-                            throw new WriteUniqueVerifyException( 
-                                    mvccEntity, ioevent.getEntityCollection(),
-                                    "Error writing unique value " + field.toString(), ex );
+                            throw new RuntimeException("Unable to write to cassandra", ex );
                         }
 
                         // does the database value match what we wrote?
@@ -130,8 +128,7 @@ public class WriteUniqueVerify implements
                             loaded = uniqueValueStrat.load( ioevent.getEntityCollection(), field );
                         }
                         catch ( ConnectionException ex ) {
-                            throw new WriteUniqueVerifyException( mvccEntity, ioevent.getEntityCollection(),
-                                    "Error verifying write", ex );
+                            throw new RuntimeException("Unable to read from cassandra", ex );
                         }
 
                         return new FieldUniquenessResult( 


[42/52] [abbrv] git commit: Adding properties file for corepersistence/common tests.

Posted by gr...@apache.org.
Adding properties file for corepersistence/common tests.


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: c9fd8211a78d63a46adff0ffb6241afc76592e99
Parents: 350489c
Author: Dave Johnson <dm...@apigee.com>
Authored: Tue Sep 2 16:46:29 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Tue Sep 2 16:46:29 2014 -0400

----------------------------------------------------------------------
 .gitignore                                            |  1 +
 .../src/test/resources/usergrid-UNIT.properties       | 14 ++++++++++++++
 2 files changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c9fd8211/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 3acc21a..4f7205a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -80,3 +80,4 @@ portal/js/templates.js
 /release/target/
 
 /portal/seleniumLog.txt
+!/stack/corepersistence/common/src/test/resources/usergrid-UNIT.properties
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c9fd8211/stack/corepersistence/common/src/test/resources/usergrid-UNIT.properties
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/test/resources/usergrid-UNIT.properties b/stack/corepersistence/common/src/test/resources/usergrid-UNIT.properties
new file mode 100644
index 0000000..7c8148d
--- /dev/null
+++ b/stack/corepersistence/common/src/test/resources/usergrid-UNIT.properties
@@ -0,0 +1,14 @@
+# Keep nothing but overriding test defaults in here
+cassandra.connections=50
+cassandra.port=9160
+cassandra.version=1.2
+cassandra.hosts=localhost
+cassandra.cluster_name=Usergrid
+collections.keyspace=Usergrid_Collections
+cassandra.timeout=5000
+cassandra.embedded=true
+
+collections.keyspace.strategy.options=replication_factor:1
+collections.keyspace.strategy.class=SimpleStrategy
+
+collection.stage.transient.timeout=5