usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject [16/52] [abbrv] git commit: Updates with merge from master.
Date Wed, 03 Sep 2014 22:11:11 GMT
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 <toddnine@apache.org>
Authored: Thu Aug 28 11:51:39 2014 -0600
Committer: Todd Nine <toddnine@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>
 


Mime
View raw message