You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sn...@apache.org on 2014/01/30 02:20:41 UTC
[01/50] [abbrv] git commit: Added 500 errors for missing exceptions.
Added a test case trying to verify that 500 is thrown back. (Currently test
case does not verify this)
Updated Branches:
refs/heads/USERGRID-2771-graph-edges 667184985 -> 2c6e7e486
Added 500 errors for missing exceptions.
Added a test case trying to verify that 500 is thrown back. (Currently test case does not verify this)
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/a55b18f1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/a55b18f1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/a55b18f1
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: a55b18f10e34fcc334cc964408b9f470684c7179
Parents: 5a57e87
Author: GERey <gr...@apigee.com>
Authored: Mon Jan 13 10:44:46 2014 -0800
Committer: GERey <gr...@apigee.com>
Committed: Mon Jan 13 10:44:46 2014 -0800
----------------------------------------------------------------------
.../rest/applications/ApplicationResource.java | 16 ++++++++++++++--
.../rest/applications/ApplicationResourceIT.java | 10 ++++++++++
2 files changed, 24 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a55b18f1/stack/rest/src/main/java/org/usergrid/rest/applications/ApplicationResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/usergrid/rest/applications/ApplicationResource.java b/stack/rest/src/main/java/org/usergrid/rest/applications/ApplicationResource.java
index bab56c8..ac9420c 100644
--- a/stack/rest/src/main/java/org/usergrid/rest/applications/ApplicationResource.java
+++ b/stack/rest/src/main/java/org/usergrid/rest/applications/ApplicationResource.java
@@ -74,8 +74,7 @@ import org.apache.shiro.codec.Base64;
import com.sun.jersey.api.json.JSONWithPadding;
import com.sun.jersey.api.view.Viewable;
-import static javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST;
-import static javax.servlet.http.HttpServletResponse.SC_OK;
+import static javax.servlet.http.HttpServletResponse.*;
import static javax.ws.rs.core.MediaType.APPLICATION_FORM_URLENCODED;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
@@ -245,6 +244,11 @@ public class ApplicationResource extends ServiceResource {
errorDescription = "user disabled";
}
catch ( Exception e1 ) {
+ logger.error( "Verification Error", e1 );
+ OAuthResponse res = OAuthResponse.errorResponse( SC_INTERNAL_SERVER_ERROR ).setError(e1.getMessage()).buildJSONMessage();
+ return Response.status( res.getResponseStatus() ).type( jsonMediaType( callback ) )
+ .entity( wrapWithCallback( res.getBody(), callback ) ).build();
+
}
}
else if ( "pin".equals( grant_type ) ) {
@@ -252,6 +256,10 @@ public class ApplicationResource extends ServiceResource {
user = management.verifyAppUserPinCredentials( services.getApplicationId(), username, pin );
}
catch ( Exception e1 ) {
+ logger.error( "Pin Verification Error", e1 );
+ OAuthResponse res = OAuthResponse.errorResponse( SC_INTERNAL_SERVER_ERROR).setError(e1.getMessage()).buildJSONMessage();
+ return Response.status( res.getResponseStatus() ).type( jsonMediaType( callback ) )
+ .entity( wrapWithCallback( res.getBody(), callback ) ).build();
}
}
else if ( "client_credentials".equals( grant_type ) ) {
@@ -263,6 +271,10 @@ public class ApplicationResource extends ServiceResource {
}
}
catch ( Exception e1 ) {
+ logger.error( "Client Credentials Error", e1 );
+ OAuthResponse res = OAuthResponse.errorResponse( SC_INTERNAL_SERVER_ERROR ).setError(e1.getMessage()).buildJSONMessage();
+ return Response.status( res.getResponseStatus() ).type( jsonMediaType( callback ) )
+ .entity( wrapWithCallback( res.getBody(), callback ) ).build();
}
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a55b18f1/stack/rest/src/test/java/org/usergrid/rest/applications/ApplicationResourceIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/usergrid/rest/applications/ApplicationResourceIT.java b/stack/rest/src/test/java/org/usergrid/rest/applications/ApplicationResourceIT.java
index e316bef..0207bd7 100644
--- a/stack/rest/src/test/java/org/usergrid/rest/applications/ApplicationResourceIT.java
+++ b/stack/rest/src/test/java/org/usergrid/rest/applications/ApplicationResourceIT.java
@@ -528,4 +528,14 @@ public class ApplicationResourceIT extends AbstractRestIT {
assertNotNull( node.get( "entities" ) );
}
+ @Test
+ public void pinExceptionVerification () throws Exception {
+ ApplicationInfo appinfo = setup.getMgmtSvc().getApplicationInfo( "test-organization/test-app" );
+
+ JsonNode node = resource().path( "/test-organization/test-app/token" ).queryParam( "username", "ed@anuff.com" )
+ .queryParam( "pin", "//b//a//!//$**$&#(bulrs" ).queryParam( "grant_type", "pin" )
+ .accept( MediaType.APPLICATION_JSON ).type( MediaType.APPLICATION_JSON_TYPE ).get( JsonNode.class );
+
+
+ }
}
[44/50] [abbrv] git commit: Prevent double debug logging.
Posted by sn...@apache.org.
Prevent double debug logging.
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/8773a183
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/8773a183
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/8773a183
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: 8773a183310181c2b6d8923cc550f5d916b90e73
Parents: 1aba620
Author: Dave Johnson <dm...@apigee.com>
Authored: Mon Jan 20 10:56:52 2014 -0500
Committer: Dave Johnson <dm...@apigee.com>
Committed: Mon Jan 20 10:56:52 2014 -0500
----------------------------------------------------------------------
stack/rest/src/test/resources/log4j.properties | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/8773a183/stack/rest/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/resources/log4j.properties b/stack/rest/src/test/resources/log4j.properties
index c660adb..34e591b 100644
--- a/stack/rest/src/test/resources/log4j.properties
+++ b/stack/rest/src/test/resources/log4j.properties
@@ -39,4 +39,4 @@ log4j.logger.org.usergrid.rest.security.AllowAjaxFilter=WARN, stdout
log4j.logger.me.prettyprint.hector.api.beans.AbstractComposite=ERROR, stdout
-#log4j.logger.org.apache.cassandra.service.StorageProxy=DEBUG, stdout
\ No newline at end of file
+log4j.logger.org.usergrid.rest.management=DEBUG
\ No newline at end of file
[13/50] [abbrv] git commit: Because of the way we initialize modules
and configurations we need to be able to access the available port finder
inside the collection module. I moved that over to the main source folder
instead of test and cleaned up some o
Posted by sn...@apache.org.
Because of the way we initialize modules and configurations we need
to be able to access the available port finder inside the collection
module. I moved that over to the main source folder instead of test
and cleaned up some of the code used to handle the thrift and gossip
ports for the CassandraRule. Also found a bug associated with running
in the UNIT deployment context in CassandraRule.
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/4c29d306
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/4c29d306
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/4c29d306
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: 4c29d3064d36fa608ec138456efd57f1e27c9309
Parents: a5bae70
Author: Alex Karasulu <ak...@gmail.com>
Authored: Wed Jan 15 18:35:51 2014 +0200
Committer: Alex Karasulu <ak...@gmail.com>
Committed: Wed Jan 15 18:35:51 2014 +0200
----------------------------------------------------------------------
.../astyanax/AstyanaxKeyspaceProvider.java | 2 +-
.../collection/astyanax/CassandraFig.java | 2 +-
.../cassandra/AvailablePortFinder.java | 187 +++++++++++++++++++
.../collection/guice/CollectionModule.java | 37 ++++
.../cassandra/AvailablePortFinder.java | 187 -------------------
.../collection/cassandra/CassandraRule.java | 22 +--
...MvccEntitySerializationStrategyImplTest.java | 21 +--
7 files changed, 233 insertions(+), 225 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4c29d306/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/AstyanaxKeyspaceProvider.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/AstyanaxKeyspaceProvider.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/AstyanaxKeyspaceProvider.java
index 512f2fa..e1fc105 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/AstyanaxKeyspaceProvider.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/AstyanaxKeyspaceProvider.java
@@ -38,7 +38,7 @@ public class AstyanaxKeyspaceProvider implements Provider<Keyspace> {
ConnectionPoolConfiguration connectionPoolConfiguration =
new ConnectionPoolConfigurationImpl( "UsergridConnectionPool" )
- .setPort( cassandraConfig.getPort() )
+ .setPort( cassandraConfig.getThriftPort() )
.setMaxConnsPerHost( cassandraConfig.getConnections() )
.setSeeds( cassandraConfig.getHosts() )
.setSocketTimeout( cassandraConfig.getTimeout() );
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4c29d306/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/CassandraFig.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/CassandraFig.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/CassandraFig.java
index 0728656..cfc361b 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/CassandraFig.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/CassandraFig.java
@@ -29,7 +29,7 @@ public interface CassandraFig extends GuicyFig {
@Key( "cassandra.port" )
@Default( "9160" )
- int getPort();
+ int getThriftPort();
@Key( "cassandra.connections" )
@Default( "20" )
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4c29d306/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/cassandra/AvailablePortFinder.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/cassandra/AvailablePortFinder.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/cassandra/AvailablePortFinder.java
new file mode 100644
index 0000000..f18d728
--- /dev/null
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/cassandra/AvailablePortFinder.java
@@ -0,0 +1,187 @@
+/*
+ * 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.collection.cassandra;
+
+
+import java.io.IOException;
+import java.net.DatagramSocket;
+import java.net.ServerSocket;
+import java.util.NoSuchElementException;
+import java.util.Set;
+import java.util.TreeSet;
+
+
+/**
+ * Finds currently available server ports.
+ *
+ * @author <a href="http://mina.apache.org">Apache MINA Project</a>
+ * @see <a href="http://www.iana.org/assignments/port-numbers">IANA.org</a>
+ */
+public class AvailablePortFinder {
+ /** The minimum number of server port number. */
+ public static final int MIN_PORT_NUMBER = 1;
+
+ /** The maximum number of server port number. */
+ public static final int MAX_PORT_NUMBER = 49151;
+
+
+ /** Creates a new instance. */
+ private AvailablePortFinder() {
+ // Do nothing
+ }
+
+
+ /**
+ * Returns the {@link java.util.Set} of currently available port numbers ({@link Integer}). This method is identical to
+ * <code>getAvailablePorts(MIN_PORT_NUMBER, MAX_PORT_NUMBER)</code>.
+ * <p/>
+ * WARNING: this can take a very long time.
+ */
+ public static Set<Integer> getAvailablePorts() {
+ return getAvailablePorts( MIN_PORT_NUMBER, MAX_PORT_NUMBER );
+ }
+
+
+ /**
+ * Gets an available port, selected by the system.
+ *
+ * @throws java.util.NoSuchElementException if there are no ports available
+ */
+ public static int getNextAvailable() {
+ ServerSocket serverSocket = null;
+
+ try {
+ // Here, we simply return an available port found by the system
+ serverSocket = new ServerSocket( 0 );
+ int port = serverSocket.getLocalPort();
+
+ // Don't forget to close the socket...
+ serverSocket.close();
+
+ return port;
+ }
+ catch ( IOException ioe ) {
+ throw new NoSuchElementException( ioe.getMessage() );
+ }
+ }
+
+
+ /**
+ * Gets the next available port starting at a port.
+ *
+ * @param fromPort the port to scan for availability
+ *
+ * @throws java.util.NoSuchElementException if there are no ports available
+ */
+ public static int getNextAvailable( int fromPort ) {
+ if ( fromPort < MIN_PORT_NUMBER || fromPort > MAX_PORT_NUMBER ) {
+ throw new IllegalArgumentException( "Invalid start port: " + fromPort );
+ }
+
+ for ( int i = fromPort; i <= MAX_PORT_NUMBER; i++ ) {
+ if ( available( i ) ) {
+ return i;
+ }
+ }
+
+ throw new NoSuchElementException( "Could not find an available port " + "above " + fromPort );
+ }
+
+
+ /**
+ * Checks to see if a specific port is available.
+ *
+ * @param port the port to check for availability
+ */
+ public static boolean available( int port ) {
+ if ( port < MIN_PORT_NUMBER || port > MAX_PORT_NUMBER ) {
+ throw new IllegalArgumentException( "Invalid start port: " + port );
+ }
+
+ ServerSocket ss = null;
+ DatagramSocket ds = null;
+
+ try {
+ ss = new ServerSocket( port );
+ ss.setReuseAddress( true );
+ ds = new DatagramSocket( port );
+ ds.setReuseAddress( true );
+ return true;
+ }
+ catch ( IOException e ) {
+ // Do nothing
+ }
+ finally {
+ if ( ds != null ) {
+ ds.close();
+ }
+
+ if ( ss != null ) {
+ try {
+ ss.close();
+ }
+ catch ( IOException e ) {
+ /* should not be thrown */
+ }
+ }
+ }
+
+ return false;
+ }
+
+
+ /**
+ * Returns the {@link java.util.Set} of currently avaliable port numbers ({@link Integer}) between the specified port range.
+ *
+ * @throws IllegalArgumentException if port range is not between {@link #MIN_PORT_NUMBER} and {@link
+ * #MAX_PORT_NUMBER} or <code>fromPort</code> if greater than <code>toPort</code>.
+ */
+ public static Set<Integer> getAvailablePorts( int fromPort, int toPort ) {
+ if ( fromPort < MIN_PORT_NUMBER || toPort > MAX_PORT_NUMBER || fromPort > toPort ) {
+ throw new IllegalArgumentException( "Invalid port range: " + fromPort + " ~ " + toPort );
+ }
+
+ Set<Integer> result = new TreeSet<Integer>();
+
+ for ( int i = fromPort; i <= toPort; i++ ) {
+ ServerSocket s = null;
+
+ try {
+ s = new ServerSocket( i );
+ result.add( new Integer( i ) );
+ }
+ catch ( IOException e ) {
+ // Do nothing
+ }
+ finally {
+ if ( s != null ) {
+ try {
+ s.close();
+ }
+ catch ( IOException e ) {
+ /* should not be thrown */
+ }
+ }
+ }
+ }
+
+ return result;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4c29d306/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/CollectionModule.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/CollectionModule.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/CollectionModule.java
index 8bc2a79..c35464b 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/CollectionModule.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/CollectionModule.java
@@ -1,12 +1,16 @@
package org.apache.usergrid.persistence.collection.guice;
+import java.io.IOException;
+
+import org.safehaus.guicyfig.Env;
import org.safehaus.guicyfig.GuicyFigModule;
import org.apache.usergrid.persistence.collection.EntityCollectionManager;
import org.apache.usergrid.persistence.collection.EntityCollectionManagerFactory;
import org.apache.usergrid.persistence.collection.EntityCollectionManagerSync;
import org.apache.usergrid.persistence.collection.astyanax.CassandraFig;
+import org.apache.usergrid.persistence.collection.cassandra.AvailablePortFinder;
import org.apache.usergrid.persistence.collection.impl.EntityCollectionManagerImpl;
import org.apache.usergrid.persistence.collection.impl.EntityCollectionManagerSyncImpl;
import org.apache.usergrid.persistence.collection.migration.MigrationManagerFig;
@@ -17,7 +21,10 @@ import org.apache.usergrid.persistence.collection.serialization.impl.Serializati
import org.apache.usergrid.persistence.collection.service.impl.ServiceModule;
import com.google.inject.AbstractModule;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
import com.google.inject.assistedinject.FactoryModuleBuilder;
+import com.netflix.config.ConfigurationManager;
import rx.Scheduler;
@@ -29,6 +36,36 @@ import rx.Scheduler;
*/
public class CollectionModule extends AbstractModule {
+ static {
+ /*
+ * --------------------------------------------------------------------
+ * Archaius Configuration Settings
+ * --------------------------------------------------------------------
+ */
+
+ try {
+ ConfigurationManager.loadCascadedPropertiesFromResources( "usergrid" );
+ }
+ catch ( IOException e ) {
+ throw new RuntimeException( "Cannot do much without properly loading our configuration.", e );
+ }
+
+ Injector injector = Guice.createInjector( new GuicyFigModule( CassandraFig.class, RxFig.class ) );
+ CassandraFig cassandraFig = injector.getInstance( CassandraFig.class );
+ RxFig rxFig = injector.getInstance( RxFig.class );
+
+ Env env = Env.getEnvironment();
+ if ( env == Env.UNIT || env == Env.ALL ) {
+ String thriftPort = String.valueOf( AvailablePortFinder.getNextAvailable() );
+ cassandraFig.bypass( "getThriftPort", thriftPort );
+ cassandraFig.bypass( "getConnections", "20" );
+ rxFig.bypass( "getMaxThreadCount", "20" );
+ cassandraFig.bypass( "getHosts", "localhost" );
+ cassandraFig.bypass( "getClusterName", "Usergrid" );
+ cassandraFig.bypass( "getKeyspaceName", "Usergrid_Collections" );
+ }
+ }
+
@Override
protected void configure() {
//noinspection unchecked
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4c29d306/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/cassandra/AvailablePortFinder.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/cassandra/AvailablePortFinder.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/cassandra/AvailablePortFinder.java
deleted file mode 100644
index f18d728..0000000
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/cassandra/AvailablePortFinder.java
+++ /dev/null
@@ -1,187 +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.collection.cassandra;
-
-
-import java.io.IOException;
-import java.net.DatagramSocket;
-import java.net.ServerSocket;
-import java.util.NoSuchElementException;
-import java.util.Set;
-import java.util.TreeSet;
-
-
-/**
- * Finds currently available server ports.
- *
- * @author <a href="http://mina.apache.org">Apache MINA Project</a>
- * @see <a href="http://www.iana.org/assignments/port-numbers">IANA.org</a>
- */
-public class AvailablePortFinder {
- /** The minimum number of server port number. */
- public static final int MIN_PORT_NUMBER = 1;
-
- /** The maximum number of server port number. */
- public static final int MAX_PORT_NUMBER = 49151;
-
-
- /** Creates a new instance. */
- private AvailablePortFinder() {
- // Do nothing
- }
-
-
- /**
- * Returns the {@link java.util.Set} of currently available port numbers ({@link Integer}). This method is identical to
- * <code>getAvailablePorts(MIN_PORT_NUMBER, MAX_PORT_NUMBER)</code>.
- * <p/>
- * WARNING: this can take a very long time.
- */
- public static Set<Integer> getAvailablePorts() {
- return getAvailablePorts( MIN_PORT_NUMBER, MAX_PORT_NUMBER );
- }
-
-
- /**
- * Gets an available port, selected by the system.
- *
- * @throws java.util.NoSuchElementException if there are no ports available
- */
- public static int getNextAvailable() {
- ServerSocket serverSocket = null;
-
- try {
- // Here, we simply return an available port found by the system
- serverSocket = new ServerSocket( 0 );
- int port = serverSocket.getLocalPort();
-
- // Don't forget to close the socket...
- serverSocket.close();
-
- return port;
- }
- catch ( IOException ioe ) {
- throw new NoSuchElementException( ioe.getMessage() );
- }
- }
-
-
- /**
- * Gets the next available port starting at a port.
- *
- * @param fromPort the port to scan for availability
- *
- * @throws java.util.NoSuchElementException if there are no ports available
- */
- public static int getNextAvailable( int fromPort ) {
- if ( fromPort < MIN_PORT_NUMBER || fromPort > MAX_PORT_NUMBER ) {
- throw new IllegalArgumentException( "Invalid start port: " + fromPort );
- }
-
- for ( int i = fromPort; i <= MAX_PORT_NUMBER; i++ ) {
- if ( available( i ) ) {
- return i;
- }
- }
-
- throw new NoSuchElementException( "Could not find an available port " + "above " + fromPort );
- }
-
-
- /**
- * Checks to see if a specific port is available.
- *
- * @param port the port to check for availability
- */
- public static boolean available( int port ) {
- if ( port < MIN_PORT_NUMBER || port > MAX_PORT_NUMBER ) {
- throw new IllegalArgumentException( "Invalid start port: " + port );
- }
-
- ServerSocket ss = null;
- DatagramSocket ds = null;
-
- try {
- ss = new ServerSocket( port );
- ss.setReuseAddress( true );
- ds = new DatagramSocket( port );
- ds.setReuseAddress( true );
- return true;
- }
- catch ( IOException e ) {
- // Do nothing
- }
- finally {
- if ( ds != null ) {
- ds.close();
- }
-
- if ( ss != null ) {
- try {
- ss.close();
- }
- catch ( IOException e ) {
- /* should not be thrown */
- }
- }
- }
-
- return false;
- }
-
-
- /**
- * Returns the {@link java.util.Set} of currently avaliable port numbers ({@link Integer}) between the specified port range.
- *
- * @throws IllegalArgumentException if port range is not between {@link #MIN_PORT_NUMBER} and {@link
- * #MAX_PORT_NUMBER} or <code>fromPort</code> if greater than <code>toPort</code>.
- */
- public static Set<Integer> getAvailablePorts( int fromPort, int toPort ) {
- if ( fromPort < MIN_PORT_NUMBER || toPort > MAX_PORT_NUMBER || fromPort > toPort ) {
- throw new IllegalArgumentException( "Invalid port range: " + fromPort + " ~ " + toPort );
- }
-
- Set<Integer> result = new TreeSet<Integer>();
-
- for ( int i = fromPort; i <= toPort; i++ ) {
- ServerSocket s = null;
-
- try {
- s = new ServerSocket( i );
- result.add( new Integer( i ) );
- }
- catch ( IOException e ) {
- // Do nothing
- }
- finally {
- if ( s != null ) {
- try {
- s.close();
- }
- catch ( IOException e ) {
- /* should not be thrown */
- }
- }
- }
- }
-
- return result;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4c29d306/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/cassandra/CassandraRule.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/cassandra/CassandraRule.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/cassandra/CassandraRule.java
index ab94574..a9123c1 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/cassandra/CassandraRule.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/cassandra/CassandraRule.java
@@ -4,6 +4,7 @@ package org.apache.usergrid.persistence.collection.cassandra;
import java.io.File;
import java.io.IOException;
+import org.safehaus.guicyfig.Env;
import org.safehaus.guicyfig.EnvironResource;
import org.safehaus.guicyfig.GuicyFigModule;
import org.slf4j.Logger;
@@ -25,10 +26,6 @@ import com.netflix.astyanax.test.EmbeddedCassandra;
public class CassandraRule extends EnvironResource {
private static final Logger LOG = LoggerFactory.getLogger( CassandraRule.class );
- public static final int THRIFT_PORT = AvailablePortFinder.getNextAvailable();
- public static final int GOSSIP_PORT = AvailablePortFinder.getNextAvailable();
- public static final String THRIFT_PORT_STR = Integer.toString( THRIFT_PORT );
-
private static final Object mutex = new Object();
private static EmbeddedCassandra cass;
@@ -39,7 +36,7 @@ public class CassandraRule extends EnvironResource {
public CassandraRule() {
- super();
+ super( Env.UNIT );
Injector injector = Guice.createInjector( new GuicyFigModule( CassandraFig.class ) );
cassandraFig = injector.getInstance( CassandraFig.class );
@@ -53,11 +50,6 @@ public class CassandraRule extends EnvironResource {
@Override
protected void before() throws Throwable {
- cassandraFig.override( "getPort", THRIFT_PORT_STR );
- cassandraFig.override( "getConnections", "20" );
- cassandraFig.override( "getHosts", "localhost" );
- cassandraFig.override( "getClusterName", "Usergrid" );
- cassandraFig.override( "getKeyspaceName", "Usergrid_Collections" );
if ( started ) {
return;
@@ -65,13 +57,6 @@ public class CassandraRule extends EnvironResource {
synchronized ( mutex ) {
- //we're late to the party, bail
- if ( started ) {
- return;
- }
-
- cassandraFig.bypass( "getPort", THRIFT_PORT_STR );
-
File dataDir = Files.createTempDir();
dataDir.deleteOnExit();
@@ -83,7 +68,8 @@ public class CassandraRule extends EnvironResource {
try {
LOG.info( "Starting cassandra" );
- cass = new EmbeddedCassandra( dataDir, "Usergrid", THRIFT_PORT, GOSSIP_PORT );
+ cass = new EmbeddedCassandra( dataDir, "Usergrid", cassandraFig.getThriftPort(),
+ AvailablePortFinder.getNextAvailable() );
cass.start();
LOG.info( "Cassandra started" );
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4c29d306/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
index 97dc803..c18158d 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
@@ -16,6 +16,7 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.safehaus.chop.api.IterationChop;
import org.safehaus.guicyfig.Env;
+import org.safehaus.guicyfig.GuicyFigModule;
import org.safehaus.guicyfig.Option;
import org.safehaus.guicyfig.Overrides;
@@ -45,7 +46,9 @@ import org.apache.usergrid.persistence.model.field.UUIDField;
import org.apache.usergrid.persistence.model.util.UUIDGenerator;
import com.google.common.base.Optional;
+import com.google.inject.Guice;
import com.google.inject.Inject;
+import com.google.inject.Injector;
import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
import com.netflix.config.ConfigurationManager;
@@ -66,20 +69,6 @@ public class MvccEntitySerializationStrategyImplTest {
/** Our RX I/O threads and this should have the same value */
private static final String CONNECTION_COUNT = "20";
- static {
- /*
- * --------------------------------------------------------------------
- * Archaius Configuration Settings
- * --------------------------------------------------------------------
- */
-
- try {
- ConfigurationManager.loadCascadedPropertiesFromResources( "usergrid" );
- }
- catch ( IOException e ) {
- throw new RuntimeException( "Cannot do much without properly loading our configuration.", e );
- }
- }
@Inject
private MvccEntitySerializationStrategy serializationStrategy;
@@ -122,12 +111,8 @@ public class MvccEntitySerializationStrategyImplTest {
@Before
public void setupClass() {
-
assertNotNull( cassandraFig );
- cassandraFig.bypass( "getPort", CassandraRule.THRIFT_PORT_STR );
-
assertNotNull( rxFig );
- rxFig.bypass( "getMaxThreadCount", CassandraRule.THRIFT_PORT_STR );
}
[41/50] [abbrv] git commit: merging in changes from upstream master
Posted by sn...@apache.org.
merging in changes from upstream 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/8781eaf7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/8781eaf7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/8781eaf7
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: 8781eaf760bc71b869bc2af4b183c6aa64ca2ab3
Parents: 59f1b4e d8459de
Author: Alex Karasulu <ak...@gmail.com>
Authored: Mon Jan 20 06:41:24 2014 +0200
Committer: Alex Karasulu <ak...@gmail.com>
Committed: Mon Jan 20 06:41:24 2014 +0200
----------------------------------------------------------------------
stack/corepersistence/collection/pom.xml | 454 +++++-----
.../DynamicCompositeFieldSerializer.java | 48 +
.../IdColDynamicCompositeSerializer.java | 87 ++
.../astyanax/MultiTennantColumnFamily.java | 16 +-
.../exception/CollectionRuntimeException.java | 18 +-
.../collection/guice/CollectionModule.java | 31 +-
.../collection/mvcc/entity/ValidationUtils.java | 1 -
.../mvcc/stage/write/EntityVersion.java | 62 ++
.../stage/write/EntityVersionSerializer.java | 67 ++
.../mvcc/stage/write/FieldSerializer.java | 102 +++
.../mvcc/stage/write/UniqueValue.java | 37 +
.../mvcc/stage/write/UniqueValueImpl.java | 121 +++
.../write/UniqueValueSerializationStrategy.java | 64 ++
.../UniqueValueSerializationStrategyImpl.java | 171 ++++
.../mvcc/stage/write/WriteCommit.java | 64 +-
.../collection/mvcc/stage/write/WriteFig.java | 42 +
.../mvcc/stage/write/WriteUniqueVerify.java | 159 +++-
.../collection/serialization/UniqueUpdate.java | 28 -
.../impl/CollectionScopedRowKeySerializer.java | 38 +-
.../MvccEntitySerializationStrategyImpl.java | 21 +-
.../MvccLogEntrySerializationStrategyImpl.java | 20 +-
.../serialization/impl/SerializationModule.java | 2 +
.../collection/EntityCollectionManagerIT.java | 61 +-
.../changelog/ChangeLogGeneratorImplTest.java | 20 -
.../mvcc/stage/AbstractEntityStageTest.java | 17 +
.../mvcc/stage/AbstractIdStageTest.java | 17 +
.../mvcc/stage/AbstractMvccEntityStageTest.java | 76 +-
.../mvcc/stage/InvalidMvccEntityGenerator.java | 118 ---
.../mvcc/stage/TestEntityGenerator.java | 17 +
.../mvcc/stage/delete/DeleteCommitTest.java | 5 +-
.../write/EntityVersionSerializerTest.java | 40 +
.../mvcc/stage/write/FieldSerializerTest.java | 47 +
...niqueValueSerializationStrategyImplTest.java | 121 +++
.../mvcc/stage/write/WriteCommitTest.java | 26 +-
.../mvcc/stage/write/WriteStartTest.java | 17 +
.../mvcc/stage/write/WriteUniqueVerifyTest.java | 66 +-
.../impl/ScopedRowKeySerializerTest.java | 7 +-
.../collection/util/InvalidEntityGenerator.java | 31 +-
.../collection/util/InvalidIdGenerator.java | 69 +-
.../util/InvalidMvccEntityGenerator.java | 144 +++
.../src/test/resources/log4j.properties | 5 +-
stack/corepersistence/graph/pom.xml | 106 +--
.../DynamicCompositeFieldSerializer.java | 53 --
.../IdColDynamicCompositeSerializer.java | 93 --
.../impl/EdgeMetadataSerializationImpl.java | 3 +-
.../impl/EdgeSerializationImpl.java | 2 +-
.../persistence/graph/EdgeManagerIT.java | 8 +-
.../persistence/model/field/AbstractField.java | 43 +-
.../persistence/model/field/BooleanField.java | 22 +-
.../persistence/model/field/DoubleField.java | 33 +-
.../usergrid/persistence/model/field/Field.java | 5 +
.../persistence/model/field/IntegerField.java | 33 +-
.../persistence/model/field/LongField.java | 35 +-
.../persistence/model/field/StringField.java | 36 +-
.../persistence/model/field/UUIDField.java | 37 +-
.../persistence/model/field/EntityTest.java | 4 +-
stack/corepersistence/pom.xml | 108 ++-
stack/pom.xml | 1 +
stack/query-validator/.gitignore | 1 +
stack/query-validator/README.md | 3 +
stack/query-validator/pom.xml | 235 +++--
stack/query-validator/sql.db | Bin 4096 -> 0 bytes
.../query/validator/ApiServerRunner.java | 49 +-
.../validator/DefaultQueryResultsMatcher.java | 32 +
.../usergrid/query/validator/QueryEntity.java | 31 +-
.../usergrid/query/validator/QueryRequest.java | 31 +-
.../usergrid/query/validator/QueryResponse.java | 22 +-
.../query/validator/QueryResultsMatcher.java | 29 +
.../usergrid/query/validator/QueryRunner.java | 23 +-
.../validator/QueryValidationConfiguration.java | 22 +-
.../query/validator/QueryValidator.java | 33 +-
.../usergrid/query/validator/SqliteRunner.java | 60 +-
.../usergrid-query-validator-context.xml | 16 +-
.../query/validator/AbstractQueryIT.java | 133 +++
.../usergrid/query/validator/QueryITSuite.java | 39 +
.../query/validator/QueryValidationTest.java | 339 -------
.../query/validator/QueryValidatorRunner.java | 209 -----
.../query/validator/users/UserQueryIT.java | 877 +++++++++++++++++++
.../src/test/resources/log4j.properties | 2 +-
.../src/test/resources/project.properties | 1 +
.../src/test/resources/user.json | 15 +-
.../resources/usergrid-custom-test.properties | 13 +-
.../test/resources/usergrid-test-context.xml | 24 +-
.../test/java/org/usergrid/rest/ITSetup.java | 9 +-
.../java/org/usergrid/rest/TomcatResource.java | 23 +-
.../cassandra/ManagementServiceImpl.java | 32 +-
86 files changed, 3860 insertions(+), 1622 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/8781eaf7/stack/corepersistence/collection/pom.xml
----------------------------------------------------------------------
diff --cc stack/corepersistence/collection/pom.xml
index e36371f,c004aa9..29a0c6b
--- a/stack/corepersistence/collection/pom.xml
+++ b/stack/corepersistence/collection/pom.xml
@@@ -2,241 -2,178 +2,241 @@@
<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/xsd/maven-4.0.0.xsd">
- <parent>
- <artifactId>persistence</artifactId>
- <groupId>org.apache.usergrid</groupId>
- <version>1.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <description>The module for handling all scope I/O</description>
+
+ <properties>
+ <guice.version>3.0</guice.version>
+ <guicyfig.version>3.3-SNAPSHOT</guicyfig.version>
+ <slf4j.version>1.7.2</slf4j.version>
+ <log4j.version>1.2.17</log4j.version>
+ <chop.version>1.0-SNAPSHOT</chop.version>
+ </properties>
+
- <artifactId>collection</artifactId>
-
- <build>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>true</filtering>
- <includes>
- <include>**/*.properties</include>
- </includes>
- </resource>
- </resources>
-
- <testResources>
- <testResource>
- <directory>src/test/resources</directory>
- <filtering>true</filtering>
- <includes>
- <include>**/*.properties</include>
- </includes>
- </testResource>
- </testResources>
-
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <version>2.4</version>
- <executions>
- <execution>
- <goals>
- <goal>test-jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.safehaus.chop</groupId>
- <artifactId>chop-maven-plugin</artifactId>
+ <parent>
+ <artifactId>persistence</artifactId>
+ <groupId>org.apache.usergrid</groupId>
<version>1.0-SNAPSHOT</version>
-
- <!--
- NOTE: you should be putting most of these variables into your settings.xml
- as an automatically activated profile.
- -->
-
- <configuration>
- <accessKey>${aws.s3.key}</accessKey>
- <secretKey>${aws.s3.secret}</secretKey>
- <availabilityZone>${availabilityZone}</availabilityZone>
- <bucketName>${aws.s3.bucket}</bucketName>
- <managerAppUsername>admin</managerAppUsername>
- <managerAppPassword>${manager.app.password}</managerAppPassword>
- <testPackageBase>org.apache.usergrid</testPackageBase>
- <runnerSSHKeyFile>${runner.ssh.key.file}</runnerSSHKeyFile>
- <failIfCommitNecessary>false</failIfCommitNecessary>
- <amiID>${ami.id}</amiID>
- <instanceType>m1.large</instanceType>
- <resultsDirectory>${resultsDirectory}</resultsDirectory>
- <dumpType>${dumpType}</dumpType>
- <coldRestartTomcat>true</coldRestartTomcat>
- <awsSecurityGroup>${security.group}</awsSecurityGroup>
- <runnerKeyPairName>${runner.keypair.name}</runnerKeyPairName>
- <runnerCount>12</runnerCount>
- <securityGroupExceptions>
- <!--
- Add your own IP address as an exception to allow access
- but please do this in the settings.xml file .. essentially
- all parameters should be in the settings.xml file.
- -->
- <param>${myip.address}/32:8080</param>
- <param>${myip.address}/32:22</param>
- </securityGroupExceptions>
- </configuration>
- </plugin>
-
- </plugins>
- </build>
-
- <dependencies>
-
- <!-- Depends on the basic models -->
- <dependency>
- <groupId>${project.parent.groupId}</groupId>
- <artifactId>model</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>com.netflix.astyanax</groupId>
- <artifactId>astyanax-core</artifactId>
- <version>${astyanax.version}</version>
- </dependency>
-
- <dependency>
- <groupId>com.netflix.astyanax</groupId>
- <artifactId>astyanax-thrift</artifactId>
- <version>${astyanax.version}</version>
- </dependency>
-
- <dependency>
- <groupId>com.netflix.astyanax</groupId>
- <artifactId>astyanax-cassandra</artifactId>
- <version>${astyanax.version}</version>
- <exclusions>
- <exclusion>
- <artifactId>servlet-api</artifactId>
- <groupId>org.mortbay.jetty</groupId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.safehaus.guicyfig</groupId>
- <artifactId>guicyfig</artifactId>
- <version>${guicyfig.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.safehaus.chop</groupId>
- <artifactId>chop-api</artifactId>
- <version>${chop.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.jukito</groupId>
- <artifactId>jukito</artifactId>
- <version>${jukito.version}</version>
- <scope>test</scope>
- </dependency>
-
- <!-- lang utils for setting uuids etc -->
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-lang3</artifactId>
- <version>3.1</version>
- </dependency>
- <!-- Serialization libraries -->
-
- <dependency>
- <groupId>org.codehaus.jackson</groupId>
- <artifactId>jackson-smile</artifactId>
- <version>1.9.13</version>
- </dependency>
-
- <dependency>
- <groupId>com.esotericsoftware.kryo</groupId>
- <artifactId>kryo</artifactId>
- <version>2.22</version>
- </dependency>
-
- <!-- helper serializers for kryo -->
- <dependency>
- <groupId>de.javakaffee</groupId>
- <artifactId>kryo-serializers</artifactId>
- <version>0.26</version>
- </dependency>
-
- <!-- Google Guice -->
- <dependency>
- <groupId>com.google.inject</groupId>
- <artifactId>guice</artifactId>
- <version>${guice.version}</version>
- </dependency>
-
- <!-- RX java -->
-
-
- <dependency>
- <groupId>com.netflix.rxjava</groupId>
- <artifactId>rxjava-core</artifactId>
- <version>0.15.1</version>
- </dependency>
-
- <dependency>
- <groupId>com.google.inject.extensions</groupId>
- <artifactId>guice-multibindings</artifactId>
- <version>${guice.version}</version>
- </dependency>
-
- <dependency>
- <groupId>com.google.inject.extensions</groupId>
- <artifactId>guice-assistedinject</artifactId>
- <version>${guice.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>${slf4j.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>${slf4j.version}</version>
- </dependency>
-
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>${log4j.version}</version>
- </dependency>
-
- <dependency>
- <groupId>com.netflix.hystrix</groupId>
- <artifactId>hystrix-core</artifactId>
- <version>${hystrix.version}</version>
- </dependency>
- <!-- Google Guice Integration Test Injectors -->
-
- <dependency>
- <groupId>${project.parent.groupId}</groupId>
- <artifactId>testutils</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <description>The module for handling all scope I/O</description>
+
+ <artifactId>collection</artifactId>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ <includes>
+ <include>**/*.properties</include>
+ </includes>
+ </resource>
+ </resources>
+
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ <filtering>true</filtering>
+ <includes>
+ <include>**/*.properties</include>
+ </includes>
+ </testResource>
+ </testResources>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.4</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
- </plugins>
++
++ <plugin>
++ <groupId>org.safehaus.chop</groupId>
++ <artifactId>chop-maven-plugin</artifactId>
++ <version>1.0-SNAPSHOT</version>
++
++ <!--
++ NOTE: you should be putting most of these variables into your settings.xml
++ as an automatically activated profile.
++ -->
++
++ <configuration>
++ <accessKey>${aws.s3.key}</accessKey>
++ <secretKey>${aws.s3.secret}</secretKey>
++ <availabilityZone>${availabilityZone}</availabilityZone>
++ <bucketName>${aws.s3.bucket}</bucketName>
++ <managerAppUsername>admin</managerAppUsername>
++ <managerAppPassword>${manager.app.password}</managerAppPassword>
++ <testPackageBase>org.apache.usergrid</testPackageBase>
++ <runnerSSHKeyFile>${runner.ssh.key.file}</runnerSSHKeyFile>
++ <failIfCommitNecessary>false</failIfCommitNecessary>
++ <amiID>${ami.id}</amiID>
++ <instanceType>m1.large</instanceType>
++ <resultsDirectory>${resultsDirectory}</resultsDirectory>
++ <dumpType>${dumpType}</dumpType>
++ <coldRestartTomcat>true</coldRestartTomcat>
++ <awsSecurityGroup>${security.group}</awsSecurityGroup>
++ <runnerKeyPairName>${runner.keypair.name}</runnerKeyPairName>
++ <runnerCount>12</runnerCount>
++ <securityGroupExceptions>
++ <!--
++ Add your own IP address as an exception to allow access
++ but please do this in the settings.xml file .. essentially
++ all parameters should be in the settings.xml file.
++ -->
++ <param>${myip.address}/32:8080</param>
++ <param>${myip.address}/32:22</param>
++ </securityGroupExceptions>
++ </configuration>
++ </plugin>
++ </plugins>
+ </build>
+
+ <dependencies>
+
++ <dependency>
++ <groupId>org.safehaus.chop</groupId>
++ <artifactId>chop-api</artifactId>
++ <version>${chop.version}</version>
++ </dependency>
++
++ <!-- Google Guice Integration Test Injectors -->
++
++ <dependency>
++ <groupId>${project.parent.groupId}</groupId>
++ <artifactId>testutils</artifactId>
++ <version>${project.version}</version>
++ <scope>test</scope>
++ </dependency>
++
+ <!-- Depends on the basic models -->
+ <dependency>
+ <groupId>${project.parent.groupId}</groupId>
+ <artifactId>model</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.netflix.astyanax</groupId>
+ <artifactId>astyanax-core</artifactId>
+ <version>${astyanax.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.netflix.astyanax</groupId>
+ <artifactId>astyanax-thrift</artifactId>
+ <version>${astyanax.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.netflix.astyanax</groupId>
+ <artifactId>astyanax-cassandra</artifactId>
+ <version>${astyanax.version}</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>servlet-api</artifactId>
+ <groupId>org.mortbay.jetty</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.safehaus.guicyfig</groupId>
+ <artifactId>guicyfig</artifactId>
+ <version>${guicyfig.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jukito</groupId>
+ <artifactId>jukito</artifactId>
+ <version>${jukito.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- lang utils for setting uuids etc -->
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <version>3.1</version>
+ </dependency>
+ <!-- Serialization libraries -->
+
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-smile</artifactId>
+ <version>1.9.13</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.esotericsoftware.kryo</groupId>
+ <artifactId>kryo</artifactId>
+ <version>2.22</version>
+ </dependency>
+
+ <!-- helper serializers for kryo -->
+ <dependency>
+ <groupId>de.javakaffee</groupId>
+ <artifactId>kryo-serializers</artifactId>
+ <version>0.26</version>
+ </dependency>
+
+ <!-- Google Guice -->
+ <dependency>
+ <groupId>com.google.inject</groupId>
+ <artifactId>guice</artifactId>
+ <version>${guice.version}</version>
+ </dependency>
+
+ <!-- RX java -->
+
+
+ <dependency>
+ <groupId>com.netflix.rxjava</groupId>
+ <artifactId>rxjava-core</artifactId>
+ <version>0.15.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.google.inject.extensions</groupId>
+ <artifactId>guice-multibindings</artifactId>
+ <version>${guice.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.google.inject.extensions</groupId>
+ <artifactId>guice-assistedinject</artifactId>
+ <version>${guice.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>${slf4j.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>${slf4j.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>${log4j.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.netflix.hystrix</groupId>
+ <artifactId>hystrix-core</artifactId>
+ <version>${hystrix.version}</version>
+ </dependency>
+
+ </dependencies>
-
</project>
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/8781eaf7/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/CollectionModule.java
----------------------------------------------------------------------
diff --cc stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/CollectionModule.java
index c35464b,294c5fc..624a039
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/CollectionModule.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/CollectionModule.java
@@@ -1,9 -1,22 +1,25 @@@
+ /*
+ * 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.
+ */
package org.apache.usergrid.persistence.collection.guice;
-
+import java.io.IOException;
+
+import org.safehaus.guicyfig.Env;
import org.safehaus.guicyfig.GuicyFigModule;
import org.apache.usergrid.persistence.collection.EntityCollectionManager;
@@@ -21,10 -33,10 +37,13 @@@ import org.apache.usergrid.persistence.
import org.apache.usergrid.persistence.collection.service.impl.ServiceModule;
import com.google.inject.AbstractModule;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
import com.google.inject.assistedinject.FactoryModuleBuilder;
+import com.netflix.config.ConfigurationManager;
+ import org.apache.usergrid.persistence.collection.mvcc.stage.write.UniqueValueSerializationStrategy;
+ import org.apache.usergrid.persistence.collection.mvcc.stage.write.UniqueValueSerializationStrategyImpl;
+ import org.apache.usergrid.persistence.collection.mvcc.stage.write.WriteFig;
import rx.Scheduler;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/8781eaf7/stack/corepersistence/collection/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --cc stack/corepersistence/collection/src/test/resources/log4j.properties
index bf81401,8a482db..eaf889c
--- a/stack/corepersistence/collection/src/test/resources/log4j.properties
+++ b/stack/corepersistence/collection/src/test/resources/log4j.properties
@@@ -1,13 -1,8 +1,14 @@@
# suppress inspection "UnusedProperty" for whole file
- log4j.rootLogger=DEBUG,stdout
- log4j.rootCategory=DEBUG,stdout
+ log4j.rootLogger=INFO,standard
-log4j.appender.standard=org.apache.log4j.ConsoleAppender
-log4j.appender.standard.layout=org.apache.log4j.PatternLayout
-log4j.appender.standard.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %p %c{3}.%M(%L)<%t>- %m%n
+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.org.apache.usergrid=DEBUG
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/8781eaf7/stack/corepersistence/model/src/test/java/org/apache/usergrid/persistence/model/field/EntityTest.java
----------------------------------------------------------------------
diff --cc stack/corepersistence/model/src/test/java/org/apache/usergrid/persistence/model/field/EntityTest.java
index c04d807,c04d807..c450263
--- a/stack/corepersistence/model/src/test/java/org/apache/usergrid/persistence/model/field/EntityTest.java
+++ b/stack/corepersistence/model/src/test/java/org/apache/usergrid/persistence/model/field/EntityTest.java
@@@ -14,8 -14,8 +14,8 @@@ import org.apache.usergrid.persistence.
import org.apache.usergrid.persistence.model.entity.SimpleId;
import org.apache.usergrid.persistence.model.util.UUIDGenerator;
--import static junit.framework.Assert.assertEquals;
--import static junit.framework.Assert.assertSame;
++import static junit.framework.TestCase.assertEquals;
++import static junit.framework.TestCase.assertSame;
import static org.junit.Assert.assertTrue;
[17/50] [abbrv] git commit: upping runners and fixing hardcoded ip
addresses in properties file,
and ignoring the jssecacerts generated while running
Posted by sn...@apache.org.
upping runners and fixing hardcoded ip addresses in properties file, and ignoring the jssecacerts generated while running
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/480d525a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/480d525a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/480d525a
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: 480d525a4b9ee7447d932e1d8ca4d8237b770bf3
Parents: 4c29d30
Author: Alex Karasulu <ak...@gmail.com>
Authored: Wed Jan 15 23:56:02 2014 +0200
Committer: Alex Karasulu <ak...@gmail.com>
Committed: Wed Jan 15 23:56:02 2014 +0200
----------------------------------------------------------------------
stack/.gitignore | 1 +
stack/corepersistence/collection.tgz | Bin 0 -> 47520 bytes
stack/corepersistence/collection/pom.xml | 4 ++--
.../src/test/resources/usergrid-CHOP.properties | 16 +++++-----------
4 files changed, 8 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/480d525a/stack/.gitignore
----------------------------------------------------------------------
diff --git a/stack/.gitignore b/stack/.gitignore
index bc54518..d3b96af 100644
--- a/stack/.gitignore
+++ b/stack/.gitignore
@@ -1,4 +1,5 @@
.idea
+jssecacerts
.sonar-ide.properties
.clover
atlassian-ide-plugin.xml
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/480d525a/stack/corepersistence/collection.tgz
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection.tgz b/stack/corepersistence/collection.tgz
new file mode 100644
index 0000000..1f152ca
Binary files /dev/null and b/stack/corepersistence/collection.tgz differ
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/480d525a/stack/corepersistence/collection/pom.xml
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/pom.xml b/stack/corepersistence/collection/pom.xml
index bc62409..29dba1c 100644
--- a/stack/corepersistence/collection/pom.xml
+++ b/stack/corepersistence/collection/pom.xml
@@ -77,8 +77,8 @@
<amiID>${ami.id}</amiID>
<awsSecurityGroup>${security.group}</awsSecurityGroup>
<runnerKeyPairName>${runner.keypair.name}</runnerKeyPairName>
- <minimumRunners>5</minimumRunners>
- <maximumRunners>8</maximumRunners>
+ <minimumRunners>6</minimumRunners>
+ <maximumRunners>9</maximumRunners>
<securityGroupExceptions>
<!--
Add your own IP address as an exception to allow access
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/480d525a/stack/corepersistence/collection/src/test/resources/usergrid-CHOP.properties
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/resources/usergrid-CHOP.properties b/stack/corepersistence/collection/src/test/resources/usergrid-CHOP.properties
index e05f487..d9c72be 100644
--- a/stack/corepersistence/collection/src/test/resources/usergrid-CHOP.properties
+++ b/stack/corepersistence/collection/src/test/resources/usergrid-CHOP.properties
@@ -1,18 +1,12 @@
# These are for CHOP environment settings
-#cassandra.connections=${cassandra.connections}
-#cassandra.port=9160
-#cassandra.version=1.2
-#cassandra.hosts=${cassandra.hosts}
-#cassandra.cluster_name=Usergrid
-#collections.keyspace=Usergrid_Collections
-#cassandra.timeout=5000
-
-
-cassandra.connections=10
+cassandra.connections=20
cassandra.port=9160
cassandra.version=1.2
-cassandra.hosts=54.224.205.239, 107.21.155.136, 54.205.144.212, 23.22.49.179, 23.22.49.179, 54.242.63.170
+
+# a comma delimited private IP address list to your chop cassandra cluster
+# define this in your settings.xml and have it as an always active profile
+cassandra.hosts=${chop.cassandra.hosts}
cassandra.cluster_name=Usergrid
collections.keyspace=Usergrid_Collections
cassandra.timeout=5000
[38/50] [abbrv] git commit: adding the instanceType
Posted by sn...@apache.org.
adding the instanceType
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/30f2d5a9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/30f2d5a9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/30f2d5a9
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: 30f2d5a9df11154be09515f5852211d1458df5f5
Parents: 93ad3b1
Author: Alex Karasulu <ak...@gmail.com>
Authored: Sat Jan 18 05:36:32 2014 +0200
Committer: Alex Karasulu <ak...@gmail.com>
Committed: Sat Jan 18 05:36:32 2014 +0200
----------------------------------------------------------------------
stack/corepersistence/collection/pom.xml | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/30f2d5a9/stack/corepersistence/collection/pom.xml
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/pom.xml b/stack/corepersistence/collection/pom.xml
index 731f6b0..91a0993 100644
--- a/stack/corepersistence/collection/pom.xml
+++ b/stack/corepersistence/collection/pom.xml
@@ -76,6 +76,7 @@
<runnerSSHKeyFile>${runner.ssh.key.file}</runnerSSHKeyFile>
<failIfCommitNecessary>false</failIfCommitNecessary>
<amiID>${ami.id}</amiID>
+ <instanceType>m1.large</instanceType>
<resultsDirectory>${resultsDirectory}</resultsDirectory>
<dumpType>${dumpType}</dumpType>
<coldRestartTomcat>true</coldRestartTomcat>
[28/50] [abbrv] git commit: Merge pull request #20 from
usergrid/unique-properties
Posted by sn...@apache.org.
Merge pull request #20 from usergrid/unique-properties
Unique 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/58b0f744
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/58b0f744
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/58b0f744
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: 58b0f7441c3360c1b0634a0b33f38ff9b42d5d4e
Parents: 2697a21 5c8ccb4
Author: tonuquq <to...@gmail.com>
Authored: Thu Jan 16 05:06:07 2014 -0800
Committer: tonuquq <to...@gmail.com>
Committed: Thu Jan 16 05:06:07 2014 -0800
----------------------------------------------------------------------
stack/corepersistence/collection/pom.xml | 361 +++++++++----------
.../DynamicCompositeFieldSerializer.java | 48 +++
.../IdColDynamicCompositeSerializer.java | 87 +++++
.../astyanax/MultiTennantColumnFamily.java | 16 +-
.../exception/CollectionRuntimeException.java | 18 +-
.../collection/guice/CollectionModule.java | 31 +-
.../collection/mvcc/entity/ValidationUtils.java | 1 -
.../mvcc/stage/write/EntityVersion.java | 62 ++++
.../stage/write/EntityVersionSerializer.java | 67 ++++
.../mvcc/stage/write/FieldSerializer.java | 102 ++++++
.../mvcc/stage/write/UniqueValue.java | 37 ++
.../mvcc/stage/write/UniqueValueImpl.java | 121 +++++++
.../write/UniqueValueSerializationStrategy.java | 64 ++++
.../UniqueValueSerializationStrategyImpl.java | 171 +++++++++
.../mvcc/stage/write/WriteCommit.java | 64 +++-
.../collection/mvcc/stage/write/WriteFig.java | 42 +++
.../mvcc/stage/write/WriteUniqueVerify.java | 159 +++++++-
.../collection/serialization/UniqueUpdate.java | 28 --
.../impl/CollectionScopedRowKeySerializer.java | 38 +-
.../MvccEntitySerializationStrategyImpl.java | 21 +-
.../MvccLogEntrySerializationStrategyImpl.java | 20 +-
.../serialization/impl/SerializationModule.java | 2 +
.../collection/EntityCollectionManagerIT.java | 61 +++-
.../changelog/ChangeLogGeneratorImplTest.java | 20 -
.../mvcc/stage/AbstractEntityStageTest.java | 17 +
.../mvcc/stage/AbstractIdStageTest.java | 17 +
.../mvcc/stage/AbstractMvccEntityStageTest.java | 76 ++--
.../mvcc/stage/InvalidMvccEntityGenerator.java | 118 ------
.../mvcc/stage/TestEntityGenerator.java | 17 +
.../mvcc/stage/delete/DeleteCommitTest.java | 5 +-
.../write/EntityVersionSerializerTest.java | 40 ++
.../mvcc/stage/write/FieldSerializerTest.java | 47 +++
...niqueValueSerializationStrategyImplTest.java | 121 +++++++
.../mvcc/stage/write/WriteCommitTest.java | 26 +-
.../mvcc/stage/write/WriteStartTest.java | 17 +
.../mvcc/stage/write/WriteUniqueVerifyTest.java | 66 ++--
.../impl/ScopedRowKeySerializerTest.java | 7 +-
.../collection/util/InvalidEntityGenerator.java | 31 +-
.../collection/util/InvalidIdGenerator.java | 69 ++--
.../util/InvalidMvccEntityGenerator.java | 144 ++++++++
.../src/test/resources/log4j.properties | 12 +-
stack/corepersistence/graph/pom.xml | 106 +++---
.../DynamicCompositeFieldSerializer.java | 53 ---
.../IdColDynamicCompositeSerializer.java | 93 -----
.../impl/EdgeMetadataSerializationImpl.java | 3 +-
.../impl/EdgeSerializationImpl.java | 2 +-
.../persistence/graph/EdgeManagerIT.java | 8 +-
.../persistence/model/field/AbstractField.java | 43 ++-
.../persistence/model/field/BooleanField.java | 22 +-
.../persistence/model/field/DoubleField.java | 33 +-
.../usergrid/persistence/model/field/Field.java | 5 +
.../persistence/model/field/IntegerField.java | 33 +-
.../persistence/model/field/LongField.java | 35 +-
.../persistence/model/field/StringField.java | 36 +-
.../persistence/model/field/UUIDField.java | 37 +-
stack/corepersistence/pom.xml | 108 +++---
56 files changed, 2286 insertions(+), 802 deletions(-)
----------------------------------------------------------------------
[09/50] [abbrv] git commit: Minor format and import cleanups.
Posted by sn...@apache.org.
Minor format and import cleanups.
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/96473c98
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/96473c98
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/96473c98
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: 96473c989a500af4c6c78d25ea0c133cccc95646
Parents: a963549
Author: Dave Johnson <dm...@apigee.com>
Authored: Mon Jan 13 15:06:07 2014 -0500
Committer: Dave Johnson <dm...@apigee.com>
Committed: Mon Jan 13 15:06:07 2014 -0500
----------------------------------------------------------------------
.../collection/mvcc/stage/write/WriteCommit.java | 18 +++++++++---------
.../UniqueValueSerializationStrategyImplTest.java | 3 ---
2 files changed, 9 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/96473c98/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommit.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommit.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommit.java
index acc4cf9..31212eb 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommit.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommit.java
@@ -61,17 +61,17 @@ public class WriteCommit implements Func1<CollectionIoEvent<MvccEntity>, Entity>
@Inject
- public WriteCommit( final MvccLogEntrySerializationStrategy logEntrySerializationStrategy,
- final MvccEntitySerializationStrategy entitySerializationStrategy,
- final UniqueValueSerializationStrategy uniqueValueSerializiationStrategy) {
+ public WriteCommit( final MvccLogEntrySerializationStrategy logStrat,
+ final MvccEntitySerializationStrategy entryStrat,
+ final UniqueValueSerializationStrategy uniqueValueStrat) {
- Preconditions.checkNotNull( logEntrySerializationStrategy, "logEntrySerializationStrategy is required" );
- Preconditions.checkNotNull( entitySerializationStrategy, "entitySerializationStrategy is required" );
+ Preconditions.checkNotNull( logStrat, "MvccLogEntrySerializationStrategy is required" );
+ Preconditions.checkNotNull( entryStrat, "MvccEntitySerializationStrategy is required" );
+ Preconditions.checkNotNull( uniqueValueStrat, "UniqueValueSerializationStrategy is required" );
-
- this.logEntryStrat = logEntrySerializationStrategy;
- this.entityStrat = entitySerializationStrategy;
- this.uniqueValueStrat = uniqueValueSerializiationStrategy;
+ this.logEntryStrat = logStrat;
+ this.entityStrat = entryStrat;
+ this.uniqueValueStrat = uniqueValueStrat;
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/96473c98/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/UniqueValueSerializationStrategyImplTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/UniqueValueSerializationStrategyImplTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/UniqueValueSerializationStrategyImplTest.java
index 075e4bb..10a70f9 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/UniqueValueSerializationStrategyImplTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/UniqueValueSerializationStrategyImplTest.java
@@ -17,9 +17,6 @@
*/
package org.apache.usergrid.persistence.collection.mvcc.stage.write;
-import org.apache.usergrid.persistence.collection.mvcc.stage.write.UniqueValue;
-import org.apache.usergrid.persistence.collection.mvcc.stage.write.UniqueValueSerializationStrategy;
-import org.apache.usergrid.persistence.collection.mvcc.stage.write.UniqueValueImpl;
import com.google.inject.Inject;
import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
import java.util.UUID;
[27/50] [abbrv] git commit: Removed unused file and Added gitignore
Posted by sn...@apache.org.
Removed unused file and Added 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/1140631c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/1140631c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/1140631c
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: 1140631c12c6b10e92b53f9d5d91b8db5a2fa5ff
Parents: 2697a21
Author: Sungju Jin <su...@softwaregeeks.org>
Authored: Thu Jan 16 22:03:55 2014 +0900
Committer: Sungju Jin <su...@softwaregeeks.org>
Committed: Thu Jan 16 22:03:55 2014 +0900
----------------------------------------------------------------------
stack/query-validator/.gitignore | 1 +
stack/query-validator/sql.db | Bin 4096 -> 0 bytes
2 files changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1140631c/stack/query-validator/.gitignore
----------------------------------------------------------------------
diff --git a/stack/query-validator/.gitignore b/stack/query-validator/.gitignore
new file mode 100644
index 0000000..98e6ef6
--- /dev/null
+++ b/stack/query-validator/.gitignore
@@ -0,0 +1 @@
+*.db
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1140631c/stack/query-validator/sql.db
----------------------------------------------------------------------
diff --git a/stack/query-validator/sql.db b/stack/query-validator/sql.db
deleted file mode 100644
index 8c6c25f..0000000
Binary files a/stack/query-validator/sql.db and /dev/null differ
[36/50] [abbrv] git commit: Start of a README for query-validator
(test commit).
Posted by sn...@apache.org.
Start of a README for query-validator (test commit).
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/d8459dee
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/d8459dee
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/d8459dee
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: d8459deec6ddf7013dd725b2f7f36e4b6b932aff
Parents: df272cb
Author: Dave Johnson <dm...@apigee.com>
Authored: Thu Jan 16 13:07:31 2014 -0500
Committer: Dave Johnson <dm...@apigee.com>
Committed: Thu Jan 16 13:07:31 2014 -0500
----------------------------------------------------------------------
stack/query-validator/README.md | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d8459dee/stack/query-validator/README.md
----------------------------------------------------------------------
diff --git a/stack/query-validator/README.md b/stack/query-validator/README.md
new file mode 100644
index 0000000..152e474
--- /dev/null
+++ b/stack/query-validator/README.md
@@ -0,0 +1,3 @@
+
+This test package verifies that the Usergrid REST API returns results and does paging and limits
+in a style similar to that of SqlLite.
\ No newline at end of file
[05/50] [abbrv] git commit: Removed test that was based on previous
exception handling.
Posted by sn...@apache.org.
Removed test that was based on previous exception handling.
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/609570e1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/609570e1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/609570e1
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: 609570e1ad2764d6d85ee7d760e941a2fbdfb73c
Parents: 9766e57
Author: GERey <gr...@apigee.com>
Authored: Mon Jan 13 11:36:22 2014 -0800
Committer: GERey <gr...@apigee.com>
Committed: Mon Jan 13 11:36:22 2014 -0800
----------------------------------------------------------------------
.../usergrid/rest/applications/ApplicationResourceIT.java | 10 ----------
1 file changed, 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/609570e1/stack/rest/src/test/java/org/usergrid/rest/applications/ApplicationResourceIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/usergrid/rest/applications/ApplicationResourceIT.java b/stack/rest/src/test/java/org/usergrid/rest/applications/ApplicationResourceIT.java
index 0207bd7..e316bef 100644
--- a/stack/rest/src/test/java/org/usergrid/rest/applications/ApplicationResourceIT.java
+++ b/stack/rest/src/test/java/org/usergrid/rest/applications/ApplicationResourceIT.java
@@ -528,14 +528,4 @@ public class ApplicationResourceIT extends AbstractRestIT {
assertNotNull( node.get( "entities" ) );
}
- @Test
- public void pinExceptionVerification () throws Exception {
- ApplicationInfo appinfo = setup.getMgmtSvc().getApplicationInfo( "test-organization/test-app" );
-
- JsonNode node = resource().path( "/test-organization/test-app/token" ).queryParam( "username", "ed@anuff.com" )
- .queryParam( "pin", "//b//a//!//$**$&#(bulrs" ).queryParam( "grant_type", "pin" )
- .accept( MediaType.APPLICATION_JSON ).type( MediaType.APPLICATION_JSON_TYPE ).get( JsonNode.class );
-
-
- }
}
[31/50] [abbrv] git commit: make sure we select the users
availabilityZone properly
Posted by sn...@apache.org.
make sure we select the users availabilityZone properly
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/cc471b50
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/cc471b50
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/cc471b50
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: cc471b502aca2791c3a068f93d15b79ff6b7b827
Parents: 265d7df
Author: Alex Karasulu <ak...@gmail.com>
Authored: Thu Jan 16 15:59:19 2014 +0200
Committer: Alex Karasulu <ak...@gmail.com>
Committed: Thu Jan 16 15:59:19 2014 +0200
----------------------------------------------------------------------
stack/corepersistence/collection/pom.xml | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cc471b50/stack/corepersistence/collection/pom.xml
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/pom.xml b/stack/corepersistence/collection/pom.xml
index 6852486..1449f3b 100644
--- a/stack/corepersistence/collection/pom.xml
+++ b/stack/corepersistence/collection/pom.xml
@@ -68,6 +68,7 @@
<configuration>
<accessKey>${aws.s3.key}</accessKey>
<secretKey>${aws.s3.secret}</secretKey>
+ <availabilityZone>${availabilityZone}</availabilityZone>
<bucketName>${aws.s3.bucket}</bucketName>
<managerAppUsername>admin</managerAppUsername>
<managerAppPassword>${manager.app.password}</managerAppPassword>
[23/50] [abbrv] git commit: making changes to prevent performance
tests from blowing up
Posted by sn...@apache.org.
making changes to prevent performance tests from blowing up
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/2795d0cd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/2795d0cd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/2795d0cd
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: 2795d0cdbffa4e981037c3d8b851cf43f1f8b7eb
Parents: 35fddfe
Author: Alex Karasulu <ak...@gmail.com>
Authored: Thu Jan 16 02:27:22 2014 +0200
Committer: Alex Karasulu <ak...@gmail.com>
Committed: Thu Jan 16 02:27:22 2014 +0200
----------------------------------------------------------------------
.../astyanax/AstyanaxKeyspaceProvider.java | 27 +++++++++++++++++++-
...MvccEntitySerializationStrategyImplTest.java | 13 +++++++++-
2 files changed, 38 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2795d0cd/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/AstyanaxKeyspaceProvider.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/AstyanaxKeyspaceProvider.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/AstyanaxKeyspaceProvider.java
index e1fc105..923e7c3 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/AstyanaxKeyspaceProvider.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/AstyanaxKeyspaceProvider.java
@@ -1,6 +1,11 @@
package org.apache.usergrid.persistence.collection.astyanax;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.ConcurrentSkipListSet;
+
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.netflix.astyanax.AstyanaxConfiguration;
@@ -23,6 +28,8 @@ import com.netflix.astyanax.thrift.ThriftFamilyFactory;
public class AstyanaxKeyspaceProvider implements Provider<Keyspace> {
private final CassandraFig cassandraConfig;
+ private final static Set<AstyanaxContext<Keyspace>> contexts =
+ new HashSet<AstyanaxContext<Keyspace>>();
@Inject
public AstyanaxKeyspaceProvider( final CassandraFig cassandraConfig ) {
@@ -32,6 +39,7 @@ public class AstyanaxKeyspaceProvider implements Provider<Keyspace> {
@Override
public Keyspace get() {
+
AstyanaxConfiguration config = new AstyanaxConfigurationImpl()
.setDiscoveryType( NodeDiscoveryType.TOKEN_AWARE )
.setTargetCassandraVersion( cassandraConfig.getVersion() );
@@ -61,8 +69,25 @@ public class AstyanaxKeyspaceProvider implements Provider<Keyspace> {
.buildKeyspace( ThriftFamilyFactory.getInstance() );
context.start();
+ synchronized ( contexts ) {
+ contexts.add( context );
+ }
+ return context.getClient();
+ }
- return context.getClient();
+ // @todo by aok - this must be considered to enable stress tests to shutdown or else
+ // @todo the system will run out of file descriptors (sockets) and tests will fail.
+ // this is where the lifecycle management annotations would come in handy.
+ public void shutdown() {
+ synchronized ( contexts ) {
+ HashSet<AstyanaxContext<Keyspace>> copy = new HashSet<AstyanaxContext<Keyspace>>( contexts.size() );
+ copy.addAll( contexts );
+
+ for ( AstyanaxContext<Keyspace> context : copy ) {
+ context.shutdown();
+ contexts.remove( context );
+ }
+ }
}
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2795d0cd/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
index c18158d..e62a471 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
@@ -9,6 +9,8 @@ import java.util.UUID;
import org.jukito.JukitoRunner;
import org.jukito.UseModules;
+import org.junit.After;
+import org.junit.AfterClass;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Rule;
@@ -21,6 +23,7 @@ import org.safehaus.guicyfig.Option;
import org.safehaus.guicyfig.Overrides;
import org.apache.usergrid.persistence.collection.CollectionScope;
+import org.apache.usergrid.persistence.collection.astyanax.AstyanaxKeyspaceProvider;
import org.apache.usergrid.persistence.collection.astyanax.CassandraFig;
import org.apache.usergrid.persistence.collection.cassandra.CassandraRule;
import org.apache.usergrid.persistence.collection.guice.CollectionModule;
@@ -77,6 +80,8 @@ public class MvccEntitySerializationStrategyImplTest {
@ClassRule
public static CassandraRule rule = new CassandraRule();
+ @Inject
+ AstyanaxKeyspaceProvider provider;
@Inject
@Rule
@@ -110,12 +115,18 @@ public class MvccEntitySerializationStrategyImplTest {
@Before
- public void setupClass() {
+ public void setup() {
assertNotNull( cassandraFig );
assertNotNull( rxFig );
}
+ @After
+ public void tearDown() {
+ provider.shutdown();
+ }
+
+
@Test
public void writeLoadDelete() throws ConnectionException {
[42/50] [abbrv] Minor formatting fixes plus license headers.
Posted by sn...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/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 265c1ae..7a0eb5d 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
@@ -1,10 +1,26 @@
+/*
+ * 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.apache.usergrid.persistence.model.field.value.EntityObject;
-
import com.google.common.base.Preconditions;
@@ -27,7 +43,6 @@ public class Entity extends EntityObject {
private UUID version;
-
/**
* Create an entity with the given type and id. Should be used for all update operations to an existing entity
*/
@@ -47,7 +62,6 @@ public class Entity extends EntityObject {
}
-
/**
* Do not use! This is only for serialization.
*/
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/entity/Id.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/entity/Id.java b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/entity/Id.java
index 3a9d49b..d456325 100644
--- a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/entity/Id.java
+++ b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/entity/Id.java
@@ -1,3 +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.
+ */
package org.apache.usergrid.persistence.model.entity;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/entity/SimpleId.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/entity/SimpleId.java b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/entity/SimpleId.java
index 08ae920..e894891 100644
--- a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/entity/SimpleId.java
+++ b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/entity/SimpleId.java
@@ -1,3 +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.
+ */
package org.apache.usergrid.persistence.model.entity;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/ArrayField.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/ArrayField.java b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/ArrayField.java
index cb5f45d..1e45884 100644
--- a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/ArrayField.java
+++ b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/ArrayField.java
@@ -1,27 +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.model.field;
+/**
+ * A marker to signal array handling. Just delegates to list field for easier handling internally
+ */
+public class ArrayField extends ListField {
-import java.util.ArrayList;
-import java.util.List;
-
-
-/** A marker to signal array handling. Just delegates to list field for easier handling internally */
-public class ArrayField extends ListField
-{
-
- /** Contructor that intializes with an empty set for adding to later */
- public ArrayField( String name )
- {
- super(name);
+ /**
+ * Contructor that intializes with an empty set for adding to later
+ */
+ public ArrayField( String name ) {
+ super( name );
}
- public ArrayField(){
+ public ArrayField() {
super();
}
- /** Add the value to the list */
- public void add( Field field )
- {
+ /**
+ * Add the value to the list
+ */
+ public void add( Field field ) {
value.add( field );
}
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/BooleanField.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/BooleanField.java b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/BooleanField.java
index 63097e0..fed011d 100644
--- a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/BooleanField.java
+++ b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/BooleanField.java
@@ -18,9 +18,7 @@
package org.apache.usergrid.persistence.model.field;
/**
- *
* @author: tnine
- *
*/
public class BooleanField extends AbstractField<Boolean> {
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/ByteBufferField.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/ByteBufferField.java b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/ByteBufferField.java
index 2dbc193..29dcb6b 100644
--- a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/ByteBufferField.java
+++ b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/ByteBufferField.java
@@ -1,28 +1,44 @@
+/*
+ * 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.field;
-
import java.nio.ByteBuffer;
+/**
+ * A field for storing byte buffers
+ */
+public class ByteBufferField extends AbstractField<ByteBuffer> {
-/** A field for storing byte buffers */
-public class ByteBufferField extends AbstractField<ByteBuffer>
-{
-
-
- /** Creates an immutable copy of the byte buffer */
- public ByteBufferField( String name, ByteBuffer value )
- {
+ /**
+ * Creates an immutable copy of the byte buffer
+ */
+ public ByteBufferField( String name, ByteBuffer value ) {
//always return a duplicate so we don't mess with the markers
super( name, value.duplicate() );
}
public ByteBufferField() {
- }
+ }
@Override
- public ByteBuffer getValue()
- {
+ public ByteBuffer getValue() {
//always return a duplicate so we don't mess with the markers
return value.duplicate();
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/DoubleField.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/DoubleField.java b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/DoubleField.java
index 07f847c..2f358bd 100644
--- a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/DoubleField.java
+++ b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/DoubleField.java
@@ -18,9 +18,7 @@
package org.apache.usergrid.persistence.model.field;
/**
- *
* @author: tnine
- *
*/
public class DoubleField extends AbstractField<Double> {
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/EntityObjectField.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/EntityObjectField.java b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/EntityObjectField.java
index d44ba2f..7739291 100644
--- a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/EntityObjectField.java
+++ b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/EntityObjectField.java
@@ -1,20 +1,35 @@
+/*
+ * 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.field;
-
import org.apache.usergrid.persistence.model.field.value.EntityObject;
+/**
+ * An object field
+ */
+public class EntityObjectField extends AbstractField<EntityObject> {
-/** An object field */
-public class EntityObjectField extends AbstractField<EntityObject>
-{
-
-
- public EntityObjectField( String name, EntityObject value )
- {
+ public EntityObjectField( String name, EntityObject value ) {
super( name, value );
}
public EntityObjectField() {
- }
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/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 4f5a917..460ca9e 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
@@ -1,12 +1,28 @@
+/*
+ * 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.field;
-
import java.io.Serializable;
-
/**
- * Interface for fields. All fields must implement this method The T is the type of field (in the java runtime) The V
- * is the value of the field
+ * Interface for fields. All fields must implement this method The T is the type of field
+ * (in the java runtime) The V is the value of the field
* @param <T>
*/
public interface Field<T> extends Serializable {
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/IntegerField.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/IntegerField.java b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/IntegerField.java
index 6a311e6..6412b35 100644
--- a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/IntegerField.java
+++ b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/IntegerField.java
@@ -18,9 +18,7 @@
package org.apache.usergrid.persistence.model.field;
/**
- *
* @author: tnine
- *
*/
public class IntegerField extends AbstractField<Integer> {
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/ListField.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/ListField.java b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/ListField.java
index 0795201..cb0e297 100644
--- a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/ListField.java
+++ b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/ListField.java
@@ -1,28 +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.model.field;
-
import java.util.ArrayList;
import java.util.List;
+/**
+ * An object field that represents a list of objects. This can also be used to represent arrays
+ */
+public class ListField extends AbstractField<List<Field>> {
-/** An object field that represents a list of objects. This can also be used to represent arrays */
-public class ListField extends AbstractField<List<Field>>
-{
-
- /** Contructor that intializes with an empty set for adding to later */
- public ListField( String name )
- {
+ /**
+ * Contructor that intializes with an empty set for adding to later
+ */
+ public ListField( String name ) {
super( name, new ArrayList<Field>() );
}
- public ListField(){
+ public ListField() {
super();
}
-
- /** Add the value to the list */
- public void add( Field field )
- {
+ /**
+ * Add the value to the list
+ */
+ public void add( Field field ) {
value.add( field );
}
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/LocationField.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/LocationField.java b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/LocationField.java
index 76d1094..29e3169 100644
--- a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/LocationField.java
+++ b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/LocationField.java
@@ -1,20 +1,38 @@
+/*
+ * 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.field;
-
import org.apache.usergrid.persistence.model.field.value.Location;
+/**
+ * Basic field for storing location data
+ */
+public class LocationField extends AbstractField<Location> {
-/** Basic field for storing location data */
-public class LocationField extends AbstractField<Location>
-{
-
- /** Create a location field with the given point */
- public LocationField( String name, Location value )
- {
+ /**
+ * Create a location field with the given point
+ */
+ public LocationField( String name, Location value ) {
super( name, value );
}
public LocationField() {
- }
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/SetField.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/SetField.java b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/SetField.java
index f28b5ec..329289c 100644
--- a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/SetField.java
+++ b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/SetField.java
@@ -1,28 +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.model.field;
-
import java.util.LinkedHashSet;
import java.util.Set;
+/**
+ * An object field that represents a set of objects
+ */
+public class SetField extends AbstractField<Set<Field>> {
-/** An object field that represents a set of objects */
-public class SetField extends AbstractField<Set<Field>>
-{
-
-
- /** Contructor that intializes with an empty set for adding to later */
- public SetField( String name )
- {
+ /**
+ * Contructor that intializes with an empty set for adding to later
+ */
+ public SetField( String name ) {
super( name, new LinkedHashSet<Field>() );
}
public SetField() {
- }
+ }
- /** Add an entry to the set */
- public void addEntry( Field field )
- {
+ /**
+ * Add an entry to the set
+ */
+ public void addEntry( Field field ) {
value.add( field );
}
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/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 fb69afb..e898392 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
@@ -1,6 +1,23 @@
+/*
+ * 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.field.value;
-
import java.io.Serializable;
import java.util.Collection;
import java.util.HashMap;
@@ -8,33 +25,34 @@ import java.util.Map;
import org.apache.usergrid.persistence.model.field.Field;
+/**
+ * Simple wrapper for holding nested objects
+ */
+public class EntityObject implements Serializable {
-/** Simple wrapper for holding nested objects */
-public class EntityObject implements Serializable
-{
-
-
- /** Fields the users can set */
- private Map<String, Field> fields = new HashMap<String, Field>();
+ /**
+ * Fields the users can set
+ */
+ private final Map<String, Field> fields = new HashMap<String, Field>();
-
- /** Add the field, return the old one if it existed */
- public <T extends java.lang.Object> Field<T> setField( Field<T> value )
- {
+ /**
+ * Add the field, return the old one if it existed
+ */
+ public <T extends java.lang.Object> Field<T> setField( Field<T> value ) {
return fields.put( value.getName(), value );
}
-
- /** Get the field by name the user has set into the entity */
- public <T extends java.lang.Object> Field<T> getField( String name )
- {
+ /**
+ * Get the field by name the user has set into the entity
+ */
+ public <T extends java.lang.Object> Field<T> getField( String name ) {
return fields.get( name );
}
-
- /** Get all fields in the entity */
- public Collection<Field> getFields()
- {
+ /**
+ * Get all fields in the entity
+ */
+ public Collection<Field> getFields() {
return fields.values();
}
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/value/Location.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/value/Location.java b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/value/Location.java
index 083f211..224c750 100644
--- a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/value/Location.java
+++ b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/field/value/Location.java
@@ -1,32 +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.model.field.value;
-
import java.io.Serializable;
-
-/** Geographic point. Should be used when we want to store geo information */
-public class Location implements Serializable
-{
+/**
+ * Geographic point. Should be used when we want to store geo information
+ */
+public class Location implements Serializable {
private final double latitude;
private final double longtitude;
-
- public Location( double latitude, double longtitude )
- {
+ public Location( double latitude, double longtitude ) {
this.latitude = latitude;
this.longtitude = longtitude;
}
-
- public double getLatitude()
- {
+ public double getLatitude() {
return latitude;
}
-
- public double getLongtitude()
- {
+ public double getLongtitude() {
return longtitude;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/util/Verify.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/util/Verify.java b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/util/Verify.java
index c7dd642..c6616ed 100644
--- a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/util/Verify.java
+++ b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/util/Verify.java
@@ -1,6 +1,23 @@
+/*
+ * 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.util;
-
/**
* Class to help with input verification
*/
@@ -15,7 +32,6 @@ public class Verify {
if(value != null){
throw new IllegalArgumentException(message );
}
-
}
@@ -33,5 +49,4 @@ public class Verify {
throw new IllegalArgumentException( message );
}
}
-
}
[10/50] [abbrv] git commit: Merge branch 'two-dot-o' into
unique-properties
Posted by sn...@apache.org.
Merge branch 'two-dot-o' into unique-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/82bea518
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/82bea518
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/82bea518
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: 82bea51809008b4f4c2a017b43a8ce4376c410c9
Parents: 96473c9 c91b5be
Author: Dave Johnson <dm...@apigee.com>
Authored: Mon Jan 13 15:06:50 2014 -0500
Committer: Dave Johnson <dm...@apigee.com>
Committed: Mon Jan 13 15:06:50 2014 -0500
----------------------------------------------------------------------
.../org/usergrid/rest/applications/ApplicationResource.java | 6 ++++++
1 file changed, 6 insertions(+)
----------------------------------------------------------------------
[21/50] [abbrv] git commit: Merge pull request #26 from
GERey/USERGRID-3011-delete-connections
Posted by sn...@apache.org.
Merge pull request #26 from GERey/USERGRID-3011-delete-connections
Usergrid 3011 delete connections
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/2697a211
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/2697a211
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/2697a211
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: 2697a211cb9abf2e92718c9f01763dcd28b39f7d
Parents: c91b5be 89b9f50
Author: Scott Ganyo <sc...@ganyo.com>
Authored: Wed Jan 15 15:03:13 2014 -0800
Committer: Scott Ganyo <sc...@ganyo.com>
Committed: Wed Jan 15 15:03:13 2014 -0800
----------------------------------------------------------------------
.../cassandra/RelationManagerImpl.java | 27 +++++++-----
.../users/ConnectionResourceTest.java | 43 ++++++++++++++++++++
2 files changed, 60 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
[04/50] [abbrv] git commit: Changed imports back to only include
SC_BAD_REQUEST and SC_OK.
Posted by sn...@apache.org.
Changed imports back to only include SC_BAD_REQUEST and SC_OK.
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/9766e576
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/9766e576
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/9766e576
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: 9766e576f6c1e11cc7dbc9f707888f460ad613e6
Parents: 9fe5e71
Author: GERey <gr...@apigee.com>
Authored: Mon Jan 13 11:34:48 2014 -0800
Committer: GERey <gr...@apigee.com>
Committed: Mon Jan 13 11:34:48 2014 -0800
----------------------------------------------------------------------
.../java/org/usergrid/rest/applications/ApplicationResource.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9766e576/stack/rest/src/main/java/org/usergrid/rest/applications/ApplicationResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/usergrid/rest/applications/ApplicationResource.java b/stack/rest/src/main/java/org/usergrid/rest/applications/ApplicationResource.java
index 7143209..a8c6e0c 100644
--- a/stack/rest/src/main/java/org/usergrid/rest/applications/ApplicationResource.java
+++ b/stack/rest/src/main/java/org/usergrid/rest/applications/ApplicationResource.java
@@ -74,7 +74,8 @@ import org.apache.shiro.codec.Base64;
import com.sun.jersey.api.json.JSONWithPadding;
import com.sun.jersey.api.view.Viewable;
-import static javax.servlet.http.HttpServletResponse.*;
+import static javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST;
+import static javax.servlet.http.HttpServletResponse.SC_OK;
import static javax.ws.rs.core.MediaType.APPLICATION_FORM_URLENCODED;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
[29/50] [abbrv] git commit: Avoid NPE in ManagementServiceImpl
Posted by sn...@apache.org.
Avoid NPE in ManagementServiceImpl
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/3f762ece
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/3f762ece
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/3f762ece
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: 3f762ece4bcd0eaa8acbb0f8fb2114becbfbf332
Parents: 1140631
Author: Sungju Jin <su...@softwaregeeks.org>
Authored: Thu Jan 16 22:52:26 2014 +0900
Committer: Sungju Jin <su...@softwaregeeks.org>
Committed: Thu Jan 16 22:52:26 2014 +0900
----------------------------------------------------------------------
.../cassandra/ManagementServiceImpl.java | 32 ++++++++++++++------
1 file changed, 23 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3f762ece/stack/services/src/main/java/org/usergrid/management/cassandra/ManagementServiceImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/usergrid/management/cassandra/ManagementServiceImpl.java b/stack/services/src/main/java/org/usergrid/management/cassandra/ManagementServiceImpl.java
index f7cc99c..8257514 100644
--- a/stack/services/src/main/java/org/usergrid/management/cassandra/ManagementServiceImpl.java
+++ b/stack/services/src/main/java/org/usergrid/management/cassandra/ManagementServiceImpl.java
@@ -290,7 +290,7 @@ public class ManagementServiceImpl implements ManagementService {
@Override
public void setup() throws Exception {
- if ( parseBoolean( properties.getProperty( PROPERTIES_SETUP_TEST_ACCOUNT ) ) ) {
+ if ( getBooleanProperty( PROPERTIES_SETUP_TEST_ACCOUNT ) ) {
String test_app_name = properties.getProperty( PROPERTIES_TEST_ACCOUNT_APP );
String test_organization_name = properties.getProperty( PROPERTIES_TEST_ACCOUNT_ORGANIZATION );
String test_admin_username = properties.getProperty( PROPERTIES_TEST_ACCOUNT_ADMIN_USER_USERNAME );
@@ -328,7 +328,7 @@ public class ManagementServiceImpl implements ManagementService {
public boolean superuserEnabled() {
- boolean superuser_enabled = parseBoolean( properties.getProperty( PROPERTIES_SYSADMIN_LOGIN_ALLOWED ) );
+ boolean superuser_enabled = getBooleanProperty( PROPERTIES_SYSADMIN_LOGIN_ALLOWED );
String superuser_username = properties.getProperty( PROPERTIES_SYSADMIN_LOGIN_NAME );
String superuser_email = properties.getProperty( PROPERTIES_SYSADMIN_LOGIN_EMAIL );
String superuser_password = properties.getProperty( PROPERTIES_SYSADMIN_LOGIN_PASSWORD );
@@ -339,7 +339,7 @@ public class ManagementServiceImpl implements ManagementService {
@Override
public void provisionSuperuser() throws Exception {
- boolean superuser_enabled = parseBoolean( properties.getProperty( PROPERTIES_SYSADMIN_LOGIN_ALLOWED ) );
+ boolean superuser_enabled = getBooleanProperty( PROPERTIES_SYSADMIN_LOGIN_ALLOWED );
String superuser_username = properties.getProperty( PROPERTIES_SYSADMIN_LOGIN_NAME );
String superuser_email = properties.getProperty( PROPERTIES_SYSADMIN_LOGIN_EMAIL );
String superuser_password = properties.getProperty( PROPERTIES_SYSADMIN_LOGIN_PASSWORD );
@@ -1247,13 +1247,11 @@ public class ManagementServiceImpl implements ManagementService {
userInfo = getUserInfo( MANAGEMENT_APPLICATION_ID, user );
boolean userIsSuperAdmin =
- properties.getProperty( PROPERTIES_SYSADMIN_LOGIN_EMAIL ).equals( userInfo.getEmail() );
-
- boolean testUserEnabled = parseBoolean( properties.getProperty( PROPERTIES_SETUP_TEST_ACCOUNT ) );
+ StringUtils.equals( getProperty( PROPERTIES_SYSADMIN_LOGIN_EMAIL ), userInfo.getEmail() );
+ boolean testUserEnabled = getBooleanProperty( PROPERTIES_SETUP_TEST_ACCOUNT );
boolean userIsTestUser = !testUserEnabled ? false :
- properties.getProperty( PROPERTIES_SYSADMIN_LOGIN_EMAIL )
- .equals( userInfo.getEmail() );
+ StringUtils.equals(getProperty( PROPERTIES_SYSADMIN_LOGIN_EMAIL ), userInfo.getEmail());
if ( !userIsSuperAdmin && !userIsTestUser ) {
@@ -1489,7 +1487,7 @@ public class ManagementServiceImpl implements ManagementService {
Map<UUID, String> organizations;
- boolean superuser_enabled = parseBoolean( properties.getProperty( PROPERTIES_SYSADMIN_LOGIN_ALLOWED ) );
+ boolean superuser_enabled = getBooleanProperty( PROPERTIES_SYSADMIN_LOGIN_ALLOWED );
String superuser_username = properties.getProperty( PROPERTIES_SYSADMIN_LOGIN_NAME );
if ( superuser_enabled && ( superuser_username != null ) && superuser_username.equals( user.getUsername() ) ) {
organizations = buildOrgBiMap( getOrganizations( null, 10 ) );
@@ -2906,4 +2904,20 @@ public class ManagementServiceImpl implements ManagementService {
// TODO Auto-generated method stub
return null;
}
+
+ private String getProperty(String key) {
+ String obj = properties.getProperty(key);
+ if(StringUtils.isEmpty(obj))
+ return null;
+ else
+ return obj;
+ }
+
+ private boolean getBooleanProperty(String key) {
+ String obj = getProperty(key);
+ if(StringUtils.isEmpty(obj))
+ return false;
+ else
+ return Boolean.parseBoolean(obj);
+ }
}
[15/50] [abbrv] git commit: Added two tests proving issue 3011. The
tests create a connection between two objects and tries to delete the
entities associated with the connection without disbanding the connection.
Posted by sn...@apache.org.
Added two tests proving issue 3011. The tests create a connection between two objects and tries to delete the entities associated with the connection without disbanding the connection.
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/4a28f6bc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/4a28f6bc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/4a28f6bc
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: 4a28f6bcd79c0ecebdddde04568fcda5b0f6b6f6
Parents: 79a34a2
Author: GERey <gr...@apigee.com>
Authored: Wed Jan 15 13:05:44 2014 -0800
Committer: GERey <gr...@apigee.com>
Committed: Wed Jan 15 13:05:44 2014 -0800
----------------------------------------------------------------------
.../users/ConnectionResourceTest.java | 23 +++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4a28f6bc/stack/rest/src/test/java/org/usergrid/rest/applications/users/ConnectionResourceTest.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/usergrid/rest/applications/users/ConnectionResourceTest.java b/stack/rest/src/test/java/org/usergrid/rest/applications/users/ConnectionResourceTest.java
index a9495c4..7850b68 100644
--- a/stack/rest/src/test/java/org/usergrid/rest/applications/users/ConnectionResourceTest.java
+++ b/stack/rest/src/test/java/org/usergrid/rest/applications/users/ConnectionResourceTest.java
@@ -207,8 +207,29 @@ public class ConnectionResourceTest extends AbstractRestIT {
JsonNode response = things.entity( "thing2" ).delete();
- assertNull (things.entity( thing1Id).connection("likes").entity( thing2Id).get());
+ JsonNode node = things.entity ( "thing2" ).get();
+ assertNull(node);
+
+ }
+
+ @Test //USERGRID-3011
+ public void connectionsDeleteFirstEntityInConnectionTest() {
+
+ CustomCollection things = context.collection( "things" );
+
+ UUID thing1Id = getEntityId( things.create( hashMap( "name", "thing1" ) ), 0 );
+
+ UUID thing2Id = getEntityId( things.create( hashMap( "name", "thing2" ) ), 0 );
+
+ //create the connection
+ things.entity( thing1Id ).connection( "likes" ).entity( thing2Id ).post();
+
+ JsonNode response = things.entity( "thing1" ).delete();
+
+ JsonNode node = things.entity ( "thing1" ).get();
+
+ assertNull(node);
}
[45/50] [abbrv] git commit: Support Java7 on Mac
Posted by sn...@apache.org.
Support Java7 on Mac
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/ff011d8f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/ff011d8f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/ff011d8f
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: ff011d8f42e6ba8547e76e542de532cdc72dcb18
Parents: 8773a18
Author: Sungju Jin <su...@softwaregeeks.org>
Authored: Tue Jan 21 21:26:27 2014 +0900
Committer: Sungju Jin <su...@softwaregeeks.org>
Committed: Tue Jan 21 21:26:27 2014 +0900
----------------------------------------------------------------------
stack/rest/pom.xml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ff011d8f/stack/rest/pom.xml
----------------------------------------------------------------------
diff --git a/stack/rest/pom.xml b/stack/rest/pom.xml
index 1629dd3..14c4565 100644
--- a/stack/rest/pom.xml
+++ b/stack/rest/pom.xml
@@ -271,9 +271,9 @@
</plugin>
<plugin>
- <groupId>org.codehaus.mojo.jspc</groupId>
+ <groupId>org.jasig.mojo.jspc</groupId>
<artifactId>jspc-maven-plugin</artifactId>
- <version>2.0-alpha-3</version>
+ <version>2.0.0</version>
<configuration>
<includeInProject>false</includeInProject>
<webFragmentFile>${project.build.directory}/web-fragment.xml.txt</webFragmentFile>
@@ -288,9 +288,9 @@
</executions>
<dependencies>
<dependency>
- <groupId>org.codehaus.mojo.jspc</groupId>
+ <groupId>org.jasig.mojo.jspc</groupId>
<artifactId>jspc-compiler-tomcat6</artifactId>
- <version>2.0-alpha-3</version>
+ <version>2.0.0</version>
</dependency>
</dependencies>
</plugin>
[37/50] [abbrv] git commit: adding results dump parameters to pom
Posted by sn...@apache.org.
adding results dump parameters to pom
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/93ad3b14
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/93ad3b14
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/93ad3b14
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: 93ad3b14364abf66b25cb294bfba34d517731e3f
Parents: cc471b5
Author: Alex Karasulu <ak...@gmail.com>
Authored: Sat Jan 18 04:22:29 2014 +0200
Committer: Alex Karasulu <ak...@gmail.com>
Committed: Sat Jan 18 04:22:29 2014 +0200
----------------------------------------------------------------------
stack/corepersistence/collection/pom.xml | 2 ++
.../impl/MvccEntitySerializationStrategyImplTest.java | 2 +-
.../corepersistence/collection/src/test/resources/log4j.properties | 2 +-
.../collection/src/test/resources/usergrid-CHOP.properties | 2 +-
4 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/93ad3b14/stack/corepersistence/collection/pom.xml
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/pom.xml b/stack/corepersistence/collection/pom.xml
index 1449f3b..731f6b0 100644
--- a/stack/corepersistence/collection/pom.xml
+++ b/stack/corepersistence/collection/pom.xml
@@ -76,6 +76,8 @@
<runnerSSHKeyFile>${runner.ssh.key.file}</runnerSSHKeyFile>
<failIfCommitNecessary>false</failIfCommitNecessary>
<amiID>${ami.id}</amiID>
+ <resultsDirectory>${resultsDirectory}</resultsDirectory>
+ <dumpType>${dumpType}</dumpType>
<coldRestartTomcat>true</coldRestartTomcat>
<awsSecurityGroup>${security.group}</awsSecurityGroup>
<runnerKeyPairName>${runner.keypair.name}</runnerKeyPairName>
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/93ad3b14/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
index a52be37..63c87ce 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
@@ -59,7 +59,7 @@ import static org.mockito.Mockito.mock;
/** @author tnine */
-@IterationChop( iterations = 1000, threads = 3 )
+@IterationChop( iterations = 1000, threads = 2 )
@RunWith( JukitoRunner.class )
@UseModules( CollectionModule.class )
public class MvccEntitySerializationStrategyImplTest {
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/93ad3b14/stack/corepersistence/collection/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/resources/log4j.properties b/stack/corepersistence/collection/src/test/resources/log4j.properties
index eeb5b9b..fb7a94e 100644
--- a/stack/corepersistence/collection/src/test/resources/log4j.properties
+++ b/stack/corepersistence/collection/src/test/resources/log4j.properties
@@ -7,4 +7,4 @@ 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.apache.usergrid=DEBUG,stdout
-
+log4j.logger.org.safehaus.chop=DEBUG,stdout
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/93ad3b14/stack/corepersistence/collection/src/test/resources/usergrid-CHOP.properties
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/resources/usergrid-CHOP.properties b/stack/corepersistence/collection/src/test/resources/usergrid-CHOP.properties
index a047fd7..d9c72be 100644
--- a/stack/corepersistence/collection/src/test/resources/usergrid-CHOP.properties
+++ b/stack/corepersistence/collection/src/test/resources/usergrid-CHOP.properties
@@ -1,6 +1,6 @@
# These are for CHOP environment settings
-cassandra.connections=30
+cassandra.connections=20
cassandra.port=9160
cassandra.version=1.2
[32/50] [abbrv] Refactoring and Improving query-validator module
Posted by sn...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ebfe96e8/stack/query-validator/src/test/java/org/usergrid/query/validator/users/UserQueryIT.java
----------------------------------------------------------------------
diff --git a/stack/query-validator/src/test/java/org/usergrid/query/validator/users/UserQueryIT.java b/stack/query-validator/src/test/java/org/usergrid/query/validator/users/UserQueryIT.java
new file mode 100644
index 0000000..fc6fafa
--- /dev/null
+++ b/stack/query-validator/src/test/java/org/usergrid/query/validator/users/UserQueryIT.java
@@ -0,0 +1,877 @@
+/**
+ * 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.usergrid.query.validator.users;
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.usergrid.persistence.Entity;
+import org.usergrid.query.validator.AbstractQueryIT;
+import org.usergrid.query.validator.QueryRequest;
+import org.usergrid.query.validator.QueryResponse;
+import org.usergrid.query.validator.QueryResultsMatcher;
+import org.usergrid.utils.StringUtils;
+
+import java.util.List;
+
+/**
+ * @author Sungju Jin
+ */
+public class UserQueryIT extends AbstractQueryIT {
+
+ @BeforeClass
+ public static void setDatas() {
+ createInitializationDatas("user");
+ }
+
+ @Test
+ public void sexEqualAndNameEqual() {
+ String sqlite = "SELECT * FROM users WHERE sex = 'male' and name = 'judekim' LIMIT 10";
+ String api = "SELECT * WHERE sex = 'male' AND name = 'judekim'";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request);
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void nameEqualAndSexEqual() {
+ String sqlite = "SELECT * FROM users WHERE name = 'judekim' and sex = 'male' LIMIT 10";
+ String api = "select * where name = 'judekim' and sex = 'male'";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request);
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void nameEqualAndSexEqual_limitL20() {
+ String sqlite = "SELECT * FROM users WHERE name = 'judekim' and sex = 'male' LIMIT 20";
+ String api = "select * where name = 'judekim' and sex = 'male'";
+ int limit = 20;
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ request.getApiQuery().setLimit(limit);
+ QueryResponse response = validator.execute(request);
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void sexEqualAndNameEqualExtra1() {
+ String sqlite = "SELECT * FROM users WHERE sex = 'female' and name = 'curioe' LIMIT 10";
+ String api = "select * where sex = 'female' and name = 'curioe'";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request);
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void sexEqualOrNameEqual() {
+ String sqlite = "SELECT * FROM users WHERE sex = 'female' or name = 'curioe' LIMIT 10";
+ String api = "select * where sex = 'female' or name = 'curioe'";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request);
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void nameBeginswithAndSexEqualAndAgeGreaterthanequalOrSexEqual_sortNameDesc() {
+ String sqlite = "SELECT * FROM users WHERE name LIKE 'a%' and sex = 'male' and age >= 35 or sex = 'female' ORDER BY name desc LIMIT 10";
+ String api = "select * where name = 'a*' and sex = 'male' and age >= 35 or sex = 'female' order by name desc";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request);
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void nameBeginswithAndSexEqualAndAgeGreaterthanequalOrSexEqual_sortAddressAscNameDesc() {
+ String sqlite = "SELECT * FROM users WHERE name LIKE 'a%' and sex = 'male' and age >= 35 or sex = 'female' ORDER BY address asc, name desc LIMIT 4";
+ String api = "select * where name = 'a*' and sex = 'male' and age >= 35 or sex = 'female' order by address asc, name desc";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ request.getApiQuery().setLimit(4);
+ QueryResponse response = validator.execute(request);
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void nameBeginswithAndSexEqualAndAgeGreaterthanequalOrSexEqual_sortAddressAscNameDesc_limitL4() {
+ String sqlite = "SELECT * FROM users WHERE name LIKE 'a%' and sex = 'male' and age >= 35 or sex = 'female' ORDER BY address asc, name desc LIMIT 4";
+ String api = "select * where name = 'a*' and sex = 'male' and age >= 35 or sex = 'female' order by address asc, name desc";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ request.getApiQuery().setLimit(4);
+ QueryResponse response = validator.execute(request);
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void sexEqual_sortAgeDescExtra1() {
+ String sqlite = "SELECT * FROM users WHERE sex = 'male' ORDER BY age desc LIMIT 10";
+ String api = "select * where sex = 'male' order by age desc";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request, new QueryResultsMatcher() {
+ @Override
+ public boolean equals(List<Entity> expectedEntities, List<Entity> actuallyEntities) {
+ boolean equals = expectedEntities.size() == expectedEntities.size();
+ if( !equals )
+ return false;
+
+ for(Entity entity : actuallyEntities) {
+ String sex = (String)entity.getProperty("sex");
+
+ if((StringUtils.equals("male",sex)) == false) {
+ return false;
+ }
+ }
+ return equals;
+ }
+ });
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void sexEqual_sortAgeDescExtra2() {
+ String sqlite = " SELECT * FROM users WHERE sex = 'female' ORDER BY age desc LIMIT 10";
+ String api = "select * where sex = 'female' order by age desc";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request);
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void sexEqualAndAgeGreaterthanequal() {
+ String sqlite = " SELECT * FROM users WHERE sex = 'male' and age >= 35 LIMIT 10";
+ String api = "select * where sex = 'male' and age >= 35";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request);
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void sexEqualAndAgeGreaterthanequal_sortAgeDesc() {
+ String sqlite = "SELECT * FROM users WHERE sex = 'male' and age >= 35 ORDER BY age desc LIMIT 10";
+ String api = "select * where sex = 'male' and age >= 35 order by age desc";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request);
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void sexEqualAndAgeGreaterthanequal_sortNameDesc() {
+ String sqlite = "SELECT * FROM users WHERE sex = 'male' and age >= 35 ORDER BY name desc LIMIT 10";
+ String api = "select * where sex = 'male' and age >= 35 order by name desc";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request);
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void sexEqualAndAgeGreaterthanequal_sortAgeDesc_limitL20() {
+ String sqlite = "SELECT * FROM users WHERE sex = 'male' and age >= 35 ORDER BY age desc LIMIT 20";
+ String api = "select * where sex = 'male' and age >= 35 order by age desc";
+ int limit = 20;
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ request.getApiQuery().setLimit(limit);
+ QueryResponse response = validator.execute(request);
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void qlSexEqualAndAgeGreaterthanequal_sortNameDesc_limitL20() {
+ String sqlite = "SELECT * FROM users WHERE sex = 'male' and age >= 35 ORDER BY name desc LIMIT 20";
+ String api = "select * where sex = 'male' and age >= 35 order by name desc";
+ int limit = 20;
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ request.getApiQuery().setLimit(limit);
+ QueryResponse response = validator.execute(request);
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void sexEqualAndAgeGreaterthanequalOrSexEqual() {
+ String sqlite = "SELECT * FROM users WHERE sex = 'male' and age >= 35 or sex = 'female' LIMIT 10";
+ String api = "select * where sex = 'male' and age >= 35 or sex = 'female'";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request, new QueryResultsMatcher() {
+ @Override
+ public boolean equals(List<Entity> expectedEntities, List<Entity> actuallyEntities) {
+ boolean equals = expectedEntities.size() == expectedEntities.size();
+ if( !equals )
+ return false;
+
+ for(Entity entity : actuallyEntities) {
+ int age = (Integer)entity.getProperty("age");
+ String sex = (String)entity.getProperty("sex");
+
+ if(((StringUtils.equals("male",sex) && age >= 35) || StringUtils.equals("female",sex)) == false) {
+ return false;
+ }
+ }
+ return equals;
+ }
+ });
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void sexEqualAndAgeGreaterthanequalOrSexEqual_sortAgeDesc() {
+ String sqlite = "SELECT * FROM users WHERE sex = 'male' and age >= 35 or sex = 'female' ORDER BY age desc LIMIT 10";
+ String api = "select * where sex = 'male' and age >= 35 or sex = 'female' order by age desc";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request);
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void limitL12() {
+ String sqlite = "SELECT * FROM users LIMIT 12";
+ String api = null;
+ int limit = 12;
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ request.getApiQuery().setLimit(limit);
+ QueryResponse response = validator.execute(request);
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void sexEqualAndAgeGreaterthanequalOrSexEqual_sortNameDesc() {
+ String sqlite = "SELECT * FROM users WHERE sex = 'male' and age >= 35 or sex = 'female' ORDER BY name desc LIMIT 10";
+ String api = "select * where sex = 'male' and age >= 35 or sex = 'female' order by name desc";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request);
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void sexEqualAndAgeGreaterthanequalOrSexEqual_sortNameDesc_limitL20() {
+ String sqlite = "SELECT * FROM users WHERE sex = 'male' and age >= 35 or sex = 'female' ORDER BY name desc LIMIT 20";
+ String api = "select * where sex = 'male' and age >= 35 or sex = 'female' order by name desc";
+ int limit = 20;
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ request.getApiQuery().setLimit(limit);
+ QueryResponse response = validator.execute(request);
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void limitL11() {
+ String sqlite = "SELECT * FROM users LIMIT 11";
+ String api = null;
+ int limit = 11;
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ request.getApiQuery().setLimit(limit);
+ QueryResponse response = validator.execute(request);
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void nameBeginswithAndSexEqualAndAgeGreaterthanequalOrSexEqual() {
+ String sqlite = "SELECT * FROM users WHERE name LIKE 'a%' and sex = 'male' and age >= 20 or sex = 'female' LIMIT 10";
+ String api = "select * where name = 'a*' and sex = 'male' and age >= 20 or sex = 'female'";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request);
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void nameBeginswithAndSexEqualAndAgeGreaterthanequalOrSexEqual_limitL20() {
+ String sqlite = "SELECT * FROM users WHERE name LIKE 'a%' and sex = 'male' and age >= 20 or sex = 'female' LIMIT 20";
+ String api = "select * where name = 'a*' and sex = 'male' and age >= 20 or sex = 'female'";
+ int limit = 20;
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ request.getApiQuery().setLimit(limit);
+ QueryResponse response = validator.execute(request);
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void sexEqualAndAgeGreaterthanequal_sortAddressDesc_limitL100() {
+ String sqlite = "SELECT * FROM users WHERE sex = 'male' and age >= 35 ORDER BY address desc LIMIT 100";
+ String api = "select * where sex = 'male' and age >= 35 order by address desc";
+ int limit = 100;
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ request.getApiQuery().setLimit(limit);
+ QueryResponse response = validator.execute(request);
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void qlNameEqual() {
+ String sqlite = "SELECT * FROM users WHERE name = 'judekim' LIMIT 10";
+ String api = "select * where name = 'judekim'";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request);
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void qlAgeEqual() {
+ String sqlite = "SELECT * FROM users WHERE age = 16 LIMIT 10";
+ String api = "select * where age = 16";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request);
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void qlNameEqualAndAgeEqual() {
+ String sqlite = "SELECT * FROM users WHERE name = 'askagirl' and age = 16 LIMIT 10";
+ String api = "select * where name = 'askagirl' and age = 16";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request, new QueryResultsMatcher() {
+ @Override
+ public boolean equals(List<Entity> expectedEntities, List<Entity> actuallyEntities) {
+ boolean equals = expectedEntities.size() == expectedEntities.size();
+ if( !equals )
+ return false;
+
+ for(Entity entity : actuallyEntities) {
+ String name = entity.getName();
+ int age = (Integer)entity.getProperty("age");
+ if ((StringUtils.equals("askagirl", name) && age == 16) == false) {
+ return false;
+ }
+ }
+ return equals;
+ }
+ });
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void qlAgeLessthan() {
+ String sqlite = "SELECT * FROM users WHERE age < 16 LIMIT 10";
+ String api = "select * where age < 16";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request, new QueryResultsMatcher() {
+ @Override
+ public boolean equals(List<Entity> expectedEntities, List<Entity> actuallyEntities) {
+ boolean equals = expectedEntities.size() == expectedEntities.size();
+ if( !equals )
+ return false;
+
+ for(Entity entity : actuallyEntities) {
+ int age = (Integer)entity.getProperty("age");
+ if((age < 16) == false) {
+ return false;
+ }
+ }
+ return equals;
+ }
+ });
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void qlAgeLessthanequal() {
+ String sqlite = "SELECT * FROM users WHERE age <= 16 LIMIT 20";
+ String api = "select * where age <= 16";
+ int limit = 20;
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ request.getApiQuery().setLimit(limit);
+ QueryResponse response = validator.execute(request, new QueryResultsMatcher() {
+ @Override
+ public boolean equals(List<Entity> expectedEntities, List<Entity> actuallyEntities) {
+ boolean equals = expectedEntities.size() == expectedEntities.size();
+ if( !equals )
+ return false;
+
+ for(Entity entity : actuallyEntities) {
+ int age = (Integer)entity.getProperty("age");
+ if((age <= 16) == false) {
+ return false;
+ }
+ }
+ return equals;
+ }
+ });
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void qlAgeGreaterthan() {
+ String sqlite = "SELECT * FROM users WHERE age > 16 LIMIT 10";
+ String api = "select * where age > 16";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request, new QueryResultsMatcher() {
+ @Override
+ public boolean equals(List<Entity> expectedEntities, List<Entity> actuallyEntities) {
+ boolean equals = expectedEntities.size() == expectedEntities.size();
+ if( !equals )
+ return false;
+
+ for(Entity entity : actuallyEntities) {
+ int age = (Integer)entity.getProperty("age");
+ if((age > 16) == false) {
+ return false;
+ }
+ }
+ return equals;
+ }
+ });
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void qlAgeGreaterthanequal() {
+ String sqlite = "SELECT * FROM users WHERE age >= 16 LIMIT 10";
+ String api = "select * where age >= 16";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request, new QueryResultsMatcher() {
+ @Override
+ public boolean equals(List<Entity> expectedEntities, List<Entity> actuallyEntities) {
+ boolean equals = expectedEntities.size() == expectedEntities.size();
+ if( !equals )
+ return false;
+
+ for(Entity entity : actuallyEntities) {
+ int age = (Integer)entity.getProperty("age");
+ if((age >= 16) == false) {
+ return false;
+ }
+ }
+ return equals;
+ }
+ });
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void qlAgeGreaterthanequalAndAgeLessthan() {
+ String sqlite = "SELECT * FROM users WHERE age >= 32 and age < 40 LIMIT 10";
+ String api = "select * where age >= 32 and age < 40";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request, new QueryResultsMatcher() {
+ @Override
+ public boolean equals(List<Entity> expectedEntities, List<Entity> actuallyEntities) {
+ boolean equals = expectedEntities.size() == expectedEntities.size();
+ if( !equals )
+ return false;
+
+ for(Entity entity : actuallyEntities) {
+ int age = (Integer)entity.getProperty("age");
+ if((age >= 32 && age < 40) == false) {
+ return false;
+ }
+ }
+ return equals;
+ }
+ });
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void qlAgeGreaterthanequalAndAgeLessthanAndSexEqual() {
+ String sqlite = "SELECT * FROM users WHERE age >= 32 and age < 40 and sex = 'female' LIMIT 10";
+ String api = "select * where age >= 32 and age < 40 and sex = 'female'";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request, new QueryResultsMatcher() {
+ @Override
+ public boolean equals(List<Entity> expectedEntities, List<Entity> actuallyEntities) {
+ boolean equals = expectedEntities.size() == expectedEntities.size();
+ if( !equals )
+ return false;
+
+ for(Entity entity : actuallyEntities) {
+ int age = (Integer)entity.getProperty("age");
+ String sex = (String)entity.getProperty("sex");
+
+ if((age >= 32 && age < 40 && StringUtils.equals("female",sex)) == false) {
+ return false;
+ }
+ }
+ return equals;
+ }
+ });
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void qlAddressFulltext() {
+ String sqlite = "SELECT * FROM users WHERE address LIKE '%서울시%' LIMIT 10";
+ String api = "select * where address contains '서울시'";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request, new QueryResultsMatcher() {
+ @Override
+ public boolean equals(List<Entity> expectedEntities, List<Entity> actuallyEntities) {
+ boolean equals = expectedEntities.size() == expectedEntities.size();
+ if( !equals )
+ return false;
+
+ for(Entity entity : actuallyEntities) {
+ String address = (String)entity.getProperty("address");
+
+ if((StringUtils.contains(address,"서울시")) == false) {
+ return false;
+ }
+ }
+ return equals;
+ }
+ });
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void qlAddressFulltextstartswith() {
+ String sqlite = " SELECT * FROM users WHERE address LIKE 'A%' LIMIT 10";
+ String api = "select * where address contains 'A*'";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request, new QueryResultsMatcher() {
+ @Override
+ public boolean equals(List<Entity> expectedEntities, List<Entity> actuallyEntities) {
+ boolean equals = expectedEntities.size() == expectedEntities.size();
+ if( !equals )
+ return false;
+
+ for(Entity entity : actuallyEntities) {
+ String address = (String)entity.getProperty("address");
+
+ if((StringUtils.startsWith(address,"A")) == false) {
+ return false;
+ }
+ }
+ return equals;
+ }
+ });
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void qlAddressBeginswith() {
+ String sqlite = "SELECT * FROM users WHERE address LIKE 'B%' LIMIT 10";
+ String api = "select * where address = 'B*'";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request, new QueryResultsMatcher() {
+ @Override
+ public boolean equals(List<Entity> expectedEntities, List<Entity> actuallyEntities) {
+ boolean equals = expectedEntities.size() == expectedEntities.size();
+ if( !equals )
+ return false;
+
+ for(Entity entity : actuallyEntities) {
+ String address = (String)entity.getProperty("address");
+
+ if((StringUtils.startsWith(address,"B")) == false) {
+ return false;
+ }
+ }
+ return equals;
+ }
+ });
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void qlAddressBeginswithAndSexFulltextstartswith() {
+ String sqlite = "SELECT * FROM users WHERE address LIKE 'C%' and sex LIKE 'ma%' LIMIT 10";
+ String api = "select * where address = 'C*' and sex contains 'ma*'";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request, new QueryResultsMatcher() {
+ @Override
+ public boolean equals(List<Entity> expectedEntities, List<Entity> actuallyEntities) {
+ boolean equals = expectedEntities.size() == expectedEntities.size();
+ if( !equals )
+ return false;
+
+ for(Entity entity : actuallyEntities) {
+ String address = (String)entity.getProperty("address");
+
+ if((StringUtils.startsWith(address,"C")) == false) {
+ return false;
+ }
+ }
+ return equals;
+ }
+ });
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void qlAddressBeginswithAndSexFulltext() {
+ String sqlite = "SELECT * FROM users WHERE (address LIKE 'D%' and sex LIKE '%male%') LIMIT 10";
+ String api = "select * where address = 'D*' and sex contains 'male'";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request, new QueryResultsMatcher() {
+ @Override
+ public boolean equals(List<Entity> expectedEntities, List<Entity> actuallyEntities) {
+ boolean equals = expectedEntities.size() == expectedEntities.size();
+ if( !equals )
+ return false;
+
+ for(Entity entity : actuallyEntities) {
+ String address = (String)entity.getProperty("address");
+
+ if((StringUtils.startsWith(address,"D")) == false) {
+ return false;
+ }
+ }
+ return equals;
+ }
+ });
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void qlSexEqualOrAgeGreaterthanequalAndAgeLessthan_limitL20() {
+ String sqlite = "SELECT * FROM users WHERE sex = 'female' or age >= 12 and age < 20 LIMIT 20";
+ String api = "select * where sex = 'female' or age >= 12 and age < 20";
+ int limit = 20;
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ request.getApiQuery().setLimit(limit);
+ QueryResponse response = validator.execute(request, new QueryResultsMatcher() {
+ @Override
+ public boolean equals(List<Entity> expectedEntities, List<Entity> actuallyEntities) {
+ boolean equals = expectedEntities.size() == expectedEntities.size();
+ if( !equals )
+ return false;
+
+ for(Entity entity : actuallyEntities) {
+ int age = (Integer)entity.getProperty("age");
+ String sex = (String)entity.getProperty("sex");
+
+ if(((StringUtils.equals("female",sex) || age >= 12) && age < 20) == false) {
+ return false;
+ }
+ }
+ return equals;
+ }
+ });
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void sortNameAsc() {
+ String sqlite = "SELECT * FROM users ORDER BY name asc LIMIT 10";
+ String api = "select * order by name asc";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request);
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void sortNameDesc() {
+ String sqlite = "SELECT * FROM users ORDER BY name desc LIMIT 10";
+ String api = "select * order by name desc";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request);
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void sortNameAscAgeDesc() {
+ String sqlite = "SELECT * FROM users ORDER BY name asc, age desc LIMIT 10";
+ String api = "select * order by name asc, age desc";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request);
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void sortNameAscAddressAsc() {
+ String sqlite = "SELECT * FROM users ORDER BY name asc, address asc LIMIT 10";
+ String api = "select * order by name asc, address asc";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request);
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void sortCreatedAsc() {
+ String sqlite = "SELECT * FROM users ORDER BY created asc LIMIT 10";
+ String api = "select * order by created asc";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request);
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void sortCreatedDesc() {
+ String sqlite = "SELECT * FROM users ORDER BY created desc LIMIT 10";
+ String api = "select * order by created desc";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request);
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void sortModifiedAsc() {
+ String sqlite = "SELECT * FROM users ORDER BY modified asc LIMIT 10";
+ String api = "select * order by modified asc";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request);
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void sortCreatedDescNameAsc() {
+ String sqlite = "SELECT * FROM users ORDER BY created desc, name asc LIMIT 10";
+ String api = "select * order by created desc, name asc";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request);
+ Assert.assertTrue(response.toString(), response.result());
+ }
+
+ @Test
+ public void sortNameAscCreatedDesc() {
+ String sqlite = "SELECT * FROM users ORDER BY name asc, created desc LIMIT 10";
+ String api = "select * order by name asc, created desc";
+
+ QueryRequest request = new QueryRequest();
+ request.setDbQuery(sqlite);
+ request.getApiQuery().setQuery(api);
+ QueryResponse response = validator.execute(request);
+ Assert.assertTrue(response.toString(), response.result());
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ebfe96e8/stack/query-validator/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/stack/query-validator/src/test/resources/log4j.properties b/stack/query-validator/src/test/resources/log4j.properties
index ddd90fb..d60fa61 100644
--- a/stack/query-validator/src/test/resources/log4j.properties
+++ b/stack/query-validator/src/test/resources/log4j.properties
@@ -39,4 +39,4 @@ log4j.logger.org.usergrid.rest.security.AllowAjaxFilter=WARN, stdout
log4j.logger.me.prettyprint.hector.api.beans.AbstractComposite=ERROR, stdout
log4j.logger.org.usergrid.query.validator.ApiServerRunner=INFO
-log4j.logger.org.usergrid.query.validator.QueryValidatorRunner=INFO
+log4j.logger.org.usergrid.query.validator.QueryValidatorRunner=INFO
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ebfe96e8/stack/query-validator/src/test/resources/project.properties
----------------------------------------------------------------------
diff --git a/stack/query-validator/src/test/resources/project.properties b/stack/query-validator/src/test/resources/project.properties
new file mode 100644
index 0000000..c0bf364
--- /dev/null
+++ b/stack/query-validator/src/test/resources/project.properties
@@ -0,0 +1 @@
+target.directory=${project.build.directory}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ebfe96e8/stack/query-validator/src/test/resources/user.json
----------------------------------------------------------------------
diff --git a/stack/query-validator/src/test/resources/user.json b/stack/query-validator/src/test/resources/user.json
index b1dbc80..19beef1 100644
--- a/stack/query-validator/src/test/resources/user.json
+++ b/stack/query-validator/src/test/resources/user.json
@@ -10,14 +10,14 @@
"name":"zoozooz",
"username":"zoozooz",
"address":"서울시 관악구 봉천동",
- "age":16,
+ "age":76,
"sex":"male"
},
{
"name":"r2fresh",
"username":"r2fresh",
"address":"경기도 고양시 일산",
- "age":16,
+ "age":36,
"sex":"male"
},
{
@@ -38,14 +38,14 @@
"name":"izakaya",
"username":"izakaya",
"address":"인천광역시 어디어디",
- "age":16,
+ "age":28,
"sex":"male"
},
{
"name":"aksagirl",
"username":"aksagirl",
"address":"부산광역시 어딘가",
- "age":16,
+ "age":26,
"sex":"male"
},
{
@@ -70,13 +70,6 @@
"sex":"male"
},
{
- "name":"akaia75",
- "username":"akaia75",
- "address":"서울시 구로구",
- "age":13,
- "sex":"male"
- },
- {
"name":"curioe",
"username":"curioe",
"address":"서울시 어디인가",
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ebfe96e8/stack/query-validator/src/test/resources/usergrid-custom-test.properties
----------------------------------------------------------------------
diff --git a/stack/query-validator/src/test/resources/usergrid-custom-test.properties b/stack/query-validator/src/test/resources/usergrid-custom-test.properties
index 39050d9..6ba10b0 100644
--- a/stack/query-validator/src/test/resources/usergrid-custom-test.properties
+++ b/stack/query-validator/src/test/resources/usergrid-custom-test.properties
@@ -1,6 +1,13 @@
usergrid.query.validator.api.enablelocal=true
-usergrid.query.validator.api.endpoint=http://localhost:8080
+usergrid.query.validator.api.endpoint=http://localhost
+usergrid.query.validator.api.endpoint.port=8080
usergrid.query.validator.api.organization=test-organization
usergrid.query.validator.api.app=test-app
-usergrid.query.validator.api.authorize.email=test@usergrid.com
-usergrid.query.validator.api.authorize.password=test
\ No newline at end of file
+usergrid.query.validator.api.authorize.email=test22
+usergrid.query.validator.api.authorize.password=test
+
+# SysAdmin login
+usergrid.sysadmin.login.name=superuser
+usergrid.sysadmin.login.email=superuser@usergrid.com
+usergrid.sysadmin.login.password=superpassword
+usergrid.sysadmin.login.allowed=true
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ebfe96e8/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 0cccb05..bec5638 100644
--- a/stack/query-validator/src/test/resources/usergrid-test-context.xml
+++ b/stack/query-validator/src/test/resources/usergrid-test-context.xml
@@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
+ 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">
<bean id="properties"
class="org.springframework.beans.factory.config.PropertiesFactoryBean">
@@ -12,12 +15,20 @@
<list>
<value>classpath:/usergrid-default.properties</value>
<value>classpath:/usergrid-test.properties</value>
- <value>${usergrid-custom-spring-test-properties}</value>
+ <value>classpath:/usergrid-custom-test.properties</value>
</list>
</property>
</bean>
- <import resource="classpath:/usergrid-query-validator-context.xml" />
+ <import resource="usergrid-rest-context.xml"/>
+
+ <bean id="traceTagManager" class="org.usergrid.persistence.cassandra.util.TraceTagManager">
+ <property name="reportUnattached" value="false"/>
+ <property name="traceEnabled" value="false"/>
+ </bean>
+
+
+ <bean id="binaryStore" class="org.usergrid.services.assets.data.LocalFileBinaryStore"/>
<bean id="setup" class="org.usergrid.persistence.cassandra.Setup">
<constructor-arg ref="entityManagerFactory"/>
@@ -30,5 +41,6 @@
<constructor-arg ref="cassandraCluster"/>
</bean>
+ <import resource="usergrid-query-validator-context.xml"/>
-</beans>
+</beans>
\ No newline at end of file
[49/50] [abbrv] git commit: removing tarball that accidentally made
it into the commit
Posted by sn...@apache.org.
removing tarball that accidentally made it into the commit
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/e3f8bba5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/e3f8bba5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/e3f8bba5
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: e3f8bba53c9c70b4ae871ce1ee11837327195b6d
Parents: ffaf123
Author: Alex Karasulu <ak...@gmail.com>
Authored: Tue Jan 21 21:42:31 2014 +0200
Committer: Alex Karasulu <ak...@gmail.com>
Committed: Tue Jan 21 21:42:31 2014 +0200
----------------------------------------------------------------------
stack/corepersistence/collection.tgz | Bin 47520 -> 0 bytes
1 file changed, 0 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e3f8bba5/stack/corepersistence/collection.tgz
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection.tgz b/stack/corepersistence/collection.tgz
deleted file mode 100644
index 1f152ca..0000000
Binary files a/stack/corepersistence/collection.tgz and /dev/null differ
[50/50] [abbrv] git commit: Merge pull request #18 from
tonuquq/two-dot-o
Posted by sn...@apache.org.
Merge pull request #18 from tonuquq/two-dot-o
adding chop integration for distributed performance stress 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/2c6e7e48
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/2c6e7e48
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/2c6e7e48
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: 2c6e7e4863d57c9f69d32829ee3acaaee3635647
Parents: 53e2ade e3f8bba
Author: Dave Johnson <da...@rollerweblogger.org>
Authored: Tue Jan 21 12:36:17 2014 -0800
Committer: Dave Johnson <da...@rollerweblogger.org>
Committed: Tue Jan 21 12:36:17 2014 -0800
----------------------------------------------------------------------
stack/.gitignore | 1 +
stack/corepersistence/collection/pom.xml | 61 +++++-
.../astyanax/AstyanaxKeyspaceProvider.java | 28 ++-
.../collection/astyanax/CassandraFig.java | 2 +-
.../cassandra/AvailablePortFinder.java | 187 +++++++++++++++++++
.../collection/guice/CollectionModule.java | 37 ++++
.../src/main/resources/usergrid.properties | 1 +
.../cassandra/AvailablePortFinder.java | 187 -------------------
.../collection/cassandra/CassandraRule.java | 27 +--
...MvccEntitySerializationStrategyImplTest.java | 22 ++-
.../src/test/resources/log4j.properties | 12 +-
.../src/test/resources/usergrid-CHOP.properties | 12 ++
.../src/test/resources/usergrid-UNIT.properties | 1 +
.../persistence/model/field/EntityTest.java | 4 +-
14 files changed, 357 insertions(+), 225 deletions(-)
----------------------------------------------------------------------
[48/50] [abbrv] git commit: Merge branch 'two-dot-o' of
https://github.com/usergrid/usergrid into two-dot-o
Posted by sn...@apache.org.
Merge branch 'two-dot-o' of https://github.com/usergrid/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/ffaf1233
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/ffaf1233
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/ffaf1233
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: ffaf1233bd63cf5bc9d6c8a189202092b19625a3
Parents: 47cd79a 53e2ade
Author: Alex Karasulu <ak...@gmail.com>
Authored: Tue Jan 21 21:26:50 2014 +0200
Committer: Alex Karasulu <ak...@gmail.com>
Committed: Tue Jan 21 21:26:50 2014 +0200
----------------------------------------------------------------------
.../DynamicCompositeFieldSerializer.java | 5 +-
.../IdColDynamicCompositeSerializer.java | 5 +-
.../persistence/collection/CollectionScope.java | 18 ++++++
.../collection/EntityCollectionManager.java | 18 ++++++
.../EntityCollectionManagerFactory.java | 52 +++++++++++++-----
.../collection/EntityCollectionManagerSync.java | 20 ++++++-
.../collection/OrganizationScope.java | 18 ++++++
.../astyanax/AstyanaxKeyspaceProvider.java | 18 ++++++
.../collection/astyanax/CassandraFig.java | 18 ++++++
.../astyanax/CompositeFieldSerializer.java | 18 ++++++
.../astyanax/IdRowCompositeSerializer.java | 18 ++++++
.../astyanax/MultiTennantColumnFamily.java | 21 ++++++-
.../MultiTennantColumnFamilyDefinition.java | 18 ++++++
.../collection/astyanax/ScopedRowKey.java | 22 +++++++-
.../collection/guice/PropertyUtils.java | 18 ++++++
.../collection/impl/CollectionScopeImpl.java | 18 ++++++
.../impl/EntityCollectionManagerImpl.java | 18 ++++++
.../impl/EntityCollectionManagerSyncImpl.java | 18 ++++++
.../collection/migration/Migration.java | 18 ++++++
.../migration/MigrationException.java | 18 ++++++
.../collection/migration/MigrationManager.java | 18 ++++++
.../mvcc/MvccEntitySerializationStrategy.java | 18 ++++++
.../mvcc/MvccLogEntrySerializationStrategy.java | 18 ++++++
.../collection/mvcc/entity/MvccEntity.java | 18 ++++++
.../collection/mvcc/entity/MvccLogEntry.java | 18 ++++++
.../collection/mvcc/entity/Stage.java | 18 ++++++
.../collection/mvcc/entity/ValidationUtils.java | 18 ++++++
.../mvcc/entity/impl/MvccEntityImpl.java | 21 ++++++-
.../mvcc/entity/impl/MvccLogEntryImpl.java | 18 ++++++
.../mvcc/event/PostProcessObserver.java | 21 ++++++-
.../mvcc/stage/CollectionIoEvent.java | 19 ++++++-
.../mvcc/stage/delete/DeleteCommit.java | 46 +++++++++++-----
.../mvcc/stage/delete/DeleteStart.java | 31 +++++++++--
.../collection/mvcc/stage/load/Load.java | 30 ++++++++--
.../mvcc/stage/write/UniqueValueImpl.java | 2 +-
.../collection/rx/CassandraThreadScheduler.java | 44 ++++++++++-----
.../persistence/collection/rx/Concurrent.java | 42 ++++++++++----
.../persistence/collection/rx/RxFig.java | 18 ++++++
.../model/builder/EntitySerializer.java | 19 ++++++-
.../model/builder/EntitySerializerFactory.java | 20 ++++++-
.../persistence/model/entity/Entity.java | 22 ++++++--
.../usergrid/persistence/model/entity/Id.java | 18 ++++++
.../persistence/model/entity/SimpleId.java | 18 ++++++
.../persistence/model/field/ArrayField.java | 48 ++++++++++------
.../persistence/model/field/BooleanField.java | 2 -
.../model/field/ByteBufferField.java | 40 ++++++++++----
.../persistence/model/field/DoubleField.java | 2 -
.../model/field/EntityObjectField.java | 33 ++++++++---
.../usergrid/persistence/model/field/Field.java | 24 ++++++--
.../persistence/model/field/IntegerField.java | 2 -
.../persistence/model/field/ListField.java | 44 ++++++++++-----
.../persistence/model/field/LocationField.java | 36 +++++++++---
.../persistence/model/field/SetField.java | 44 ++++++++++-----
.../model/field/value/EntityObject.java | 58 +++++++++++++-------
.../persistence/model/field/value/Location.java | 39 ++++++++-----
.../usergrid/persistence/model/util/Verify.java | 21 ++++++-
stack/rest/pom.xml | 8 +--
stack/rest/src/test/resources/log4j.properties | 2 +-
58 files changed, 1085 insertions(+), 210 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ffaf1233/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/AstyanaxKeyspaceProvider.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ffaf1233/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/CassandraFig.java
----------------------------------------------------------------------
[18/50] [abbrv] git commit: Make tests happy despite the fact that
the JUnit Theory stuff does not like Jukito.
Posted by sn...@apache.org.
Make tests happy despite the fact that the JUnit Theory stuff does not like Jukito.
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/ffbbed30
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/ffbbed30
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/ffbbed30
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: ffbbed30f00b47b60874ff1454e856bc083e1d30
Parents: 000a219
Author: Dave Johnson <dm...@apigee.com>
Authored: Wed Jan 15 17:27:29 2014 -0500
Committer: Dave Johnson <dm...@apigee.com>
Committed: Wed Jan 15 17:27:29 2014 -0500
----------------------------------------------------------------------
.../collection/mvcc/entity/ValidationUtils.java | 3 +-
.../mvcc/stage/write/WriteUniqueVerify.java | 26 ++--
.../mvcc/stage/AbstractMvccEntityStageTest.java | 59 ++++----
.../mvcc/stage/InvalidMvccEntityGenerator.java | 126 ----------------
.../mvcc/stage/write/WriteUniqueVerifyTest.java | 10 +-
.../collection/util/InvalidEntityGenerator.java | 4 +
.../collection/util/InvalidIdGenerator.java | 51 ++++---
.../util/InvalidMvccEntityGenerator.java | 144 +++++++++++++++++++
8 files changed, 223 insertions(+), 200 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ffbbed30/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/ValidationUtils.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/ValidationUtils.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/ValidationUtils.java
index e8a8481..0d416ed 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/ValidationUtils.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/ValidationUtils.java
@@ -82,8 +82,7 @@ public class ValidationUtils {
final UUID uuid = entityId.getUuid();
- Preconditions.checkArgument( uuid != null, "The id uuid is required to be set" );
-
+ Preconditions.checkNotNull( uuid, "The id uuid is required to be set" );
Preconditions.checkArgument( uuid.version() == UUID_VERSION, "The uuid must be version 1" );
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ffbbed30/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 b6ae94d..5ddd519 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
@@ -49,27 +49,38 @@ public class WriteUniqueVerify
private static final Logger LOG = LoggerFactory.getLogger( WriteUniqueVerify.class );
- private final WriteFig writeFig;
-
private final UniqueValueSerializationStrategy uniqueValueStrat;
private final ExecutorService threadPool;
+ private final int MAX_THREAD_COUNT;
+
+ private final int UNIQUE_VALUE_TTL;
+
@Inject
public WriteUniqueVerify( WriteFig writeFig,
UniqueValueSerializationStrategy uniqueValueSerializiationStrategy ) {
- this.writeFig = writeFig;
+
this.uniqueValueStrat = uniqueValueSerializiationStrategy;
- this.threadPool = Executors.newFixedThreadPool( writeFig.getMaxThreadCount() );
+
+ if ( writeFig == null) {
+ MAX_THREAD_COUNT = 100;
+ UNIQUE_VALUE_TTL = 30;
+ } else {
+ MAX_THREAD_COUNT = writeFig.getMaxThreadCount();
+ UNIQUE_VALUE_TTL = writeFig.getUniqueValueTimeToLive();
+ }
+
+ this.threadPool = Executors.newFixedThreadPool( MAX_THREAD_COUNT );
}
@Override
public CollectionIoEvent<MvccEntity> call( final CollectionIoEvent<MvccEntity> ioevent ) {
- final Entity entity = ioevent.getEvent().getEntity().get();
-
ValidationUtils.verifyMvccEntityWithEntity( ioevent.getEvent() );
+ final Entity entity = ioevent.getEvent().getEntity().get();
+
// use simple thread pool to verify fields in parallel
final List<Future<FieldUniquenessResult>> results =
new ArrayList<Future<FieldUniquenessResult>>();
@@ -87,8 +98,7 @@ public class WriteUniqueVerify
field, entity.getId(), entity.getVersion() );
// use TTL in case something goes wrong before entity is finally committed
- MutationBatch mb = uniqueValueStrat.write(
- written, writeFig.getUniqueValueTimeToLive() );
+ MutationBatch mb = uniqueValueStrat.write( written, UNIQUE_VALUE_TTL );
try {
mb.execute();
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ffbbed30/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractMvccEntityStageTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractMvccEntityStageTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractMvccEntityStageTest.java
index fafefc3..527c1de 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractMvccEntityStageTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractMvccEntityStageTest.java
@@ -17,7 +17,8 @@
*/
package org.apache.usergrid.persistence.collection.mvcc.stage;
-
+import org.apache.usergrid.persistence.collection.util.InvalidMvccEntityGenerator;
+import com.google.common.base.Optional;
import org.junit.Test;
import org.junit.experimental.theories.Theories;
import org.junit.experimental.theories.Theory;
@@ -31,67 +32,67 @@ import org.apache.usergrid.persistence.collection.util.InvalidIdGenerator;
import org.apache.usergrid.persistence.model.entity.Entity;
import org.apache.usergrid.persistence.model.entity.Id;
-import com.google.common.base.Optional;
-
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
-
-/** @author tnine */
-@RunWith(Theories.class)
+/**
+ * @author tnine
+ */
+@RunWith( Theories.class )
public abstract class AbstractMvccEntityStageTest {
+ private static final Logger LOG = LoggerFactory.getLogger( AbstractMvccEntityStageTest.class );
+
/**
- * Tests all possible combinations that will result in a NullPointerException input fail the
+ * Tests all possible combinations that will result in a NullPointerException input fail the
* MvccEntity interface to be a mockito mock impl
*/
- @Test(expected = NullPointerException.class)
+ @Test( expected = NullPointerException.class )
@Theory
- public void testNonNullable(
- @InvalidMvccEntityGenerator.NullFields final MvccEntity mvccEntity,
+ public void testNonNullable(
+ @InvalidMvccEntityGenerator.NullFields final MvccEntity mvccEntity,
@InvalidEntityGenerator.NullFields final Entity entity,
@InvalidIdGenerator.NullFields final Id nullValidationFailId ) throws Exception {
testStage( mvccEntity, entity, nullValidationFailId );
}
-
/**
- * Tests all possible combinations that will result in an invalid input Excepts the MvccEntity
+ * Tests all possible combinations that will result in an invalid input Excepts the MvccEntity
* interface to be a mockito mock impl
*/
- @Test(expected = IllegalArgumentException.class)
+ @Test( expected = IllegalArgumentException.class )
@Theory
- public void testInvalidValue(
- @InvalidMvccEntityGenerator.IllegalFields final MvccEntity mvccEntity,
+ public void testInvalidValue(
+ @InvalidMvccEntityGenerator.IllegalFields final MvccEntity mvccEntity,
@InvalidEntityGenerator.IllegalFields final Entity entity,
@InvalidIdGenerator.IllegalFields final Id invalidValueId ) throws Exception {
testStage( mvccEntity, entity, invalidValueId );
}
+ public void testStage(
+ final MvccEntity mvccEntity, final Entity entity, final Id id ) throws Exception {
- public void testStage(
- final MvccEntity mvccEntity, final Entity entity, final Id id ) throws Exception {
-
-// if ( entity != null ) {
-// EntityUtils.setId( entity, id );
-// }
+ if ( entity != null ) {
+ EntityUtils.setId( entity, id );
+ }
final CollectionScope context = mock( CollectionScope.class );
-// if ( mvccEntity != null ) {
-// when(mvccEntity.getEntity() ).thenReturn( Optional.fromNullable( entity ) );
-// when(mvccEntity.getId()).thenReturn( id );
-// }
+ if ( mvccEntity != null ) {
+ when( mvccEntity.getEntity() ).thenReturn( Optional.fromNullable( entity ) );
+ when( mvccEntity.getId() ).thenReturn( id );
+ }
validateStage( new CollectionIoEvent<MvccEntity>( context, mvccEntity ) );
}
-
- /**
- * Get an instance of the Func1 That takes an CollectionIoEvent with an entity type
- * for validation testing
+ /**
+ * Get an instance of the Func1 That takes an CollectionIoEvent with an entity type for
+ * validation testing
*/
protected abstract void validateStage( CollectionIoEvent<MvccEntity> event );
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ffbbed30/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/InvalidMvccEntityGenerator.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/InvalidMvccEntityGenerator.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/InvalidMvccEntityGenerator.java
deleted file mode 100644
index e1393c2..0000000
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/InvalidMvccEntityGenerator.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * 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.
- */
-package org.apache.usergrid.persistence.collection.mvcc.stage;
-
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.UUID;
-
-import org.junit.experimental.theories.ParameterSignature;
-import org.junit.experimental.theories.ParameterSupplier;
-import org.junit.experimental.theories.ParametersSuppliedBy;
-import org.junit.experimental.theories.PotentialAssignment;
-
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
-import org.apache.usergrid.persistence.model.entity.Id;
-import org.apache.usergrid.persistence.model.util.UUIDGenerator;
-
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-
-/**
- * Generates a list of invalid MvccEntities for input verification. To be used with theory testing.
- *
- * @author tnine
- */
-public class InvalidMvccEntityGenerator {
-
-
- @Retention( RetentionPolicy.RUNTIME )
- @ParametersSuppliedBy( NullFieldsSupplier.class )
- public @interface NullFields {
-
- }
-
-
- /** Supplies all possible combination of null fields on entities */
- public static class NullFieldsSupplier extends ParameterSupplier {
-
-
- @Override
- public List<PotentialAssignment> getValueSources( final ParameterSignature sig ) {
- final List<PotentialAssignment> result = new ArrayList<PotentialAssignment>();
-
- result.add( PotentialAssignment.forValue( "nullValue", null ) );
- result.add( PotentialAssignment.forValue( "nullSubTypes", nullSubElements() ) );
-
- return result;
- }
-
-
- /** Missing fields */
- private static MvccEntity nullSubElements() {
-
- final MvccEntity entity = mock( MvccEntity.class );
- return entity;
- }
-
-
-
- }
-
-
- @Retention( RetentionPolicy.RUNTIME )
- @ParametersSuppliedBy( IllegalFieldsSupplier.class )
- public @interface IllegalFields {
-
- }
-
-
- /** Supplies all possible combination of null fields on entities */
- public static class IllegalFieldsSupplier extends ParameterSupplier {
-
-
- @Override
- public List<PotentialAssignment> getValueSources( final ParameterSignature sig ) {
- final List<PotentialAssignment> result = new ArrayList<PotentialAssignment>();
-
- result.add( PotentialAssignment.forValue( "wrongUuidType", wrongUuidType() ) );
- result.add( PotentialAssignment.forValue( "invalidSubTypes", mock( MvccEntity.class )) );
-
- return result;
- }
-
-
- /** Incorrect fields */
-
-
- private static MvccEntity wrongUuidType() {
-
- final Id id = mock( Id.class );
-
- when( id.getUuid() ).thenReturn( UUIDGenerator.newTimeUUID() );
- when( id.getType() ).thenReturn( "test" );
-
- final MvccEntity entity = mock( MvccEntity.class );
-
- when( entity.getId() ).thenReturn( id );
- when( entity.getVersion() ).thenReturn( UUID.randomUUID() );
-
- return entity;
- }
-
-
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ffbbed30/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerifyTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerifyTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerifyTest.java
index 7569c18..91d9295 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerifyTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerifyTest.java
@@ -30,18 +30,15 @@ import org.apache.usergrid.persistence.model.entity.Entity;
import static org.apache.usergrid.persistence.collection.mvcc.stage.TestEntityGenerator.fromEntity;
import static org.apache.usergrid.persistence.collection.mvcc.stage.TestEntityGenerator.generateEntity;
-import org.jukito.JukitoRunner;
import org.jukito.UseModules;
import static org.junit.Assert.assertSame;
import org.junit.ClassRule;
-import org.junit.runner.RunWith;
import static org.mockito.Mockito.mock;
/**
* @author tnine
*/
-@RunWith( JukitoRunner.class )
@UseModules( CollectionModule.class )
public class WriteUniqueVerifyTest extends AbstractMvccEntityStageTest {
@@ -51,9 +48,6 @@ public class WriteUniqueVerifyTest extends AbstractMvccEntityStageTest {
@Inject
private UniqueValueSerializationStrategy uniqueValueSerializiationStrategy;
- @Inject
- private WriteFig writeFig;
-
/** Standard flow */
@Test
public void testStartStage() throws Exception {
@@ -66,7 +60,7 @@ public class WriteUniqueVerifyTest extends AbstractMvccEntityStageTest {
final MvccEntity mvccEntity = fromEntity( entity );
// run the stage
- WriteUniqueVerify newStage = new WriteUniqueVerify( writeFig, uniqueValueSerializiationStrategy );
+ WriteUniqueVerify newStage = new WriteUniqueVerify( null, uniqueValueSerializiationStrategy );
CollectionIoEvent<MvccEntity>
result = newStage.call( new CollectionIoEvent<MvccEntity>( collectionScope, mvccEntity ) );
@@ -86,7 +80,7 @@ public class WriteUniqueVerifyTest extends AbstractMvccEntityStageTest {
@Override
protected void validateStage( final CollectionIoEvent<MvccEntity> event ) {
- new WriteUniqueVerify( writeFig, uniqueValueSerializiationStrategy ).call( event );
+ new WriteUniqueVerify( null, uniqueValueSerializiationStrategy ).call( event );
}
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ffbbed30/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidEntityGenerator.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidEntityGenerator.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidEntityGenerator.java
index df4fb72..5879d74 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidEntityGenerator.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidEntityGenerator.java
@@ -32,6 +32,8 @@ import org.junit.experimental.theories.PotentialAssignment;
import org.apache.usergrid.persistence.model.entity.Entity;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
@@ -42,6 +44,7 @@ import static org.mockito.Mockito.when;
*/
public class InvalidEntityGenerator {
+ private static final Logger LOG = LoggerFactory.getLogger( InvalidIdGenerator.class );
@Retention(RetentionPolicy.RUNTIME)
@ParametersSuppliedBy(NullFieldsSupplier.class)
@@ -84,6 +87,7 @@ public class InvalidEntityGenerator {
@Override
public List<PotentialAssignment> getValueSources( final ParameterSignature sig ) {
+
final List<PotentialAssignment> result = new ArrayList<PotentialAssignment>();
result.add( PotentialAssignment
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ffbbed30/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 5341813..5044611 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
@@ -17,7 +17,6 @@
*/
package org.apache.usergrid.persistence.collection.util;
-
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
@@ -34,15 +33,17 @@ import org.apache.usergrid.persistence.model.util.UUIDGenerator;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
- * Generates a list of invalid entities for input verification. To be used with Theory testing.
+ * Generates a list of invalid entities for input verification. To be used with Theory testing.
*
* @author tnine
*/
public class InvalidIdGenerator {
+ private static final Logger LOG = LoggerFactory.getLogger( InvalidIdGenerator.class );
@Retention( RetentionPolicy.RUNTIME )
@ParametersSuppliedBy( NullFieldsSupplier.class )
@@ -50,10 +51,11 @@ public class InvalidIdGenerator {
}
- /** Supplies all possible combination of null fields on ids */
+ /**
+ * Supplies all possible combination of null fields on ids
+ */
public static class NullFieldsSupplier extends ParameterSupplier {
-
@Override
public List<PotentialAssignment> getValueSources( final ParameterSignature sig ) {
final List<PotentialAssignment> result = new ArrayList<PotentialAssignment>();
@@ -65,21 +67,22 @@ public class InvalidIdGenerator {
return result;
}
-
- /** Missing fields */
+ /**
+ * Missing fields
+ */
private static Id nullEntityId() {
-
final Id entityId = mock( Id.class );
when( entityId.getUuid() ).thenReturn( null );
when( entityId.getType() ).thenReturn( "test" );
- return entityId ;
+ return entityId;
}
-
- /** Null entity type */
+ /**
+ * Null entity type
+ */
private static Id nullEntityType() {
final Id entityId = mock( Id.class );
@@ -87,60 +90,54 @@ public class InvalidIdGenerator {
when( entityId.getUuid() ).thenReturn( UUIDGenerator.newTimeUUID() );
when( entityId.getType() ).thenReturn( null );
- return entityId ;
+ return entityId;
}
}
-
@Retention( RetentionPolicy.RUNTIME )
@ParametersSuppliedBy( IllegalFieldsSupplier.class )
public @interface IllegalFields {
}
-
- /** Supplies all possible combination of null fields on ids */
+ /**
+ * Supplies all possible combination of null fields on ids
+ */
public static class IllegalFieldsSupplier extends ParameterSupplier {
-
@Override
public List<PotentialAssignment> getValueSources( final ParameterSignature sig ) {
- final List<PotentialAssignment> result = new ArrayList<PotentialAssignment>();
-
+ final List<PotentialAssignment> result = new ArrayList<PotentialAssignment>();
result.add( PotentialAssignment.forValue( "wrongEntityUuidType", wrongEntityUuidType() ) );
result.add( PotentialAssignment.forValue( "wrongEntityTypeLength", wrongEntityTypeLength() ) );
return result;
}
-
- /** Incorrect fields */
-
-
+ /**
+ * 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 ;
+ return entityId;
}
-
private static Id wrongEntityTypeLength() {
-
final Id entityId = mock( Id.class );
//set this to a non time uuid
when( entityId.getUuid() ).thenReturn( UUID.randomUUID() );
when( entityId.getType() ).thenReturn( "" );
- return entityId ;
+ return entityId;
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ffbbed30/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidMvccEntityGenerator.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidMvccEntityGenerator.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidMvccEntityGenerator.java
new file mode 100644
index 0000000..8056b2d
--- /dev/null
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidMvccEntityGenerator.java
@@ -0,0 +1,144 @@
+/*
+ * 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.
+ */
+package org.apache.usergrid.persistence.collection.util;
+
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
+import org.junit.experimental.theories.ParameterSignature;
+import org.junit.experimental.theories.ParameterSupplier;
+import org.junit.experimental.theories.ParametersSuppliedBy;
+import org.junit.experimental.theories.PotentialAssignment;
+
+import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
+import org.apache.usergrid.persistence.model.entity.Id;
+import org.apache.usergrid.persistence.model.util.UUIDGenerator;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * Generates a list of invalid MvccEntities for input verification. To be used with theory testing.
+ *
+ * @author tnine
+ */
+public class InvalidMvccEntityGenerator {
+
+ private static final Logger LOG = LoggerFactory.getLogger( InvalidIdGenerator.class );
+
+ @Retention( RetentionPolicy.RUNTIME )
+ @ParametersSuppliedBy( NullFieldsSupplier.class )
+ public @interface NullFields {
+
+ }
+
+
+ /** Supplies all possible combination of null fields on entities */
+ public static class NullFieldsSupplier extends ParameterSupplier {
+
+
+ @Override
+ public List<PotentialAssignment> getValueSources( final ParameterSignature sig ) {
+
+ final List<PotentialAssignment> result = new ArrayList<PotentialAssignment>();
+
+ result.add( PotentialAssignment.forValue( "nullValue", null ) );
+ result.add( PotentialAssignment.forValue( "nullSubTypes", nullSubElements() ) );
+
+ return result;
+ }
+
+
+ /** Missing fields */
+ private static MvccEntity nullSubElements() {
+
+ final MvccEntity entity = mock( MvccEntity.class );
+ return entity;
+ }
+
+
+
+ }
+
+
+ @Retention( RetentionPolicy.RUNTIME )
+ @ParametersSuppliedBy( IllegalFieldsSupplier.class )
+ public @interface IllegalFields {
+
+ }
+
+
+ /** Supplies all possible combination of null fields on entities */
+ public static class IllegalFieldsSupplier extends ParameterSupplier {
+
+
+ @Override
+ public List<PotentialAssignment> getValueSources( final ParameterSignature sig ) {
+ final List<PotentialAssignment> result = new ArrayList<PotentialAssignment>();
+
+ result.add( PotentialAssignment.forValue( "wrongUuidType", wrongUuidType() ) );
+ result.add( PotentialAssignment.forValue( "invalidSubTypes", invalidId() ) );
+
+ return result;
+ }
+
+
+ /** Incorrect fields */
+
+
+ private static MvccEntity wrongUuidType() {
+
+ final Id id = mock( Id.class );
+
+ when( id.getUuid() ).thenReturn( UUIDGenerator.newTimeUUID() );
+ when( id.getType() ).thenReturn( "test" );
+
+ final MvccEntity entity = mock( MvccEntity.class );
+
+ when( entity.getId() ).thenReturn( id );
+ when( entity.getVersion() ).thenReturn( UUID.randomUUID() );
+
+ return entity;
+ }
+
+ private static MvccEntity invalidId() {
+
+ final Id id = mock( Id.class );
+
+ when( id.getUuid() ).thenReturn( UUIDGenerator.newTimeUUID() );
+ when( id.getType() ).thenReturn( "" );
+
+ final MvccEntity entity = mock( MvccEntity.class );
+
+ when( entity.getId() ).thenReturn( id );
+ when( entity.getVersion() ).thenReturn( UUID.randomUUID() );
+
+ return entity;
+ }
+
+ }
+
+
+}
[46/50] [abbrv] git commit: Merge pull request #33 from
sungjuly/USERGRID-14
Posted by sn...@apache.org.
Merge pull request #33 from sungjuly/USERGRID-14
Support Java7 on Mac
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/53e2ade8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/53e2ade8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/53e2ade8
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: 53e2ade8e9572ccce35126923330136de22c187c
Parents: 8773a18 ff011d8
Author: tonuquq <to...@gmail.com>
Authored: Tue Jan 21 09:39:54 2014 -0800
Committer: tonuquq <to...@gmail.com>
Committed: Tue Jan 21 09:39:54 2014 -0800
----------------------------------------------------------------------
stack/rest/pom.xml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
[34/50] [abbrv] git commit: Add query-validator module
Posted by sn...@apache.org.
Add query-validator module
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/bb52e1c2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/bb52e1c2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/bb52e1c2
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: bb52e1c2c0cdb25bef8d7ba980034d060a088d3c
Parents: ebfe96e
Author: Sungju Jin <su...@softwaregeeks.org>
Authored: Thu Jan 16 23:04:57 2014 +0900
Committer: Sungju Jin <su...@softwaregeeks.org>
Committed: Thu Jan 16 23:04:57 2014 +0900
----------------------------------------------------------------------
stack/pom.xml | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bb52e1c2/stack/pom.xml
----------------------------------------------------------------------
diff --git a/stack/pom.xml b/stack/pom.xml
index 2ec4757..7906901 100644
--- a/stack/pom.xml
+++ b/stack/pom.xml
@@ -166,6 +166,7 @@
<module>websocket</module>
<module>rest</module>
<module>launcher</module>
+ <module>query-validator</module>
<module>test-utils</module>
<module>build-tools</module>
</modules>
[33/50] [abbrv] git commit: Refactoring and Improving query-validator
module
Posted by sn...@apache.org.
Refactoring and Improving query-validator module
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/ebfe96e8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/ebfe96e8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/ebfe96e8
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: ebfe96e8403d62ecb4a3c27e019ae4a65576e24c
Parents: 447ede6
Author: Sungju Jin <su...@softwaregeeks.org>
Authored: Thu Jan 16 23:04:12 2014 +0900
Committer: Sungju Jin <su...@softwaregeeks.org>
Committed: Thu Jan 16 23:04:12 2014 +0900
----------------------------------------------------------------------
stack/query-validator/pom.xml | 235 +++--
.../query/validator/ApiServerRunner.java | 49 +-
.../validator/DefaultQueryResultsMatcher.java | 32 +
.../usergrid/query/validator/QueryEntity.java | 31 +-
.../usergrid/query/validator/QueryRequest.java | 31 +-
.../usergrid/query/validator/QueryResponse.java | 22 +-
.../query/validator/QueryResultsMatcher.java | 29 +
.../usergrid/query/validator/QueryRunner.java | 23 +-
.../validator/QueryValidationConfiguration.java | 22 +-
.../query/validator/QueryValidator.java | 33 +-
.../usergrid/query/validator/SqliteRunner.java | 60 +-
.../usergrid-query-validator-context.xml | 16 +-
.../query/validator/AbstractQueryIT.java | 133 +++
.../usergrid/query/validator/QueryITSuite.java | 39 +
.../query/validator/QueryValidationTest.java | 339 -------
.../query/validator/QueryValidatorRunner.java | 209 -----
.../query/validator/users/UserQueryIT.java | 877 +++++++++++++++++++
.../src/test/resources/log4j.properties | 2 +-
.../src/test/resources/project.properties | 1 +
.../src/test/resources/user.json | 15 +-
.../resources/usergrid-custom-test.properties | 13 +-
.../test/resources/usergrid-test-context.xml | 24 +-
22 files changed, 1476 insertions(+), 759 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ebfe96e8/stack/query-validator/pom.xml
----------------------------------------------------------------------
diff --git a/stack/query-validator/pom.xml b/stack/query-validator/pom.xml
index eb0f42e..30bb3dd 100644
--- a/stack/query-validator/pom.xml
+++ b/stack/query-validator/pom.xml
@@ -5,23 +5,19 @@
<parent>
<groupId>org.usergrid</groupId>
<artifactId>usergrid</artifactId>
- <version>0.0.16-SNAPSHOT</version>
+ <version>0.0.28-SNAPSHOT</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <!-- This seems to be a safe figure -->
+ <core.it.heapmax>1024m</core.it.heapmax>
+ <core.it.heapmin>1024m</core.it.heapmin>
</properties>
<artifactId>usergrid-query-validator</artifactId>
<name>Usergrid Query Validator</name>
- <description>Query validator tools for Usergrid system.</description>
+ <description>Query validator tools for Usergrid.</description>
<packaging>jar</packaging>
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-report-plugin</artifactId>
- </plugin>
- </plugins>
- </reporting>
+
<build>
<resources>
<resource>
@@ -37,9 +33,7 @@
<directory>src/test/resources</directory>
<filtering>true</filtering>
<includes>
- <include>**/*.xml</include>
- <include>**/*.properties</include>
- <include>**/*.json</include>
+ <include>**/*</include>
</includes>
</testResource>
</testResources>
@@ -48,7 +42,17 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <testFailureIgnore>false</testFailureIgnore>
+ <argLine>-Xmx${core.it.heapmax} -Xms${core.it.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8
+ </argLine>
+
+ <includes>
+ <include>**/*Suite.java</include>
+ </includes>
+ <excludes>
+ <!-- Need to exclude Suite tests to prevent double execution -->
+ <exclude>**/UserQueryIT.java</exclude>
+ </excludes>
+
</configuration>
</plugin>
@@ -77,7 +81,6 @@
<goal>test-jar</goal>
</goals>
<configuration>
- <classifier>tests</classifier>
<includes>
<include>**/org/usergrid/**</include>
</includes>
@@ -92,142 +95,202 @@
<groupId>org.usergrid</groupId>
<artifactId>usergrid-config</artifactId>
<version>${project.version}</version>
- <scope>test</scope>
- <classifier>tests</classifier>
</dependency>
+
<dependency>
<groupId>org.usergrid</groupId>
- <artifactId>usergrid-count-batcher</artifactId>
+ <artifactId>usergrid-core</artifactId>
<version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>commons-logging</artifactId>
+ <groupId>commons-logging</groupId>
+ </exclusion>
+ </exclusions>
</dependency>
+
<dependency>
<groupId>org.usergrid</groupId>
- <artifactId>usergrid-count-common</artifactId>
+ <artifactId>usergrid-rest</artifactId>
<version>${project.version}</version>
+ <classifier>classes</classifier>
+ <exclusions>
+ <exclusion>
+ <artifactId>servlet-api</artifactId>
+ <groupId>javax.servlet</groupId>
+ </exclusion>
+ </exclusions>
</dependency>
+
<dependency>
<groupId>org.usergrid</groupId>
- <artifactId>usergrid-test-utils</artifactId>
+ <artifactId>usergrid-rest</artifactId>
<version>${project.version}</version>
- <scope>test</scope>
+ <classifier>compiled-jsp</classifier>
</dependency>
+
<dependency>
<groupId>org.usergrid</groupId>
- <artifactId>usergrid-core</artifactId>
+ <artifactId>usergrid-rest</artifactId>
<version>${project.version}</version>
- <exclusions>
- <exclusion>
- <artifactId>commons-logging</artifactId>
- <groupId>commons-logging</groupId>
- </exclusion>
- </exclusions>
+ <classifier>tests</classifier>
+ <scope>test</scope>
</dependency>
+
+ <!-- Apache Dependencies -->
+
<dependency>
- <groupId>org.usergrid</groupId>
- <artifactId>usergrid-scheduler</artifactId>
- <version>${project.version}</version>
+ <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>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.usergrid</groupId>
- <artifactId>usergrid-core</artifactId>
+ <artifactId>usergrid-config</artifactId>
<version>${project.version}</version>
<scope>test</scope>
<classifier>tests</classifier>
</dependency>
+
<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
+ <groupId>org.usergrid</groupId>
+ <artifactId>usergrid-test-utils</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
</dependency>
+
<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
+ <groupId>org.usergrid</groupId>
+ <artifactId>usergrid-core</artifactId>
+ <version>${project.version}</version>
<scope>test</scope>
+ <classifier>tests</classifier>
</dependency>
+
<dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency>
+
<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>jcl-over-slf4j</artifactId>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
+
<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>jul-to-slf4j</artifactId>
+ <groupId>org.jvnet.mock-javamail</groupId>
+ <artifactId>mock-javamail</artifactId>
<scope>test</scope>
</dependency>
+
<dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- <exclusions>
- <exclusion>
- <artifactId>commons-logging</artifactId>
- <groupId>commons-logging</groupId>
- </exclusion>
- </exclusions>
+ <groupId>org.hectorclient</groupId>
+ <artifactId>hector-test</artifactId>
+ <scope>test</scope>
</dependency>
+
<dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-expression</artifactId>
+ <groupId>org.apache.tomcat.embed</groupId>
+ <artifactId>tomcat-embed-core</artifactId>
+ <scope>test</scope>
</dependency>
+
<dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-beans</artifactId>
+ <groupId>org.apache.tomcat.embed</groupId>
+ <artifactId>tomcat-embed-logging-juli</artifactId>
+ <scope>test</scope>
</dependency>
+
<dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-aop</artifactId>
+ <groupId>org.apache.tomcat.embed</groupId>
+ <artifactId>tomcat-embed-jasper</artifactId>
+ <scope>test</scope>
</dependency>
+
<dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-jasper-el</artifactId>
+ <scope>test</scope>
</dependency>
+
<dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context-support</artifactId>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-jsp-api</artifactId>
+ <scope>test</scope>
</dependency>
+
<dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-web</artifactId>
+ <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>org.springframework</groupId>
- <artifactId>spring-test</artifactId>
+ <groupId>com.sun.jersey.jersey-test-framework</groupId>
+ <artifactId>jersey-test-framework-external</artifactId>
<scope>test</scope>
</dependency>
+
<dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-jdbc</artifactId>
- <version>${org.springframework.version}</version>
+ <groupId>com.sun.jersey.jersey-test-framework</groupId>
+ <artifactId>jersey-test-framework-core</artifactId>
+ <scope>test</scope>
</dependency>
+
+
+
<dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
+ <groupId>org.usergrid</groupId>
+ <artifactId>usergrid-java-client</artifactId>
</dependency>
+
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.7.2</version>
</dependency>
- <dependency>
- <groupId>org.usergrid</groupId>
- <artifactId>usergrid-java-client</artifactId>
- <version>0.0.3</version>
- <scope>compile</scope>
- </dependency>
+
<dependency>
- <groupId>org.usergrid</groupId>
- <artifactId>usergrid-standalone</artifactId>
- <version>${project.version}</version>
- <exclusions>
- <exclusion>
- <artifactId>commons-logging</artifactId>
- <groupId>commons-logging</groupId>
- </exclusion>
- </exclusions>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jdbc</artifactId>
+ <version>${org.springframework.version}</version>
</dependency>
+
</dependencies>
-</project>
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ebfe96e8/stack/query-validator/src/main/java/org/usergrid/query/validator/ApiServerRunner.java
----------------------------------------------------------------------
diff --git a/stack/query-validator/src/main/java/org/usergrid/query/validator/ApiServerRunner.java b/stack/query-validator/src/main/java/org/usergrid/query/validator/ApiServerRunner.java
index b7c5739..7a7015e 100644
--- a/stack/query-validator/src/main/java/org/usergrid/query/validator/ApiServerRunner.java
+++ b/stack/query-validator/src/main/java/org/usergrid/query/validator/ApiServerRunner.java
@@ -1,33 +1,34 @@
-/*******************************************************************************
- * Copyright 2013 baas.io
- *
- * 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
+/**
+ * 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
+ * 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.usergrid.query.validator;
import org.apache.commons.lang.StringUtils;
import org.codehaus.jackson.JsonNode;
import org.springframework.http.HttpMethod;
import org.springframework.stereotype.Component;
+import org.usergrid.java.client.Client;
import org.usergrid.java.client.response.ApiResponse;
import org.usergrid.persistence.Entity;
+import org.usergrid.persistence.Schema;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
-import org.usergrid.java.client.Client;
-import org.usergrid.persistence.Schema;
-
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -35,7 +36,7 @@ import java.util.logging.Logger;
import static org.usergrid.java.client.utils.ObjectUtils.isEmpty;
/**
- * @author Sung-ju Jin(realbeast)
+ * @author Sungju Jin
*/
@Component
public class ApiServerRunner implements QueryRunner {
@@ -78,17 +79,17 @@ public class ApiServerRunner implements QueryRunner {
}
public boolean insertDatas() {
- List<org.usergrid.java.client.entities.Entity> clientEntities = getEntitiesForClient(getEntities());
- for(org.usergrid.java.client.entities.Entity entity : clientEntities) {
- ApiResponse response = client.createEntity(entity);
- if( response == null || !StringUtils.isEmpty(response.getError()) ) {
- logger.log(Level.SEVERE, response.getErrorDescription());
- //throw new RuntimeException(response.getErrorDescription());
- } else {
- logger.log(Level.INFO, response.toString());
- }
- }
- return true;
+ List<org.usergrid.java.client.entities.Entity> clientEntities = getEntitiesForClient(getEntities());
+ for(org.usergrid.java.client.entities.Entity entity : clientEntities) {
+ ApiResponse response = client.createEntity(entity);
+ if( response == null || !StringUtils.isEmpty(response.getError()) ) {
+ logger.log(Level.SEVERE, response.getErrorDescription());
+ //throw new RuntimeException(response.getErrorDescription());
+ } else {
+ logger.log(Level.INFO, response.toString());
+ }
+ }
+ return true;
}
private List<org.usergrid.java.client.entities.Entity> getEntitiesForClient(List<Entity> entities) {
@@ -209,4 +210,4 @@ public class ApiServerRunner implements QueryRunner {
public void setPassword(String password) {
this.password = password;
}
-}
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ebfe96e8/stack/query-validator/src/main/java/org/usergrid/query/validator/DefaultQueryResultsMatcher.java
----------------------------------------------------------------------
diff --git a/stack/query-validator/src/main/java/org/usergrid/query/validator/DefaultQueryResultsMatcher.java b/stack/query-validator/src/main/java/org/usergrid/query/validator/DefaultQueryResultsMatcher.java
new file mode 100644
index 0000000..614b9fc
--- /dev/null
+++ b/stack/query-validator/src/main/java/org/usergrid/query/validator/DefaultQueryResultsMatcher.java
@@ -0,0 +1,32 @@
+/**
+ * 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.usergrid.query.validator;
+
+import org.usergrid.persistence.Entity;
+
+import java.util.List;
+
+/**
+ * @author Sungju Jin
+ */
+public class DefaultQueryResultsMatcher implements QueryResultsMatcher {
+ @Override
+ public boolean equals(List<Entity> expectedEntities, List<Entity> actuallyEntities) {
+ return expectedEntities.equals(actuallyEntities);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ebfe96e8/stack/query-validator/src/main/java/org/usergrid/query/validator/QueryEntity.java
----------------------------------------------------------------------
diff --git a/stack/query-validator/src/main/java/org/usergrid/query/validator/QueryEntity.java b/stack/query-validator/src/main/java/org/usergrid/query/validator/QueryEntity.java
index c4ccd3e..c43afe7 100644
--- a/stack/query-validator/src/main/java/org/usergrid/query/validator/QueryEntity.java
+++ b/stack/query-validator/src/main/java/org/usergrid/query/validator/QueryEntity.java
@@ -1,9 +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.
+ */
package org.usergrid.query.validator;
import org.usergrid.persistence.DynamicEntity;
import java.util.Map;
+/**
+ * @author Sungju Jin
+ */
public class QueryEntity extends DynamicEntity {
@Override
@@ -26,9 +46,18 @@ public class QueryEntity extends DynamicEntity {
Object value = properties.get(key);
Object otherValue = otherProperties.get(key);
+
+ if(value.getClass() == Boolean.class) {
+ value = (Boolean)value ? 1 : 0;
+ }
+
+ if(otherValue.getClass() == Boolean.class) {
+ otherValue = (Boolean)otherValue ? 1 : 0;
+ }
+
if( otherValue == null || !value.equals(otherValue) )
return false;
}
return true;
}
-}
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ebfe96e8/stack/query-validator/src/main/java/org/usergrid/query/validator/QueryRequest.java
----------------------------------------------------------------------
diff --git a/stack/query-validator/src/main/java/org/usergrid/query/validator/QueryRequest.java b/stack/query-validator/src/main/java/org/usergrid/query/validator/QueryRequest.java
index 0515085..59032ba 100644
--- a/stack/query-validator/src/main/java/org/usergrid/query/validator/QueryRequest.java
+++ b/stack/query-validator/src/main/java/org/usergrid/query/validator/QueryRequest.java
@@ -1,27 +1,28 @@
-/*******************************************************************************
- * Copyright 2013 baas.io
- *
- * 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
+/**
+ * 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
+ * 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.usergrid.query.validator;
/**
- * @author Sung-ju Jin(realbeast)
+ * @author Sungju Jin
*/
public class QueryRequest {
private String dbQuery;
private ApiQuery apiQuery;
- private boolean ignoreOrdering;
public QueryRequest() {
this.apiQuery = new ApiQuery();
@@ -63,12 +64,4 @@ public class QueryRequest {
this.limit = limit;
}
}
-
- public boolean isIgnoreOrdering() {
- return ignoreOrdering;
- }
-
- public void setIgnoreOrdering(boolean ignoreOrdering) {
- this.ignoreOrdering = ignoreOrdering;
- }
-}
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ebfe96e8/stack/query-validator/src/main/java/org/usergrid/query/validator/QueryResponse.java
----------------------------------------------------------------------
diff --git a/stack/query-validator/src/main/java/org/usergrid/query/validator/QueryResponse.java b/stack/query-validator/src/main/java/org/usergrid/query/validator/QueryResponse.java
index 6a7dbce..6a05c13 100644
--- a/stack/query-validator/src/main/java/org/usergrid/query/validator/QueryResponse.java
+++ b/stack/query-validator/src/main/java/org/usergrid/query/validator/QueryResponse.java
@@ -1,18 +1,20 @@
-/*******************************************************************************
- * Copyright 2013 baas.io
- *
- * 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
+/**
+ * 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
+ * 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.usergrid.query.validator;
import org.apache.commons.lang.StringUtils;
@@ -21,7 +23,7 @@ import org.usergrid.persistence.Entity;
import java.util.List;
/**
- * @author Sung-ju Jin(realbeast)
+ * @author Sungju Jin
*/
public class QueryResponse {
@@ -100,4 +102,4 @@ public class QueryResponse {
builder.append("\n");
return builder.toString();
}
-}
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ebfe96e8/stack/query-validator/src/main/java/org/usergrid/query/validator/QueryResultsMatcher.java
----------------------------------------------------------------------
diff --git a/stack/query-validator/src/main/java/org/usergrid/query/validator/QueryResultsMatcher.java b/stack/query-validator/src/main/java/org/usergrid/query/validator/QueryResultsMatcher.java
new file mode 100644
index 0000000..e720ec5
--- /dev/null
+++ b/stack/query-validator/src/main/java/org/usergrid/query/validator/QueryResultsMatcher.java
@@ -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.
+ */
+package org.usergrid.query.validator;
+
+import org.usergrid.persistence.Entity;
+
+import java.util.List;
+
+/**
+ * @author Sungju Jin
+ */
+public interface QueryResultsMatcher {
+ boolean equals(List<Entity> expectedEntities, List<Entity> actuallyEntities);
+}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ebfe96e8/stack/query-validator/src/main/java/org/usergrid/query/validator/QueryRunner.java
----------------------------------------------------------------------
diff --git a/stack/query-validator/src/main/java/org/usergrid/query/validator/QueryRunner.java b/stack/query-validator/src/main/java/org/usergrid/query/validator/QueryRunner.java
index caabb96..fbc6220 100644
--- a/stack/query-validator/src/main/java/org/usergrid/query/validator/QueryRunner.java
+++ b/stack/query-validator/src/main/java/org/usergrid/query/validator/QueryRunner.java
@@ -1,25 +1,28 @@
-/*******************************************************************************
- * Copyright 2013 baas.io
- *
- * 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
+/**
+ * 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
+ * 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.usergrid.query.validator;
-import java.util.List;
import org.usergrid.persistence.Entity;
+import java.util.List;
+
/**
- * @author Sung-ju Jin(realbeast)
+ * @author Sungju Jin
*/
public interface QueryRunner {
public boolean setup();
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ebfe96e8/stack/query-validator/src/main/java/org/usergrid/query/validator/QueryValidationConfiguration.java
----------------------------------------------------------------------
diff --git a/stack/query-validator/src/main/java/org/usergrid/query/validator/QueryValidationConfiguration.java b/stack/query-validator/src/main/java/org/usergrid/query/validator/QueryValidationConfiguration.java
index 147a75a..35f3994 100644
--- a/stack/query-validator/src/main/java/org/usergrid/query/validator/QueryValidationConfiguration.java
+++ b/stack/query-validator/src/main/java/org/usergrid/query/validator/QueryValidationConfiguration.java
@@ -1,3 +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
+ *
+ * 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.usergrid.query.validator;
import org.usergrid.persistence.Entity;
@@ -5,6 +22,9 @@ import org.usergrid.utils.InflectionUtils;
import java.util.List;
+/**
+ * @author Sungju Jin
+ */
public class QueryValidationConfiguration {
String org;
@@ -71,4 +91,4 @@ public class QueryValidationConfiguration {
public void setPassword(String password) {
this.password = password;
}
-}
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ebfe96e8/stack/query-validator/src/main/java/org/usergrid/query/validator/QueryValidator.java
----------------------------------------------------------------------
diff --git a/stack/query-validator/src/main/java/org/usergrid/query/validator/QueryValidator.java b/stack/query-validator/src/main/java/org/usergrid/query/validator/QueryValidator.java
index d5eb67a..0e7f89a 100644
--- a/stack/query-validator/src/main/java/org/usergrid/query/validator/QueryValidator.java
+++ b/stack/query-validator/src/main/java/org/usergrid/query/validator/QueryValidator.java
@@ -1,18 +1,20 @@
-/*******************************************************************************
- * Copyright 2013 baas.io
- *
- * 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
+/**
+ * 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
+ * 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.usergrid.query.validator;
import org.springframework.beans.factory.annotation.Autowired;
@@ -22,7 +24,7 @@ import org.usergrid.persistence.Entity;
import java.util.List;
/**
- * @author Sung-ju Jin(realbeast)
+ * @author Sungju Jin
*/
@Component
public class QueryValidator {
@@ -45,14 +47,13 @@ public class QueryValidator {
}
public QueryResponse execute(QueryRequest request) {
+ return execute(request, new DefaultQueryResultsMatcher());
+ }
+
+ public QueryResponse execute(QueryRequest request, QueryResultsMatcher matcher) {
List<Entity> sqlEntities = sql.execute(request.getDbQuery());
List<Entity> apiEntities = api.execute(request.getApiQuery().getQuery(), request.getApiQuery().getLimit());
- boolean equals = false;
- if( request.isIgnoreOrdering() ) {
- equals = sqlEntities.size() == apiEntities.size();
- } else {
- equals = sqlEntities.equals(apiEntities);
- }
+ boolean equals = matcher.equals(sqlEntities, apiEntities);
QueryResponse response = new QueryResponse();
response.setResult(equals);
@@ -74,4 +75,4 @@ public class QueryValidator {
api.setEmail(configuration.getEmail());
api.setPassword(configuration.getPassword());
}
-}
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ebfe96e8/stack/query-validator/src/main/java/org/usergrid/query/validator/SqliteRunner.java
----------------------------------------------------------------------
diff --git a/stack/query-validator/src/main/java/org/usergrid/query/validator/SqliteRunner.java b/stack/query-validator/src/main/java/org/usergrid/query/validator/SqliteRunner.java
index b85e19c..dd728c8 100644
--- a/stack/query-validator/src/main/java/org/usergrid/query/validator/SqliteRunner.java
+++ b/stack/query-validator/src/main/java/org/usergrid/query/validator/SqliteRunner.java
@@ -1,18 +1,20 @@
-/*******************************************************************************
- * Copyright 2013 baas.io
- *
- * 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
+/**
+ * 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
+ * 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.usergrid.query.validator;
import org.apache.commons.lang.StringUtils;
@@ -31,7 +33,7 @@ import java.util.Map;
import java.util.logging.Logger;
/**
- * @author Sung-ju Jin(realbeast)
+ * @author Sungju Jin
*/
@Component
public class SqliteRunner implements QueryRunner {
@@ -65,8 +67,28 @@ public class SqliteRunner implements QueryRunner {
feilds.append(key);
feilds.append(",");
- Object value = entity.getProperty(key);
- Class type = value.getClass();
+ Class type = null;
+ try
+ {
+ type = entity.getProperty(key).getClass();
+ } catch (NullPointerException ne) {
+ type = entity.getDynamicProperties().get(key).getClass();
+ }
+
+ Object value = null;
+ if(StringUtils.equals("name",key)) {
+ value = entity.getName();
+ } else {
+ value = entity.getProperty(key);
+ }
+ if( type == Boolean.class ) {
+ if((Boolean)value) {
+ value = 1;
+ } else {
+ value = 0;
+ }
+ }
+
String sqlType = getSqlDatatype(type);
if( StringUtils.equals("TEXT", sqlType) ) {
values.append("'");
@@ -104,7 +126,14 @@ public class SqliteRunner implements QueryRunner {
builder.append(key);
builder.append(" ");
- Class type = entity.getProperty(key).getClass();
+ Class type = null;
+ try
+ {
+ type = entity.getProperty(key).getClass();
+ } catch (NullPointerException ne) {
+ type = entity.getDynamicProperties().get(key).getClass();
+ }
+
String sqlType = getSqlDatatype(type);
builder.append(sqlType);
builder.append(",");
@@ -140,10 +169,13 @@ public class SqliteRunner implements QueryRunner {
// based on sqlite (http://www.sqlite.org/datatype3.html)
private String getSqlDatatype(Class clz) {
+ if ( clz == null )
+ return "TEXT";
+
if( clz == Integer.class || clz == Long.class || clz == Boolean.class ) {
return "INTEGER";
} else if( clz == Double.class ) {
- return "REAL";
+ return "REAL";
} else if( clz == Byte.class ) {
return "BLOB";
}
@@ -157,4 +189,4 @@ public class SqliteRunner implements QueryRunner {
public void setEntities(List<Entity> entities) {
this.entities = entities;
}
-}
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ebfe96e8/stack/query-validator/src/main/resources/usergrid-query-validator-context.xml
----------------------------------------------------------------------
diff --git a/stack/query-validator/src/main/resources/usergrid-query-validator-context.xml b/stack/query-validator/src/main/resources/usergrid-query-validator-context.xml
index b2bf935..89679d7 100644
--- a/stack/query-validator/src/main/resources/usergrid-query-validator-context.xml
+++ b/stack/query-validator/src/main/resources/usergrid-query-validator-context.xml
@@ -1,16 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:context="http://www.springframework.org/schema/context"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
+ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
- <context:annotation-config />
+ <context:annotation-config />
<context:component-scan base-package="org.usergrid.query.validator" />
- <import resource="classpath:/usergrid-core-context.xml" />
-
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="org.sqlite.JDBC" />
@@ -20,4 +18,4 @@
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="dataSource" />
</bean>
-</beans>
+</beans>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ebfe96e8/stack/query-validator/src/test/java/org/usergrid/query/validator/AbstractQueryIT.java
----------------------------------------------------------------------
diff --git a/stack/query-validator/src/test/java/org/usergrid/query/validator/AbstractQueryIT.java b/stack/query-validator/src/test/java/org/usergrid/query/validator/AbstractQueryIT.java
new file mode 100644
index 0000000..b48e094
--- /dev/null
+++ b/stack/query-validator/src/test/java/org/usergrid/query/validator/AbstractQueryIT.java
@@ -0,0 +1,133 @@
+/**
+ * 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.usergrid.query.validator;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang.StringUtils;
+import org.junit.BeforeClass;
+import org.usergrid.management.ApplicationInfo;
+import org.usergrid.management.ManagementService;
+import org.usergrid.management.OrganizationInfo;
+import org.usergrid.management.UserInfo;
+import org.usergrid.persistence.Entity;
+import org.usergrid.utils.JsonUtils;
+
+import java.io.IOException;
+import java.net.URL;
+import java.nio.charset.Charset;
+import java.util.*;
+
+import static org.junit.Assert.assertNotNull;
+
+/**
+ * @author Sungju Jin
+ */
+public class AbstractQueryIT {
+
+ protected static QueryValidator validator;
+ private static Properties properties;
+ private static String fullEndpoint;
+ private static String orgName;
+ private static String appName;
+ private static String email;
+ private static String password;
+ private static int port;
+
+ @BeforeClass
+ public static void tearsup() throws Exception {
+ validator = QueryITSuite.cassandraResource.getBean(QueryValidator.class);
+ properties = QueryITSuite.cassandraResource.getBean("properties",Properties.class);
+ if( isDisableLocalServer()) {
+ return;
+ }
+ setProperties();
+ createOrganizationWithApplication();
+ }
+
+ private static void createOrganizationWithApplication() throws Exception {
+ String uuid = UUID.randomUUID().toString().replaceAll("-", "");
+ orgName = orgName + uuid;
+ appName = appName + uuid;
+ email = orgName + "@usergrid.com";
+ ManagementService managementService = QueryITSuite.serverResource.getMgmtSvc();
+ UserInfo user = managementService.createAdminUser(orgName, "Query Test", email, password, false, false);
+ OrganizationInfo org = managementService.createOrganization(orgName, user, false );
+ assertNotNull( org );
+ ApplicationInfo app = managementService.createApplication( org.getUuid(), appName);
+ assertNotNull( app );
+ }
+
+ private static void setProperties() {
+ port = QueryITSuite.serverResource.getTomcatPort();
+ fullEndpoint = (String)properties.get("usergrid.query.validator.api.endpoint") + ":" + port;
+ orgName = (String)properties.get("usergrid.query.validator.api.organization");
+ appName = (String)properties.get("usergrid.query.validator.api.app");
+ email = (String)properties.get("usergrid.query.validator.api.authorize.email");
+ password = (String)properties.get("usergrid.query.validator.api.authorize.password");
+ }
+
+ protected static void createInitializationDatas(String collection) {
+ List<Entity> entities = loadEntitiesFromResource(collection);
+ QueryValidationConfiguration configuration = new QueryValidationConfiguration();
+ configuration.setEndpointUri(fullEndpoint);
+ configuration.setOrg(orgName);
+ configuration.setEmail(email);
+ configuration.setPassword(password);
+ configuration.setApp(appName);
+ configuration.setCollection(collection);
+ configuration.setEntities(entities);
+ validator.setConfiguration(configuration);
+ validator.setup();
+ }
+
+ private static List<Entity> loadEntitiesFromResource(String collection) {
+ String json = null;
+ try {
+ URL url = Thread.currentThread().getContextClassLoader().getResource(collection + ".json");
+ json = FileUtils.readFileToString(FileUtils.toFile(url), Charset.forName("UTF-8"));
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ List<Entity> entities = new ArrayList<Entity>();
+ List<Map<String, Object>> datas = (List<Map<String, Object>>) JsonUtils.parse(json);
+ int index = 0;
+ for(Map<String, Object> data : datas) {
+ long created = System.currentTimeMillis() + (index*1000);
+
+ QueryEntity entity = new QueryEntity();
+ entity.setType(collection);
+ for ( Map.Entry<String, Object> property : data.entrySet() ) {
+ if(StringUtils.equals("name", property.getKey()))
+ entity.setName((String)property.getValue());
+ else
+ entity.setProperty( property.getKey(), property.getValue() );
+ }
+ entity.setProperties(data);
+ entity.setCreated(created);
+ entity.setModified(created);
+ entities.add(entity);
+ index++;
+ }
+ return entities;
+ }
+
+ private static boolean isDisableLocalServer() {
+ return !StringUtils.equalsIgnoreCase("true", (String) properties.get("usergrid.query.validator.api.enablelocal"));
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ebfe96e8/stack/query-validator/src/test/java/org/usergrid/query/validator/QueryITSuite.java
----------------------------------------------------------------------
diff --git a/stack/query-validator/src/test/java/org/usergrid/query/validator/QueryITSuite.java b/stack/query-validator/src/test/java/org/usergrid/query/validator/QueryITSuite.java
new file mode 100644
index 0000000..327776f
--- /dev/null
+++ b/stack/query-validator/src/test/java/org/usergrid/query/validator/QueryITSuite.java
@@ -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.
+ */
+package org.usergrid.query.validator;
+
+import org.junit.ClassRule;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.usergrid.cassandra.CassandraResource;
+import org.usergrid.query.validator.users.UserQueryIT;
+import org.usergrid.rest.ITSetup;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses(
+ {
+ UserQueryIT.class
+ })
+public class QueryITSuite {
+ @ClassRule
+ public static CassandraResource cassandraResource = CassandraResource.newWithAvailablePorts();
+
+ //TODO Detecting current path
+ @ClassRule
+ public static ITSetup serverResource = new ITSetup( cassandraResource, "../rest/src/main/webapp" );
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ebfe96e8/stack/query-validator/src/test/java/org/usergrid/query/validator/QueryValidationTest.java
----------------------------------------------------------------------
diff --git a/stack/query-validator/src/test/java/org/usergrid/query/validator/QueryValidationTest.java b/stack/query-validator/src/test/java/org/usergrid/query/validator/QueryValidationTest.java
deleted file mode 100644
index 5fbacb3..0000000
--- a/stack/query-validator/src/test/java/org/usergrid/query/validator/QueryValidationTest.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*******************************************************************************
- * Copyright 2013 baas.io
- *
- * 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.usergrid.query.validator;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.Assert;
-
-/**
- * @author Sung-ju Jin(realbeast)
- */
-@RunWith(QueryValidatorRunner.class)
-public class QueryValidationTest {
-
- private QueryValidator validator;
-
- @Before
- public void setup() {
- validator = QueryValidatorRunner.getValidator();
- }
-
- @Test
- public void sexEqualAndNameEqual() {
- String sqlite = "SELECT * FROM users WHERE sex = 'male' and name = 'judekim' LIMIT 10";
- String api = "SELECT * WHERE sex = 'male' AND name = 'judekim'";
-
- QueryRequest request = new QueryRequest();
- request.setDbQuery(sqlite);
- request.getApiQuery().setQuery(api);
- QueryResponse response = validator.execute(request);
- Assert.assertTrue(response.toString(), response.result());
- }
-
- @Test
- public void nameEqualAndSexEqual() {
- String sqlite = "SELECT * FROM users WHERE name = 'judekim' and sex = 'male' LIMIT 10";
- String api = "select * where name = 'judekim' and sex = 'male'";
-
- QueryRequest request = new QueryRequest();
- request.setDbQuery(sqlite);
- request.getApiQuery().setQuery(api);
- QueryResponse response = validator.execute(request);
- Assert.assertTrue(response.toString(), response.result());
- }
-
- @Test
- public void nameEqualAndSexEqual_limitL20() {
- String sqlite = "SELECT * FROM users WHERE name = 'judekim' and sex = 'male' LIMIT 20";
- String api = "select * where name = 'judekim' and sex = 'male'";
- int limit = 20;
-
- QueryRequest request = new QueryRequest();
- request.setDbQuery(sqlite);
- request.getApiQuery().setQuery(api);
- request.getApiQuery().setLimit(limit);
- QueryResponse response = validator.execute(request);
- Assert.assertTrue(response.toString(), response.result());
- }
-
- @Test
- public void sexEqualAndNameEqualExtra1() {
- String sqlite = "SELECT * FROM users WHERE sex = 'female' and name = 'curioe' LIMIT 10";
- String api = "select * where sex = 'female' and name = 'curioe'";
-
- QueryRequest request = new QueryRequest();
- request.setDbQuery(sqlite);
- request.getApiQuery().setQuery(api);
- QueryResponse response = validator.execute(request);
- Assert.assertTrue(response.toString(), response.result());
- }
-
- @Test
- public void sexEqualOrNameEqual() {
- String sqlite = "SELECT * FROM users WHERE sex = 'female' or name = 'curioe' LIMIT 10";
- String api = "select * where sex = 'female' or name = 'curioe'";
-
- QueryRequest request = new QueryRequest();
- request.setDbQuery(sqlite);
- request.getApiQuery().setQuery(api);
- QueryResponse response = validator.execute(request);
- Assert.assertTrue(response.toString(), response.result());
- }
-
- @Test
- public void nameBeginswithAndSexEqualAndAgeGreaterthanequalOrSexEqual_sortNameDesc() {
- String sqlite = "SELECT * FROM users WHERE name LIKE 'a%' and sex = 'male' and age >= 35 or sex = 'female' ORDER BY name desc LIMIT 10";
- String api = "select * where name = 'a*' and sex = 'male' and age >= 35 or sex = 'female' order by name desc";
-
- QueryRequest request = new QueryRequest();
- request.setDbQuery(sqlite);
- request.getApiQuery().setQuery(api);
- QueryResponse response = validator.execute(request);
- Assert.assertTrue(response.toString(), response.result());
- }
-
- @Test
- public void nameBeginswithAndSexEqualAndAgeGreaterthanequalOrSexEqual_sortAddressAscNameDesc() {
- String sqlite = "SELECT * FROM users WHERE name LIKE 'a%' and sex = 'male' and age >= 35 or sex = 'female' ORDER BY address asc, name desc LIMIT 4";
- String api = "select * where name = 'a*' and sex = 'male' and age >= 35 or sex = 'female' order by address asc, name desc";
-
- QueryRequest request = new QueryRequest();
- request.setDbQuery(sqlite);
- request.getApiQuery().setQuery(api);
- QueryResponse response = validator.execute(request);
- Assert.assertTrue(response.toString(), response.result());
- }
-
- @Test
- public void nameBeginswithAndSexEqualAndAgeGreaterthanequalOrSexEqual_sortAddressAscNameDesc_limitL4() {
- String sqlite = "SELECT * FROM users WHERE name LIKE 'a%' and sex = 'male' and age >= 35 or sex = 'female' ORDER BY address asc, name desc LIMIT 4";
- String api = "select * where name = 'a*' and sex = 'male' and age >= 35 or sex = 'female' order by address asc, name desc";
-
- QueryRequest request = new QueryRequest();
- request.setDbQuery(sqlite);
- request.getApiQuery().setQuery(api);
- QueryResponse response = validator.execute(request);
- Assert.assertTrue(response.toString(), response.result());
- }
-
- @Test
- public void sexEqual_sortAgeDescExtra1() {
- String sqlite = "SELECT * FROM users WHERE sex = 'male' ORDER BY age desc LIMIT 10";
- String api = "select * where sex = 'male' order by age desc";
-
- QueryRequest request = new QueryRequest();
- request.setDbQuery(sqlite);
- request.getApiQuery().setQuery(api);
- QueryResponse response = validator.execute(request);
- Assert.assertTrue(response.toString(), response.result());
- }
-
- @Test
- public void sexEqual_sortAgeDescExtra2() {
- String sqlite = " SELECT * FROM users WHERE sex = 'female' ORDER BY age desc LIMIT 10";
- String api = "select * where sex = 'female' order by age desc";
-
- QueryRequest request = new QueryRequest();
- request.setDbQuery(sqlite);
- request.getApiQuery().setQuery(api);
- QueryResponse response = validator.execute(request);
- Assert.assertTrue(response.toString(), response.result());
- }
-
- @Test
- public void sexEqualAndAgeGreaterthanequal() {
- String sqlite = " SELECT * FROM users WHERE sex = 'male' and age >= 35 LIMIT 10";
- String api = "select * where sex = 'male' and age >= 35";
-
- QueryRequest request = new QueryRequest();
- request.setDbQuery(sqlite);
- request.getApiQuery().setQuery(api);
- QueryResponse response = validator.execute(request);
- Assert.assertTrue(response.toString(), response.result());
- }
-
- @Test
- public void sexEqualAndAgeGreaterthanequal_sortAgeDesc() {
- String sqlite = "SELECT * FROM users WHERE sex = 'male' and age >= 35 ORDER BY age desc LIMIT 10";
- String api = "select * where sex = 'male' and age >= 35 order by age desc";
-
- QueryRequest request = new QueryRequest();
- request.setDbQuery(sqlite);
- request.getApiQuery().setQuery(api);
- QueryResponse response = validator.execute(request);
- Assert.assertTrue(response.toString(), response.result());
- }
-
- @Test
- public void sexEqualAndAgeGreaterthanequal_sortNameDesc() {
- String sqlite = "SELECT * FROM users WHERE sex = 'male' and age >= 35 ORDER BY name desc LIMIT 10";
- String api = "select * where sex = 'male' and age >= 35 order by name desc";
-
- QueryRequest request = new QueryRequest();
- request.setDbQuery(sqlite);
- request.getApiQuery().setQuery(api);
- QueryResponse response = validator.execute(request);
- Assert.assertTrue(response.toString(), response.result());
- }
-
- @Test
- public void sexEqualAndAgeGreaterthanequal_sortAgeDesc_limitL100() {
- String sqlite = "SELECT * FROM users WHERE sex = 'male' and age >= 35 ORDER BY age desc LIMIT 100";
- String api = "select * where sex = 'male' and age >= 35 order by age desc";
- int limit = 100;
-
- QueryRequest request = new QueryRequest();
- request.setDbQuery(sqlite);
- request.getApiQuery().setQuery(api);
- request.getApiQuery().setLimit(limit);
- QueryResponse response = validator.execute(request);
- Assert.assertTrue(response.toString(), response.result());
- }
-
- @Test
- public void qlSexEqualAndAgeGreaterthanequal_sortNameDesc_limitL100() {
- String sqlite = "SELECT * FROM users WHERE sex = 'male' and age >= 35 ORDER BY name desc LIMIT 100";
- String api = "select * where sex = 'male' and age >= 35 order by name desc";
- int limit = 100;
-
- QueryRequest request = new QueryRequest();
- request.setDbQuery(sqlite);
- request.getApiQuery().setQuery(api);
- request.getApiQuery().setLimit(limit);
- QueryResponse response = validator.execute(request);
- Assert.assertTrue(response.toString(), response.result());
- }
-
- @Test
- public void sexEqualAndAgeGreaterthanequalOrSexEqual() {
- String sqlite = "SELECT * FROM users WHERE sex = 'male' and age >= 35 or sex = 'female' LIMIT 10";
- String api = "select * where sex = 'male' and age >= 35 or sex = 'female'";
-
- QueryRequest request = new QueryRequest();
- request.setDbQuery(sqlite);
- request.getApiQuery().setQuery(api);
- QueryResponse response = validator.execute(request);
- Assert.assertTrue(response.toString(), response.result());
- }
-
- @Test
- public void sexEqualAndAgeGreaterthanequalOrSexEqual_sortAgeDesc() {
- String sqlite = "SELECT * FROM users WHERE sex = 'male' and age >= 35 or sex = 'female' ORDER BY age desc LIMIT 10";
- String api = "select * where sex = 'male' and age >= 35 or sex = 'female' order by age desc";
-
- QueryRequest request = new QueryRequest();
- request.setDbQuery(sqlite);
- request.getApiQuery().setQuery(api);
- QueryResponse response = validator.execute(request);
- Assert.assertTrue(response.toString(), response.result());
- }
-
- @Test
- public void limitL12() {
- String sqlite = "SELECT * FROM users LIMIT 12";
- String api = null;
- int limit = 12;
-
- QueryRequest request = new QueryRequest();
- request.setDbQuery(sqlite);
- request.getApiQuery().setQuery(api);
- request.getApiQuery().setLimit(limit);
- QueryResponse response = validator.execute(request);
- Assert.assertTrue(response.toString(), response.result());
- }
-
- @Test
- public void sexEqualAndAgeGreaterthanequalOrSexEqual_sortNameDesc() {
- String sqlite = "SELECT * FROM users WHERE sex = 'male' and age >= 35 or sex = 'female' ORDER BY name desc LIMIT 10";
- String api = "select * where sex = 'male' and age >= 35 or sex = 'female' order by name desc";
-
- QueryRequest request = new QueryRequest();
- request.setDbQuery(sqlite);
- request.getApiQuery().setQuery(api);
- QueryResponse response = validator.execute(request);
- Assert.assertTrue(response.toString(), response.result());
- }
-
- @Test
- public void sexEqualAndAgeGreaterthanequalOrSexEqual_sortNameDesc_limitL100() {
- String sqlite = "SELECT * FROM users WHERE sex = 'male' and age >= 35 or sex = 'female' ORDER BY name desc LIMIT 100";
- String api = "select * where sex = 'male' and age >= 35 or sex = 'female' order by name desc";
- int limit = 100;
-
- QueryRequest request = new QueryRequest();
- request.setDbQuery(sqlite);
- request.getApiQuery().setQuery(api);
- request.getApiQuery().setLimit(limit);
- QueryResponse response = validator.execute(request);
- Assert.assertTrue(response.toString(), response.result());
- }
-
- @Test
- public void limitL11() {
- String sqlite = "SELECT * FROM users LIMIT 11";
- String api = null;
- int limit = 11;
-
- QueryRequest request = new QueryRequest();
- request.setDbQuery(sqlite);
- request.getApiQuery().setQuery(api);
- request.getApiQuery().setLimit(limit);
- QueryResponse response = validator.execute(request);
- Assert.assertTrue(response.toString(), response.result());
- }
-
- @Test
- public void nameBeginswithAndSexEqualAndAgeGreaterthanequalOrSexEqual() {
- String sqlite = "SELECT * FROM users WHERE name LIKE 'a%' and sex = 'male' and age >= 20 or sex = 'female' LIMIT 10";
- String api = "select * where name = 'a*' and sex = 'male' and age >= 20 or sex = 'female'";
-
- QueryRequest request = new QueryRequest();
- request.setDbQuery(sqlite);
- request.getApiQuery().setQuery(api);
- QueryResponse response = validator.execute(request);
- Assert.assertTrue(response.toString(), response.result());
- }
-
- @Test
- public void nameBeginswithAndSexEqualAndAgeGreaterthanequalOrSexEqual_limitL20() {
- String sqlite = "SELECT * FROM users WHERE name LIKE 'a%' and sex = 'male' and age >= 20 or sex = 'female' LIMIT 20";
- String api = "select * where name = 'a*' and sex = 'male' and age >= 20 or sex = 'female'";
- int limit = 20;
-
- QueryRequest request = new QueryRequest();
- request.setDbQuery(sqlite);
- request.getApiQuery().setQuery(api);
- request.getApiQuery().setLimit(limit);
- QueryResponse response = validator.execute(request);
- Assert.assertTrue(response.toString(), response.result());
- }
-
- @Test
- public void sexEqualAndAgeGreaterthanequal_sortAddressDesc_limitL100() {
- String sqlite = "SELECT * FROM users WHERE sex = 'male' and age >= 35 ORDER BY address desc LIMIT 100";
- String api = "select * where sex = 'male' and age >= 35 order by address desc";
- int limit = 100;
-
- QueryRequest request = new QueryRequest();
- request.setDbQuery(sqlite);
- request.getApiQuery().setQuery(api);
- request.getApiQuery().setLimit(limit);
- QueryResponse response = validator.execute(request);
- Assert.assertTrue(response.toString(), response.result());
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ebfe96e8/stack/query-validator/src/test/java/org/usergrid/query/validator/QueryValidatorRunner.java
----------------------------------------------------------------------
diff --git a/stack/query-validator/src/test/java/org/usergrid/query/validator/QueryValidatorRunner.java b/stack/query-validator/src/test/java/org/usergrid/query/validator/QueryValidatorRunner.java
deleted file mode 100644
index 6f9d443..0000000
--- a/stack/query-validator/src/test/java/org/usergrid/query/validator/QueryValidatorRunner.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*******************************************************************************
- * Copyright 2013 baas.io
- *
- * 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.usergrid.query.validator;
-
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang.StringUtils;
-import org.junit.runner.notification.RunNotifier;
-import org.junit.runners.model.InitializationError;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.usergrid.cassandra.CassandraRunner;
-import org.usergrid.cassandra.DataControl;
-import org.usergrid.management.ManagementService;
-import org.usergrid.persistence.Entity;
-import org.usergrid.standalone.Server;
-import org.usergrid.utils.JsonUtils;
-
-import java.io.IOException;
-import java.net.URL;
-import java.nio.charset.Charset;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-/**
- * @author Sung-ju Jin(realbeast)
- */
-public class QueryValidatorRunner extends CassandraRunner {
-
- private static Logger logger = LoggerFactory.getLogger(QueryValidatorRunner.class);
- private boolean enableLocalServer;
- private static StandaloneServer standaloneServer;
- private Properties properties;
- private static QueryValidator validator;
- private static boolean initialize = false;
-
- public QueryValidatorRunner(Class<?> klass) throws InitializationError {
- super(klass);
- }
-
- @Override
- protected DataControl preTest(RunNotifier notifier) {
- DataControl control = super.preTest(notifier);
- try {
- setup();
- } catch (InitializationError initializationError) {
- initializationError.printStackTrace();
- }
- return control;
- }
-
- public static QueryValidator getValidator() {
- return validator;
- }
-
- public synchronized void setup() throws InitializationError {
- if(initialize)
- return;
-
- try {
- logger.info("Loading initialize...");
- Thread.sleep(20*1000);
- } catch (InterruptedException e) {}
-
- validator = CassandraRunner.getBean(QueryValidator.class);
- properties = CassandraRunner.getBean("properties",Properties.class);
-
- if( validator == null || properties == null) {
- throw new InitializationError("Application context not loaded.");
- }
-
- String enableString = (String)properties.get("usergrid.query.validator.api.enablelocal");
- enableLocalServer = StringUtils.endsWithIgnoreCase("true", enableString);
- if( enableLocalServer ) {
- startStandaloneServer();
- try {
- logger.info("Loading standalone server...");
- Thread.sleep(20*1000);
- } catch (InterruptedException e) {}
- }
- initialize = true;
-
- String endpoint = (String)properties.get("usergrid.query.validator.api.endpoint");
- String organization = (String)properties.get("usergrid.query.validator.api.organization");
- String app = (String)properties.get("usergrid.query.validator.api.app");
- String email = (String)properties.get("usergrid.query.validator.api.authorize.email");
- String password = (String)properties.get("usergrid.query.validator.api.authorize.password");
-
- String collection = "user";
- List<Entity> entities = loadEntities(collection);
- QueryValidationConfiguration configuration = new QueryValidationConfiguration();
- configuration.setEndpointUri(endpoint);
- configuration.setOrg(organization);
- configuration.setEmail(email);
- configuration.setPassword(password);
- configuration.setApp(app);
- configuration.setCollection(collection);
- configuration.setEntities(entities);
- validator.setConfiguration(configuration);
- validator.setup();
-
- }
-
- private List<Entity> loadEntities(String collection) {
- String json = null;
- try {
- URL url = Thread.currentThread().getContextClassLoader().getResource(collection + ".json");
- json = FileUtils.readFileToString(FileUtils.toFile(url), Charset.forName("UTF-8"));
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- List<Entity> entities = new ArrayList<Entity>();
- List<Map<String, Object>> datas = (List<Map<String, Object>>) JsonUtils.parse(json);
- for(Map<String, Object> data : datas) {
- Entity entity = new QueryEntity();
- entity.setType(collection);
- entity.setProperties(data);
- entity.setCreated(System.currentTimeMillis());
- entity.setModified(entity.getCreated());
- entities.add(entity);
- }
- return entities;
- }
-
- private void startStandaloneServer() {
- standaloneServer = new StandaloneServer();
- try {
- Thread thread = new Thread(standaloneServer);
- thread.start();
- } catch (Exception ex) {
- logger.error("Could not schedule standalone server runner", ex);
- }
- Runtime.getRuntime().addShutdownHook(new Thread() {
- @Override
- public void run() {
- try {
- logger.error("In shutdownHook");
- stopServer();
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
- });
- boolean loaded = false;
- while (!loaded) {
- if( standaloneServer.server.isRunning() ) {
- if( standaloneServer.server.getManagementService() != null ) {
- loaded = true;
- continue;
- }
- }
- try {
- logger.info("Loding application context...");
- Thread.sleep(2*1000);
- } catch (InterruptedException e) {
- continue;
- }
- }
-
- if(loaded) {
- ManagementService managementService = standaloneServer.server.getManagementService();
- try {
- managementService.setup();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- logger.info("Finish start standalone server.");
- }
-
- static class StandaloneServer implements Runnable {
- public static Server server;
-
- public StandaloneServer() {
- server = new Server();
- }
-
- @Override
- public void run() {
- server.setInitializeDatabaseOnStart(true);
- server.setDaemon(false);
- server.startServer();
- }
-
- public void stop() {
- server.stopServer();
- }
- }
-
- private void stopServer() {
- standaloneServer.stop();
- }
-}
[02/50] [abbrv] git commit: Properties in parent,
and switch to GuicyFig 3.2 in collection.
Posted by sn...@apache.org.
Properties in parent, and switch to GuicyFig 3.2 in collection.
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/075374b7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/075374b7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/075374b7
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: 075374b7814fa4fa7ef63fb15de4362d36f82770
Parents: 88d797b
Author: Dave Johnson <dm...@apigee.com>
Authored: Mon Jan 13 13:55:52 2014 -0500
Committer: Dave Johnson <dm...@apigee.com>
Committed: Mon Jan 13 13:55:52 2014 -0500
----------------------------------------------------------------------
stack/corepersistence/collection/pom.xml | 7 -------
stack/corepersistence/pom.xml | 1 +
2 files changed, 1 insertion(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/075374b7/stack/corepersistence/collection/pom.xml
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/pom.xml b/stack/corepersistence/collection/pom.xml
index 512ecfb..c004aa9 100644
--- a/stack/corepersistence/collection/pom.xml
+++ b/stack/corepersistence/collection/pom.xml
@@ -10,13 +10,6 @@
<modelVersion>4.0.0</modelVersion>
<description>The module for handling all scope I/O</description>
- <properties>
- <guice.version>3.0</guice.version>
- <guicyfig.version>3.2-SNAPSHOT</guicyfig.version>
- <slf4j.version>1.7.2</slf4j.version>
- <log4j.version>1.2.17</log4j.version>
- </properties>
-
<artifactId>collection</artifactId>
<build>
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/075374b7/stack/corepersistence/pom.xml
----------------------------------------------------------------------
diff --git a/stack/corepersistence/pom.xml b/stack/corepersistence/pom.xml
index 4604c82..31b32d7 100644
--- a/stack/corepersistence/pom.xml
+++ b/stack/corepersistence/pom.xml
@@ -21,6 +21,7 @@
<log4j.version>1.2.17</log4j.version>
<rx.version>0.15.1</rx.version>
<hystrix.version>1.3.8</hystrix.version>
+ <guicyfig.version>3.2</guicyfig.version>
</properties>
<modules>
[20/50] [abbrv] git commit: Initialized connection to null. Added if
else statements checking the possible instance types of the iterator.
Posted by sn...@apache.org.
Initialized connection to null.
Added if else statements checking the possible instance types of the iterator.
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/89b9f502
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/89b9f502
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/89b9f502
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: 89b9f502a14db98dfa32e890a46ac700ab272c6b
Parents: 2dde4ea
Author: GERey <gr...@apigee.com>
Authored: Wed Jan 15 14:55:47 2014 -0800
Committer: GERey <gr...@apigee.com>
Committed: Wed Jan 15 14:55:47 2014 -0800
----------------------------------------------------------------------
.../cassandra/RelationManagerImpl.java | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/89b9f502/stack/core/src/main/java/org/usergrid/persistence/cassandra/RelationManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/usergrid/persistence/cassandra/RelationManagerImpl.java b/stack/core/src/main/java/org/usergrid/persistence/cassandra/RelationManagerImpl.java
index da11ddd..d2d6c15 100644
--- a/stack/core/src/main/java/org/usergrid/persistence/cassandra/RelationManagerImpl.java
+++ b/stack/core/src/main/java/org/usergrid/persistence/cassandra/RelationManagerImpl.java
@@ -1088,10 +1088,24 @@ public class RelationManagerImpl implements RelationManager {
PagingResultsIterator itr =
new PagingResultsIterator( getConnectedEntities(headEntity, null, null, Level.REFS) );
- ConnectionRefImpl connection;
+ ConnectionRefImpl connection = null;
while ( itr.hasNext() ) {
- connection = new ConnectionRefImpl( new SimpleEntityRef((EntityRef)itr.next()));
+ Object itrObj = itr.next();
+ if ( itrObj instanceof ConnectionRefImpl ) {
+ connection = (ConnectionRefImpl) itrObj;
+ }
+ else if ( itrObj instanceof SimpleEntityRef ) {
+ connection = new ConnectionRefImpl( (SimpleEntityRef) itrObj );
+ }
+ else {
+ if ( itrObj instanceof EntityRef ) {
+ connection = new ConnectionRefImpl( new SimpleEntityRef((EntityRef) itr.next()));
+ }
+ else if ( itrObj instanceof UUID ) {
+ connection = new ConnectionRefImpl( new SimpleEntityRef((UUID)itr.next()));
+ }
+ }
batchUpdateEntityConnection( batch, true, connection, timestampUuid );
}
[19/50] [abbrv] git commit: fix the test package
Posted by sn...@apache.org.
fix the test package
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/cfe5f4d5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/cfe5f4d5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/cfe5f4d5
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: cfe5f4d50b9a7baabf865f7376e1364fafead46c
Parents: 480d525
Author: Alex Karasulu <ak...@gmail.com>
Authored: Thu Jan 16 00:50:12 2014 +0200
Committer: Alex Karasulu <ak...@gmail.com>
Committed: Thu Jan 16 00:50:12 2014 +0200
----------------------------------------------------------------------
stack/corepersistence/collection/pom.xml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cfe5f4d5/stack/corepersistence/collection/pom.xml
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/pom.xml b/stack/corepersistence/collection/pom.xml
index 29dba1c..f900cdb 100644
--- a/stack/corepersistence/collection/pom.xml
+++ b/stack/corepersistence/collection/pom.xml
@@ -71,10 +71,11 @@
<bucketName>${aws.s3.bucket}</bucketName>
<managerAppUsername>admin</managerAppUsername>
<managerAppPassword>${manager.app.password}</managerAppPassword>
- <testPackageBase>org.safehaus.chop.example</testPackageBase>
+ <testPackageBase>org.apache.usergrid</testPackageBase>
<runnerSSHKeyFile>${runner.ssh.key.file}</runnerSSHKeyFile>
<failIfCommitNecessary>false</failIfCommitNecessary>
<amiID>${ami.id}</amiID>
+ <coldRestartTomcat>true</coldRestartTomcat>
<awsSecurityGroup>${security.group}</awsSecurityGroup>
<runnerKeyPairName>${runner.keypair.name}</runnerKeyPairName>
<minimumRunners>6</minimumRunners>
[14/50] [abbrv] git commit: Add concurrency for unique value
verification,
make thread pool and unique value TTL configurable via new WriteFig. Plus,
license headers and import re-orgs.
Posted by sn...@apache.org.
Add concurrency for unique value verification, make thread pool and unique value TTL configurable via new WriteFig. Plus, license headers and import re-orgs.
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/000a219e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/000a219e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/000a219e
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: 000a219ec94f10403954c9eea69351d89aefb892
Parents: 82bea51
Author: Dave Johnson <dm...@apigee.com>
Authored: Wed Jan 15 13:15:06 2014 -0500
Committer: Dave Johnson <dm...@apigee.com>
Committed: Wed Jan 15 13:15:06 2014 -0500
----------------------------------------------------------------------
.../collection/guice/CollectionModule.java | 27 +++-
.../collection/mvcc/entity/ValidationUtils.java | 2 +-
.../mvcc/stage/write/WriteCommit.java | 2 +-
.../collection/mvcc/stage/write/WriteFig.java | 42 ++++++
.../mvcc/stage/write/WriteUniqueVerify.java | 132 ++++++++++++++-----
.../collection/serialization/UniqueUpdate.java | 28 ----
.../changelog/ChangeLogGeneratorImplTest.java | 20 ---
.../mvcc/stage/AbstractEntityStageTest.java | 17 +++
.../mvcc/stage/AbstractIdStageTest.java | 17 +++
.../mvcc/stage/AbstractMvccEntityStageTest.java | 32 ++++-
.../mvcc/stage/InvalidMvccEntityGenerator.java | 26 ++--
.../mvcc/stage/TestEntityGenerator.java | 17 +++
.../write/EntityVersionSerializerTest.java | 2 -
.../mvcc/stage/write/FieldSerializerTest.java | 1 -
...niqueValueSerializationStrategyImplTest.java | 4 +-
.../mvcc/stage/write/WriteCommitTest.java | 17 +++
.../mvcc/stage/write/WriteStartTest.java | 17 +++
.../mvcc/stage/write/WriteUniqueVerifyTest.java | 23 +++-
.../collection/util/InvalidEntityGenerator.java | 27 +++-
.../collection/util/InvalidIdGenerator.java | 18 ++-
.../src/test/resources/log4j.properties | 11 +-
.../impl/EdgeMetadataSerializationImpl.java | 3 +-
22 files changed, 361 insertions(+), 124 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/CollectionModule.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/CollectionModule.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/CollectionModule.java
index e05084b..294c5fc 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/CollectionModule.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/CollectionModule.java
@@ -1,6 +1,22 @@
+/*
+ * 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.
+ */
package org.apache.usergrid.persistence.collection.guice;
-
import org.safehaus.guicyfig.GuicyFigModule;
import org.apache.usergrid.persistence.collection.EntityCollectionManager;
@@ -20,6 +36,7 @@ import com.google.inject.AbstractModule;
import com.google.inject.assistedinject.FactoryModuleBuilder;
import org.apache.usergrid.persistence.collection.mvcc.stage.write.UniqueValueSerializationStrategy;
import org.apache.usergrid.persistence.collection.mvcc.stage.write.UniqueValueSerializationStrategyImpl;
+import org.apache.usergrid.persistence.collection.mvcc.stage.write.WriteFig;
import rx.Scheduler;
@@ -34,8 +51,12 @@ public class CollectionModule extends AbstractModule {
@Override
protected void configure() {
//noinspection unchecked
- install( new GuicyFigModule( RxFig.class, MigrationManagerFig.class,
- CassandraFig.class, SerializationFig.class ) );
+ install( new GuicyFigModule(
+ RxFig.class,
+ MigrationManagerFig.class,
+ CassandraFig.class,
+ SerializationFig.class,
+ WriteFig.class ) );
install( new SerializationModule() );
install( new ServiceModule() );
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/ValidationUtils.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/ValidationUtils.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/ValidationUtils.java
index 910da91..e8a8481 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/ValidationUtils.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/ValidationUtils.java
@@ -82,7 +82,7 @@ public class ValidationUtils {
final UUID uuid = entityId.getUuid();
- Preconditions.checkNotNull( uuid, "The id uuid is required to be set" );
+ Preconditions.checkArgument( uuid != null, "The id uuid is required to be set" );
Preconditions.checkArgument( uuid.version() == UUID_VERSION, "The uuid must be version 1" );
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommit.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommit.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommit.java
index 31212eb..bcec305 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommit.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommit.java
@@ -105,7 +105,7 @@ public class WriteCommit implements Func1<CollectionIoEvent<MvccEntity>, Entity>
if ( field.isUnique() ) {
UniqueValue written = new UniqueValueImpl(
ioEvent.getEntityCollection(), field, entity.getId(), entity.getVersion());
- MutationBatch mb = uniqueValueStrat.write( written, null );
+ MutationBatch mb = uniqueValueStrat.write( written );
// merge into our existing mutation batch
logMutation.mergeShallow( mb );
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteFig.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteFig.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteFig.java
new file mode 100644
index 0000000..d2282a8
--- /dev/null
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteFig.java
@@ -0,0 +1,42 @@
+/*
+ * 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.
+ */
+package org.apache.usergrid.persistence.collection.mvcc.stage.write;
+
+import org.safehaus.guicyfig.Default;
+import org.safehaus.guicyfig.GuicyFig;
+import org.safehaus.guicyfig.Key;
+
+/**
+ * Configuration for Write stage classes.
+ */
+public interface WriteFig extends GuicyFig {
+
+ /**
+ * Max number of threads the uniqueness verification pool can allocate. Can be dynamically changed after starting
+ */
+ @Key( "collection.stage.write.verification.threads" )
+ @Default( "20" )
+ int getMaxThreadCount();
+
+ /**
+ * Time to Live for Unique Values before commit.
+ */
+ @Key( "collection.stage.write.verification.ttl.seconds" )
+ @Default( "10" )
+ int getUniqueValueTimeToLive();
+}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/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 a147469..b6ae94d 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
@@ -17,7 +17,6 @@
*/
package org.apache.usergrid.persistence.collection.mvcc.stage.write;
-
import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
import org.apache.usergrid.persistence.collection.mvcc.entity.ValidationUtils;
import org.apache.usergrid.persistence.collection.mvcc.stage.CollectionIoEvent;
@@ -26,6 +25,13 @@ import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.netflix.astyanax.MutationBatch;
import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
import org.apache.usergrid.persistence.collection.exception.CollectionRuntimeException;
import org.apache.usergrid.persistence.model.entity.Entity;
import org.apache.usergrid.persistence.model.field.Field;
@@ -35,63 +41,121 @@ import org.slf4j.LoggerFactory;
import rx.util.functions.Func1;
/**
- * This phase should execute any verification on the MvccEntity
+ * This phase execute all unique value verification on the MvccEntity.
*/
@Singleton
-public class WriteUniqueVerify
- implements Func1<CollectionIoEvent<MvccEntity>, CollectionIoEvent<MvccEntity>> {
+public class WriteUniqueVerify
+ implements Func1<CollectionIoEvent<MvccEntity>, CollectionIoEvent<MvccEntity>> {
private static final Logger LOG = LoggerFactory.getLogger( WriteUniqueVerify.class );
- private UniqueValueSerializationStrategy uniqueValueStrat;
+ private final WriteFig writeFig;
+
+ private final UniqueValueSerializationStrategy uniqueValueStrat;
+
+ private final ExecutorService threadPool;
@Inject
- public WriteUniqueVerify( UniqueValueSerializationStrategy uniqueValueSerializiationStrategy ) {
+ public WriteUniqueVerify( WriteFig writeFig,
+ UniqueValueSerializationStrategy uniqueValueSerializiationStrategy ) {
+ this.writeFig = writeFig;
this.uniqueValueStrat = uniqueValueSerializiationStrategy;
+ this.threadPool = Executors.newFixedThreadPool( writeFig.getMaxThreadCount() );
}
@Override
public CollectionIoEvent<MvccEntity> call( final CollectionIoEvent<MvccEntity> ioevent ) {
+ final Entity entity = ioevent.getEvent().getEntity().get();
+
ValidationUtils.verifyMvccEntityWithEntity( ioevent.getEvent() );
- Entity entity = ioevent.getEvent().getEntity().get();
+ // use simple thread pool to verify fields in parallel
+ final List<Future<FieldUniquenessResult>> results =
+ new ArrayList<Future<FieldUniquenessResult>>();
- for ( Field field : entity.getFields() ) {
+ for ( final Field field : entity.getFields() ) {
if ( field.isUnique() ) {
- // use write-first then read strategy
- UniqueValue written = new UniqueValueImpl(
- ioevent.getEntityCollection(), field, entity.getId(), entity.getVersion());
-
- // use TTL in case something goes wrong before entity is finally committed
- // TODO: make TTL configurable
- MutationBatch mb = uniqueValueStrat.write( written, 10 );
- try {
- mb.execute();
- } catch (ConnectionException ex) {
- throw new CollectionRuntimeException(
- "Error writing unique value " + field.toString(), ex );
- }
-
- // does the database value match what we wrote?
- UniqueValue loaded;
- try {
- loaded = uniqueValueStrat.load(
- ioevent.getEntityCollection(), field );
-
- } catch (ConnectionException ex) {
- throw new CollectionRuntimeException( ex );
- }
+ results.add( threadPool.submit( new Callable<FieldUniquenessResult>() {
- if ( !loaded.equals(written) ) {
- throw new CollectionRuntimeException( "Duplicate field value " + field.toString() );
- }
+ public FieldUniquenessResult call() throws Exception {
+
+ // use write-first then read strategy
+ UniqueValue written = new UniqueValueImpl( ioevent.getEntityCollection(),
+ field, entity.getId(), entity.getVersion() );
+
+ // use TTL in case something goes wrong before entity is finally committed
+ MutationBatch mb = uniqueValueStrat.write(
+ written, writeFig.getUniqueValueTimeToLive() );
+
+ try {
+ mb.execute();
+ } catch ( ConnectionException ex ) {
+ throw new CollectionRuntimeException(
+ "Error writing unique value " + field.toString(), ex );
+ }
+
+ // does the database value match what we wrote?
+ UniqueValue loaded;
+ try {
+ loaded = uniqueValueStrat.load(
+ ioevent.getEntityCollection(), field );
+
+ } catch ( ConnectionException ex ) {
+ throw new CollectionRuntimeException( ex );
+ }
+
+ return new FieldUniquenessResult( field, loaded.equals( written ));
+ }
+
+ } ) );
+
+ }
+ }
+ for ( Future<FieldUniquenessResult> result : results ) {
+ try {
+ if ( !result.get().isUnique() ) {
+ Field field = result.get().getField();
+ throw new CollectionRuntimeException( "Duplicate field value "
+ + field.getName() + " = " + field.getValue().toString());
+ }
+ } catch ( InterruptedException ex ) {
+ LOG.error( "Error verifing uniqueness", ex );
+ } catch ( ExecutionException ex ) {
+ LOG.error( "Error verifing uniqueness", ex );
}
}
return ioevent;
}
+
+ static class FieldUniquenessResult {
+ private Field field;
+ private Boolean unique;
+
+ public FieldUniquenessResult( Field f, Boolean u ) {
+ this.field = f;
+ this.unique = u;
+ }
+
+ public Boolean isUnique() {
+ return unique;
+ }
+
+ public void setUnique( Boolean isUnique ) {
+ this.unique = isUnique;
+ }
+
+ public Field getField() {
+ return field;
+ }
+
+ public void setField( Field field ) {
+ this.field = field;
+ }
+
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/UniqueUpdate.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/UniqueUpdate.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/UniqueUpdate.java
deleted file mode 100644
index d4c0ffc..0000000
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/UniqueUpdate.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package org.apache.usergrid.persistence.collection.serialization;
-
-
-import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
-import org.apache.usergrid.persistence.model.field.Field;
-
-
-/**
- * Interface to define how unique updates should be performed
- */
-public interface UniqueUpdate {
-
- /**
- * WriteUniqueVerify the entity we're trying to write in our current context has the correct most current version
- *
- * @param context The mvcc context
- * @param uniqueField The field to check for uniqueness
- *
- * @return True if the value in the uniqueField is unique in the collection context
- */
- public boolean verifyUnique( MvccEntity context, Field<?> uniqueField );
-
- /**
- * During the commit phase, ensure this entity is committed as a unique value. This may release locks or overwrite
- * expiring timeout values since we are at the final commit phase
- */
- public void commitUnique( MvccEntity entity, Field<?> uniqueField );
-}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/changelog/ChangeLogGeneratorImplTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/changelog/ChangeLogGeneratorImplTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/changelog/ChangeLogGeneratorImplTest.java
index 5f40f0e..c9fb131 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/changelog/ChangeLogGeneratorImplTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/changelog/ChangeLogGeneratorImplTest.java
@@ -69,26 +69,6 @@ public class ChangeLogGeneratorImplTest {
@Inject
MvccEntitySerializationStrategy mvccEntitySerializationStrategy;
- public ChangeLogGeneratorImplTest() {
- }
-
- @BeforeClass
- public static void setUpClass() {
- }
-
- @AfterClass
- public static void tearDownClass() {
- }
-
- @Before
- public void setUp() {
- }
-
- @After
- public void tearDown() {
- }
-
-
/**
* Test that change log creation follows Todd's example.
*/
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractEntityStageTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractEntityStageTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractEntityStageTest.java
index c3e7f68..3882dc9 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractEntityStageTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractEntityStageTest.java
@@ -1,3 +1,20 @@
+/*
+ * 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.
+ */
package org.apache.usergrid.persistence.collection.mvcc.stage;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractIdStageTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractIdStageTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractIdStageTest.java
index 4d30ced..ea071ac 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractIdStageTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractIdStageTest.java
@@ -1,3 +1,20 @@
+/*
+ * 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.
+ */
package org.apache.usergrid.persistence.collection.mvcc.stage;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractMvccEntityStageTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractMvccEntityStageTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractMvccEntityStageTest.java
index 6154dbe..fafefc3 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractMvccEntityStageTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/AbstractMvccEntityStageTest.java
@@ -1,3 +1,20 @@
+/*
+ * 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.
+ */
package org.apache.usergrid.persistence.collection.mvcc.stage;
@@ -34,6 +51,7 @@ public abstract class AbstractMvccEntityStageTest {
@InvalidMvccEntityGenerator.NullFields final MvccEntity mvccEntity,
@InvalidEntityGenerator.NullFields final Entity entity,
@InvalidIdGenerator.NullFields final Id nullValidationFailId ) throws Exception {
+
testStage( mvccEntity, entity, nullValidationFailId );
}
@@ -56,16 +74,16 @@ public abstract class AbstractMvccEntityStageTest {
public void testStage(
final MvccEntity mvccEntity, final Entity entity, final Id id ) throws Exception {
- if(entity != null){
- EntityUtils.setId( entity, id );
- }
+// if ( entity != null ) {
+// EntityUtils.setId( entity, id );
+// }
final CollectionScope context = mock( CollectionScope.class );
- if(mvccEntity != null){
- when(mvccEntity.getEntity() ).thenReturn( Optional.fromNullable( entity ) );
- when(mvccEntity.getId()).thenReturn( id );
- }
+// if ( mvccEntity != null ) {
+// when(mvccEntity.getEntity() ).thenReturn( Optional.fromNullable( entity ) );
+// when(mvccEntity.getId()).thenReturn( id );
+// }
validateStage( new CollectionIoEvent<MvccEntity>( context, mvccEntity ) );
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/InvalidMvccEntityGenerator.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/InvalidMvccEntityGenerator.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/InvalidMvccEntityGenerator.java
index c1fef8d..e1393c2 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/InvalidMvccEntityGenerator.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/InvalidMvccEntityGenerator.java
@@ -1,3 +1,20 @@
+/*
+ * 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.
+ */
package org.apache.usergrid.persistence.collection.mvcc.stage;
@@ -43,12 +60,9 @@ public class InvalidMvccEntityGenerator {
public List<PotentialAssignment> getValueSources( final ParameterSignature sig ) {
final List<PotentialAssignment> result = new ArrayList<PotentialAssignment>();
-
result.add( PotentialAssignment.forValue( "nullValue", null ) );
result.add( PotentialAssignment.forValue( "nullSubTypes", nullSubElements() ) );
-
-
return result;
}
@@ -56,11 +70,7 @@ public class InvalidMvccEntityGenerator {
/** Missing fields */
private static MvccEntity nullSubElements() {
-
final MvccEntity entity = mock( MvccEntity.class );
-
- when( entity.getVersion() ).thenReturn( UUIDGenerator.newTimeUUID() );
-
return entity;
}
@@ -84,11 +94,9 @@ public class InvalidMvccEntityGenerator {
public List<PotentialAssignment> getValueSources( final ParameterSignature sig ) {
final List<PotentialAssignment> result = new ArrayList<PotentialAssignment>();
-
result.add( PotentialAssignment.forValue( "wrongUuidType", wrongUuidType() ) );
result.add( PotentialAssignment.forValue( "invalidSubTypes", mock( MvccEntity.class )) );
-
return result;
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/TestEntityGenerator.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/TestEntityGenerator.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/TestEntityGenerator.java
index 133154d..4f7bd17 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/TestEntityGenerator.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/TestEntityGenerator.java
@@ -1,3 +1,20 @@
+/*
+ * 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.
+ */
package org.apache.usergrid.persistence.collection.mvcc.stage;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/EntityVersionSerializerTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/EntityVersionSerializerTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/EntityVersionSerializerTest.java
index b11cdcf..8b4a4f7 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/EntityVersionSerializerTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/EntityVersionSerializerTest.java
@@ -17,8 +17,6 @@
*/
package org.apache.usergrid.persistence.collection.mvcc.stage.write;
-import org.apache.usergrid.persistence.collection.mvcc.stage.write.EntityVersion;
-import org.apache.usergrid.persistence.collection.mvcc.stage.write.EntityVersionSerializer;
import java.nio.ByteBuffer;
import org.apache.usergrid.persistence.model.entity.SimpleId;
import org.apache.usergrid.persistence.model.util.UUIDGenerator;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/FieldSerializerTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/FieldSerializerTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/FieldSerializerTest.java
index de683af..b7deff8 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/FieldSerializerTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/FieldSerializerTest.java
@@ -17,7 +17,6 @@
*/
package org.apache.usergrid.persistence.collection.mvcc.stage.write;
-import org.apache.usergrid.persistence.collection.mvcc.stage.write.FieldSerializer;
import com.netflix.astyanax.model.CompositeBuilder;
import com.netflix.astyanax.model.CompositeParser;
import com.netflix.astyanax.model.Composites;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/UniqueValueSerializationStrategyImplTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/UniqueValueSerializationStrategyImplTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/UniqueValueSerializationStrategyImplTest.java
index 10a70f9..144e634 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/UniqueValueSerializationStrategyImplTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/UniqueValueSerializationStrategyImplTest.java
@@ -65,7 +65,7 @@ public class UniqueValueSerializationStrategyImplTest {
Id entityId = new SimpleId( UUIDGenerator.newTimeUUID(), "entity");
UUID version = UUIDGenerator.newTimeUUID();
UniqueValue stored = new UniqueValueImpl( scope, field, entityId, version );
- strategy.write( stored, null ).execute();
+ strategy.write( stored ).execute();
UniqueValue retrieved = strategy.load( scope, field );
Assert.assertNotNull( retrieved );
@@ -111,7 +111,7 @@ public class UniqueValueSerializationStrategyImplTest {
Id entityId = new SimpleId( UUIDGenerator.newTimeUUID(), "entity");
UUID version = UUIDGenerator.newTimeUUID();
UniqueValue stored = new UniqueValueImpl( scope, field, entityId, version );
- strategy.write( stored, null ).execute();
+ strategy.write( stored ).execute();
strategy.delete( stored ).execute();
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommitTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommitTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommitTest.java
index ca1a057..981a14d 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommitTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteCommitTest.java
@@ -1,3 +1,20 @@
+/*
+ * 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.
+ */
package org.apache.usergrid.persistence.collection.mvcc.stage.write;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteStartTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteStartTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteStartTest.java
index 9a344f8..ecb458a 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteStartTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteStartTest.java
@@ -1,3 +1,20 @@
+/*
+ * 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.
+ */
package org.apache.usergrid.persistence.collection.mvcc.stage.write;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerifyTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerifyTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerifyTest.java
index ec095bf..7569c18 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerifyTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerifyTest.java
@@ -21,6 +21,8 @@ import com.google.inject.Inject;
import org.junit.Test;
import org.apache.usergrid.persistence.collection.CollectionScope;
+import org.apache.usergrid.persistence.collection.cassandra.CassandraRule;
+import org.apache.usergrid.persistence.collection.guice.CollectionModule;
import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
import org.apache.usergrid.persistence.collection.mvcc.stage.AbstractMvccEntityStageTest;
import org.apache.usergrid.persistence.collection.mvcc.stage.CollectionIoEvent;
@@ -28,17 +30,29 @@ import org.apache.usergrid.persistence.model.entity.Entity;
import static org.apache.usergrid.persistence.collection.mvcc.stage.TestEntityGenerator.fromEntity;
import static org.apache.usergrid.persistence.collection.mvcc.stage.TestEntityGenerator.generateEntity;
+import org.jukito.JukitoRunner;
+import org.jukito.UseModules;
import static org.junit.Assert.assertSame;
+import org.junit.ClassRule;
+import org.junit.runner.RunWith;
import static org.mockito.Mockito.mock;
-/** @author tnine */
-
+/**
+ * @author tnine
+ */
+@RunWith( JukitoRunner.class )
+@UseModules( CollectionModule.class )
public class WriteUniqueVerifyTest extends AbstractMvccEntityStageTest {
+ @ClassRule
+ public static CassandraRule rule = new CassandraRule();
+
@Inject
private UniqueValueSerializationStrategy uniqueValueSerializiationStrategy;
+ @Inject
+ private WriteFig writeFig;
/** Standard flow */
@Test
@@ -52,7 +66,7 @@ public class WriteUniqueVerifyTest extends AbstractMvccEntityStageTest {
final MvccEntity mvccEntity = fromEntity( entity );
// run the stage
- WriteUniqueVerify newStage = new WriteUniqueVerify( uniqueValueSerializiationStrategy );
+ WriteUniqueVerify newStage = new WriteUniqueVerify( writeFig, uniqueValueSerializiationStrategy );
CollectionIoEvent<MvccEntity>
result = newStage.call( new CollectionIoEvent<MvccEntity>( collectionScope, mvccEntity ) );
@@ -70,10 +84,9 @@ public class WriteUniqueVerifyTest extends AbstractMvccEntityStageTest {
assertSame( "Entity correct", entity, entry.getEntity().get() );
}
-
@Override
protected void validateStage( final CollectionIoEvent<MvccEntity> event ) {
- new WriteUniqueVerify( uniqueValueSerializiationStrategy ).call( event );
+ new WriteUniqueVerify( writeFig, uniqueValueSerializiationStrategy ).call( event );
}
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidEntityGenerator.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidEntityGenerator.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidEntityGenerator.java
index 632ecc0..df4fb72 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidEntityGenerator.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidEntityGenerator.java
@@ -1,3 +1,20 @@
+/*
+ * 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.
+ */
package org.apache.usergrid.persistence.collection.util;
@@ -13,6 +30,8 @@ import org.junit.experimental.theories.ParametersSuppliedBy;
import org.junit.experimental.theories.PotentialAssignment;
import org.apache.usergrid.persistence.model.entity.Entity;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
/**
@@ -38,12 +57,14 @@ public class InvalidEntityGenerator {
@Override
public List<PotentialAssignment> getValueSources( final ParameterSignature sig ) {
-
final List<PotentialAssignment> result = new ArrayList<PotentialAssignment>();
- result.add( PotentialAssignment.forValue( "nullEntity", null ) );
- result.add( PotentialAssignment.forValue( "nullIdsEntity", new Entity() ) );
+ final Entity entity = mock( Entity.class );
+ when( entity.getId() ).thenReturn( null );
+ when( entity.getVersion() ).thenReturn( null );
+ result.add( PotentialAssignment.forValue( "nullEntity", null ) );
+ result.add( PotentialAssignment.forValue( "nullIdsEntity", entity ) );
return result;
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/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 6354c55..5341813 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
@@ -1,3 +1,20 @@
+/*
+ * 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.
+ */
package org.apache.usergrid.persistence.collection.util;
@@ -41,7 +58,6 @@ public class InvalidIdGenerator {
public List<PotentialAssignment> getValueSources( final ParameterSignature sig ) {
final List<PotentialAssignment> result = new ArrayList<PotentialAssignment>();
-
result.add( PotentialAssignment.forValue( "nullId", null ) );
result.add( PotentialAssignment.forValue( "nullEntityId", nullEntityId() ) );
result.add( PotentialAssignment.forValue( "nullEntityType", nullEntityType() ) );
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/collection/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/resources/log4j.properties b/stack/corepersistence/collection/src/test/resources/log4j.properties
index 1a7a06c..8a482db 100644
--- a/stack/corepersistence/collection/src/test/resources/log4j.properties
+++ b/stack/corepersistence/collection/src/test/resources/log4j.properties
@@ -1,9 +1,8 @@
# suppress inspection "UnusedProperty" for whole file
-log4j.rootLogger=WARN,stdout
-log4j.rootCategory=WARN,stdout
+log4j.rootLogger=INFO,standard
-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.appender.standard=org.apache.log4j.ConsoleAppender
+log4j.appender.standard.layout=org.apache.log4j.PatternLayout
+log4j.appender.standard.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %p %c{3}.%M(%L)<%t>- %m%n
-log4j.logger.org.apache.usergrid=DEBUG,stdout
+log4j.logger.org.apache.usergrid=DEBUG
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/000a219e/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationImpl.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationImpl.java
index fb3c6b7..c9d3f6c 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationImpl.java
@@ -134,8 +134,9 @@ public class EdgeMetadataSerializationImpl implements EdgeMetadataSerialization,
//write source->target edge type and id type to meta data
+ EdgeIdTypeKey tk = new EdgeIdTypeKey( source, edgeType );
final ScopedRowKey<OrganizationScope, EdgeIdTypeKey> sourceTypeKey =
- new ScopedRowKey<OrganizationScope, EdgeIdTypeKey>( scope, new EdgeIdTypeKey( source, edgeType ) );
+ new ScopedRowKey<OrganizationScope, EdgeIdTypeKey>( scope, tk );
batch.withRow( CF_TARGET_EDGE_ID_TYPES, sourceTypeKey ).setTimestamp( timestamp )
[08/50] [abbrv] git commit: Graph module needs Hystrix too
Posted by sn...@apache.org.
Graph module needs Hystrix too
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/a9635491
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/a9635491
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/a9635491
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: a963549158d64cda225c168693c35498bc1cacc7
Parents: f834a19
Author: Dave Johnson <dm...@apigee.com>
Authored: Mon Jan 13 15:05:35 2014 -0500
Committer: Dave Johnson <dm...@apigee.com>
Committed: Mon Jan 13 15:05:35 2014 -0500
----------------------------------------------------------------------
stack/corepersistence/graph/pom.xml | 6 ++++++
1 file changed, 6 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a9635491/stack/corepersistence/graph/pom.xml
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/pom.xml b/stack/corepersistence/graph/pom.xml
index 28d606a..86147bf 100644
--- a/stack/corepersistence/graph/pom.xml
+++ b/stack/corepersistence/graph/pom.xml
@@ -53,6 +53,12 @@
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>com.netflix.hystrix</groupId>
+ <artifactId>hystrix-core</artifactId>
+ <version>${hystrix.version}</version>
+ </dependency>
+
</dependencies>
</project>
[11/50] [abbrv] git commit: Added in test that checks to see if you
can delete a single connection with a connection attached.
Posted by sn...@apache.org.
Added in test that checks to see if you can delete a single connection with a connection attached.
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/79a34a2a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/79a34a2a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/79a34a2a
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: 79a34a2a5bfa3b39ac64b2ce51162346acf51ea2
Parents: 5a57e87
Author: GERey <gr...@apigee.com>
Authored: Mon Jan 13 15:55:15 2014 -0800
Committer: GERey <gr...@apigee.com>
Committed: Mon Jan 13 15:55:15 2014 -0800
----------------------------------------------------------------------
.../users/ConnectionResourceTest.java | 22 ++++++++++++++++++++
1 file changed, 22 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/79a34a2a/stack/rest/src/test/java/org/usergrid/rest/applications/users/ConnectionResourceTest.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/usergrid/rest/applications/users/ConnectionResourceTest.java b/stack/rest/src/test/java/org/usergrid/rest/applications/users/ConnectionResourceTest.java
index ab29ea8..a9495c4 100644
--- a/stack/rest/src/test/java/org/usergrid/rest/applications/users/ConnectionResourceTest.java
+++ b/stack/rest/src/test/java/org/usergrid/rest/applications/users/ConnectionResourceTest.java
@@ -8,6 +8,7 @@ import java.util.UUID;
import javax.ws.rs.core.MediaType;
import org.codehaus.jackson.JsonNode;
+import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.usergrid.rest.AbstractRestIT;
@@ -17,6 +18,7 @@ import org.usergrid.rest.test.resource.CustomCollection;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.UniformInterfaceException;
+import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.usergrid.utils.MapUtils.hashMap;
@@ -190,4 +192,24 @@ public class ConnectionResourceTest extends AbstractRestIT {
assertEquals( "Should point to thing2 as an entity connection", thing2Id, returned );
}
+
+ @Test //USERGRID-3011
+ public void connectionsDeleteSecondEntityInConnectionTest() {
+
+ CustomCollection things = context.collection( "things" );
+
+ UUID thing1Id = getEntityId( things.create( hashMap( "name", "thing1" ) ), 0 );
+
+ UUID thing2Id = getEntityId( things.create( hashMap( "name", "thing2" ) ), 0 );
+
+ //create the connection
+ things.entity( thing1Id ).connection( "likes" ).entity( thing2Id ).post();
+
+ JsonNode response = things.entity( "thing2" ).delete();
+
+ assertNull (things.entity( thing1Id).connection("likes").entity( thing2Id).get());
+
+
+ }
+
}
[16/50] [abbrv] git commit: Pruned old code. Created a new Connection
by downcasting the entity associated with the connection Changed the iterator
so that it will return ConnectionEntityRefImpl objects.
Posted by sn...@apache.org.
Pruned old code.
Created a new Connection by downcasting the entity associated with the connection
Changed the iterator so that it will return ConnectionEntityRefImpl objects.
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/2dde4ea4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/2dde4ea4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/2dde4ea4
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: 2dde4ea4202084cf8444b3e6d4482dd9bcfc9e58
Parents: 4a28f6b
Author: GERey <gr...@apigee.com>
Authored: Wed Jan 15 13:09:39 2014 -0800
Committer: GERey <gr...@apigee.com>
Committed: Wed Jan 15 13:09:39 2014 -0800
----------------------------------------------------------------------
.../persistence/cassandra/RelationManagerImpl.java | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2dde4ea4/stack/core/src/main/java/org/usergrid/persistence/cassandra/RelationManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/usergrid/persistence/cassandra/RelationManagerImpl.java b/stack/core/src/main/java/org/usergrid/persistence/cassandra/RelationManagerImpl.java
index 4f565c7..da11ddd 100644
--- a/stack/core/src/main/java/org/usergrid/persistence/cassandra/RelationManagerImpl.java
+++ b/stack/core/src/main/java/org/usergrid/persistence/cassandra/RelationManagerImpl.java
@@ -1086,22 +1086,15 @@ public class RelationManagerImpl implements RelationManager {
PagingResultsIterator itr =
- new PagingResultsIterator( getConnectingEntities( headEntity, null, null, Level.REFS ) );
+ new PagingResultsIterator( getConnectedEntities(headEntity, null, null, Level.REFS) );
ConnectionRefImpl connection;
while ( itr.hasNext() ) {
- connection = ( ConnectionRefImpl ) itr.next();
+ connection = new ConnectionRefImpl( new SimpleEntityRef((EntityRef)itr.next()));
batchUpdateEntityConnection( batch, true, connection, timestampUuid );
}
- //
- // List<ConnectionRefImpl> connections = getConnectionsWithEntity(headEntity.getUuid());
- // if (connections != null) {
- // for (ConnectionRefImpl connection : connections) {
- // batchUpdateEntityConnection(batch, true, connection, timestampUuid);
- // }
- // }
}
[43/50] [abbrv] git commit: Minor formatting fixes plus license
headers.
Posted by sn...@apache.org.
Minor formatting fixes plus license headers.
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/1aba6206
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/1aba6206
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/1aba6206
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: 1aba62062b3d839d72ede9f7047608caaf224c7f
Parents: d8459de
Author: Dave Johnson <dm...@apigee.com>
Authored: Mon Jan 20 10:56:16 2014 -0500
Committer: Dave Johnson <dm...@apigee.com>
Committed: Mon Jan 20 10:56:16 2014 -0500
----------------------------------------------------------------------
.../DynamicCompositeFieldSerializer.java | 5 +-
.../IdColDynamicCompositeSerializer.java | 5 +-
.../persistence/collection/CollectionScope.java | 18 ++++++
.../collection/EntityCollectionManager.java | 18 ++++++
.../EntityCollectionManagerFactory.java | 52 +++++++++++++-----
.../collection/EntityCollectionManagerSync.java | 20 ++++++-
.../collection/OrganizationScope.java | 18 ++++++
.../astyanax/AstyanaxKeyspaceProvider.java | 18 ++++++
.../collection/astyanax/CassandraFig.java | 18 ++++++
.../astyanax/CompositeFieldSerializer.java | 18 ++++++
.../astyanax/IdRowCompositeSerializer.java | 18 ++++++
.../astyanax/MultiTennantColumnFamily.java | 21 ++++++-
.../MultiTennantColumnFamilyDefinition.java | 18 ++++++
.../collection/astyanax/ScopedRowKey.java | 22 +++++++-
.../collection/guice/PropertyUtils.java | 18 ++++++
.../collection/impl/CollectionScopeImpl.java | 18 ++++++
.../impl/EntityCollectionManagerImpl.java | 18 ++++++
.../impl/EntityCollectionManagerSyncImpl.java | 18 ++++++
.../collection/migration/Migration.java | 18 ++++++
.../migration/MigrationException.java | 18 ++++++
.../collection/migration/MigrationManager.java | 18 ++++++
.../mvcc/MvccEntitySerializationStrategy.java | 18 ++++++
.../mvcc/MvccLogEntrySerializationStrategy.java | 18 ++++++
.../collection/mvcc/entity/MvccEntity.java | 18 ++++++
.../collection/mvcc/entity/MvccLogEntry.java | 18 ++++++
.../collection/mvcc/entity/Stage.java | 18 ++++++
.../collection/mvcc/entity/ValidationUtils.java | 18 ++++++
.../mvcc/entity/impl/MvccEntityImpl.java | 21 ++++++-
.../mvcc/entity/impl/MvccLogEntryImpl.java | 18 ++++++
.../mvcc/event/PostProcessObserver.java | 21 ++++++-
.../mvcc/stage/CollectionIoEvent.java | 19 ++++++-
.../mvcc/stage/delete/DeleteCommit.java | 46 +++++++++++-----
.../mvcc/stage/delete/DeleteStart.java | 31 +++++++++--
.../collection/mvcc/stage/load/Load.java | 30 ++++++++--
.../mvcc/stage/write/UniqueValueImpl.java | 2 +-
.../collection/rx/CassandraThreadScheduler.java | 44 ++++++++++-----
.../persistence/collection/rx/Concurrent.java | 42 ++++++++++----
.../persistence/collection/rx/RxFig.java | 18 ++++++
.../model/builder/EntitySerializer.java | 19 ++++++-
.../model/builder/EntitySerializerFactory.java | 20 ++++++-
.../persistence/model/entity/Entity.java | 22 ++++++--
.../usergrid/persistence/model/entity/Id.java | 18 ++++++
.../persistence/model/entity/SimpleId.java | 18 ++++++
.../persistence/model/field/ArrayField.java | 48 ++++++++++------
.../persistence/model/field/BooleanField.java | 2 -
.../model/field/ByteBufferField.java | 40 ++++++++++----
.../persistence/model/field/DoubleField.java | 2 -
.../model/field/EntityObjectField.java | 33 ++++++++---
.../usergrid/persistence/model/field/Field.java | 24 ++++++--
.../persistence/model/field/IntegerField.java | 2 -
.../persistence/model/field/ListField.java | 44 ++++++++++-----
.../persistence/model/field/LocationField.java | 36 +++++++++---
.../persistence/model/field/SetField.java | 44 ++++++++++-----
.../model/field/value/EntityObject.java | 58 +++++++++++++-------
.../persistence/model/field/value/Location.java | 39 ++++++++-----
.../usergrid/persistence/model/util/Verify.java | 21 ++++++-
56 files changed, 1080 insertions(+), 205 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/astyanax/DynamicCompositeFieldSerializer.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/astyanax/DynamicCompositeFieldSerializer.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/astyanax/DynamicCompositeFieldSerializer.java
index 17a0fe2..1aae61e 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/astyanax/DynamicCompositeFieldSerializer.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/astyanax/DynamicCompositeFieldSerializer.java
@@ -24,8 +24,9 @@ import com.netflix.astyanax.model.DynamicComposite;
/**
- * This interface is for re-using multiple components in a composite. Implementing this allows many different types to
- * be serialized together in a single composite
+ * This interface is for re-using multiple components in a composite.
+ * Implementing this allows many different types to be serialized
+ * together in a single composite
*
* @author tnine
*/
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/astyanax/IdColDynamicCompositeSerializer.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/astyanax/IdColDynamicCompositeSerializer.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/astyanax/IdColDynamicCompositeSerializer.java
index cd7dd99..44da06b 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/astyanax/IdColDynamicCompositeSerializer.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/astyanax/IdColDynamicCompositeSerializer.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.usergrid.persistence.astyanax;
@@ -42,7 +41,8 @@ public class IdColDynamicCompositeSerializer implements DynamicCompositeFieldSer
private static final StringSerializer STRING_SERIALIZER = StringSerializer.get();
private static final UUIDSerializer UUID_SERIALIZER = UUIDSerializer.get();
- private static final IdColDynamicCompositeSerializer INSTANCE = new IdColDynamicCompositeSerializer();
+ private static final IdColDynamicCompositeSerializer INSTANCE =
+ new IdColDynamicCompositeSerializer();
private IdColDynamicCompositeSerializer() {
@@ -50,7 +50,6 @@ public class IdColDynamicCompositeSerializer implements DynamicCompositeFieldSer
}
-
/**
* Get the singleton serializer
*/
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/CollectionScope.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/CollectionScope.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/CollectionScope.java
index 4d6fbbf..be5924d 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/CollectionScope.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/CollectionScope.java
@@ -1,3 +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.
+ */
package org.apache.usergrid.persistence.collection;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityCollectionManager.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityCollectionManager.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityCollectionManager.java
index 9942fba..3322164 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityCollectionManager.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityCollectionManager.java
@@ -1,3 +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.
+ */
package org.apache.usergrid.persistence.collection;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityCollectionManagerFactory.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityCollectionManagerFactory.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityCollectionManagerFactory.java
index 05e5093..59a5e09 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityCollectionManagerFactory.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityCollectionManagerFactory.java
@@ -1,35 +1,59 @@
+/*
+ * 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.collection;
/**
- * A basic factory that creates a collection manager with the given context. Each instance of this factory should exist
- * for a Single OrganizationScope
+ * A basic factory that creates a collection manager with the given context.
+ * Each instance of this factory should exist for a Single OrganizationScope
*/
public interface EntityCollectionManagerFactory {
/**
- * Create a new EntityCollectionManager for the given context. The EntityCollectionManager can safely be used on the
- * current thread and will cache responses. The returned instance should not be shared among threads it will not be
- * guaranteed to be thread safe.
+ * Create a new EntityCollectionManager for the given context.
+ * The EntityCollectionManager can safely be used on the current thread
+ * and will cache responses. The returned instance should not be shared
+ * among threads it will not be guaranteed to be thread safe.
*
- * @param collectionScope The collectionScope collectionScope to use when creating the collectionScope manager
+ * @param collectionScope The collectionScope collectionScope to use
+ * when creating the collectionScope manager
*
* @return The collectionScope manager to perform operations within the provided context
*/
- public EntityCollectionManager createCollectionManager( CollectionScope collectionScope );
+ public EntityCollectionManager
+ createCollectionManager( CollectionScope collectionScope );
/**
- * Create a new EntityCollectionManagerSync for the given context. The EntityCollectionManager can safely be used on the
- * current thread and will cache responses. The returned instance should not be shared among threads it will not be
- * guaranteed to be thread safe. This implementation will be synchronous.
- * Try to use the async implementation if possible
- *
+ * Create a new EntityCollectionManagerSync for the given context.
+ * The EntityCollectionManager can safely be used on the current thread
+ * and will cache responses. The returned instance should not be shared
+ * among threads it will not be guaranteed to be thread safe.
+ * This implementation will be synchronous. Try to use the async
+ * implementation if possible
*
- * @param collectionScope The collectionScope collectionScope to use when creating the collectionScope manager
+ * @param collectionScope The collectionScope collectionScope to use when
+ * creating the collectionScope manager
*
* @return The collectionScope manager to perform operations within the provided context
*/
- public EntityCollectionManagerSync createCollectionManagerSync( CollectionScope collectionScope );
+ public EntityCollectionManagerSync
+ createCollectionManagerSync( CollectionScope collectionScope );
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityCollectionManagerSync.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityCollectionManagerSync.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityCollectionManagerSync.java
index 32654c7..34181e9 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityCollectionManagerSync.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityCollectionManagerSync.java
@@ -1,3 +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.
+ */
package org.apache.usergrid.persistence.collection;
@@ -6,10 +24,8 @@ import org.apache.usergrid.persistence.model.entity.Id;
/**
- *
* A synchronous implementation that will block until the call is returned.
* @author: tnine
- *
*/
public interface EntityCollectionManagerSync {
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/OrganizationScope.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/OrganizationScope.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/OrganizationScope.java
index 34129cb..f168e7b 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/OrganizationScope.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/OrganizationScope.java
@@ -1,3 +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.
+ */
package org.apache.usergrid.persistence.collection;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/AstyanaxKeyspaceProvider.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/AstyanaxKeyspaceProvider.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/AstyanaxKeyspaceProvider.java
index 512f2fa..12ba2ca 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/AstyanaxKeyspaceProvider.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/AstyanaxKeyspaceProvider.java
@@ -1,3 +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.
+ */
package org.apache.usergrid.persistence.collection.astyanax;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/CassandraFig.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/CassandraFig.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/CassandraFig.java
index 0728656..6ff9828 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/CassandraFig.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/CassandraFig.java
@@ -1,3 +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.
+ */
package org.apache.usergrid.persistence.collection.astyanax;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/CompositeFieldSerializer.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/CompositeFieldSerializer.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/CompositeFieldSerializer.java
index 062645c..dc91b16 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/CompositeFieldSerializer.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/CompositeFieldSerializer.java
@@ -1,3 +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.
+ */
package org.apache.usergrid.persistence.collection.astyanax;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/IdRowCompositeSerializer.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/IdRowCompositeSerializer.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/IdRowCompositeSerializer.java
index d3e9f34..8444adc 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/IdRowCompositeSerializer.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/IdRowCompositeSerializer.java
@@ -1,3 +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.
+ */
package org.apache.usergrid.persistence.collection.astyanax;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/MultiTennantColumnFamily.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/MultiTennantColumnFamily.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/MultiTennantColumnFamily.java
index 73a354c..b69c7a2 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/MultiTennantColumnFamily.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/MultiTennantColumnFamily.java
@@ -1,3 +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.
+ */
package org.apache.usergrid.persistence.collection.astyanax;
@@ -12,7 +30,8 @@ import com.netflix.astyanax.model.ColumnFamily;
*
* @author tnine
*/
-public class MultiTennantColumnFamily<S extends OrganizationScope, K, V> extends ColumnFamily<ScopedRowKey<S, K>, V> {
+public class MultiTennantColumnFamily<S extends OrganizationScope, K, V>
+ extends ColumnFamily<ScopedRowKey<S, K>, V> {
public MultiTennantColumnFamily(
final String columnFamilyName,
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/MultiTennantColumnFamilyDefinition.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/MultiTennantColumnFamilyDefinition.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/MultiTennantColumnFamilyDefinition.java
index 9adfb19..764ae36 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/MultiTennantColumnFamilyDefinition.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/MultiTennantColumnFamilyDefinition.java
@@ -1,3 +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.
+ */
package org.apache.usergrid.persistence.collection.astyanax;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/ScopedRowKey.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/ScopedRowKey.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/ScopedRowKey.java
index dd47881..c2eaa90 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/ScopedRowKey.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/ScopedRowKey.java
@@ -1,3 +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.
+ */
package org.apache.usergrid.persistence.collection.astyanax;
@@ -7,8 +25,8 @@ import com.google.common.base.Preconditions;
/**
- * A row key that is within a Scope. Every I/O operation should be using this class. No keys should be allowed that
- * aren't within a Scope
+ * A row key that is within a Scope. Every I/O operation should be using this class.
+ * No keys should be allowed that aren't within a Scope
*
* @author tnine
*/
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/PropertyUtils.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/PropertyUtils.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/PropertyUtils.java
index 54c3475..629813c 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/PropertyUtils.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/PropertyUtils.java
@@ -1,3 +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.
+ */
package org.apache.usergrid.persistence.collection.guice;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/CollectionScopeImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/CollectionScopeImpl.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/CollectionScopeImpl.java
index 3776e12..38dcad1 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/CollectionScopeImpl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/CollectionScopeImpl.java
@@ -1,3 +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.
+ */
package org.apache.usergrid.persistence.collection.impl;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerImpl.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerImpl.java
index b5237b5..12bca5d 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerImpl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerImpl.java
@@ -1,3 +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.
+ */
package org.apache.usergrid.persistence.collection.impl;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerSyncImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerSyncImpl.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerSyncImpl.java
index ddd1e8d..c04e70b 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerSyncImpl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerSyncImpl.java
@@ -1,3 +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.
+ */
package org.apache.usergrid.persistence.collection.impl;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/migration/Migration.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/migration/Migration.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/migration/Migration.java
index 9074386..8d83364 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/migration/Migration.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/migration/Migration.java
@@ -1,3 +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.
+ */
package org.apache.usergrid.persistence.collection.migration;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/migration/MigrationException.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/migration/MigrationException.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/migration/MigrationException.java
index 3003940..a3487dc 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/migration/MigrationException.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/migration/MigrationException.java
@@ -1,3 +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.
+ */
package org.apache.usergrid.persistence.collection.migration;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/migration/MigrationManager.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/migration/MigrationManager.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/migration/MigrationManager.java
index 94fa9ac..7cb4103 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/migration/MigrationManager.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/migration/MigrationManager.java
@@ -1,3 +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.
+ */
package org.apache.usergrid.persistence.collection.migration;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/MvccEntitySerializationStrategy.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/MvccEntitySerializationStrategy.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/MvccEntitySerializationStrategy.java
index 73ff5a8..c7fba3b 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/MvccEntitySerializationStrategy.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/MvccEntitySerializationStrategy.java
@@ -1,3 +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.
+ */
package org.apache.usergrid.persistence.collection.mvcc;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/MvccLogEntrySerializationStrategy.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/MvccLogEntrySerializationStrategy.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/MvccLogEntrySerializationStrategy.java
index b25c0dd..a7c9d64 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/MvccLogEntrySerializationStrategy.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/MvccLogEntrySerializationStrategy.java
@@ -1,3 +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.
+ */
package org.apache.usergrid.persistence.collection.mvcc;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/MvccEntity.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/MvccEntity.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/MvccEntity.java
index 011a561..7419041 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/MvccEntity.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/MvccEntity.java
@@ -1,3 +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.
+ */
package org.apache.usergrid.persistence.collection.mvcc.entity;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/MvccLogEntry.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/MvccLogEntry.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/MvccLogEntry.java
index 0d32ecf..a285a78 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/MvccLogEntry.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/MvccLogEntry.java
@@ -1,3 +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.
+ */
package org.apache.usergrid.persistence.collection.mvcc.entity;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/Stage.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/Stage.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/Stage.java
index 928afa0..007f013 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/Stage.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/Stage.java
@@ -1,3 +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.
+ */
package org.apache.usergrid.persistence.collection.mvcc.entity;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/ValidationUtils.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/ValidationUtils.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/ValidationUtils.java
index 0d416ed..98fa14e 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/ValidationUtils.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/ValidationUtils.java
@@ -1,3 +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.
+ */
package org.apache.usergrid.persistence.collection.mvcc.entity;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccEntityImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccEntityImpl.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccEntityImpl.java
index 6f29cac..39e525e 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccEntityImpl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccEntityImpl.java
@@ -1,3 +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.
+ */
package org.apache.usergrid.persistence.collection.mvcc.entity.impl;
@@ -26,7 +44,8 @@ public class MvccEntityImpl implements MvccEntity {
}
- public MvccEntityImpl( final Id entityId, final UUID version, final Optional<Entity> entity ) {
+ public MvccEntityImpl(
+ final Id entityId, final UUID version, final Optional<Entity> entity ) {
Preconditions.checkNotNull( entityId, "entity id is required" );
Preconditions.checkNotNull( version, "version id is required" );
Preconditions.checkNotNull( entity, "entity is required" );
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/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 5065405..4b5552e 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
@@ -1,3 +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.
+ */
package org.apache.usergrid.persistence.collection.mvcc.entity.impl;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/event/PostProcessObserver.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/event/PostProcessObserver.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/event/PostProcessObserver.java
index 223a5d3..b06957d 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/event/PostProcessObserver.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/event/PostProcessObserver.java
@@ -1,14 +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.
+ */
package org.apache.usergrid.persistence.collection.mvcc.event;
-
import org.apache.usergrid.persistence.collection.CollectionScope;
import org.apache.usergrid.persistence.collection.mvcc.entity.MvccEntity;
/**
- *
* @author: tnine
- *
*/
public interface PostProcessObserver {
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/CollectionIoEvent.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/CollectionIoEvent.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/CollectionIoEvent.java
index e74e41d..1ad270f 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/CollectionIoEvent.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/CollectionIoEvent.java
@@ -1,6 +1,23 @@
+/*
+ * 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.collection.mvcc.stage;
-
import org.apache.usergrid.persistence.collection.CollectionScope;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/DeleteCommit.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/DeleteCommit.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/DeleteCommit.java
index ef456fa..2cf393b 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/DeleteCommit.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/DeleteCommit.java
@@ -1,3 +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.
+ */
package org.apache.usergrid.persistence.collection.mvcc.stage.delete;
@@ -27,28 +45,28 @@ import rx.util.functions.Func1;
/**
- * This phase should invoke any finalization, and mark the entity as committed in the data store before returning
+ * This phase should invoke any finalization, and mark the entity
+ * as committed in the data store before returning
*/
@Singleton
public class DeleteCommit implements Func1<CollectionIoEvent<MvccEntity>, Void> {
-
private static final Logger LOG = LoggerFactory.getLogger( DeleteCommit.class );
- private final MvccLogEntrySerializationStrategy logEntrySerializationStrategy;
- private final MvccEntitySerializationStrategy entitySerializationStrategy;
-
+ private final MvccLogEntrySerializationStrategy logStrat;
+ private final MvccEntitySerializationStrategy entityStrat;
@Inject
- public DeleteCommit( final MvccLogEntrySerializationStrategy logEntrySerializationStrategy,
- final MvccEntitySerializationStrategy entitySerializationStrategy ) {
-
- Preconditions.checkNotNull( logEntrySerializationStrategy, "logEntrySerializationStrategy is required" );
- Preconditions.checkNotNull( entitySerializationStrategy, "entitySerializationStrategy is required" );
+ public DeleteCommit( final MvccLogEntrySerializationStrategy logStrat,
+ final MvccEntitySerializationStrategy entityStrat ) {
+ Preconditions.checkNotNull(
+ logStrat, "logEntrySerializationStrategy is required" );
+ Preconditions.checkNotNull(
+ entityStrat, "entitySerializationStrategy is required" );
- this.logEntrySerializationStrategy = logEntrySerializationStrategy;
- this.entitySerializationStrategy = entitySerializationStrategy;
+ this.logStrat = logStrat;
+ this.entityStrat = entityStrat;
}
@@ -69,10 +87,10 @@ public class DeleteCommit implements Func1<CollectionIoEvent<MvccEntity>, Void>
final MvccLogEntry startEntry = new MvccLogEntryImpl( entityId, version,
org.apache.usergrid.persistence.collection.mvcc.entity.Stage.COMMITTED );
- MutationBatch logMutation = logEntrySerializationStrategy.write( collectionScope, startEntry );
+ MutationBatch logMutation = logStrat.write( collectionScope, startEntry );
//insert a "cleared" value into the versions. Post processing should actually delete
- MutationBatch entityMutation = entitySerializationStrategy.clear( collectionScope, entityId, version );
+ MutationBatch entityMutation = entityStrat.clear( collectionScope, entityId, version );
//merge the 2 into 1 mutation
logMutation.mergeShallow( entityMutation );
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/DeleteStart.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/DeleteStart.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/DeleteStart.java
index 7bab25b..b7d6268 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/DeleteStart.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/DeleteStart.java
@@ -1,3 +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.
+ */
package org.apache.usergrid.persistence.collection.mvcc.stage.delete;
@@ -31,8 +49,9 @@ import rx.util.functions.Func1;
/**
- * This is the first stage and should be invoked immediately when a write is started. It should persist the start of a
- * new write in the data store for a checkpoint and recovery
+ * This is the first stage and should be invoked immediately when a write is started.
+ * It should persist the start of a new write in the data store for
+ * a checkpoint and recovery
*/
@Singleton
public class DeleteStart implements Func1<CollectionIoEvent<Id>, CollectionIoEvent<MvccEntity>> {
@@ -48,7 +67,10 @@ public class DeleteStart implements Func1<CollectionIoEvent<Id>, CollectionIoEve
* Create a new stage with the current context
*/
@Inject
- public DeleteStart( final MvccLogEntrySerializationStrategy logStrategy, final UUIDService uuidService ) {
+ public DeleteStart(
+ final MvccLogEntrySerializationStrategy logStrategy,
+ final UUIDService uuidService ) {
+
Preconditions.checkNotNull( logStrategy, "logStrategy is required" );
Preconditions.checkNotNull( uuidService, "uuidService is required" );
@@ -84,7 +106,8 @@ public class DeleteStart implements Func1<CollectionIoEvent<Id>, CollectionIoEve
//create the mvcc entity for the next stage
- final MvccEntityImpl nextStage = new MvccEntityImpl( entityId, version, Optional.<Entity>absent() );
+ final MvccEntityImpl nextStage = new MvccEntityImpl(
+ entityId, version, Optional.<Entity>absent() );
return new CollectionIoEvent<MvccEntity>( collectionScope, nextStage );
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/load/Load.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/load/Load.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/load/Load.java
index 803983d..6f61d3e 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/load/Load.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/load/Load.java
@@ -1,3 +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.
+ */
package org.apache.usergrid.persistence.collection.mvcc.stage.load;
@@ -38,8 +56,10 @@ public class Load implements Func1<CollectionIoEvent<Id>, Entity> {
@Inject
- public Load( final UUIDService uuidService, final MvccEntitySerializationStrategy entitySerializationStrategy ) {
- Preconditions.checkNotNull( entitySerializationStrategy, "entitySerializationStrategy is required" );
+ public Load( final UUIDService uuidService,
+ final MvccEntitySerializationStrategy entitySerializationStrategy ) {
+ Preconditions.checkNotNull( entitySerializationStrategy,
+ "entitySerializationStrategy is required" );
Preconditions.checkNotNull( uuidService, "uuidService is required" );
@@ -60,7 +80,8 @@ public class Load implements Func1<CollectionIoEvent<Id>, Entity> {
//generate a version that represents now
final UUID versionMax = uuidService.newTimeUUID();
- List<MvccEntity> results = entitySerializationStrategy.load( collectionScope, entityId, versionMax, 1 );
+ List<MvccEntity> results = entitySerializationStrategy.load(
+ collectionScope, entityId, versionMax, 1 );
//nothing to do, we didn't get a result back
if ( results.size() != 1 ) {
@@ -69,7 +90,8 @@ public class Load implements Func1<CollectionIoEvent<Id>, Entity> {
final Optional<Entity> targetVersion = results.get( 0 ).getEntity();
- //this entity has been marked as cleared. The version exists, but does not have entity data
+ //this entity has been marked as cleared.
+ //The version exists, but does not have entity data
if ( !targetVersion.isPresent() ) {
//TODO, a lazy async repair/cleanup here?
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/UniqueValueImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/UniqueValueImpl.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/UniqueValueImpl.java
index 686eb1f..76ac439 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/UniqueValueImpl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/UniqueValueImpl.java
@@ -30,7 +30,7 @@ public class UniqueValueImpl implements UniqueValue {
private final CollectionScope collectionScope;
private final Field field;
private final Id entityId;
- private UUID entityVersion;
+ private final UUID entityVersion;
public UniqueValueImpl(
final CollectionScope scope, final Field field, Id entityId, final UUID version ) {
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/rx/CassandraThreadScheduler.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/rx/CassandraThreadScheduler.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/rx/CassandraThreadScheduler.java
index 7f9de19..512f0ec 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/rx/CassandraThreadScheduler.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/rx/CassandraThreadScheduler.java
@@ -1,3 +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.
+ */
package org.apache.usergrid.persistence.collection.rx;
@@ -20,16 +38,10 @@ import rx.Scheduler;
import rx.concurrency.Schedulers;
-/**
- *
- *
- */
public class CassandraThreadScheduler implements Provider<Scheduler> {
-
private static final Logger LOG = LoggerFactory.getLogger(CassandraThreadScheduler.class);
-
private final RxFig rxFig;
@@ -63,19 +75,21 @@ public class CassandraThreadScheduler implements Provider<Scheduler> {
/**
- * Create a threadpool that will reclaim unused threads after 60 seconds. It uses the max thread count set
- * here.
- * It intentionally uses the DynamicProperty, so that when it is updated, the listener updates the pool size
- * Additional allocation is trivial. Shrinking the size will require all currently executing threads to run
- * to completion, without allowing additional tasks to be queued.
- *
+ * Create a threadpool that will reclaim unused threads after 60 seconds.
+ * It uses the max thread count set here. It intentionally uses the
+ * DynamicProperty, so that when it is updated, the listener updates the
+ * pool size. Additional allocation is trivial. Shrinking the size
+ * will require all currently executing threads to run to completion,
+ * without allowing additional tasks to be queued.
*/
- final ThreadPoolExecutor pool = new ThreadPoolExecutor( 0, rxFig.getMaxThreadCount(), 60L, TimeUnit.SECONDS,
+ final ThreadPoolExecutor pool = new ThreadPoolExecutor(
+ 0, rxFig.getMaxThreadCount(), 60L, TimeUnit.SECONDS,
new SynchronousQueue<Runnable>(), factory, new ThreadPoolExecutor.AbortPolicy() );
- //if our max thread count is updated, we want to immediately update the pool. Per the javadoc
- //if the size is smaller, existing threads will continue to run until they become idle and time out
+ // if our max thread count is updated, we want to immediately update the pool.
+ // Per the javadoc if the size is smaller, existing threads will continue to run
+ // until they become idle and time out
rxFig.addPropertyChangeListener( new PropertyChangeListener() {
@Override
public void propertyChange( final PropertyChangeEvent evt ) {
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/rx/Concurrent.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/rx/Concurrent.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/rx/Concurrent.java
index 88e9fbb..f1c4ac2 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/rx/Concurrent.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/rx/Concurrent.java
@@ -1,3 +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.
+ */
package org.apache.usergrid.persistence.collection.rx;
@@ -12,15 +30,12 @@ import rx.util.functions.Func1;
/**
* A utility class that encapsulates many Funct1 operations that receive and emit the same type.
- * These functions are executed in parallel, then "zipped" into a single response. This is useful
- * when you want to perform operations on a single initial observable, then combine the result into a
- * single observable to continue the sequence
-
+ * These functions are executed in parallel, then "zipped" into a single response.
+ * This is useful when you want to perform operations on a single initial observable,
+ * then combine the result into a single observable to continue the sequence
*/
public class Concurrent<T, R> implements Func1<T, Observable<R>> {
-
-
private final Func1<T, R>[] concurrent;
private Concurrent( final Func1<T, R>[] concurrent ){
@@ -34,7 +49,9 @@ public class Concurrent<T, R> implements Func1<T, Observable<R>> {
//put all our observables together for concurrency
for( Func1<T, R> funct: concurrent){
- final Observable<R> observable = Observable.from(input).subscribeOn( Schedulers.threadPoolForIO() ).map( funct );
+ final Observable<R> observable =
+ Observable.from(input).subscribeOn(
+ Schedulers.threadPoolForIO() ).map( funct );
observables.add( observable );
}
@@ -53,16 +70,17 @@ public class Concurrent<T, R> implements Func1<T, Observable<R>> {
/**
- * Create an instance of concurrent execution. All functions specified in the list are invoked in parallel.
- * The results are then "zipped" into a single observable which is returned
- *
+ * Create an instance of concurrent execution. All functions specified
+ * in the list are invoked in parallel. The results are then "zipped"
+ * into a single observable which is returned
*
* @param observable The observable we're invoking on
* @param concurrent The concurrent operations we're invoking
* @return
*/
- public static <T, R> Observable<R> concurrent( final Observable<T> observable, final Func1<T, R>... concurrent ){
- return observable.mapMany( new Concurrent<T, R>( concurrent ));
+ public static <T, R> Observable<R> concurrent(
+ final Observable<T> observable, final Func1<T, R>... concurrent ){
+ return observable.mapMany( new Concurrent<T, R>( concurrent ));
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/rx/RxFig.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/rx/RxFig.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/rx/RxFig.java
index 3519598..9751a9f 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/rx/RxFig.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/rx/RxFig.java
@@ -1,3 +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.
+ */
package org.apache.usergrid.persistence.collection.rx;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/builder/EntitySerializer.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/builder/EntitySerializer.java b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/builder/EntitySerializer.java
index 94759af..b0417d2 100644
--- a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/builder/EntitySerializer.java
+++ b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/builder/EntitySerializer.java
@@ -1,8 +1,25 @@
+/*
+ * 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.builder;
import org.apache.usergrid.persistence.model.entity.Entity;
-import org.apache.usergrid.persistence.model.entity.Id;
/**
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1aba6206/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/builder/EntitySerializerFactory.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/builder/EntitySerializerFactory.java b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/builder/EntitySerializerFactory.java
index 325645e..1104b54 100644
--- a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/builder/EntitySerializerFactory.java
+++ b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/builder/EntitySerializerFactory.java
@@ -1,6 +1,23 @@
+/*
+ * 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.builder;
-
import org.apache.usergrid.persistence.model.entity.Id;
@@ -18,5 +35,4 @@ public interface EntitySerializerFactory {
*/
<T> EntitySerializer<T> getSerializer(Id id);
-
}
[40/50] [abbrv] git commit: trill down some of the debugging and
increase runners to test with chop
Posted by sn...@apache.org.
trill down some of the debugging and increase runners to test with chop
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/59f1b4ea
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/59f1b4ea
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/59f1b4ea
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: 59f1b4ea6c067543089a527b0f6f7c28f19d7e7d
Parents: f87f471
Author: Alex Karasulu <ak...@gmail.com>
Authored: Mon Jan 20 06:03:55 2014 +0200
Committer: Alex Karasulu <ak...@gmail.com>
Committed: Mon Jan 20 06:03:55 2014 +0200
----------------------------------------------------------------------
stack/corepersistence/collection/pom.xml | 2 +-
.../collection/src/test/resources/log4j.properties | 7 +++++--
2 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/59f1b4ea/stack/corepersistence/collection/pom.xml
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/pom.xml b/stack/corepersistence/collection/pom.xml
index 1ea959e..e36371f 100644
--- a/stack/corepersistence/collection/pom.xml
+++ b/stack/corepersistence/collection/pom.xml
@@ -82,7 +82,7 @@
<coldRestartTomcat>true</coldRestartTomcat>
<awsSecurityGroup>${security.group}</awsSecurityGroup>
<runnerKeyPairName>${runner.keypair.name}</runnerKeyPairName>
- <runnerCount>9</runnerCount>
+ <runnerCount>12</runnerCount>
<securityGroupExceptions>
<!--
Add your own IP address as an exception to allow access
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/59f1b4ea/stack/corepersistence/collection/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/resources/log4j.properties b/stack/corepersistence/collection/src/test/resources/log4j.properties
index fb7a94e..bf81401 100644
--- a/stack/corepersistence/collection/src/test/resources/log4j.properties
+++ b/stack/corepersistence/collection/src/test/resources/log4j.properties
@@ -6,5 +6,8 @@ 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.apache.usergrid=DEBUG,stdout
-log4j.logger.org.safehaus.chop=DEBUG,stdout
+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
[39/50] [abbrv] git commit: removing old min max and using exact
runner counts
Posted by sn...@apache.org.
removing old min max and using exact runner counts
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/f87f4710
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/f87f4710
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/f87f4710
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: f87f471068c0a2e8c38513c15617ee00c6a7706c
Parents: 30f2d5a
Author: Alex Karasulu <ak...@gmail.com>
Authored: Sun Jan 19 13:18:28 2014 +0200
Committer: Alex Karasulu <ak...@gmail.com>
Committed: Sun Jan 19 13:18:28 2014 +0200
----------------------------------------------------------------------
stack/corepersistence/collection/pom.xml | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f87f4710/stack/corepersistence/collection/pom.xml
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/pom.xml b/stack/corepersistence/collection/pom.xml
index 91a0993..1ea959e 100644
--- a/stack/corepersistence/collection/pom.xml
+++ b/stack/corepersistence/collection/pom.xml
@@ -82,8 +82,7 @@
<coldRestartTomcat>true</coldRestartTomcat>
<awsSecurityGroup>${security.group}</awsSecurityGroup>
<runnerKeyPairName>${runner.keypair.name}</runnerKeyPairName>
- <minimumRunners>9</minimumRunners>
- <maximumRunners>9</maximumRunners>
+ <runnerCount>9</runnerCount>
<securityGroupExceptions>
<!--
Add your own IP address as an exception to allow access
[12/50] [abbrv] git commit: Fixing breakage in CassandraRule in CHOP
environment and making sure we're loading the usergrid properties cascaded in
a test.
Posted by sn...@apache.org.
Fixing breakage in CassandraRule in CHOP environment and making
sure we're loading the usergrid properties cascaded in a 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/a5bae707
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/a5bae707
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/a5bae707
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: a5bae70715a21e0a4cd8fd0aa3c72b96fe68b41a
Parents: 0456561
Author: Alex Karasulu <ak...@gmail.com>
Authored: Tue Jan 14 22:42:37 2014 +0200
Committer: Alex Karasulu <ak...@gmail.com>
Committed: Tue Jan 14 22:42:37 2014 +0200
----------------------------------------------------------------------
stack/corepersistence/collection/pom.xml | 2 +-
.../src/main/resources/usergrid.properties | 1 +
.../collection/cassandra/CassandraRule.java | 11 +++++-----
...MvccEntitySerializationStrategyImplTest.java | 22 +++++++++++++++++---
.../src/test/resources/usergrid-CHOP.properties | 18 ++++++++++++++++
.../src/test/resources/usergrid-UNIT.properties | 1 +
6 files changed, 46 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a5bae707/stack/corepersistence/collection/pom.xml
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/pom.xml b/stack/corepersistence/collection/pom.xml
index d061204..bc62409 100644
--- a/stack/corepersistence/collection/pom.xml
+++ b/stack/corepersistence/collection/pom.xml
@@ -12,7 +12,7 @@
<properties>
<guice.version>3.0</guice.version>
- <guicyfig.version>3.2</guicyfig.version>
+ <guicyfig.version>3.3-SNAPSHOT</guicyfig.version>
<slf4j.version>1.7.2</slf4j.version>
<log4j.version>1.2.17</log4j.version>
<chop.version>1.0-SNAPSHOT</chop.version>
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a5bae707/stack/corepersistence/collection/src/main/resources/usergrid.properties
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/resources/usergrid.properties b/stack/corepersistence/collection/src/main/resources/usergrid.properties
new file mode 100644
index 0000000..37a8fa8
--- /dev/null
+++ b/stack/corepersistence/collection/src/main/resources/usergrid.properties
@@ -0,0 +1 @@
+# Keep nothing but production defaults in here
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a5bae707/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/cassandra/CassandraRule.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/cassandra/CassandraRule.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/cassandra/CassandraRule.java
index bd37c1f..ab94574 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/cassandra/CassandraRule.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/cassandra/CassandraRule.java
@@ -43,11 +43,6 @@ public class CassandraRule extends EnvironResource {
Injector injector = Guice.createInjector( new GuicyFigModule( CassandraFig.class ) );
cassandraFig = injector.getInstance( CassandraFig.class );
- cassandraFig.override( "getPort", THRIFT_PORT_STR );
- cassandraFig.override( "getConnections", "20" );
- cassandraFig.override( "getHosts", "localhost" );
- cassandraFig.override( "getClusterName", "Usergrid" );
- cassandraFig.override( "getKeyspaceName", "Usergrid_Collections" );
}
@@ -58,6 +53,12 @@ public class CassandraRule extends EnvironResource {
@Override
protected void before() throws Throwable {
+ cassandraFig.override( "getPort", THRIFT_PORT_STR );
+ cassandraFig.override( "getConnections", "20" );
+ cassandraFig.override( "getHosts", "localhost" );
+ cassandraFig.override( "getClusterName", "Usergrid" );
+ cassandraFig.override( "getKeyspaceName", "Usergrid_Collections" );
+
if ( started ) {
return;
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a5bae707/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
index 061023e..97dc803 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
@@ -1,12 +1,12 @@
package org.apache.usergrid.persistence.collection.serialization.impl;
+import java.io.IOException;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.UUID;
-import org.jukito.JukitoModule;
import org.jukito.JukitoRunner;
import org.jukito.UseModules;
import org.junit.Before;
@@ -47,6 +47,7 @@ import org.apache.usergrid.persistence.model.util.UUIDGenerator;
import com.google.common.base.Optional;
import com.google.inject.Inject;
import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
+import com.netflix.config.ConfigurationManager;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
@@ -58,13 +59,28 @@ import static org.mockito.Mockito.mock;
/** @author tnine */
-@IterationChop( iterations = 1000, runners = 6, threads = 9 )
+@IterationChop( iterations = 1000, threads = 9 )
@RunWith( JukitoRunner.class )
@UseModules( CollectionModule.class )
public class MvccEntitySerializationStrategyImplTest {
/** Our RX I/O threads and this should have the same value */
private static final String CONNECTION_COUNT = "20";
+ static {
+ /*
+ * --------------------------------------------------------------------
+ * Archaius Configuration Settings
+ * --------------------------------------------------------------------
+ */
+
+ try {
+ ConfigurationManager.loadCascadedPropertiesFromResources( "usergrid" );
+ }
+ catch ( IOException e ) {
+ throw new RuntimeException( "Cannot do much without properly loading our configuration.", e );
+ }
+ }
+
@Inject
private MvccEntitySerializationStrategy serializationStrategy;
@@ -90,6 +106,7 @@ public class MvccEntitySerializationStrategyImplTest {
@Inject
@Overrides( name = "unit-test",
+ environments = Env.UNIT,
options = {
@Option( method = "getMaxThreadCount", override = CONNECTION_COUNT )
}
@@ -105,7 +122,6 @@ public class MvccEntitySerializationStrategyImplTest {
@Before
public void setupClass() {
-// GuicyFigModule.injectMembers( this );
assertNotNull( cassandraFig );
cassandraFig.bypass( "getPort", CassandraRule.THRIFT_PORT_STR );
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a5bae707/stack/corepersistence/collection/src/test/resources/usergrid-CHOP.properties
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/resources/usergrid-CHOP.properties b/stack/corepersistence/collection/src/test/resources/usergrid-CHOP.properties
new file mode 100644
index 0000000..e05f487
--- /dev/null
+++ b/stack/corepersistence/collection/src/test/resources/usergrid-CHOP.properties
@@ -0,0 +1,18 @@
+# These are for CHOP environment settings
+
+#cassandra.connections=${cassandra.connections}
+#cassandra.port=9160
+#cassandra.version=1.2
+#cassandra.hosts=${cassandra.hosts}
+#cassandra.cluster_name=Usergrid
+#collections.keyspace=Usergrid_Collections
+#cassandra.timeout=5000
+
+
+cassandra.connections=10
+cassandra.port=9160
+cassandra.version=1.2
+cassandra.hosts=54.224.205.239, 107.21.155.136, 54.205.144.212, 23.22.49.179, 23.22.49.179, 54.242.63.170
+cassandra.cluster_name=Usergrid
+collections.keyspace=Usergrid_Collections
+cassandra.timeout=5000
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a5bae707/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
new file mode 100644
index 0000000..6a5013c
--- /dev/null
+++ b/stack/corepersistence/collection/src/test/resources/usergrid-UNIT.properties
@@ -0,0 +1 @@
+# Keep nothing but overriding test defaults in here
\ No newline at end of file
[47/50] [abbrv] git commit: chop settings that hold in the
performance test environment
Posted by sn...@apache.org.
chop settings that hold in the performance test environment
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/47cd79a3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/47cd79a3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/47cd79a3
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: 47cd79a371d98efef05f449c6cc01847171d9f3b
Parents: 8781eaf
Author: Alex Karasulu <ak...@gmail.com>
Authored: Tue Jan 21 21:26:34 2014 +0200
Committer: Alex Karasulu <ak...@gmail.com>
Committed: Tue Jan 21 21:26:34 2014 +0200
----------------------------------------------------------------------
stack/corepersistence/collection/pom.xml | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/47cd79a3/stack/corepersistence/collection/pom.xml
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/pom.xml b/stack/corepersistence/collection/pom.xml
index 29a0c6b..31ceec0 100644
--- a/stack/corepersistence/collection/pom.xml
+++ b/stack/corepersistence/collection/pom.xml
@@ -5,10 +5,10 @@
<properties>
<guice.version>3.0</guice.version>
- <guicyfig.version>3.3-SNAPSHOT</guicyfig.version>
+ <guicyfig.version>3.3</guicyfig.version>
<slf4j.version>1.7.2</slf4j.version>
<log4j.version>1.2.17</log4j.version>
- <chop.version>1.0-SNAPSHOT</chop.version>
+ <chop.version>1.0</chop.version>
</properties>
<parent>
@@ -59,7 +59,7 @@
<plugin>
<groupId>org.safehaus.chop</groupId>
<artifactId>chop-maven-plugin</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <version>${chop.version}</version>
<!--
NOTE: you should be putting most of these variables into your settings.xml
@@ -83,7 +83,7 @@
<coldRestartTomcat>true</coldRestartTomcat>
<awsSecurityGroup>${security.group}</awsSecurityGroup>
<runnerKeyPairName>${runner.keypair.name}</runnerKeyPairName>
- <runnerCount>12</runnerCount>
+ <runnerCount>6</runnerCount>
<securityGroupExceptions>
<!--
Add your own IP address as an exception to allow access
@@ -108,14 +108,6 @@
<!-- Google Guice Integration Test Injectors -->
- <dependency>
- <groupId>${project.parent.groupId}</groupId>
- <artifactId>testutils</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
-
- <!-- Depends on the basic models -->
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>model</artifactId>
[03/50] [abbrv] git commit: Added warnings for unexpected exceptions
in OAUTH implementation.
Posted by sn...@apache.org.
Added warnings for unexpected exceptions in OAUTH implementation.
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/9fe5e718
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/9fe5e718
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/9fe5e718
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: 9fe5e7189e026dc2ba1e1949353d05720548addc
Parents: a55b18f
Author: GERey <gr...@apigee.com>
Authored: Mon Jan 13 11:32:34 2014 -0800
Committer: GERey <gr...@apigee.com>
Committed: Mon Jan 13 11:32:34 2014 -0800
----------------------------------------------------------------------
.../rest/applications/ApplicationResource.java | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9fe5e718/stack/rest/src/main/java/org/usergrid/rest/applications/ApplicationResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/usergrid/rest/applications/ApplicationResource.java b/stack/rest/src/main/java/org/usergrid/rest/applications/ApplicationResource.java
index ac9420c..7143209 100644
--- a/stack/rest/src/main/java/org/usergrid/rest/applications/ApplicationResource.java
+++ b/stack/rest/src/main/java/org/usergrid/rest/applications/ApplicationResource.java
@@ -244,10 +244,7 @@ public class ApplicationResource extends ServiceResource {
errorDescription = "user disabled";
}
catch ( Exception e1 ) {
- logger.error( "Verification Error", e1 );
- OAuthResponse res = OAuthResponse.errorResponse( SC_INTERNAL_SERVER_ERROR ).setError(e1.getMessage()).buildJSONMessage();
- return Response.status( res.getResponseStatus() ).type( jsonMediaType( callback ) )
- .entity( wrapWithCallback( res.getBody(), callback ) ).build();
+ logger.warn( "Unexpected exception during token username/password verification", e1 );
}
}
@@ -256,10 +253,8 @@ public class ApplicationResource extends ServiceResource {
user = management.verifyAppUserPinCredentials( services.getApplicationId(), username, pin );
}
catch ( Exception e1 ) {
- logger.error( "Pin Verification Error", e1 );
- OAuthResponse res = OAuthResponse.errorResponse( SC_INTERNAL_SERVER_ERROR).setError(e1.getMessage()).buildJSONMessage();
- return Response.status( res.getResponseStatus() ).type( jsonMediaType( callback ) )
- .entity( wrapWithCallback( res.getBody(), callback ) ).build();
+ logger.warn( "Unexpected exception during token pin verification", e1 );
+
}
}
else if ( "client_credentials".equals( grant_type ) ) {
@@ -271,10 +266,7 @@ public class ApplicationResource extends ServiceResource {
}
}
catch ( Exception e1 ) {
- logger.error( "Client Credentials Error", e1 );
- OAuthResponse res = OAuthResponse.errorResponse( SC_INTERNAL_SERVER_ERROR ).setError(e1.getMessage()).buildJSONMessage();
- return Response.status( res.getResponseStatus() ).type( jsonMediaType( callback ) )
- .entity( wrapWithCallback( res.getBody(), callback ) ).build();
+ logger.warn( "Unexpected exception during token client authentication", e1 );
}
}
@@ -465,6 +457,7 @@ public class ApplicationResource extends ServiceResource {
errorDescription = "user disabled";
}
catch ( Exception e1 ) {
+ logger.warn("Unexpected exception in authorize username/password verification", e1);
}
if ( ( user != null ) && isNotBlank( redirect_uri ) ) {
[30/50] [abbrv] git commit: Extending TomcatResource
Posted by sn...@apache.org.
Extending TomcatResource
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/447ede6d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/447ede6d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/447ede6d
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: 447ede6d2d85c70baa1dd37e8f2e0f291a68aac8
Parents: 3f762ec
Author: Sungju Jin <su...@softwaregeeks.org>
Authored: Thu Jan 16 22:52:54 2014 +0900
Committer: Sungju Jin <su...@softwaregeeks.org>
Committed: Thu Jan 16 22:52:54 2014 +0900
----------------------------------------------------------------------
.../test/java/org/usergrid/rest/ITSetup.java | 9 ++++++--
.../java/org/usergrid/rest/TomcatResource.java | 23 ++++++++------------
2 files changed, 16 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/447ede6d/stack/rest/src/test/java/org/usergrid/rest/ITSetup.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/usergrid/rest/ITSetup.java b/stack/rest/src/test/java/org/usergrid/rest/ITSetup.java
index 2701202..0b335a9 100644
--- a/stack/rest/src/test/java/org/usergrid/rest/ITSetup.java
+++ b/stack/rest/src/test/java/org/usergrid/rest/ITSetup.java
@@ -50,11 +50,16 @@ public class ITSetup extends ExternalResource {
private Properties properties;
- public ITSetup( CassandraResource cassandraResource ) {
+ public ITSetup( CassandraResource cassandraResource) {
this.cassandraResource = cassandraResource;
tomcatResource = TomcatResource.instance;
+ tomcatResource.setWebAppsPath("src/main/webapp");
+ }
-
+ public ITSetup( CassandraResource cassandraResource, String webAppsPath ) {
+ this.cassandraResource = cassandraResource;
+ tomcatResource = TomcatResource.instance;
+ tomcatResource.setWebAppsPath(webAppsPath);
}
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/447ede6d/stack/rest/src/test/java/org/usergrid/rest/TomcatResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/usergrid/rest/TomcatResource.java b/stack/rest/src/test/java/org/usergrid/rest/TomcatResource.java
index 8ba697f..4b223aa 100644
--- a/stack/rest/src/test/java/org/usergrid/rest/TomcatResource.java
+++ b/stack/rest/src/test/java/org/usergrid/rest/TomcatResource.java
@@ -15,20 +15,14 @@ import com.google.common.io.Files;
/** @author tnine */
public class TomcatResource extends ExternalResource {
+ public static final TomcatResource instance = new TomcatResource();
private static Object mutex = new Object();
-
private static final String CONTEXT = "/";
-
+ private String webAppsPath;
private int port;
-
-
-
-
private Tomcat tomcat;
protected TomcatResource(){
-
-
}
@Override
@@ -51,9 +45,7 @@ public class TomcatResource extends ExternalResource {
tomcat = new Tomcat();
tomcat.setBaseDir( dataDir.getAbsolutePath() );
tomcat.setPort( port );
- tomcat.addWebapp( CONTEXT, new File( "src/main/webapp" ).getAbsolutePath() );
-
-
+ tomcat.addWebapp( CONTEXT, new File( getWebAppsPath() ).getAbsolutePath() );
tomcat.start();
}
}
@@ -67,8 +59,11 @@ public class TomcatResource extends ExternalResource {
return port;
}
+ public String getWebAppsPath() {
+ return webAppsPath;
+ }
- public static final TomcatResource instance = new TomcatResource();
-
-
+ public void setWebAppsPath(String webAppsPath) {
+ this.webAppsPath = webAppsPath;
+ }
}
[07/50] [abbrv] git commit: Use two methods instead of asking caller
to pass null to indicate no TTL.
Posted by sn...@apache.org.
Use two methods instead of asking caller to pass null to indicate no TTL.
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/f834a190
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/f834a190
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/f834a190
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: f834a1908dfcc923e30ea37eb49f1f0d59003f6f
Parents: 075374b
Author: Dave Johnson <dm...@apigee.com>
Authored: Mon Jan 13 15:05:05 2014 -0500
Committer: Dave Johnson <dm...@apigee.com>
Committed: Mon Jan 13 15:05:05 2014 -0500
----------------------------------------------------------------------
.../write/UniqueValueSerializationStrategy.java | 10 +++++++++-
.../UniqueValueSerializationStrategyImpl.java | 17 +++++++++++++++--
2 files changed, 24 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f834a190/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/UniqueValueSerializationStrategy.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/UniqueValueSerializationStrategy.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/UniqueValueSerializationStrategy.java
index 0169361..0a6b635 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/UniqueValueSerializationStrategy.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/UniqueValueSerializationStrategy.java
@@ -31,7 +31,15 @@ public interface UniqueValueSerializationStrategy {
* Write the specified UniqueValue to Cassandra with optional timeToLive in milliseconds.
*
* @param uniqueValue Object to be written
- * @param timeToLive How long object should live in seconds (or null to live forever)
+ * @return MutatationBatch that encapsulates operation, caller may or may not execute.
+ */
+ public MutationBatch write( UniqueValue uniqueValue );
+
+ /**
+ * Write the specified UniqueValue to Cassandra with optional timeToLive in milliseconds.
+ *
+ * @param uniqueValue Object to be written
+ * @param timeToLive How long object should live in seconds
* @return MutatationBatch that encapsulates operation, caller may or may not execute.
*/
public MutationBatch write( UniqueValue uniqueValue, Integer timeToLive );
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f834a190/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/UniqueValueSerializationStrategyImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/UniqueValueSerializationStrategyImpl.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/UniqueValueSerializationStrategyImpl.java
index 35c924f..8c2e9eb 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/UniqueValueSerializationStrategyImpl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/UniqueValueSerializationStrategyImpl.java
@@ -78,19 +78,32 @@ public class UniqueValueSerializationStrategyImpl implements UniqueValueSerializ
}
+ public MutationBatch write( UniqueValue uniqueValue ) {
+ return write( uniqueValue, Integer.MAX_VALUE );
+ }
+
+
@Override
- public MutationBatch write( UniqueValue value, final Integer timeToLive ) {
+ public MutationBatch write( UniqueValue value, Integer timeToLive ) {
Preconditions.checkNotNull( value, "value is required" );
+ Preconditions.checkNotNull( timeToLive, "timeToLive is required" );
final EntityVersion ev = new EntityVersion( value.getEntityId(), value.getEntityVersion() );
+ final Integer ttl;
+ if ( timeToLive.equals( Integer.MAX_VALUE )) {
+ ttl = null;
+ } else {
+ ttl = timeToLive;
+ }
+
return doWrite( value.getCollectionScope(), value.getField(),
new UniqueValueSerializationStrategyImpl.RowOp() {
@Override
public void doOp( final ColumnListMutation<EntityVersion> colMutation ) {
- colMutation.putColumn( ev, 0x0, timeToLive );
+ colMutation.putColumn( ev, 0x0, ttl );
}
} );
}
[24/50] [abbrv] git commit: blow up is still present just testing
with a single iteration - have to commit to be able to get chop to respond
Posted by sn...@apache.org.
blow up is still present just testing with a single iteration - have to commit to be able to get chop to respond
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/7072b857
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/7072b857
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/7072b857
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: 7072b85746a980bc5dd9923ccdc9e0ed8e4eb19e
Parents: 2795d0c
Author: Alex Karasulu <ak...@gmail.com>
Authored: Thu Jan 16 02:41:43 2014 +0200
Committer: Alex Karasulu <ak...@gmail.com>
Committed: Thu Jan 16 02:41:43 2014 +0200
----------------------------------------------------------------------
.../impl/MvccEntitySerializationStrategyImplTest.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7072b857/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
index e62a471..7248bac 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
@@ -65,7 +65,7 @@ import static org.mockito.Mockito.mock;
/** @author tnine */
-@IterationChop( iterations = 1000, threads = 9 )
+@IterationChop( iterations = 1, threads = 1 )
@RunWith( JukitoRunner.class )
@UseModules( CollectionModule.class )
public class MvccEntitySerializationStrategyImplTest {
[25/50] [abbrv] git commit: USERGRID-3037: added code to clean up
connections and tweaked parameters to most taxing levels
Posted by sn...@apache.org.
USERGRID-3037: added code to clean up connections and tweaked parameters to most taxing levels
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/265d7dfe
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/265d7dfe
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/265d7dfe
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: 265d7dfed88d8906dd2926b2119d6713cee6ced8
Parents: 7072b85
Author: Alex Karasulu <ak...@gmail.com>
Authored: Thu Jan 16 07:18:36 2014 +0200
Committer: Alex Karasulu <ak...@gmail.com>
Committed: Thu Jan 16 07:18:36 2014 +0200
----------------------------------------------------------------------
stack/corepersistence/collection/pom.xml | 2 +-
.../collection/astyanax/AstyanaxKeyspaceProvider.java | 3 +--
.../impl/MvccEntitySerializationStrategyImplTest.java | 8 +-------
.../collection/src/test/resources/usergrid-CHOP.properties | 2 +-
4 files changed, 4 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/265d7dfe/stack/corepersistence/collection/pom.xml
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/pom.xml b/stack/corepersistence/collection/pom.xml
index f900cdb..6852486 100644
--- a/stack/corepersistence/collection/pom.xml
+++ b/stack/corepersistence/collection/pom.xml
@@ -78,7 +78,7 @@
<coldRestartTomcat>true</coldRestartTomcat>
<awsSecurityGroup>${security.group}</awsSecurityGroup>
<runnerKeyPairName>${runner.keypair.name}</runnerKeyPairName>
- <minimumRunners>6</minimumRunners>
+ <minimumRunners>9</minimumRunners>
<maximumRunners>9</maximumRunners>
<securityGroupExceptions>
<!--
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/265d7dfe/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/AstyanaxKeyspaceProvider.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/AstyanaxKeyspaceProvider.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/AstyanaxKeyspaceProvider.java
index 923e7c3..0a71691 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/AstyanaxKeyspaceProvider.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/AstyanaxKeyspaceProvider.java
@@ -1,10 +1,8 @@
package org.apache.usergrid.persistence.collection.astyanax;
-import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
-import java.util.concurrent.ConcurrentSkipListSet;
import com.google.inject.Inject;
import com.google.inject.Provider;
@@ -28,6 +26,7 @@ import com.netflix.astyanax.thrift.ThriftFamilyFactory;
public class AstyanaxKeyspaceProvider implements Provider<Keyspace> {
private final CassandraFig cassandraConfig;
+ // @todo aok - this being static is utterly horrible and needs to change
private final static Set<AstyanaxContext<Keyspace>> contexts =
new HashSet<AstyanaxContext<Keyspace>>();
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/265d7dfe/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
index 7248bac..a52be37 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
@@ -1,7 +1,6 @@
package org.apache.usergrid.persistence.collection.serialization.impl;
-import java.io.IOException;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -10,7 +9,6 @@ import java.util.UUID;
import org.jukito.JukitoRunner;
import org.jukito.UseModules;
import org.junit.After;
-import org.junit.AfterClass;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Rule;
@@ -18,7 +16,6 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.safehaus.chop.api.IterationChop;
import org.safehaus.guicyfig.Env;
-import org.safehaus.guicyfig.GuicyFigModule;
import org.safehaus.guicyfig.Option;
import org.safehaus.guicyfig.Overrides;
@@ -49,11 +46,8 @@ import org.apache.usergrid.persistence.model.field.UUIDField;
import org.apache.usergrid.persistence.model.util.UUIDGenerator;
import com.google.common.base.Optional;
-import com.google.inject.Guice;
import com.google.inject.Inject;
-import com.google.inject.Injector;
import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
-import com.netflix.config.ConfigurationManager;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
@@ -65,7 +59,7 @@ import static org.mockito.Mockito.mock;
/** @author tnine */
-@IterationChop( iterations = 1, threads = 1 )
+@IterationChop( iterations = 1000, threads = 3 )
@RunWith( JukitoRunner.class )
@UseModules( CollectionModule.class )
public class MvccEntitySerializationStrategyImplTest {
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/265d7dfe/stack/corepersistence/collection/src/test/resources/usergrid-CHOP.properties
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/resources/usergrid-CHOP.properties b/stack/corepersistence/collection/src/test/resources/usergrid-CHOP.properties
index d9c72be..a047fd7 100644
--- a/stack/corepersistence/collection/src/test/resources/usergrid-CHOP.properties
+++ b/stack/corepersistence/collection/src/test/resources/usergrid-CHOP.properties
@@ -1,6 +1,6 @@
# These are for CHOP environment settings
-cassandra.connections=20
+cassandra.connections=30
cassandra.port=9160
cassandra.version=1.2
[06/50] [abbrv] git commit: Merge pull request #25 from
GERey/OAuth_Exceptions
Posted by sn...@apache.org.
Merge pull request #25 from GERey/OAuth_Exceptions
O auth exceptions
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/c91b5bec
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/c91b5bec
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/c91b5bec
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: c91b5becb8f3fa874e2ded49341dfd92bf2e348b
Parents: 5a57e87 609570e
Author: tonuquq <to...@gmail.com>
Authored: Mon Jan 13 11:40:37 2014 -0800
Committer: tonuquq <to...@gmail.com>
Committed: Mon Jan 13 11:40:37 2014 -0800
----------------------------------------------------------------------
.../org/usergrid/rest/applications/ApplicationResource.java | 6 ++++++
1 file changed, 6 insertions(+)
----------------------------------------------------------------------
[35/50] [abbrv] git commit: Merge pull request #28 from
sungjuly/USERGRID-12
Posted by sn...@apache.org.
Merge pull request #28 from sungjuly/USERGRID-12
Improving query-validator modules and fixes test case
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/df272cb6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/df272cb6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/df272cb6
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: df272cb6e18635ec524d0d3e2137c539478ef933
Parents: 58b0f74 bb52e1c
Author: Dave Johnson <da...@rollerweblogger.org>
Authored: Thu Jan 16 07:02:54 2014 -0800
Committer: Dave Johnson <da...@rollerweblogger.org>
Committed: Thu Jan 16 07:02:54 2014 -0800
----------------------------------------------------------------------
stack/pom.xml | 1 +
stack/query-validator/.gitignore | 1 +
stack/query-validator/pom.xml | 235 +++--
stack/query-validator/sql.db | Bin 4096 -> 0 bytes
.../query/validator/ApiServerRunner.java | 49 +-
.../validator/DefaultQueryResultsMatcher.java | 32 +
.../usergrid/query/validator/QueryEntity.java | 31 +-
.../usergrid/query/validator/QueryRequest.java | 31 +-
.../usergrid/query/validator/QueryResponse.java | 22 +-
.../query/validator/QueryResultsMatcher.java | 29 +
.../usergrid/query/validator/QueryRunner.java | 23 +-
.../validator/QueryValidationConfiguration.java | 22 +-
.../query/validator/QueryValidator.java | 33 +-
.../usergrid/query/validator/SqliteRunner.java | 60 +-
.../usergrid-query-validator-context.xml | 16 +-
.../query/validator/AbstractQueryIT.java | 133 +++
.../usergrid/query/validator/QueryITSuite.java | 39 +
.../query/validator/QueryValidationTest.java | 339 -------
.../query/validator/QueryValidatorRunner.java | 209 -----
.../query/validator/users/UserQueryIT.java | 877 +++++++++++++++++++
.../src/test/resources/log4j.properties | 2 +-
.../src/test/resources/project.properties | 1 +
.../src/test/resources/user.json | 15 +-
.../resources/usergrid-custom-test.properties | 13 +-
.../test/resources/usergrid-test-context.xml | 24 +-
.../test/java/org/usergrid/rest/ITSetup.java | 9 +-
.../java/org/usergrid/rest/TomcatResource.java | 23 +-
.../cassandra/ManagementServiceImpl.java | 32 +-
28 files changed, 1517 insertions(+), 784 deletions(-)
----------------------------------------------------------------------
[22/50] [abbrv] git commit: Merge branch 'two-dot-o' of
https://github.com/usergrid/usergrid into two-dot-o
Posted by sn...@apache.org.
Merge branch 'two-dot-o' of https://github.com/usergrid/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/35fddfe1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/35fddfe1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/35fddfe1
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: 35fddfe1257acb227fbbd7a7922dceb6a4e625f2
Parents: cfe5f4d 2697a21
Author: Alex Karasulu <ak...@gmail.com>
Authored: Thu Jan 16 01:30:07 2014 +0200
Committer: Alex Karasulu <ak...@gmail.com>
Committed: Thu Jan 16 01:30:07 2014 +0200
----------------------------------------------------------------------
.../cassandra/RelationManagerImpl.java | 27 +++++++-----
.../rest/applications/ApplicationResource.java | 6 +++
.../users/ConnectionResourceTest.java | 43 ++++++++++++++++++++
3 files changed, 66 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
[26/50] [abbrv] git commit: Merge branch 'two-dot-o' into
unique-properties
Posted by sn...@apache.org.
Merge branch 'two-dot-o' into unique-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/5c8ccb46
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/5c8ccb46
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/5c8ccb46
Branch: refs/heads/USERGRID-2771-graph-edges
Commit: 5c8ccb460875e046b2ac48a58a4f8d670df4bfe6
Parents: ffbbed3 2697a21
Author: Dave Johnson <dm...@apigee.com>
Authored: Thu Jan 16 07:54:14 2014 -0500
Committer: Dave Johnson <dm...@apigee.com>
Committed: Thu Jan 16 07:54:14 2014 -0500
----------------------------------------------------------------------
.../cassandra/RelationManagerImpl.java | 27 +++++++-----
.../users/ConnectionResourceTest.java | 43 ++++++++++++++++++++
2 files changed, 60 insertions(+), 10 deletions(-)
----------------------------------------------------------------------