You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sf...@apache.org on 2015/11/12 16:51:49 UTC
[01/32] usergrid git commit: Remove bootstrap call from multi-tenant
migration.
Repository: usergrid
Updated Branches:
refs/heads/master de42b9cb0 -> 67ab24430
Remove bootstrap call from multi-tenant migration.
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/432c2e9c
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/432c2e9c
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/432c2e9c
Branch: refs/heads/master
Commit: 432c2e9c1a7e74bd1053f957b15aa1ba7cf01b57
Parents: eb2756b
Author: Michael Russo <mi...@gmail.com>
Authored: Fri Oct 30 16:05:48 2015 -0700
Committer: Michael Russo <mi...@gmail.com>
Committed: Fri Oct 30 16:05:48 2015 -0700
----------------------------------------------------------------------
stack/scripts/multitenant_migrate.py | 28 +++++-----------------------
1 file changed, 5 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/432c2e9c/stack/scripts/multitenant_migrate.py
----------------------------------------------------------------------
diff --git a/stack/scripts/multitenant_migrate.py b/stack/scripts/multitenant_migrate.py
index d1131c1..f728671 100644
--- a/stack/scripts/multitenant_migrate.py
+++ b/stack/scripts/multitenant_migrate.py
@@ -22,11 +22,10 @@
#
# Login to the Tomcat instance and run this command, specifying both superuser and tenant organization:
#
-# python migrate_entity_data.py --org <org1name> --super <user>:<pass> --init
+# python multitenant_migrate.py --org <org1name> --super <user>:<pass> --init
#
-# This command will setup and bootstrap the database, setup the migration system and update index mappings:
+# This command will setup the database, setup the migration system and update index mappings:
# - /system/database/setup
-# - /system/database/bootstrap
# - /system/migrate/run/migration-system
# - /system/migrate/run/index_mapping_migration
#
@@ -39,7 +38,7 @@
#
# On the same Tomcat instance and run this command with the --date timestamp you noted in the previous step:
#
-# python migrate_entity_data.py --org <org1name> --super <user>:<pass> --date <timestamp>
+# python multitenant_migrate.py --org <org1name> --super <user>:<pass> --date <timestamp>
#
# Then it will migrate appinfos, re-index the management app and then for each of the specified org's apps
# it will de-dup connections and re-index the app with a start-date specified so only data modified since
@@ -49,7 +48,7 @@
#
# Login to the Tomcat instance and run this command, specifying both superuser and tenant organization:
#
-# python migrate_entity_data.py --org <org2name> --super <user>:<pass>
+# python multitenant_migrate.py --org <org2name> --super <user>:<pass>
#
# This command will migrate appinfos, re-index the management app and then for each of the specified org's apps
# it will de-dup connections and re-index the app.
@@ -60,7 +59,7 @@
#
# On the same Tomcat instance and run this command with the --date timestamp you noted in the previous step:
#
-# python migrate_entity_data.py --org <org2name> --super <user>:<pass> --date <timestamp>
+# python multitenant_migrate.py --org <org2name> --super <user>:<pass> --date <timestamp>
#
# Then it will migrate appinfos, re-index the management app and then for each of the specified org's apps
# it will de-dup connections and re-index the app with a start-date specified so only data modified since
@@ -208,9 +207,7 @@ class Migrate:
if self.init:
# Init the migration system as this is the first migration done on the cluster
-
self.run_database_setup()
- self.run_database_bootstrap()
migration_system_updated = self.is_migration_system_updated()
@@ -312,10 +309,6 @@ class Migrate:
url = self.endpoint + '/system/database/setup'
return url
- def get_database_bootstrap_url(self):
- url = self.endpoint + '/system/database/bootstrap'
- return url
-
def get_migration_url(self):
url = self.endpoint + '/system/migrate/run'
return url
@@ -380,17 +373,6 @@ class Migrate:
self.logger.error('Failed to run database setup, %s', e)
exit_on_error(str(e))
- def run_database_bootstrap(self):
- try:
- setupUrl = self.get_database_bootstrap_url()
- r = requests.put(url=setupUrl, auth=(self.super_user, self.super_pass))
- if r.status_code != 200:
- exit_on_error('Database Bootstrap Failed')
-
- except requests.exceptions.RequestException as e:
- self.logger.error('Failed to run database bootstrap, %s', e)
- exit_on_error(str(e))
-
def start_index_mapping_migration(self):
try:
migrateUrl = self.get_migration_url() + '/' + PLUGIN_INDEX_MAPPING
[22/32] usergrid git commit: Change read by name not found message
from INFO to DEBUG.
Posted by sf...@apache.org.
Change read by name not found message from INFO to DEBUG.
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/c3a5bc43
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/c3a5bc43
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/c3a5bc43
Branch: refs/heads/master
Commit: c3a5bc436d927bab0a17db7e857027914a4d6b15
Parents: ad07e2b
Author: Mike Dunker <md...@apigee.com>
Authored: Fri Nov 6 15:36:21 2015 -0800
Committer: Mike Dunker <md...@apigee.com>
Committed: Fri Nov 6 15:36:21 2015 -0800
----------------------------------------------------------------------
.../org/apache/usergrid/services/AbstractCollectionService.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/c3a5bc43/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java b/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java
index 607c476..351abc6 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java
@@ -152,7 +152,9 @@ public class AbstractCollectionService extends AbstractService {
Entity entity = em.getUniqueEntityFromAlias( getEntityType(), name );
if ( entity == null ) {
- logger.info( "miss on entityType: {} with name: {}", getEntityType(), name );
+ if (logger.isDebugEnabled()) {
+ logger.debug("miss on entityType: {} with name: {}", getEntityType(), name);
+ }
String msg = "Cannot find entity with name: "+name;
throw new EntityNotFoundException( msg );
}
[20/32] usergrid git commit: fix exclusion with new version of wns lib
Posted by sf...@apache.org.
fix exclusion with new version of wns lib
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/d42d82cb
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/d42d82cb
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/d42d82cb
Branch: refs/heads/master
Commit: d42d82cb97000581912299171690a5148df18dfa
Parents: 5a39c05
Author: Shawn Feldman <sf...@apache.org>
Authored: Fri Nov 6 15:26:29 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Fri Nov 6 15:26:29 2015 -0700
----------------------------------------------------------------------
.../1.3.1-USERGRID/_remote.repositories | 7 ++
...wns-1.3.1-USERGRID-jar-with-dependencies.jar | Bin 0 -> 6806358 bytes
.../java-wns-1.3.1-USERGRID-javadoc.jar | Bin 0 -> 240001 bytes
.../java-wns-1.3.1-USERGRID-sources.jar | Bin 0 -> 22656 bytes
.../1.3.1-USERGRID/java-wns-1.3.1-USERGRID.jar | Bin 0 -> 34924 bytes
.../1.3.1-USERGRID/java-wns-1.3.1-USERGRID.pom | 115 +++++++++++++++++++
stack/pom.xml | 14 +--
stack/rest/pom.xml | 10 ++
stack/services/pom.xml | 3 +-
9 files changed, 141 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/d42d82cb/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/_remote.repositories
----------------------------------------------------------------------
diff --git a/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/_remote.repositories b/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/_remote.repositories
new file mode 100644
index 0000000..b24cacf
--- /dev/null
+++ b/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/_remote.repositories
@@ -0,0 +1,7 @@
+#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
+#Fri Nov 06 15:17:59 MST 2015
+java-wns-1.3.1-USERGRID-sources.jar>=
+java-wns-1.3.1-USERGRID-jar-with-dependencies.jar>=
+java-wns-1.3.1-USERGRID.jar>=
+java-wns-1.3.1-USERGRID-javadoc.jar>=
+java-wns-1.3.1-USERGRID.pom>=
http://git-wip-us.apache.org/repos/asf/usergrid/blob/d42d82cb/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-jar-with-dependencies.jar
----------------------------------------------------------------------
diff --git a/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-jar-with-dependencies.jar b/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-jar-with-dependencies.jar
new file mode 100644
index 0000000..f118d2f
Binary files /dev/null and b/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-jar-with-dependencies.jar differ
http://git-wip-us.apache.org/repos/asf/usergrid/blob/d42d82cb/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-javadoc.jar
----------------------------------------------------------------------
diff --git a/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-javadoc.jar b/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-javadoc.jar
new file mode 100644
index 0000000..7c902ad
Binary files /dev/null and b/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-javadoc.jar differ
http://git-wip-us.apache.org/repos/asf/usergrid/blob/d42d82cb/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-sources.jar
----------------------------------------------------------------------
diff --git a/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-sources.jar b/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-sources.jar
new file mode 100644
index 0000000..74dc5a0
Binary files /dev/null and b/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-sources.jar differ
http://git-wip-us.apache.org/repos/asf/usergrid/blob/d42d82cb/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID.jar
----------------------------------------------------------------------
diff --git a/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID.jar b/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID.jar
new file mode 100644
index 0000000..dce3b10
Binary files /dev/null and b/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID.jar differ
http://git-wip-us.apache.org/repos/asf/usergrid/blob/d42d82cb/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID.pom
----------------------------------------------------------------------
diff --git a/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID.pom b/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID.pom
new file mode 100644
index 0000000..8939db3
--- /dev/null
+++ b/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID.pom
@@ -0,0 +1,115 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>com.github.fernandospr</groupId>
+ <artifactId>java-wns</artifactId>
+ <packaging>jar</packaging>
+ <version>1.3.1-USERGRID</version>
+ <name>java-wns</name>
+ <description>Library to send notifications using WNS</description>
+ <url>https://github.com/fernandospr/java-wns</url>
+ <licenses>
+ <license>
+ <name>New BSD License</name>
+ <url>http://www.opensource.org/licenses/bsd-license.php</url>
+ <distribution>repo</distribution>
+ </license>
+ </licenses>
+
+ <!-- Inherit the Sonatype OSS deployment configuration -->
+ <parent>
+ <groupId>org.sonatype.oss</groupId>
+ <artifactId>oss-parent</artifactId>
+ <version>7</version>
+ </parent>
+
+ <scm>
+ <connection>scm:git:git@github.com:fernandospr/java-wns.git</connection>
+ <url>scm:git:git@github.com:fernandospr/java-wns.git</url>
+ <developerConnection>scm:git:git@github.com:fernandospr/java-wns.git</developerConnection>
+ </scm>
+ <developers>
+ <developer>
+ <id>fernandospr</id>
+ <name>Fernando Sproviero</name>
+ </developer>
+ </developers>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.12</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-client</artifactId>
+ <version>1.19</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish.jersey.connectors</groupId>
+ <artifactId>jersey-apache-connector</artifactId>
+ <version>2.16</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.jaxrs</groupId>
+ <artifactId>jackson-jaxrs-xml-provider</artifactId>
+ <version>2.3.3</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.jaxrs</groupId>
+ <artifactId>jackson-jaxrs-json-provider</artifactId>
+ <version>2.3.3</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptorRefs>
+ <descriptorRef>jar-with-dependencies</descriptorRef>
+ </descriptorRefs>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>2.2.1</version>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.9</version>
+ <executions>
+ <execution>
+ <id>attach-javadocs</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
http://git-wip-us.apache.org/repos/asf/usergrid/blob/d42d82cb/stack/pom.xml
----------------------------------------------------------------------
diff --git a/stack/pom.xml b/stack/pom.xml
index dfa5045..ae55ea1 100644
--- a/stack/pom.xml
+++ b/stack/pom.xml
@@ -1647,13 +1647,13 @@
</reporting>
- <!--<repositories>-->
- <!--<repository>-->
- <!--<id>local-dependencies</id>-->
- <!--<name>local-depedendencies</name>-->
- <!--<url>file://${project.basedir}/../m2/repository</url>-->
- <!--</repository>-->
- <!--</repositories>-->
+ <repositories>
+ <repository>
+ <id>local-dependencies</id>
+ <name>local-depedendencies</name>
+ <url>file://${project.basedir}/../m2/repository</url>
+ </repository>
+ </repositories>
<scm>
<url>https://git-wip-us.apache.org/repos/asf/incubator-usergrid.git</url>
http://git-wip-us.apache.org/repos/asf/usergrid/blob/d42d82cb/stack/rest/pom.xml
----------------------------------------------------------------------
diff --git a/stack/rest/pom.xml b/stack/rest/pom.xml
index 6c47d82..7b1bad6 100644
--- a/stack/rest/pom.xml
+++ b/stack/rest/pom.xml
@@ -408,6 +408,16 @@
<scope>test</scope>
<classifier>tests</classifier>
</dependency>
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <version>3.1</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey.contribs</groupId>
+ <artifactId>jersey-apache-client</artifactId>
+ <version>1.19</version>
+ </dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/usergrid/blob/d42d82cb/stack/services/pom.xml
----------------------------------------------------------------------
diff --git a/stack/services/pom.xml b/stack/services/pom.xml
index d1ec212..5560079 100644
--- a/stack/services/pom.xml
+++ b/stack/services/pom.xml
@@ -434,10 +434,11 @@
<artifactId>stream</artifactId>
<version>2.7.0</version>
</dependency>
+ <!-- fork: https://github.com/apigee/java-wns/tree/usergrid -->
<dependency>
<groupId>com.github.fernandospr</groupId>
<artifactId>java-wns</artifactId>
- <version>1.3</version>
+ <version>1.3.1-USERGRID</version>
<exclusions>
<exclusion>
<artifactId>jackson-jaxrs</artifactId>
[28/32] usergrid git commit: remove repeated logic
Posted by sf...@apache.org.
remove repeated logic
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/e3d1f3b6
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/e3d1f3b6
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/e3d1f3b6
Branch: refs/heads/master
Commit: e3d1f3b6d8c3be86f0d36dbf6c86321676860a34
Parents: d363242
Author: Shawn Feldman <sf...@apache.org>
Authored: Mon Nov 9 15:10:16 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Mon Nov 9 15:10:16 2015 -0700
----------------------------------------------------------------------
.../usergrid/persistence/queue/DefaultQueueManager.java | 7 +------
.../usergrid/services/notifications/wns/WNSAdapterTest.java | 2 +-
2 files changed, 2 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/e3d1f3b6/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/DefaultQueueManager.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/DefaultQueueManager.java b/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/DefaultQueueManager.java
index c3b5917..ea30fc0 100644
--- a/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/DefaultQueueManager.java
+++ b/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/DefaultQueueManager.java
@@ -74,12 +74,7 @@ public class DefaultQueueManager implements QueueManager {
@Override
public void sendMessages(List bodies) throws IOException {
for(Object body : bodies){
- String uuid = UUID.randomUUID().toString();
- try {
- queue.put(new QueueMessage(uuid, "handle_" + uuid, body, "put type here"));
- }catch (InterruptedException ie){
- throw new RuntimeException(ie);
- }
+ sendMessage( ( Serializable )body);
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/e3d1f3b6/stack/services/src/test/java/org/apache/usergrid/services/notifications/wns/WNSAdapterTest.java
----------------------------------------------------------------------
diff --git a/stack/services/src/test/java/org/apache/usergrid/services/notifications/wns/WNSAdapterTest.java b/stack/services/src/test/java/org/apache/usergrid/services/notifications/wns/WNSAdapterTest.java
index aa60e84..35f3180 100644
--- a/stack/services/src/test/java/org/apache/usergrid/services/notifications/wns/WNSAdapterTest.java
+++ b/stack/services/src/test/java/org/apache/usergrid/services/notifications/wns/WNSAdapterTest.java
@@ -30,7 +30,7 @@ import org.junit.Test;
import java.util.UUID;
/**
- * Classy class class.
+ * test windows phone.
*/
public class WNSAdapterTest extends AbstractServiceIT{
@Test
[02/32] usergrid git commit: Fix issue where data from objects nested
within an array were not getting indexed.
Posted by sf...@apache.org.
Fix issue where data from objects nested within an array were not getting indexed.
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/244fa52e
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/244fa52e
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/244fa52e
Branch: refs/heads/master
Commit: 244fa52ee2685d0ca68986b5747cd21576738d14
Parents: 432c2e9
Author: Michael Russo <mi...@gmail.com>
Authored: Tue Nov 3 11:12:29 2015 -0800
Committer: Michael Russo <mi...@gmail.com>
Committed: Tue Nov 3 11:25:38 2015 -0800
----------------------------------------------------------------------
.../index/impl/EntityMappingParser.java | 4 ++
.../index/impl/EntityToMapConverterTest.java | 48 ++++++++++++++++++++
2 files changed, 52 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/244fa52e/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EntityMappingParser.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EntityMappingParser.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EntityMappingParser.java
index 63cef04..2c82782 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EntityMappingParser.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EntityMappingParser.java
@@ -202,11 +202,15 @@ public class EntityMappingParser implements FieldParser {
*/
private void iterate( final Map<String, ?> map ) {
+ lastCollection.push( map );
+
for ( final Map.Entry<String, ?> jsonField : map.entrySet() ) {
pushField( jsonField.getKey() );
visitValue( jsonField.getValue() );
popField();
}
+
+ lastCollection.pop();
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/244fa52e/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityToMapConverterTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityToMapConverterTest.java b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityToMapConverterTest.java
index c412cf4..7e7c466 100644
--- a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityToMapConverterTest.java
+++ b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityToMapConverterTest.java
@@ -650,4 +650,52 @@ public class EntityToMapConverterTest {
assertEquals( "value", field.get( IndexingUtils.FIELD_STRING ) );
}
+
+ /**
+ * Objects nested within arrays are allowed to be indexed (just not n+1 nested arrays themselves)
+ */
+ @Test
+ public void testObjectNestedInArray() {
+
+ final ArrayField<Object> array = new ArrayField<>("array");
+
+ // this should not get indexed
+ final ArrayField<Object> nestedArray1 = new ArrayField<>("nestedArray");
+ nestedArray1.add("1");
+
+ // this should get indexed
+ final EntityObject nestedObject1 = new EntityObject();
+ final ArrayField<Object> objectArray = new ArrayField<>("nestedArrayInObject");
+ final EntityObject nestedObject2 = new EntityObject();
+ nestedObject2.setField(new StringField("nestedKey", "nestedValue"));
+ objectArray.add(nestedObject2);
+ nestedObject1.setField(objectArray);
+
+ array.add(nestedArray1);
+ array.add(nestedObject1);
+
+ Entity rootEntity = new Entity( "test" );
+ rootEntity.setField( array );
+
+ final UUID version = UUIDGenerator.newTimeUUID();
+ EntityUtils.setVersion( rootEntity, version );
+
+ final ApplicationScope scope = new ApplicationScopeImpl( createId( "application" ) );
+ final IndexEdge indexEdge =
+ new IndexEdgeImpl( createId( "source" ), "testEdgeType", SearchEdge.NodeType.SOURCE, 1000 );
+
+ final Map<String, Object> entityMap = EntityToMapConverter.convert( scope, indexEdge, rootEntity );
+ final List<EntityField> fields = ( List<EntityField> ) entityMap.get( IndexingUtils.ENTITY_FIELDS );
+
+ // if size of fields is not == 1, then we either
+ // 1) did not index anything or 2) indexed the nested array that shouldn't be indexed at all
+ assertEquals( 1, fields.size() );
+
+ final EntityField field = fields.get( 0 );
+ final String path = "array.nestedArrayInObject.nestedKey".toLowerCase();
+
+ assertEquals( path, field.get( IndexingUtils.FIELD_NAME ) );
+
+ }
+
}
[12/32] usergrid git commit: Fixes NPE issue.
Posted by sf...@apache.org.
Fixes NPE issue.
Adds additional validation time
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/94579c72
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/94579c72
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/94579c72
Branch: refs/heads/master
Commit: 94579c7213862afa194a7aec78b1a92070e7bbf8
Parents: 591a2f1
Author: Todd Nine <tn...@apigee.com>
Authored: Thu Nov 5 14:45:53 2015 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Thu Nov 5 14:45:53 2015 -0700
----------------------------------------------------------------------
.../graph/serialization/impl/shard/DirectedEdgeMeta.java | 4 ++--
.../persistence/graph/GraphManagerShardConsistencyIT.java | 5 +++++
2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/94579c72/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/DirectedEdgeMeta.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/DirectedEdgeMeta.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/DirectedEdgeMeta.java
index 1d81d20..e7143bc 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/DirectedEdgeMeta.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/DirectedEdgeMeta.java
@@ -457,7 +457,7 @@ public abstract class DirectedEdgeMeta {
final SearchByIdType search =
- new SimpleSearchByIdType( targetId, edgeType, maxValue, order, sourceType, null );
+ new SimpleSearchByIdType( targetId, edgeType, maxValue, order, sourceType, Optional.absent() );
return serialization.getEdgesToTargetBySourceType( edgeColumnFamilies, scope, search, shards );
}
@@ -517,7 +517,7 @@ public abstract class DirectedEdgeMeta {
final String edgeType = types[0];
final SimpleSearchByEdge search =
- new SimpleSearchByEdge( sourceId, edgeType, targetId, maxValue, order, null );
+ new SimpleSearchByEdge( sourceId, edgeType, targetId, maxValue, order, Optional.absent() );
return serialization.getEdgeVersions( edgeColumnFamilies, scope, search, shards );
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/94579c72/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerShardConsistencyIT.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerShardConsistencyIT.java b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerShardConsistencyIT.java
index 6aad289..a9f9cb7 100644
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerShardConsistencyIT.java
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerShardConsistencyIT.java
@@ -358,6 +358,11 @@ public class GraphManagerShardConsistencyIT {
Thread.sleep( 2000 );
}
+
+ //now continue reading everything for 30 seconds
+
+ Thread.sleep(30000);
+
executor.shutdownNow();
}
[30/32] usergrid git commit: fix bug in expiration
Posted by sf...@apache.org.
fix bug in expiration
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/24600e0b
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/24600e0b
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/24600e0b
Branch: refs/heads/master
Commit: 24600e0bd17bff9ca022271d780a7e220bfda94e
Parents: 5fd1d5d
Author: Shawn Feldman <sf...@apache.org>
Authored: Wed Nov 11 09:48:42 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Wed Nov 11 09:48:42 2015 -0700
----------------------------------------------------------------------
.../apache/usergrid/services/notifications/wns/WNSAdapter.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/24600e0b/stack/services/src/main/java/org/apache/usergrid/services/notifications/wns/WNSAdapter.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/wns/WNSAdapter.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/wns/WNSAdapter.java
index 3ad3d35..f2946df 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/wns/WNSAdapter.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/wns/WNSAdapter.java
@@ -77,8 +77,9 @@ public class WNSAdapter implements ProviderAdapter {
// set the optional TTL value used when pushing notifications
WnsNotificationRequestOptional opt = new WnsNotificationRequestOptional();
- opt.ttl = String.valueOf(notification.getExpireTTLSeconds());
-
+ if(notification.getExpireTTLSeconds()>0) {
+ opt.ttl = String.valueOf(notification.getExpireTTLSeconds());
+ }
switch (translatedNotification.getType()) {
case "toast":
WnsToast toast = new WnsToastBuilder().bindingTemplateToastText01(translatedNotification.getMessage().toString()).build();
[24/32] usergrid git commit: forked was to version 1.2-USERGRID
Posted by sf...@apache.org.
forked was to version 1.2-USERGRID
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/32f805a5
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/32f805a5
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/32f805a5
Branch: refs/heads/master
Commit: 32f805a5fa2bbd6aa3a816752e601da2f7c47e57
Parents: 6ea8f6b
Author: Shawn Feldman <sf...@apache.org>
Authored: Mon Nov 9 11:22:28 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Mon Nov 9 11:22:28 2015 -0700
----------------------------------------------------------------------
.../java-wns/1.2-USERGRID/_remote.repositories | 7 +
...a-wns-1.2-USERGRID-jar-with-dependencies.jar | Bin 0 -> 1836665 bytes
.../java-wns-1.2-USERGRID-javadoc.jar | Bin 0 -> 234289 bytes
.../java-wns-1.2-USERGRID-sources.jar | Bin 0 -> 21654 bytes
.../1.2-USERGRID/java-wns-1.2-USERGRID.jar | Bin 0 -> 33164 bytes
.../1.2-USERGRID/java-wns-1.2-USERGRID.pom | 128 +++++++++++++++++++
.../1.3.1-USERGRID/_remote.repositories | 9 --
...wns-1.3.1-USERGRID-jar-with-dependencies.jar | Bin 6504429 -> 0 bytes
.../java-wns-1.3.1-USERGRID-javadoc.jar | Bin 239980 -> 0 bytes
.../java-wns-1.3.1-USERGRID-sources.jar | Bin 22657 -> 0 bytes
.../1.3.1-USERGRID/java-wns-1.3.1-USERGRID.jar | Bin 34898 -> 0 bytes
.../1.3.1-USERGRID/java-wns-1.3.1-USERGRID.pom | 110 ----------------
stack/services/pom.xml | 4 +-
13 files changed, 137 insertions(+), 121 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/32f805a5/stack/m2/repository/com/github/fernandospr/java-wns/1.2-USERGRID/_remote.repositories
----------------------------------------------------------------------
diff --git a/stack/m2/repository/com/github/fernandospr/java-wns/1.2-USERGRID/_remote.repositories b/stack/m2/repository/com/github/fernandospr/java-wns/1.2-USERGRID/_remote.repositories
new file mode 100644
index 0000000..dc98831
--- /dev/null
+++ b/stack/m2/repository/com/github/fernandospr/java-wns/1.2-USERGRID/_remote.repositories
@@ -0,0 +1,7 @@
+#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
+#Mon Nov 09 10:18:48 MST 2015
+java-wns-1.2-USERGRID.pom>=
+java-wns-1.2-USERGRID-javadoc.jar>=
+java-wns-1.2-USERGRID-jar-with-dependencies.jar>=
+java-wns-1.2-USERGRID.jar>=
+java-wns-1.2-USERGRID-sources.jar>=
http://git-wip-us.apache.org/repos/asf/usergrid/blob/32f805a5/stack/m2/repository/com/github/fernandospr/java-wns/1.2-USERGRID/java-wns-1.2-USERGRID-jar-with-dependencies.jar
----------------------------------------------------------------------
diff --git a/stack/m2/repository/com/github/fernandospr/java-wns/1.2-USERGRID/java-wns-1.2-USERGRID-jar-with-dependencies.jar b/stack/m2/repository/com/github/fernandospr/java-wns/1.2-USERGRID/java-wns-1.2-USERGRID-jar-with-dependencies.jar
new file mode 100644
index 0000000..785c1ab
Binary files /dev/null and b/stack/m2/repository/com/github/fernandospr/java-wns/1.2-USERGRID/java-wns-1.2-USERGRID-jar-with-dependencies.jar differ
http://git-wip-us.apache.org/repos/asf/usergrid/blob/32f805a5/stack/m2/repository/com/github/fernandospr/java-wns/1.2-USERGRID/java-wns-1.2-USERGRID-javadoc.jar
----------------------------------------------------------------------
diff --git a/stack/m2/repository/com/github/fernandospr/java-wns/1.2-USERGRID/java-wns-1.2-USERGRID-javadoc.jar b/stack/m2/repository/com/github/fernandospr/java-wns/1.2-USERGRID/java-wns-1.2-USERGRID-javadoc.jar
new file mode 100644
index 0000000..03af259
Binary files /dev/null and b/stack/m2/repository/com/github/fernandospr/java-wns/1.2-USERGRID/java-wns-1.2-USERGRID-javadoc.jar differ
http://git-wip-us.apache.org/repos/asf/usergrid/blob/32f805a5/stack/m2/repository/com/github/fernandospr/java-wns/1.2-USERGRID/java-wns-1.2-USERGRID-sources.jar
----------------------------------------------------------------------
diff --git a/stack/m2/repository/com/github/fernandospr/java-wns/1.2-USERGRID/java-wns-1.2-USERGRID-sources.jar b/stack/m2/repository/com/github/fernandospr/java-wns/1.2-USERGRID/java-wns-1.2-USERGRID-sources.jar
new file mode 100644
index 0000000..9a0fb2b
Binary files /dev/null and b/stack/m2/repository/com/github/fernandospr/java-wns/1.2-USERGRID/java-wns-1.2-USERGRID-sources.jar differ
http://git-wip-us.apache.org/repos/asf/usergrid/blob/32f805a5/stack/m2/repository/com/github/fernandospr/java-wns/1.2-USERGRID/java-wns-1.2-USERGRID.jar
----------------------------------------------------------------------
diff --git a/stack/m2/repository/com/github/fernandospr/java-wns/1.2-USERGRID/java-wns-1.2-USERGRID.jar b/stack/m2/repository/com/github/fernandospr/java-wns/1.2-USERGRID/java-wns-1.2-USERGRID.jar
new file mode 100644
index 0000000..5e073ad
Binary files /dev/null and b/stack/m2/repository/com/github/fernandospr/java-wns/1.2-USERGRID/java-wns-1.2-USERGRID.jar differ
http://git-wip-us.apache.org/repos/asf/usergrid/blob/32f805a5/stack/m2/repository/com/github/fernandospr/java-wns/1.2-USERGRID/java-wns-1.2-USERGRID.pom
----------------------------------------------------------------------
diff --git a/stack/m2/repository/com/github/fernandospr/java-wns/1.2-USERGRID/java-wns-1.2-USERGRID.pom b/stack/m2/repository/com/github/fernandospr/java-wns/1.2-USERGRID/java-wns-1.2-USERGRID.pom
new file mode 100644
index 0000000..40a6e55
--- /dev/null
+++ b/stack/m2/repository/com/github/fernandospr/java-wns/1.2-USERGRID/java-wns-1.2-USERGRID.pom
@@ -0,0 +1,128 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>com.github.fernandospr</groupId>
+ <artifactId>java-wns</artifactId>
+ <packaging>jar</packaging>
+ <version>1.2-USERGRID</version>
+ <name>java-wns</name>
+ <description>Library to send notifications using WNS</description>
+ <url>https://github.com/fernandospr/java-wns</url>
+ <licenses>
+ <license>
+ <name>New BSD License</name>
+ <url>http://www.opensource.org/licenses/bsd-license.php</url>
+ <distribution>repo</distribution>
+ </license>
+ </licenses>
+
+ <!-- Inherit the Sonatype OSS deployment configuration -->
+ <parent>
+ <groupId>org.sonatype.oss</groupId>
+ <artifactId>oss-parent</artifactId>
+ <version>7</version>
+ </parent>
+
+ <scm>
+ <connection>scm:git:git@github.com:fernandospr/java-wns.git</connection>
+ <url>scm:git:git@github.com:fernandospr/java-wns.git</url>
+ <developerConnection>scm:git:git@github.com:fernandospr/java-wns.git</developerConnection>
+ </scm>
+ <developers>
+ <developer>
+ <id>fernandospr</id>
+ <name>Fernando Sproviero</name>
+ </developer>
+ </developers>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-client</artifactId>
+ <version>1.19</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-core</artifactId>
+ <version>2.3.3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.fasterxml.jackson.jaxrs</groupId>
+ <artifactId>jackson-jaxrs-json-provider</artifactId>
+ <version>2.3.3</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptorRefs>
+ <descriptorRef>jar-with-dependencies</descriptorRef>
+ </descriptorRefs>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <!--
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-gpg-plugin</artifactId>
+ <version>1.4</version>
+ <executions>
+ <execution>
+ <id>sign-artifacts</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>sign</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>2.2.1</version>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.9</version>
+ <executions>
+ <execution>
+ <id>attach-javadocs</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
http://git-wip-us.apache.org/repos/asf/usergrid/blob/32f805a5/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/_remote.repositories
----------------------------------------------------------------------
diff --git a/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/_remote.repositories b/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/_remote.repositories
deleted file mode 100644
index 408d82f..0000000
--- a/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/_remote.repositories
+++ /dev/null
@@ -1,9 +0,0 @@
-#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
-#Fri Nov 06 16:50:37 MST 2015
-java-wns-1.3.1-USERGRID.pom>local-dependencies=
-java-wns-1.3.1-USERGRID-sources.jar>=
-java-wns-1.3.1-USERGRID-jar-with-dependencies.jar>=
-java-wns-1.3.1-USERGRID.jar>local-dependencies=
-java-wns-1.3.1-USERGRID.jar>=
-java-wns-1.3.1-USERGRID-javadoc.jar>=
-java-wns-1.3.1-USERGRID.pom>=
http://git-wip-us.apache.org/repos/asf/usergrid/blob/32f805a5/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-jar-with-dependencies.jar
----------------------------------------------------------------------
diff --git a/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-jar-with-dependencies.jar b/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-jar-with-dependencies.jar
deleted file mode 100644
index 465d258..0000000
Binary files a/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-jar-with-dependencies.jar and /dev/null differ
http://git-wip-us.apache.org/repos/asf/usergrid/blob/32f805a5/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-javadoc.jar
----------------------------------------------------------------------
diff --git a/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-javadoc.jar b/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-javadoc.jar
deleted file mode 100644
index f0a8037..0000000
Binary files a/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-javadoc.jar and /dev/null differ
http://git-wip-us.apache.org/repos/asf/usergrid/blob/32f805a5/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-sources.jar
----------------------------------------------------------------------
diff --git a/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-sources.jar b/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-sources.jar
deleted file mode 100644
index 3c6c4e3..0000000
Binary files a/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-sources.jar and /dev/null differ
http://git-wip-us.apache.org/repos/asf/usergrid/blob/32f805a5/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID.jar
----------------------------------------------------------------------
diff --git a/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID.jar b/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID.jar
deleted file mode 100644
index e03410f..0000000
Binary files a/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID.jar and /dev/null differ
http://git-wip-us.apache.org/repos/asf/usergrid/blob/32f805a5/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID.pom
----------------------------------------------------------------------
diff --git a/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID.pom b/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID.pom
deleted file mode 100644
index ece0cc3..0000000
--- a/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID.pom
+++ /dev/null
@@ -1,110 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>com.github.fernandospr</groupId>
- <artifactId>java-wns</artifactId>
- <packaging>jar</packaging>
- <version>1.3.1-USERGRID</version>
- <name>java-wns</name>
- <description>Library to send notifications using WNS</description>
- <url>https://github.com/fernandospr/java-wns</url>
- <licenses>
- <license>
- <name>New BSD License</name>
- <url>http://www.opensource.org/licenses/bsd-license.php</url>
- <distribution>repo</distribution>
- </license>
- </licenses>
-
- <!-- Inherit the Sonatype OSS deployment configuration -->
- <parent>
- <groupId>org.sonatype.oss</groupId>
- <artifactId>oss-parent</artifactId>
- <version>7</version>
- </parent>
-
- <scm>
- <connection>scm:git:git@github.com:fernandospr/java-wns.git</connection>
- <url>scm:git:git@github.com:fernandospr/java-wns.git</url>
- <developerConnection>scm:git:git@github.com:fernandospr/java-wns.git</developerConnection>
- </scm>
- <developers>
- <developer>
- <id>fernandospr</id>
- <name>Fernando Sproviero</name>
- </developer>
- </developers>
-
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.12</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.glassfish.jersey.connectors</groupId>
- <artifactId>jersey-apache-connector</artifactId>
- <version>2.22.1</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.jaxrs</groupId>
- <artifactId>jackson-jaxrs-xml-provider</artifactId>
- <version>2.3.3</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.jaxrs</groupId>
- <artifactId>jackson-jaxrs-json-provider</artifactId>
- <version>2.3.3</version>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <configuration>
- <descriptorRefs>
- <descriptorRef>jar-with-dependencies</descriptorRef>
- </descriptorRefs>
- </configuration>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <version>2.2.1</version>
- <executions>
- <execution>
- <id>attach-sources</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>2.9</version>
- <executions>
- <execution>
- <id>attach-javadocs</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
http://git-wip-us.apache.org/repos/asf/usergrid/blob/32f805a5/stack/services/pom.xml
----------------------------------------------------------------------
diff --git a/stack/services/pom.xml b/stack/services/pom.xml
index 754b74c..853596e 100644
--- a/stack/services/pom.xml
+++ b/stack/services/pom.xml
@@ -434,11 +434,11 @@
<artifactId>stream</artifactId>
<version>2.7.0</version>
</dependency>
- <!-- fork: https://github.com/apigee/java-wns/tree/usergrid -->
+ <!-- fork: https://github.com/apigee/java-wns/tree/1.2-USERGRID -->
<dependency>
<groupId>com.github.fernandospr</groupId>
<artifactId>java-wns</artifactId>
- <version>1.3.1-USERGRID</version>
+ <version>1.2-USERGRID</version>
</dependency>
</dependencies>
</project>
[31/32] usergrid git commit: Merge branch '2.1-release' of
https://git-wip-us.apache.org/repos/asf/usergrid into 2.1-release
Posted by sf...@apache.org.
Merge branch '2.1-release' of https://git-wip-us.apache.org/repos/asf/usergrid into 2.1-release
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/204bf042
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/204bf042
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/204bf042
Branch: refs/heads/master
Commit: 204bf04272be75056a05e40b4bf6d3c389f0b134
Parents: 24600e0 7945209
Author: Shawn Feldman <sf...@apache.org>
Authored: Wed Nov 11 09:49:04 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Wed Nov 11 09:49:04 2015 -0700
----------------------------------------------------------------------
.../read/traverse/AbstractReadGraphFilter.java | 6 +-
.../usergrid/corepersistence/index/RxTest.java | 5 +-
.../persistence/graph/guice/GraphModule.java | 7 -
.../impl/shard/DirectedEdgeMeta.java | 4 +-
.../impl/shard/EdgeShardStrategy.java | 10 +-
.../impl/shard/NodeShardApproximation.java | 66 --
.../impl/shard/ShardEntryGroup.java | 3 +-
.../impl/shard/ShardedEdgeSerialization.java | 2 +-
.../serialization/impl/shard/count/Counter.java | 131 ----
.../shard/count/NodeShardApproximationImpl.java | 272 --------
.../count/NodeShardCounterSerialization.java | 48 --
.../NodeShardCounterSerializationImpl.java | 186 ------
.../impl/shard/count/ShardKey.java | 75 ---
.../shard/impl/NodeShardAllocationImpl.java | 19 +-
.../impl/shard/impl/ShardGroupDeletionImpl.java | 158 ++---
.../impl/ShardedEdgeSerializationImpl.java | 28 -
.../shard/impl/SizebasedEdgeColumnFamilies.java | 4 +-
.../shard/impl/SizebasedEdgeShardStrategy.java | 13 +-
.../graph/GraphManagerShardConsistencyIT.java | 5 +
.../graph/GraphManagerShardingIT.java | 208 ------
.../impl/shard/NodeShardAllocationTest.java | 48 +-
.../impl/shard/ShardEntryGroupTest.java | 28 +
.../shard/count/NodeShardApproximationTest.java | 627 -------------------
.../NodeShardCounterSerializationTest.java | 124 ----
.../shard/impl/ShardGroupDeletionImplTest.java | 5 +
.../persistence/queue/DefaultQueueManager.java | 58 +-
.../java-wns/1.2-USERGRID/_remote.repositories | 7 +
...a-wns-1.2-USERGRID-jar-with-dependencies.jar | Bin 0 -> 1836665 bytes
.../java-wns-1.2-USERGRID-javadoc.jar | Bin 0 -> 234289 bytes
.../java-wns-1.2-USERGRID-sources.jar | Bin 0 -> 21654 bytes
.../1.2-USERGRID/java-wns-1.2-USERGRID.jar | Bin 0 -> 33164 bytes
.../1.2-USERGRID/java-wns-1.2-USERGRID.pom | 128 ++++
stack/pom.xml | 14 +-
stack/rest/pom.xml | 10 +
.../exceptions/AbstractExceptionMapper.java | 8 +-
stack/services/pom.xml | 10 +-
.../services/AbstractCollectionService.java | 10 +-
.../notifications/wns/WNSAdapterTest.java | 49 ++
38 files changed, 399 insertions(+), 1977 deletions(-)
----------------------------------------------------------------------
[03/32] usergrid git commit: De-dup management app as part of
migration script and fix re-index so it passes the APP uuid into the API
call.
Posted by sf...@apache.org.
De-dup management app as part of migration script and fix re-index so it passes the APP uuid into the API call.
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/dfc70f45
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/dfc70f45
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/dfc70f45
Branch: refs/heads/master
Commit: dfc70f45cc1100776ed81cb346668dd73ca3288b
Parents: 244fa52
Author: Michael Russo <mi...@gmail.com>
Authored: Tue Nov 3 14:33:03 2015 -0800
Committer: Michael Russo <mi...@gmail.com>
Committed: Tue Nov 3 14:37:28 2015 -0800
----------------------------------------------------------------------
stack/scripts/multitenant_migrate.py | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/dfc70f45/stack/scripts/multitenant_migrate.py
----------------------------------------------------------------------
diff --git a/stack/scripts/multitenant_migrate.py b/stack/scripts/multitenant_migrate.py
index f728671..c31783c 100644
--- a/stack/scripts/multitenant_migrate.py
+++ b/stack/scripts/multitenant_migrate.py
@@ -232,7 +232,6 @@ class Migrate:
break
# Migrate app info
-
if self.is_appinfo_migrated():
self.logger.info('AppInfo already migrated. Resetting version for re-migration.')
self.reset_appinfo_migration()
@@ -251,11 +250,24 @@ class Migrate:
break
self.logger.info('AppInfo Migration Ended.')
+ # De-dup management app
+ job = self.start_dedup(MANAGEMENT_APP_ID)
+ self.logger.info('Started management dedup. App=[%s], Job=[%s]', MANAGEMENT_APP_ID, job)
+ is_running = True
+ while is_running:
+ time.sleep(STATUS_INTERVAL_SECONDS)
+ is_running = self.is_dedup_running(job)
+ if not is_running:
+ break
+
+ self.logger.info("Finished dedup. App=[%s], Job=[%s]", MANAGEMENT_APP_ID, job)
+ self.metrics['dedup_end_' + MANAGEMENT_APP_ID] = get_current_time()
+
# Reindex management app
job = self.start_app_reindex(MANAGEMENT_APP_ID)
self.metrics['reindex_start'] = get_current_time()
- self.logger.info('Started Re-index. Job=[%s]', job)
+ self.logger.info('Started management Re-index. Job=[%s]', job)
is_running = True
while is_running:
time.sleep(STATUS_INTERVAL_SECONDS)
@@ -263,7 +275,7 @@ class Migrate:
if not is_running:
break
- self.logger.info("Finished Re-index. Job=[%s]", job)
+ self.logger.info("Finished management Re-index. Job=[%s]", job)
self.metrics['reindex_end'] = get_current_time()
# Dedup and re-index all of organization's apps
@@ -517,7 +529,7 @@ class Migrate:
body = json.dumps({'updated': self.start_date})
try:
- r = requests.post(url=self.get_reindex_url(), data=body, auth=(self.super_user, self.super_pass))
+ r = requests.post(url=self.get_reindex_url() + "/" + appId, data=body, auth=(self.super_user, self.super_pass))
if r.status_code == 200:
response = r.json()
[07/32] usergrid git commit: revert pom
Posted by sf...@apache.org.
revert pom
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/5fd1d5df
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/5fd1d5df
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/5fd1d5df
Branch: refs/heads/master
Commit: 5fd1d5df5597e196031937f63d406d790e1f113d
Parents: 8da60e2
Author: Shawn Feldman <sf...@apache.org>
Authored: Wed Nov 4 17:02:49 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Wed Nov 4 17:02:49 2015 -0700
----------------------------------------------------------------------
stack/services/pom.xml | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/5fd1d5df/stack/services/pom.xml
----------------------------------------------------------------------
diff --git a/stack/services/pom.xml b/stack/services/pom.xml
index 0be2bcf..2daa8f6 100644
--- a/stack/services/pom.xml
+++ b/stack/services/pom.xml
@@ -438,7 +438,12 @@
<groupId>com.github.fernandospr</groupId>
<artifactId>java-wns</artifactId>
<version>1.3</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>jackson-jaxrs</artifactId>
+ <groupId>org.codehaus.jackson</groupId>
+ </exclusion>
+ </exclusions>
</dependency>
-
</dependencies>
</project>
[16/32] usergrid git commit: Merge branch '2.1-release' of
https://git-wip-us.apache.org/repos/asf/usergrid into 2.1-release
Posted by sf...@apache.org.
Merge branch '2.1-release' of https://git-wip-us.apache.org/repos/asf/usergrid into 2.1-release
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/67c0bfa1
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/67c0bfa1
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/67c0bfa1
Branch: refs/heads/master
Commit: 67c0bfa103e3ee37218d8ace70ae6a6f14b530a7
Parents: 6b58d3e 3f4d33a
Author: Mike Dunker <md...@apigee.com>
Authored: Fri Nov 6 12:29:19 2015 -0800
Committer: Mike Dunker <md...@apigee.com>
Committed: Fri Nov 6 12:29:19 2015 -0800
----------------------------------------------------------------------
.../impl/shard/impl/ShardGroupDeletionImpl.java | 165 ++++++++++---------
.../shard/impl/ShardGroupDeletionImplTest.java | 2 +
2 files changed, 86 insertions(+), 81 deletions(-)
----------------------------------------------------------------------
[10/32] usergrid git commit: Removes approximation logic on shards to
ensure that we're auditing the actual shard value.
Posted by sf...@apache.org.
http://git-wip-us.apache.org/repos/asf/usergrid/blob/591a2f1f/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardCounterSerializationTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardCounterSerializationTest.java b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardCounterSerializationTest.java
deleted file mode 100644
index 86f2491..0000000
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardCounterSerializationTest.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.usergrid.persistence.graph.serialization.impl.shard.count;
-
-
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.usergrid.persistence.core.guice.MigrationManagerRule;
-import org.apache.usergrid.persistence.core.scope.ApplicationScope;
-import org.apache.usergrid.persistence.core.test.ITRunner;
-import org.apache.usergrid.persistence.core.test.UseModules;
-import org.apache.usergrid.persistence.core.util.IdGenerator;
-import org.apache.usergrid.persistence.graph.GraphFig;
-import org.apache.usergrid.persistence.graph.guice.TestGraphModule;
-import org.apache.usergrid.persistence.graph.serialization.EdgeSerialization;
-import org.apache.usergrid.persistence.graph.serialization.impl.shard.DirectedEdgeMeta;
-import org.apache.usergrid.persistence.graph.serialization.impl.shard.Shard;
-import org.apache.usergrid.persistence.model.entity.Id;
-import org.apache.usergrid.persistence.model.util.UUIDGenerator;
-
-import com.google.inject.Inject;
-import com.netflix.astyanax.Keyspace;
-import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
-
-import static org.apache.usergrid.persistence.core.util.IdGenerator.createId;
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-
-@RunWith(ITRunner.class)
-@UseModules({ TestGraphModule.class })
-public class NodeShardCounterSerializationTest {
-
- private static final Logger log = LoggerFactory.getLogger( NodeShardCounterSerializationTest.class );
-
-
- @Inject
- @Rule
- public MigrationManagerRule migrationManagerRule;
-
-
- protected EdgeSerialization serialization;
-
- @Inject
- protected GraphFig graphFig;
-
- @Inject
- protected Keyspace keyspace;
-
- @Inject
- protected NodeShardCounterSerialization nodeShardCounterSerialization;
-
- protected ApplicationScope scope;
-
-
- @Before
- public void setup() {
- scope = mock( ApplicationScope.class );
-
- Id orgId = mock( Id.class );
-
- when( orgId.getType() ).thenReturn( "organization" );
- when( orgId.getUuid() ).thenReturn( UUIDGenerator.newTimeUUID() );
-
- when( scope.getApplication() ).thenReturn( orgId );
- }
-
-
- @Test
- public void testWritesRead() throws ConnectionException {
-
-
- final Id id = IdGenerator.createId( "test" );
-
- ShardKey key1 = new ShardKey( scope, new Shard( 0, 0, false ), DirectedEdgeMeta.fromSourceNode( id, "type1" ) );
-
- ShardKey key2 = new ShardKey( scope, new Shard( 0, 0, false ), DirectedEdgeMeta.fromSourceNode( id, "type2" ) );
-
- ShardKey key3 = new ShardKey( scope, new Shard( 1, 0, false ), DirectedEdgeMeta.fromSourceNode( id, "type1" ) );
-
-
- Counter counter = new Counter();
- counter.add( key1, 1000 );
- counter.add( key2, 2000 );
- counter.add( key3, 3000 );
-
- nodeShardCounterSerialization.flush( counter ).execute();
-
-
- final long time1 = nodeShardCounterSerialization.getCount( key1 );
-
- assertEquals( 1000, time1 );
-
- final long time2 = nodeShardCounterSerialization.getCount( key2 );
-
- assertEquals( 2000, time2 );
-
- final long time3 = nodeShardCounterSerialization.getCount( key3 );
-
- assertEquals( 3000, time3 );
- }
-}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/591a2f1f/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupDeletionImplTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupDeletionImplTest.java b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupDeletionImplTest.java
index f943e9b..9db997d 100644
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupDeletionImplTest.java
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupDeletionImplTest.java
@@ -318,6 +318,7 @@ public class ShardGroupDeletionImplTest {
}
+
private DirectedEdgeMeta getDirectedEdgeMeta() {
final Id sourceId = createId( "source" );
@@ -329,6 +330,8 @@ public class ShardGroupDeletionImplTest {
}
+
+
private void initExecutor( final int numberThreads, final int queueLength ) {
listeningExecutorService = MoreExecutors.listeningDecorator( TaskExecutorFactory
.createTaskExecutor( "GraphTaskExecutor", numberThreads, queueLength,
[05/32] usergrid git commit: Fix issue where read repair was causing
empty messages to be queued.
Posted by sf...@apache.org.
Fix issue where read repair was causing empty messages to be queued.
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/91354471
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/91354471
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/91354471
Branch: refs/heads/master
Commit: 913544719ddc84c1eb6cbbdfe463a7712ad73051
Parents: dfc70f4
Author: Michael Russo <mi...@gmail.com>
Authored: Wed Nov 4 14:02:53 2015 -0800
Committer: Michael Russo <mi...@gmail.com>
Committed: Wed Nov 4 14:02:53 2015 -0800
----------------------------------------------------------------------
.../corepersistence/asyncevents/AmazonAsyncEventService.java | 8 +++++---
.../pipeline/read/traverse/AbstractReadGraphFilter.java | 2 +-
.../persistence/index/impl/IndexOperationMessage.java | 4 ++--
3 files changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/91354471/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java
index 6b9abbc..16e119c 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java
@@ -490,6 +490,11 @@ public class AmazonAsyncEventService implements AsyncEventService {
*/
public void queueIndexOperationMessage( final IndexOperationMessage indexOperationMessage ) {
+ // don't try to produce something with nothing
+ if(indexOperationMessage.isEmpty()){
+ return;
+ }
+
final String jsonValue = ObjectJsonSerializer.INSTANCE.toString( indexOperationMessage );
final UUID newMessageId = UUIDGenerator.newTimeUUID();
@@ -760,10 +765,7 @@ public class AmazonAsyncEventService implements AsyncEventService {
.map(result -> result.getQueueMessage().get())
.collect(Collectors.toList());
- //only Q it if it's empty
- if(!combined.isEmpty()) {
queueIndexOperationMessage( combined );
- }
return messagesToAck;
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/91354471/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/traverse/AbstractReadGraphFilter.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/traverse/AbstractReadGraphFilter.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/traverse/AbstractReadGraphFilter.java
index 89230d7..78a3450 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/traverse/AbstractReadGraphFilter.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/traverse/AbstractReadGraphFilter.java
@@ -245,8 +245,8 @@ public abstract class AbstractReadGraphFilter extends AbstractPathFilter<Id, Id,
private Observable.Transformer<IndexOperationMessage, IndexOperationMessage> applyCollector() {
return observable -> observable
- .filter((IndexOperationMessage msg) -> !msg.isEmpty())
.collect(() -> new IndexOperationMessage(), (collector, single) -> collector.ingest(single))
+ .filter(msg -> !msg.isEmpty())
.doOnNext(indexOperation -> {
asyncEventService.queueIndexOperationMessage(indexOperation);
});
http://git-wip-us.apache.org/repos/asf/usergrid/blob/91354471/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexOperationMessage.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexOperationMessage.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexOperationMessage.java
index bcee308..7d19ce3 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexOperationMessage.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexOperationMessage.java
@@ -115,7 +115,7 @@ public class IndexOperationMessage implements Serializable {
}
public void ingest(IndexOperationMessage singleMessage) {
- this.indexRequests.addAll(singleMessage.getIndexRequests().stream().collect(Collectors.toList()));
- this.deIndexRequests.addAll(singleMessage.getDeIndexRequests().stream().collect(Collectors.toList()));
+ this.indexRequests.addAll(singleMessage.getIndexRequests());
+ this.deIndexRequests.addAll(singleMessage.getDeIndexRequests());
}
}
[23/32] usergrid git commit: fix exclusion with new version of wns lib
Posted by sf...@apache.org.
fix exclusion with new version of wns lib
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/6ea8f6b6
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/6ea8f6b6
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/6ea8f6b6
Branch: refs/heads/master
Commit: 6ea8f6b6feabb624ee583442eedbda55d8e78d07
Parents: 3c20c67
Author: Shawn Feldman <sf...@apache.org>
Authored: Fri Nov 6 17:01:53 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Fri Nov 6 17:01:53 2015 -0700
----------------------------------------------------------------------
.../1.3.1-USERGRID/_remote.repositories | 4 +++-
...wns-1.3.1-USERGRID-jar-with-dependencies.jar | Bin 6806358 -> 6504429 bytes
.../java-wns-1.3.1-USERGRID-javadoc.jar | Bin 240001 -> 239980 bytes
.../java-wns-1.3.1-USERGRID-sources.jar | Bin 22656 -> 22657 bytes
.../1.3.1-USERGRID/java-wns-1.3.1-USERGRID.jar | Bin 34924 -> 34898 bytes
.../1.3.1-USERGRID/java-wns-1.3.1-USERGRID.pom | 23 ++++++++-----------
6 files changed, 12 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/6ea8f6b6/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/_remote.repositories
----------------------------------------------------------------------
diff --git a/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/_remote.repositories b/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/_remote.repositories
index b24cacf..408d82f 100644
--- a/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/_remote.repositories
+++ b/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/_remote.repositories
@@ -1,7 +1,9 @@
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
-#Fri Nov 06 15:17:59 MST 2015
+#Fri Nov 06 16:50:37 MST 2015
+java-wns-1.3.1-USERGRID.pom>local-dependencies=
java-wns-1.3.1-USERGRID-sources.jar>=
java-wns-1.3.1-USERGRID-jar-with-dependencies.jar>=
+java-wns-1.3.1-USERGRID.jar>local-dependencies=
java-wns-1.3.1-USERGRID.jar>=
java-wns-1.3.1-USERGRID-javadoc.jar>=
java-wns-1.3.1-USERGRID.pom>=
http://git-wip-us.apache.org/repos/asf/usergrid/blob/6ea8f6b6/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-jar-with-dependencies.jar
----------------------------------------------------------------------
diff --git a/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-jar-with-dependencies.jar b/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-jar-with-dependencies.jar
index f118d2f..465d258 100644
Binary files a/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-jar-with-dependencies.jar and b/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-jar-with-dependencies.jar differ
http://git-wip-us.apache.org/repos/asf/usergrid/blob/6ea8f6b6/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-javadoc.jar
----------------------------------------------------------------------
diff --git a/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-javadoc.jar b/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-javadoc.jar
index 7c902ad..f0a8037 100644
Binary files a/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-javadoc.jar and b/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-javadoc.jar differ
http://git-wip-us.apache.org/repos/asf/usergrid/blob/6ea8f6b6/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-sources.jar
----------------------------------------------------------------------
diff --git a/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-sources.jar b/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-sources.jar
index 74dc5a0..3c6c4e3 100644
Binary files a/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-sources.jar and b/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID-sources.jar differ
http://git-wip-us.apache.org/repos/asf/usergrid/blob/6ea8f6b6/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID.jar
----------------------------------------------------------------------
diff --git a/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID.jar b/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID.jar
index dce3b10..e03410f 100644
Binary files a/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID.jar and b/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID.jar differ
http://git-wip-us.apache.org/repos/asf/usergrid/blob/6ea8f6b6/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID.pom
----------------------------------------------------------------------
diff --git a/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID.pom b/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID.pom
index 8939db3..ece0cc3 100644
--- a/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID.pom
+++ b/stack/m2/repository/com/github/fernandospr/java-wns/1.3.1-USERGRID/java-wns-1.3.1-USERGRID.pom
@@ -41,26 +41,21 @@
<version>4.12</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-client</artifactId>
- <version>1.19</version>
- </dependency>
<dependency>
<groupId>org.glassfish.jersey.connectors</groupId>
<artifactId>jersey-apache-connector</artifactId>
- <version>2.16</version>
+ <version>2.22.1</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.jaxrs</groupId>
+ <artifactId>jackson-jaxrs-xml-provider</artifactId>
+ <version>2.3.3</version>
</dependency>
<dependency>
- <groupId>com.fasterxml.jackson.jaxrs</groupId>
- <artifactId>jackson-jaxrs-xml-provider</artifactId>
- <version>2.3.3</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.jaxrs</groupId>
- <artifactId>jackson-jaxrs-json-provider</artifactId>
- <version>2.3.3</version>
+ <groupId>com.fasterxml.jackson.jaxrs</groupId>
+ <artifactId>jackson-jaxrs-json-provider</artifactId>
+ <version>2.3.3</version>
</dependency>
</dependencies>
[14/32] usergrid git commit: Shorts circuit delete until further
testing
Posted by sf...@apache.org.
Shorts circuit delete until further testing
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/3f4d33ae
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/3f4d33ae
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/3f4d33ae
Branch: refs/heads/master
Commit: 3f4d33aeed7a68778a5d64af8b875711a13b45b8
Parents: 6dfa2e2
Author: Todd Nine <tn...@apigee.com>
Authored: Fri Nov 6 10:40:18 2015 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Fri Nov 6 10:40:18 2015 -0700
----------------------------------------------------------------------
.../impl/shard/impl/ShardGroupDeletionImpl.java | 165 ++++++++++---------
.../shard/impl/ShardGroupDeletionImplTest.java | 2 +
2 files changed, 86 insertions(+), 81 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/3f4d33ae/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupDeletionImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupDeletionImpl.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupDeletionImpl.java
index ea10ed5..4d6be1b 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupDeletionImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupDeletionImpl.java
@@ -125,87 +125,90 @@ public class ShardGroupDeletionImpl implements ShardGroupDeletion {
final ShardEntryGroup shardEntryGroup,
final Iterator<MarkedEdge> edgeIterator ) {
- logger.trace( "Beginning audit of shard group {}", shardEntryGroup );
-
- /**
- * Compaction is pending, we cannot check it
- */
- if ( shardEntryGroup.isCompactionPending() ) {
- logger.trace( "Shard group {} is compacting, not auditing group", shardEntryGroup );
- return DeleteResult.COMPACTION_PENDING;
- }
-
-
- final long currentTime = timeService.getCurrentTime();
-
- if ( shardEntryGroup.isNew( currentTime ) ) {
- logger.trace( "Shard group {} contains a shard that is is too new, not auditing group", shardEntryGroup );
- return DeleteResult.TOO_NEW;
- }
-
- /**
- * We have edges, and therefore cannot delete them
- */
- if ( edgeIterator.hasNext() ) {
- logger.trace( "Shard group {} has edges, not deleting", shardEntryGroup );
-
- return DeleteResult.CONTAINS_EDGES;
- }
-
-
- //now we can proceed based on the shard meta state and we don't have any edge
-
- DeleteResult result = DeleteResult.NO_OP;
-
- MutationBatch rollup = null;
-
- for ( final Shard shard : shardEntryGroup.getReadShards() ) {
-
- //skip the min shard
- if(shard.isMinShard()){
- logger.trace( "Shard {} in group {} is the minimum, not deleting", shard, shardEntryGroup );
- continue;
- }
-
- //The shard is not compacted, we cannot remove it. This should never happen, a bit of an "oh shit" scenario.
- //the isCompactionPending should return false in this case
- if(!shard.isCompacted()){
- logger.warn( "Shard {} in group {} is not compacted yet was checked. Short circuiting", shard, shardEntryGroup );
- return DeleteResult.NO_OP;
- }
-
-
- final MutationBatch shardRemovalMutation =
- edgeShardSerialization.removeShardMeta( applicationScope, shard, directedEdgeMeta );
-
- if ( rollup == null ) {
- rollup = shardRemovalMutation;
- }
-
- else {
- rollup.mergeShallow( shardRemovalMutation );
- }
-
- result = DeleteResult.DELETED;
-
- logger.trace( "Removing shard {} in group {}", shard, shardEntryGroup );
- }
-
-
- if( rollup != null) {
-
- try {
- rollup.execute();
- }
- catch ( ConnectionException e ) {
- logger.error( "Unable to execute shard deletion", e );
- throw new RuntimeException( "Unable to execute shard deletion", e );
- }
- }
-
- logger.trace( "Completed auditing shard group {}", shardEntryGroup );
-
- return result;
+ //TEMPORARILY Removed until further testing
+ return DeleteResult.NO_OP;
+
+// logger.trace( "Beginning audit of shard group {}", shardEntryGroup );
+//
+// /**
+// * Compaction is pending, we cannot check it
+// */
+// if ( shardEntryGroup.isCompactionPending() ) {
+// logger.trace( "Shard group {} is compacting, not auditing group", shardEntryGroup );
+// return DeleteResult.COMPACTION_PENDING;
+// }
+//
+//
+// final long currentTime = timeService.getCurrentTime();
+//
+// if ( shardEntryGroup.isNew( currentTime ) ) {
+// logger.trace( "Shard group {} contains a shard that is is too new, not auditing group", shardEntryGroup );
+// return DeleteResult.TOO_NEW;
+// }
+//
+// /**
+// * We have edges, and therefore cannot delete them
+// */
+// if ( edgeIterator.hasNext() ) {
+// logger.trace( "Shard group {} has edges, not deleting", shardEntryGroup );
+//
+// return DeleteResult.CONTAINS_EDGES;
+// }
+//
+//
+// //now we can proceed based on the shard meta state and we don't have any edge
+//
+// DeleteResult result = DeleteResult.NO_OP;
+//
+// MutationBatch rollup = null;
+//
+// for ( final Shard shard : shardEntryGroup.getReadShards() ) {
+//
+// //skip the min shard
+// if(shard.isMinShard()){
+// logger.trace( "Shard {} in group {} is the minimum, not deleting", shard, shardEntryGroup );
+// continue;
+// }
+//
+// //The shard is not compacted, we cannot remove it. This should never happen, a bit of an "oh shit" scenario.
+// //the isCompactionPending should return false in this case
+// if(!shard.isCompacted()){
+// logger.warn( "Shard {} in group {} is not compacted yet was checked. Short circuiting", shard, shardEntryGroup );
+// return DeleteResult.NO_OP;
+// }
+//
+//
+// final MutationBatch shardRemovalMutation =
+// edgeShardSerialization.removeShardMeta( applicationScope, shard, directedEdgeMeta );
+//
+// if ( rollup == null ) {
+// rollup = shardRemovalMutation;
+// }
+//
+// else {
+// rollup.mergeShallow( shardRemovalMutation );
+// }
+//
+// result = DeleteResult.DELETED;
+//
+// logger.trace( "Removing shard {} in group {}", shard, shardEntryGroup );
+// }
+//
+//
+// if( rollup != null) {
+//
+// try {
+// rollup.execute();
+// }
+// catch ( ConnectionException e ) {
+// logger.error( "Unable to execute shard deletion", e );
+// throw new RuntimeException( "Unable to execute shard deletion", e );
+// }
+// }
+//
+// logger.trace( "Completed auditing shard group {}", shardEntryGroup );
+//
+// return result;
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/3f4d33ae/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupDeletionImplTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupDeletionImplTest.java b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupDeletionImplTest.java
index 9db997d..1cf6d54 100644
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupDeletionImplTest.java
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupDeletionImplTest.java
@@ -24,6 +24,7 @@ import java.util.concurrent.ExecutionException;
import org.junit.After;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import org.apache.usergrid.persistence.core.consistency.TimeService;
@@ -55,6 +56,7 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+@Ignore("Temporarily removing until delete is re-enabled")
public class ShardGroupDeletionImplTest {
[27/32] usergrid git commit: Merge branch '2.1-release' of
https://git-wip-us.apache.org/repos/asf/usergrid into jackson-exclusion
Posted by sf...@apache.org.
Merge branch '2.1-release' of https://git-wip-us.apache.org/repos/asf/usergrid into jackson-exclusion
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/d363242e
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/d363242e
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/d363242e
Branch: refs/heads/master
Commit: d363242e56571db6fa09f8be5b6753e864fb72a4
Parents: 9fd657b c3a5bc4
Author: Shawn Feldman <sf...@apache.org>
Authored: Mon Nov 9 14:15:56 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Mon Nov 9 14:15:56 2015 -0700
----------------------------------------------------------------------
.../org/apache/usergrid/services/AbstractCollectionService.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
[08/32] usergrid git commit: Adds more explicit check for
isCompactionPending. Directly checks for a compaction target.
Posted by sf...@apache.org.
Adds more explicit check for isCompactionPending. Directly checks for a compaction target.
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/9c54de3d
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/9c54de3d
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/9c54de3d
Branch: refs/heads/master
Commit: 9c54de3d59f6e5f21fb3970951c4157be0540d2d
Parents: 5fd1d5d
Author: Todd Nine <tn...@apigee.com>
Authored: Thu Nov 5 14:16:09 2015 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Thu Nov 5 14:16:09 2015 -0700
----------------------------------------------------------------------
.../impl/shard/ShardEntryGroup.java | 3 ++-
.../impl/shard/ShardEntryGroupTest.java | 28 ++++++++++++++++++++
2 files changed, 30 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/9c54de3d/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardEntryGroup.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardEntryGroup.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardEntryGroup.java
index 543f1fb..403ccf8 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardEntryGroup.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardEntryGroup.java
@@ -188,7 +188,8 @@ public class ShardEntryGroup {
* Return true if we have a pending compaction
*/
public boolean isCompactionPending() {
- return !isTooSmallToCompact();
+ //if we have a compaction target, a compaction is pending
+ return getCompactionTarget() != null;
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/9c54de3d/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardEntryGroupTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardEntryGroupTest.java b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardEntryGroupTest.java
index 30634e2..28d42d2 100644
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardEntryGroupTest.java
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardEntryGroupTest.java
@@ -406,6 +406,34 @@ public class ShardEntryGroupTest {
assertFalse( shardEntryGroup.canBeDeleted( minShard ) );
}
+
+ @Test
+ public void isCompactionPending(){
+ //set with no shard
+
+ final Shard minShard = Shard.MIN_SHARD;
+
+ final ShardEntryGroup oneShardGroup = new ShardEntryGroup( 1 );
+
+ oneShardGroup.addShard( minShard );
+
+ assertFalse(oneShardGroup.isCompactionPending());
+
+
+ //now test with 2 shards, 1 marked as non compacted.
+
+ final Shard nextShard = new Shard( 1000, 1000, false );
+
+ final ShardEntryGroup pendingGroup = new ShardEntryGroup( 1 );
+
+ pendingGroup.addShard( nextShard );
+ pendingGroup.addShard( minShard );
+
+ assertTrue(pendingGroup.isCompactionPending());
+
+
+
+ }
}
[32/32] usergrid git commit: merge
Posted by sf...@apache.org.
merge
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/67ab2443
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/67ab2443
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/67ab2443
Branch: refs/heads/master
Commit: 67ab24430c90586122e8458a168d48bad30bf494
Parents: de42b9c 204bf04
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Nov 12 08:35:38 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Nov 12 08:35:38 2015 -0700
----------------------------------------------------------------------
.../asyncevents/AmazonAsyncEventService.java | 8 +-
.../read/traverse/AbstractReadGraphFilter.java | 8 +-
.../usergrid/corepersistence/index/RxTest.java | 1 +
.../persistence/graph/guice/GraphModule.java | 7 -
.../impl/shard/DirectedEdgeMeta.java | 4 +-
.../impl/shard/EdgeShardStrategy.java | 10 +-
.../impl/shard/NodeShardApproximation.java | 66 --
.../impl/shard/ShardEntryGroup.java | 3 +-
.../impl/shard/ShardedEdgeSerialization.java | 2 +-
.../serialization/impl/shard/count/Counter.java | 131 ----
.../shard/count/NodeShardApproximationImpl.java | 272 --------
.../count/NodeShardCounterSerialization.java | 48 --
.../NodeShardCounterSerializationImpl.java | 186 ------
.../impl/shard/count/ShardKey.java | 75 ---
.../shard/impl/NodeShardAllocationImpl.java | 19 +-
.../impl/shard/impl/ShardGroupDeletionImpl.java | 158 ++---
.../impl/ShardedEdgeSerializationImpl.java | 28 -
.../shard/impl/SizebasedEdgeColumnFamilies.java | 4 +-
.../shard/impl/SizebasedEdgeShardStrategy.java | 13 +-
.../graph/GraphManagerShardConsistencyIT.java | 5 +
.../graph/GraphManagerShardingIT.java | 208 ------
.../impl/shard/NodeShardAllocationTest.java | 48 +-
.../impl/shard/ShardEntryGroupTest.java | 28 +
.../shard/count/NodeShardApproximationTest.java | 627 -------------------
.../NodeShardCounterSerializationTest.java | 124 ----
.../shard/impl/ShardGroupDeletionImplTest.java | 5 +
.../index/impl/EntityMappingParser.java | 4 +
.../index/impl/IndexOperationMessage.java | 4 +-
.../index/impl/EntityToMapConverterTest.java | 48 ++
.../java-wns/1.2-USERGRID/_remote.repositories | 7 +
...a-wns-1.2-USERGRID-jar-with-dependencies.jar | Bin 0 -> 1836665 bytes
.../java-wns-1.2-USERGRID-javadoc.jar | Bin 0 -> 234289 bytes
.../java-wns-1.2-USERGRID-sources.jar | Bin 0 -> 21654 bytes
.../1.2-USERGRID/java-wns-1.2-USERGRID.jar | Bin 0 -> 33164 bytes
.../1.2-USERGRID/java-wns-1.2-USERGRID.pom | 128 ++++
stack/pom.xml | 4 -
stack/rest/pom.xml | 10 +
.../exceptions/AbstractExceptionMapper.java | 8 +-
stack/scripts/multitenant_migrate.py | 48 +-
stack/services/pom.xml | 23 +-
.../services/AbstractCollectionService.java | 10 +-
.../services/notifications/wns/WNSAdapter.java | 5 +-
.../notifications/wns/WNSAdapterTest.java | 49 ++
43 files changed, 438 insertions(+), 1998 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/67ab2443/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/67ab2443/stack/core/src/test/java/org/apache/usergrid/corepersistence/index/RxTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/67ab2443/stack/pom.xml
----------------------------------------------------------------------
diff --cc stack/pom.xml
index c1ded77,ae55ea1..3f7b68b
--- a/stack/pom.xml
+++ b/stack/pom.xml
@@@ -1574,26 -1646,7 +1574,23 @@@
</plugins>
</reporting>
--
+ <profiles>
+ <profile>
+ <id>jacoco</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>${surefire.plugin.version}</version>
+ <configuration>
+ <argLine>-javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline} -javaagent:${settings.localRepository}/org/jacoco/org.jacoco.agent/${jacoco.version}/org.jacoco.agent-${jacoco.version}-runtime.jar=destfile=${project.build.directory}/jacoco.exec</argLine>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
-
- <!--
<repositories>
<repository>
<id>local-dependencies</id>
http://git-wip-us.apache.org/repos/asf/usergrid/blob/67ab2443/stack/rest/pom.xml
----------------------------------------------------------------------
diff --cc stack/rest/pom.xml
index d70cdd8,7b1bad6..601ed61
--- a/stack/rest/pom.xml
+++ b/stack/rest/pom.xml
@@@ -395,6 -400,24 +395,16 @@@
<artifactId>usergrid-java-client</artifactId>
<scope>test</scope>
</dependency>
-
- <dependency>
- <groupId>org.apache.usergrid</groupId>
- <artifactId>usergrid-services</artifactId>
- <version>2.1.0-SNAPSHOT</version>
- <scope>test</scope>
- <classifier>tests</classifier>
- </dependency>
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <version>3.1</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey.contribs</groupId>
+ <artifactId>jersey-apache-client</artifactId>
+ <version>1.19</version>
+ </dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/usergrid/blob/67ab2443/stack/services/pom.xml
----------------------------------------------------------------------
diff --cc stack/services/pom.xml
index 0c66ccf,a37e6ee..9837e76
--- a/stack/services/pom.xml
+++ b/stack/services/pom.xml
@@@ -455,47 -439,7 +456,29 @@@
<dependency>
<groupId>com.github.fernandospr</groupId>
<artifactId>java-wns</artifactId>
- <version>1.3</version>
- <exclusions>
- <exclusion>
- <artifactId>jackson-jaxrs</artifactId>
- <groupId>org.codehaus.jackson</groupId>
- </exclusion>
- <!-- Would be nice if we could exclude this dependency on Jersey 1.
- Apparently Java-WNS 1.3.1 will move to Jersey 2.
- <exclusion>
- <artifactId>jersey-apache-client</artifactId>
- <groupId>com.sun.jersey.contribs</groupId>
- </exclusion>
- <exclusion>
- <artifactId>jersey-client</artifactId>
- <groupId>com.sun.jersey</groupId>
- </exclusion>
- -->
- </exclusions>
+ <version>1.2-USERGRID</version>
</dependency>
-
</dependencies>
+
+ <!--
+ Need jacoco profile here because we override the parent's surefire plugin settings above.
+ -->
+ <profiles>
+ <profile>
+ <id>jacoco</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>${surefire.plugin.version}</version>
+ <configuration>
+ <argLine>-Dtest.barrier.timestamp=${maven.build.timestamp} -Dtest.clean.storage=true -Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline} -javaagent:${settings.localRepository}/org/jacoco/org.jacoco.agent/${jacoco.version}/org.jacoco.agent-${jacoco.version}-runtime.jar=destfile=${project.build.directory}/jacoco.exec</argLine>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
</project>
[13/32] usergrid git commit: Changes log level so we can catch repair
in the logs at default info level
Posted by sf...@apache.org.
Changes log level so we can catch repair in the logs at default info level
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/6dfa2e29
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/6dfa2e29
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/6dfa2e29
Branch: refs/heads/master
Commit: 6dfa2e2903e30dfbbaa9f5a9c0e1465588f56718
Parents: 94579c7
Author: Todd Nine <tn...@apigee.com>
Authored: Thu Nov 5 15:56:39 2015 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Thu Nov 5 15:56:39 2015 -0700
----------------------------------------------------------------------
.../pipeline/read/traverse/AbstractReadGraphFilter.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/6dfa2e29/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/traverse/AbstractReadGraphFilter.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/traverse/AbstractReadGraphFilter.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/traverse/AbstractReadGraphFilter.java
index 78a3450..862a80e 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/traverse/AbstractReadGraphFilter.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/pipeline/read/traverse/AbstractReadGraphFilter.java
@@ -120,7 +120,7 @@ public abstract class AbstractReadGraphFilter extends AbstractPathFilter<Id, Id,
if (isDeleted) {
- logger.trace("Edge {} is deleted, deleting the edge", markedEdge);
+ logger.info("Edge {} is deleted when seeking, deleting the edge", markedEdge);
final Observable<IndexOperationMessage> indexMessageObservable = eventBuilder.buildDeleteEdge(applicationScope, markedEdge);
indexMessageObservable
@@ -133,7 +133,7 @@ public abstract class AbstractReadGraphFilter extends AbstractPathFilter<Id, Id,
if (isSourceNodeDeleted) {
final Id sourceNodeId = markedEdge.getSourceNode();
- logger.trace("Edge {} has a deleted source node, deleting the entity for id {}", markedEdge, sourceNodeId);
+ logger.info("Edge {} has a deleted source node, deleting the entity for id {}", markedEdge, sourceNodeId);
final EventBuilderImpl.EntityDeleteResults
entityDeleteResults = eventBuilder.buildEntityDelete(applicationScope, sourceNodeId);
@@ -153,7 +153,7 @@ public abstract class AbstractReadGraphFilter extends AbstractPathFilter<Id, Id,
if (isTargetNodeDelete) {
final Id targetNodeId = markedEdge.getTargetNode();
- logger.trace("Edge {} has a deleted target node, deleting the entity for id {}", markedEdge, targetNodeId);
+ logger.info("Edge {} has a deleted target node, deleting the entity for id {}", markedEdge, targetNodeId);
final EventBuilderImpl.EntityDeleteResults
entityDeleteResults = eventBuilder.buildEntityDelete(applicationScope, targetNodeId);
[29/32] usergrid git commit: Moving log message to trace as it occurs
a lot during normal runtime traffic.
Posted by sf...@apache.org.
Moving log message to trace as it occurs a lot during normal runtime traffic.
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/79452099
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/79452099
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/79452099
Branch: refs/heads/master
Commit: 79452099b809627f06efb63902b50688a18e27eb
Parents: e3d1f3b
Author: Michael Russo <mi...@gmail.com>
Authored: Wed Nov 11 08:23:22 2015 -0800
Committer: Michael Russo <mi...@gmail.com>
Committed: Wed Nov 11 08:23:22 2015 -0800
----------------------------------------------------------------------
.../serialization/impl/shard/impl/NodeShardAllocationImpl.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/79452099/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardAllocationImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardAllocationImpl.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardAllocationImpl.java
index 8943737..a849029 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardAllocationImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardAllocationImpl.java
@@ -226,7 +226,7 @@ public class NodeShardAllocationImpl implements NodeShardAllocation {
* Sanity check in case we audit before we have a full shard
*/
if ( marked == null ) {
- LOG.info( "Shard {} in shard group {} not full, not splitting", shardEntryGroup );
+ LOG.trace( "Shard {} in shard group {} not full, not splitting", shardEntryGroup );
return false;
}
[17/32] usergrid git commit: Changes cache options to be more
sensible defaults
Posted by sf...@apache.org.
Changes cache options to be more sensible defaults
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/39ccdb19
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/39ccdb19
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/39ccdb19
Branch: refs/heads/master
Commit: 39ccdb191845a58b82de2cd001a62bb2e37c12be
Parents: 67c0bfa
Author: Todd Nine <tn...@apigee.com>
Authored: Fri Nov 6 14:01:21 2015 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Fri Nov 6 14:01:21 2015 -0700
----------------------------------------------------------------------
.../graph/serialization/impl/shard/ShardedEdgeSerialization.java | 2 +-
.../impl/shard/impl/SizebasedEdgeColumnFamilies.java | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/39ccdb19/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardedEdgeSerialization.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardedEdgeSerialization.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardedEdgeSerialization.java
index 51fdf0c..45d8a47 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardedEdgeSerialization.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/ShardedEdgeSerialization.java
@@ -122,7 +122,7 @@ public interface ShardedEdgeSerialization {
* @param markedEdge The edge to write
* @param timestamp The timestamp to use
*/
- MutationBatch deleteEdgeVersions( EdgeColumnFamilies columnFamilies, ApplicationScope scope, MarkedEdge markedEdge,
+ MutationBatch deleteEdgeVersions( EdgeColumnFamilies columnFamilies, ApplicationScope scope, MarkedEdge markedEdge,
Collection<Shard> shards, DirectedEdgeMeta sourceEdgeMeta, UUID timestamp );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/39ccdb19/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/SizebasedEdgeColumnFamilies.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/SizebasedEdgeColumnFamilies.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/SizebasedEdgeColumnFamilies.java
index 8f16448..f163ecd 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/SizebasedEdgeColumnFamilies.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/SizebasedEdgeColumnFamilies.java
@@ -140,7 +140,7 @@ public class SizebasedEdgeColumnFamilies implements EdgeColumnFamilies {
graphCf( TARGET_NODE_SOURCE_TYPE ),
new MultiTennantColumnFamilyDefinition( EDGE_VERSIONS, BytesType.class.getSimpleName(),
ColumnTypes.LONG_TYPE_REVERSED, BytesType.class.getSimpleName(),
- MultiTennantColumnFamilyDefinition.CacheOption.KEYS ) );
+ MultiTennantColumnFamilyDefinition.CacheOption.ALL ) );
}
@@ -149,6 +149,6 @@ public class SizebasedEdgeColumnFamilies implements EdgeColumnFamilies {
*/
private MultiTennantColumnFamilyDefinition graphCf( MultiTennantColumnFamily cf ) {
return new MultiTennantColumnFamilyDefinition( cf, BytesType.class.getSimpleName(), EDGE_DYNAMIC_COMPOSITE_TYPE,
- BytesType.class.getSimpleName(), MultiTennantColumnFamilyDefinition.CacheOption.KEYS );
+ BytesType.class.getSimpleName(), MultiTennantColumnFamilyDefinition.CacheOption.ALL );
}
}
[09/32] usergrid git commit: add wns constructor test
Posted by sf...@apache.org.
add wns constructor test
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/5a39c05c
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/5a39c05c
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/5a39c05c
Branch: refs/heads/master
Commit: 5a39c05c9109cd0431d851e4498bfd51d373dfda
Parents: 70b7e27
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Nov 5 14:33:04 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Nov 5 14:33:04 2015 -0700
----------------------------------------------------------------------
stack/services/pom.xml | 6 +++
.../notifications/wns/WNSAdapterTest.java | 49 ++++++++++++++++++++
2 files changed, 55 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/5a39c05c/stack/services/pom.xml
----------------------------------------------------------------------
diff --git a/stack/services/pom.xml b/stack/services/pom.xml
index 0be2bcf..d1ec212 100644
--- a/stack/services/pom.xml
+++ b/stack/services/pom.xml
@@ -438,6 +438,12 @@
<groupId>com.github.fernandospr</groupId>
<artifactId>java-wns</artifactId>
<version>1.3</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>jackson-jaxrs</artifactId>
+ <groupId>org.codehaus.jackson</groupId>
+ </exclusion>
+ </exclusions>
</dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/usergrid/blob/5a39c05c/stack/services/src/test/java/org/apache/usergrid/services/notifications/wns/WNSAdapterTest.java
----------------------------------------------------------------------
diff --git a/stack/services/src/test/java/org/apache/usergrid/services/notifications/wns/WNSAdapterTest.java b/stack/services/src/test/java/org/apache/usergrid/services/notifications/wns/WNSAdapterTest.java
new file mode 100644
index 0000000..aa60e84
--- /dev/null
+++ b/stack/services/src/test/java/org/apache/usergrid/services/notifications/wns/WNSAdapterTest.java
@@ -0,0 +1,49 @@
+/*
+ *
+ * * 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.services.notifications.wns;
+
+import org.apache.usergrid.corepersistence.util.CpNamingUtils;
+import org.apache.usergrid.management.OrganizationInfo;
+import org.apache.usergrid.management.OrganizationOwnerInfo;
+import org.apache.usergrid.persistence.EntityManager;
+import org.apache.usergrid.persistence.entities.Notifier;
+import org.apache.usergrid.services.AbstractServiceIT;
+import org.junit.Test;
+
+import java.util.UUID;
+
+/**
+ * Classy class class.
+ */
+public class WNSAdapterTest extends AbstractServiceIT{
+ @Test
+ public void windows() throws Exception {
+
+
+ EntityManager em = setup.getEmf().getEntityManager(app.getId());
+
+ Notifier notifier = new Notifier();
+ notifier.setLogging(true);
+ notifier.setSid("ms-app://s-1-15-2-2411381248-444863693-3819932088-4077691928-1194867744-112853457-373132695");
+ notifier.setApiKey("QAHlxzMXhg5eP5q9bf/W3komtUXegf7B");
+ WNSAdapter adapter = new WNSAdapter(em, notifier);
+ adapter.testConnection();
+ }
+}
[25/32] usergrid git commit: forked wns
Posted by sf...@apache.org.
forked wns
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/5222b9a0
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/5222b9a0
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/5222b9a0
Branch: refs/heads/master
Commit: 5222b9a046d28e832397dfb3f9ebff6eb77c6bd0
Parents: 32f805a
Author: Shawn Feldman <sf...@apache.org>
Authored: Mon Nov 9 11:22:51 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Mon Nov 9 11:22:51 2015 -0700
----------------------------------------------------------------------
stack/services/pom.xml | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/5222b9a0/stack/services/pom.xml
----------------------------------------------------------------------
diff --git a/stack/services/pom.xml b/stack/services/pom.xml
index 853596e..a37e6ee 100644
--- a/stack/services/pom.xml
+++ b/stack/services/pom.xml
@@ -435,6 +435,7 @@
<version>2.7.0</version>
</dependency>
<!-- fork: https://github.com/apigee/java-wns/tree/1.2-USERGRID -->
+ <!-- forked to eliminate jackson dependency issues -->
<dependency>
<groupId>com.github.fernandospr</groupId>
<artifactId>java-wns</artifactId>
[19/32] usergrid git commit: Ignore failing test that's not critical
to Usergrid. Fails intermittently.
Posted by sf...@apache.org.
Ignore failing test that's not critical to Usergrid. Fails intermittently.
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/ad07e2bb
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/ad07e2bb
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/ad07e2bb
Branch: refs/heads/master
Commit: ad07e2bb1ae14348b83f3b9aa6a3c81a484bdd4f
Parents: 5ef62bb
Author: Michael Russo <mi...@gmail.com>
Authored: Fri Nov 6 13:57:26 2015 -0800
Committer: Michael Russo <mi...@gmail.com>
Committed: Fri Nov 6 13:57:26 2015 -0800
----------------------------------------------------------------------
.../test/java/org/apache/usergrid/corepersistence/index/RxTest.java | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/ad07e2bb/stack/core/src/test/java/org/apache/usergrid/corepersistence/index/RxTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/corepersistence/index/RxTest.java b/stack/core/src/test/java/org/apache/usergrid/corepersistence/index/RxTest.java
index a0e9118..e36c8ae 100644
--- a/stack/core/src/test/java/org/apache/usergrid/corepersistence/index/RxTest.java
+++ b/stack/core/src/test/java/org/apache/usergrid/corepersistence/index/RxTest.java
@@ -41,6 +41,7 @@ import static org.junit.Assert.assertTrue;
public class RxTest {
@Test
+ @Ignore("This fails intermittently. Possible race condition with Rx. Need to investigate more.")
public void testPublish() throws InterruptedException {
final int count = 10;
[26/32] usergrid git commit: fix queue manager impl
Posted by sf...@apache.org.
fix queue manager impl
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/9fd657b8
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/9fd657b8
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/9fd657b8
Branch: refs/heads/master
Commit: 9fd657b84ee86af50ee207e2b5d60054964c30e0
Parents: 5222b9a
Author: Shawn Feldman <sf...@apache.org>
Authored: Mon Nov 9 14:14:28 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Mon Nov 9 14:14:28 2015 -0700
----------------------------------------------------------------------
.../persistence/queue/DefaultQueueManager.java | 61 +++++++++++++-------
1 file changed, 40 insertions(+), 21 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/9fd657b8/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/DefaultQueueManager.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/DefaultQueueManager.java b/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/DefaultQueueManager.java
index 5201279..c3b5917 100644
--- a/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/DefaultQueueManager.java
+++ b/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/DefaultQueueManager.java
@@ -1,3 +1,4 @@
+
/*
*
* * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -18,33 +19,43 @@
*
*/
-package org.apache.usergrid.persistence.queue;
+ package org.apache.usergrid.persistence.queue;
-import rx.Observable;
+ import rx.Observable;
-import java.io.IOException;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.UUID;
-import java.util.concurrent.ArrayBlockingQueue;
+ import java.io.IOException;
+ import java.util.AbstractQueue;
+ import java.io.Serializable;
+ import java.util.ArrayList;
+ import java.util.List;
+ import java.util.UUID;
+ import java.util.concurrent.ArrayBlockingQueue;
+ import java.util.concurrent.LinkedBlockingQueue;
+ import java.util.concurrent.PriorityBlockingQueue;
+ import java.util.concurrent.TimeUnit;
/**
* Default queue manager implementation, uses in memory linked queue
*/
public class DefaultQueueManager implements QueueManager {
public ArrayBlockingQueue<QueueMessage> queue = new ArrayBlockingQueue<>(10000);
+
@Override
- public synchronized Observable<QueueMessage> getMessages(int limit, int transactionTimeout, int waitTime, Class klass) {
+ public Observable<QueueMessage> getMessages(int limit, int transactionTimeout, int waitTime, Class klass) {
List<QueueMessage> returnQueue = new ArrayList<>();
- for(int i=0;i<limit;i++){
- if(!queue.isEmpty()){
- returnQueue.add( queue.remove());
- }else{
- break;
- }
+ try {
+ QueueMessage message=null;
+ int count = 5;
+ do {
+ message = queue.poll(100, TimeUnit.MILLISECONDS);
+ if (message != null) {
+ returnQueue.add(message);
+ }
+ }while(message!=null && count-->0);
+ }catch (InterruptedException ie){
+ throw new RuntimeException(ie);
}
- return Observable.from( returnQueue);
+ return rx.Observable.from(returnQueue);
}
@Override
@@ -61,10 +72,14 @@ public class DefaultQueueManager implements QueueManager {
}
@Override
- public synchronized void sendMessages(List bodies) throws IOException {
+ public void sendMessages(List bodies) throws IOException {
for(Object body : bodies){
String uuid = UUID.randomUUID().toString();
- queue.add(new QueueMessage(uuid,"handle_"+uuid,body,"putappriate type here"));
+ try {
+ queue.put(new QueueMessage(uuid, "handle_" + uuid, body, "put type here"));
+ }catch (InterruptedException ie){
+ throw new RuntimeException(ie);
+ }
}
}
@@ -72,14 +87,18 @@ public class DefaultQueueManager implements QueueManager {
@Override
public <T extends Serializable> void sendMessage( final T body ) throws IOException {
String uuid = UUID.randomUUID().toString();
- queue.add(new QueueMessage(uuid,"handle_"+uuid,body,"put type here"));
-
+ try {
+ queue.offer(new QueueMessage(uuid, "handle_" + uuid, body, "put type here"),5000,TimeUnit.MILLISECONDS);
+ }catch (InterruptedException ie){
+ throw new RuntimeException(ie);
+ }
}
+
@Override
public <T extends Serializable> void sendMessageToTopic( final T body ) throws IOException {
- sendMessage( body );
+ sendMessage( body );
}
[04/32] usergrid git commit: remove exclusion
Posted by sf...@apache.org.
remove exclusion
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/70b7e275
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/70b7e275
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/70b7e275
Branch: refs/heads/master
Commit: 70b7e27504690895d53053b9e247edf4614beedb
Parents: dfc70f4
Author: Shawn Feldman <sf...@apache.org>
Authored: Wed Nov 4 12:45:12 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Wed Nov 4 12:45:12 2015 -0700
----------------------------------------------------------------------
stack/services/pom.xml | 6 ------
1 file changed, 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/70b7e275/stack/services/pom.xml
----------------------------------------------------------------------
diff --git a/stack/services/pom.xml b/stack/services/pom.xml
index d1ec212..0be2bcf 100644
--- a/stack/services/pom.xml
+++ b/stack/services/pom.xml
@@ -438,12 +438,6 @@
<groupId>com.github.fernandospr</groupId>
<artifactId>java-wns</artifactId>
<version>1.3</version>
- <exclusions>
- <exclusion>
- <artifactId>jackson-jaxrs</artifactId>
- <groupId>org.codehaus.jackson</groupId>
- </exclusion>
- </exclusions>
</dependency>
</dependencies>
[06/32] usergrid git commit: Merge commit 'refs/pull/427/head' of
apache.github.com:apache/usergrid into 2.1-release
Posted by sf...@apache.org.
Merge commit 'refs/pull/427/head' of apache.github.com:apache/usergrid into 2.1-release
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/8da60e2a
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/8da60e2a
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/8da60e2a
Branch: refs/heads/master
Commit: 8da60e2aa745a1f897bebbe4773438e6339637df
Parents: 70b7e27 9135447
Author: Mike Dunker <md...@apigee.com>
Authored: Wed Nov 4 14:12:39 2015 -0800
Committer: Mike Dunker <md...@apigee.com>
Committed: Wed Nov 4 14:12:39 2015 -0800
----------------------------------------------------------------------
.../corepersistence/asyncevents/AmazonAsyncEventService.java | 8 +++++---
.../pipeline/read/traverse/AbstractReadGraphFilter.java | 2 +-
.../persistence/index/impl/IndexOperationMessage.java | 4 ++--
3 files changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
[11/32] usergrid git commit: Removes approximation logic on shards to
ensure that we're auditing the actual shard value.
Posted by sf...@apache.org.
Removes approximation logic on shards to ensure that we're auditing the actual shard value.
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/591a2f1f
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/591a2f1f
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/591a2f1f
Branch: refs/heads/master
Commit: 591a2f1fd97b7259cf72d10855f2832b8342b5a4
Parents: 9c54de3
Author: Todd Nine <tn...@apigee.com>
Authored: Thu Nov 5 14:37:39 2015 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Thu Nov 5 14:40:08 2015 -0700
----------------------------------------------------------------------
.../persistence/graph/guice/GraphModule.java | 7 -
.../impl/shard/EdgeShardStrategy.java | 10 +-
.../impl/shard/NodeShardApproximation.java | 66 --
.../serialization/impl/shard/count/Counter.java | 131 ----
.../shard/count/NodeShardApproximationImpl.java | 272 --------
.../count/NodeShardCounterSerialization.java | 48 --
.../NodeShardCounterSerializationImpl.java | 186 ------
.../impl/shard/count/ShardKey.java | 75 ---
.../shard/impl/NodeShardAllocationImpl.java | 19 +-
.../impl/shard/impl/ShardGroupDeletionImpl.java | 7 +
.../impl/ShardedEdgeSerializationImpl.java | 28 -
.../shard/impl/SizebasedEdgeShardStrategy.java | 13 +-
.../graph/GraphManagerShardingIT.java | 208 ------
.../impl/shard/NodeShardAllocationTest.java | 48 +-
.../shard/count/NodeShardApproximationTest.java | 627 -------------------
.../NodeShardCounterSerializationTest.java | 124 ----
.../shard/impl/ShardGroupDeletionImplTest.java | 3 +
17 files changed, 25 insertions(+), 1847 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/591a2f1f/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/guice/GraphModule.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/guice/GraphModule.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/guice/GraphModule.java
index d2476eb..cf0ffcb 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/guice/GraphModule.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/guice/GraphModule.java
@@ -59,14 +59,10 @@ import org.apache.usergrid.persistence.graph.serialization.impl.shard.EdgeColumn
import org.apache.usergrid.persistence.graph.serialization.impl.shard.EdgeShardSerialization;
import org.apache.usergrid.persistence.graph.serialization.impl.shard.EdgeShardStrategy;
import org.apache.usergrid.persistence.graph.serialization.impl.shard.NodeShardAllocation;
-import org.apache.usergrid.persistence.graph.serialization.impl.shard.NodeShardApproximation;
import org.apache.usergrid.persistence.graph.serialization.impl.shard.NodeShardCache;
import org.apache.usergrid.persistence.graph.serialization.impl.shard.ShardGroupCompaction;
import org.apache.usergrid.persistence.graph.serialization.impl.shard.ShardGroupDeletion;
import org.apache.usergrid.persistence.graph.serialization.impl.shard.ShardedEdgeSerialization;
-import org.apache.usergrid.persistence.graph.serialization.impl.shard.count.NodeShardApproximationImpl;
-import org.apache.usergrid.persistence.graph.serialization.impl.shard.count.NodeShardCounterSerialization;
-import org.apache.usergrid.persistence.graph.serialization.impl.shard.count.NodeShardCounterSerializationImpl;
import org.apache.usergrid.persistence.graph.serialization.impl.shard.impl.AsyncTaskExecutorImpl;
import org.apache.usergrid.persistence.graph.serialization.impl.shard.impl.EdgeShardSerializationImpl;
import org.apache.usergrid.persistence.graph.serialization.impl.shard.impl.NodeShardAllocationImpl;
@@ -114,9 +110,7 @@ public abstract class GraphModule extends AbstractModule {
*/
bind(NodeShardAllocation.class).to( NodeShardAllocationImpl.class );
- bind( NodeShardApproximation.class ).to( NodeShardApproximationImpl.class );
bind( NodeShardCache.class ).to( NodeShardCacheImpl.class );
- bind( NodeShardCounterSerialization.class ).to( NodeShardCounterSerializationImpl.class );
/**
* Binding for task tracker
@@ -182,7 +176,6 @@ public abstract class GraphModule extends AbstractModule {
migrationBinding.addBinding().to( Key.get( EdgeColumnFamilies.class ) );
migrationBinding.addBinding().to( Key.get( EdgeShardSerialization.class ) );
- migrationBinding.addBinding().to( Key.get( NodeShardCounterSerialization.class ) );
//Get the old version and the new one
migrationBinding.addBinding().to( Key.get( EdgeMetadataSerializationV1Impl.class) );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/591a2f1f/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/EdgeShardStrategy.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/EdgeShardStrategy.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/EdgeShardStrategy.java
index 1e02a72..803e31e 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/EdgeShardStrategy.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/EdgeShardStrategy.java
@@ -44,15 +44,7 @@ public interface EdgeShardStrategy {
*/
public Iterator<ShardEntryGroup> getReadShards(final ApplicationScope scope, final long maxTimestamp, final DirectedEdgeMeta directedEdgeMeta );
- /**
- * Increment our count meta data by the passed value. Can be a positive or a negative number.
- * @param scope The scope in the application
- * @param shard The shard to use
- * @param count The amount to increment or decrement
- * @param directedEdgeMeta The edge meta data to use
- * @return
- */
- public void increment(final ApplicationScope scope, Shard shard, long count, final DirectedEdgeMeta directedEdgeMeta );
+
http://git-wip-us.apache.org/repos/asf/usergrid/blob/591a2f1f/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/NodeShardApproximation.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/NodeShardApproximation.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/NodeShardApproximation.java
deleted file mode 100644
index fc39e56..0000000
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/NodeShardApproximation.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.usergrid.persistence.graph.serialization.impl.shard;
-
-
-import org.apache.usergrid.persistence.core.scope.ApplicationScope;
-
-
-/**
- * Interface for creating approximate estimates of shards
- */
-public interface NodeShardApproximation {
-
-
- /**
- * Increment the shard Id the specified amount
- *
- * @param scope The scope
- * @param shard The shard to use
- * @param count The count to increment
- * @param directedEdgeMeta The directed edge meta data to use
- */
- public void increment( final ApplicationScope scope, final Shard shard,
- final long count, final DirectedEdgeMeta directedEdgeMeta );
-
-
- /**
- * Get the approximation of the number of unique items
- *
- * @param scope The scope
- * @param directedEdgeMeta The directed edge meta data to use
- */
- public long getCount( final ApplicationScope scope, final Shard shard, final DirectedEdgeMeta directedEdgeMeta );
-
-
- /**
- * Flush the current counters in the Approximation. Will return immediately after the flush. You can then use flushPending
- * to check the state.
- */
- public void beginFlush();
-
- /**
- * Return true if there is data to be flushed
- * @return
- */
- public boolean flushPending();
-
-
-}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/591a2f1f/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/Counter.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/Counter.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/Counter.java
deleted file mode 100644
index f5666a2..0000000
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/Counter.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.usergrid.persistence.graph.serialization.impl.shard.count;
-
-
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.atomic.AtomicLong;
-
-import com.google.common.base.Preconditions;
-
-
-/**
- * This class is synchronized for addition. It is meant to be used across multiple threads
- */
-public class Counter {
- /**
- * The counter to tell us how often it was invoked
- */
- private final AtomicLong invokeCounter;
-
- /**
- * Pointer to our "current" counter map. We beginFlush this when time expires or we hit our count
- */
- private final ConcurrentHashMap<ShardKey, AtomicLong> counts;
-
- /**
- * The timestamp the concurrent map was created
- */
- private final long createTimestamp;
-
-
- /**
- * Implementation of the internal counters
- */
- public Counter() {
- this.createTimestamp = System.currentTimeMillis();
- this.invokeCounter = new AtomicLong();
- this.counts = new ConcurrentHashMap<>();
- }
-
-
- /**
- * Add the count to the key.
- */
- public void add( final ShardKey key, final long count ) {
- AtomicLong counter = counts.get( key );
-
- if ( counter == null ) {
- counter = new AtomicLong();
- AtomicLong existingCounter = counts.putIfAbsent( key, counter );
-
- if ( existingCounter != null ) {
- counter = existingCounter;
- }
- }
-
- counter.addAndGet( count );
- invokeCounter.incrementAndGet();
- }
-
-
- /**
- * Get the current valye from the cache
- */
- public long get( final ShardKey key ) {
- AtomicLong counter = counts.get( key );
-
- if ( counter == null ) {
- return 0;
- }
-
- return counter.get();
- }
-
-
- /**
- * Deep copy the counts from other into this counter
- * @param other
- */
- public void merge(final Counter other){
-
- Preconditions.checkNotNull(other, "other cannot be null");
- Preconditions.checkNotNull( other.counts, "other.counts cannot be null" );
-
- for(Map.Entry<ShardKey, AtomicLong> entry: other.counts.entrySet()){
- add(entry.getKey(), entry.getValue().get());
- }
- }
-
-
- /**
- * Get all entries
- * @return
- */
- public Set<Map.Entry<ShardKey, AtomicLong>> getEntries(){
- return counts.entrySet();
- }
-
-
- /**
- * Get the count of the number of times we've been incremented
- * @return
- */
- public long getInvokeCount() {
- return invokeCounter.get();
- }
-
-
-
- public long getCreateTimestamp() {
- return createTimestamp;
- }
-}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/591a2f1f/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardApproximationImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardApproximationImpl.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardApproximationImpl.java
deleted file mode 100644
index fceb32c..0000000
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardApproximationImpl.java
+++ /dev/null
@@ -1,272 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.usergrid.persistence.graph.serialization.impl.shard.count;
-
-
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.locks.ReentrantReadWriteLock;
-
-import javax.inject.Inject;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.usergrid.persistence.core.consistency.TimeService;
-import org.apache.usergrid.persistence.core.scope.ApplicationScope;
-import org.apache.usergrid.persistence.graph.GraphFig;
-import org.apache.usergrid.persistence.graph.serialization.impl.shard.DirectedEdgeMeta;
-import org.apache.usergrid.persistence.graph.serialization.impl.shard.NodeShardApproximation;
-import org.apache.usergrid.persistence.graph.serialization.impl.shard.Shard;
-
-import com.netflix.astyanax.MutationBatch;
-import com.netflix.hystrix.HystrixCommand;
-import com.netflix.hystrix.HystrixCommandGroupKey;
-import com.netflix.hystrix.HystrixThreadPoolProperties;
-
-import rx.functions.Action0;
-import rx.schedulers.Schedulers;
-
-
-/**
- * Implementation for doing edge approximation based on counters. Uses a guava loading cache to load values from
- * cassandra, and beginFlush them on cache eviction.
- */
-public class NodeShardApproximationImpl implements NodeShardApproximation {
-
- private static final Logger LOG = LoggerFactory.getLogger(NodeShardApproximationImpl.class);
-
- /**
- * Read write locks to ensure we atomically swap correctly
- */
- private final ReentrantReadWriteLock reentrantReadWriteLock = new ReentrantReadWriteLock();
- private final ReentrantReadWriteLock.ReadLock readLock = reentrantReadWriteLock.readLock();
- private final ReentrantReadWriteLock.WriteLock writeLockLock = reentrantReadWriteLock.writeLock();
-
- private final GraphFig graphFig;
- private final NodeShardCounterSerialization nodeShardCounterSerialization;
- private final TimeService timeService;
-
- /**
- * Counter currently implemented
- */
- private volatile Counter currentCounter;
-
- /**
- * The counter that is currently in process of flushing to Cassandra. Can be null
- */
- private final BlockingQueue<Counter> flushQueue;
-
- private final FlushWorker worker;
-
- /**
- * Command group used for realtime user commands
- */
- public static final HystrixCommand.Setter
- COUNT_GROUP = HystrixCommand.Setter.withGroupKey(
- HystrixCommandGroupKey.Factory.asKey( "BatchCounterRollup" ) ).andThreadPoolPropertiesDefaults(
- HystrixThreadPoolProperties.Setter().withCoreSize( 100 ) );
-
-
- /**
- * Create a time shard approximation with the correct configuration.
- */
- @Inject
- public NodeShardApproximationImpl( final GraphFig graphFig,
- final NodeShardCounterSerialization nodeShardCounterSerialization,
- final TimeService timeService ) {
- this.graphFig = graphFig;
- this.nodeShardCounterSerialization = nodeShardCounterSerialization;
- this.timeService = timeService;
- this.currentCounter = new Counter();
- this.flushQueue = new LinkedBlockingQueue<>( graphFig.getCounterFlushQueueSize() );
-
- this.worker = new FlushWorker( this.flushQueue, nodeShardCounterSerialization );
-
- Schedulers.newThread().createWorker().schedule( worker );
-
- }
-
-
- @Override
- public void increment(
- final ApplicationScope scope, final Shard shard,
- final long count, final DirectedEdgeMeta directedEdgeMeta ) {
-
-
- final ShardKey key = new ShardKey( scope, shard, directedEdgeMeta );
-
- readLock.lock();
-
-
- try {
- currentCounter.add( key, count );
- }
- finally {
- readLock.unlock();
- }
-
- checkFlush();
- }
-
-
- @Override
- public long getCount( final ApplicationScope scope, final Shard shard, final DirectedEdgeMeta directedEdgeMeta ) {
-
- final ShardKey key = new ShardKey( scope, shard, directedEdgeMeta );
-
-
- readLock.lock();
-
- long count;
-
- try {
- count = currentCounter.get( key );
-
- }
- finally {
- readLock.unlock();
- }
-
-
- //read from Cassandra and add to get a "close enough" number
- return count + nodeShardCounterSerialization.getCount( key );
- }
-
-
- @Override
- public void beginFlush() {
-
- writeLockLock.lock();
-
- try {
-
- final boolean queued = flushQueue.offer( currentCounter );
-
- /**
- * We were able to q the beginFlush, swap it
- */
- if ( queued ) {
- currentCounter = new Counter();
- }
- }
- finally {
- writeLockLock.unlock();
- }
- }
-
-
- @Override
- public boolean flushPending() {
- return flushQueue.size() > 0 || worker.isFlushing();
- }
-
-
- /**
- * Check if we need to beginFlush. If we do, perform the beginFlush
- */
- private void checkFlush() {
-
- //there's no beginFlush pending and we're past the timeout or count
- if ( currentCounter.getCreateTimestamp() + graphFig.getCounterFlushInterval() > timeService.getCurrentTime()
- || currentCounter.getInvokeCount() >= graphFig.getCounterFlushCount() ) {
- beginFlush();
- }
- }
-
-
- /**
- * Worker that will take from the queue
- */
- private static class FlushWorker implements Action0 {
-
- private final BlockingQueue<Counter> counterQueue;
- private final NodeShardCounterSerialization nodeShardCounterSerialization;
-
- private volatile Counter rollUp;
-
-
- private FlushWorker( final BlockingQueue<Counter> counterQueue,
- final NodeShardCounterSerialization nodeShardCounterSerialization ) {
- this.counterQueue = counterQueue;
- this.nodeShardCounterSerialization = nodeShardCounterSerialization;
- }
-
-
- @Override
- public void call() {
-
-
- while ( true ) {
- /**
- * Block taking the first element. Once we take this, batch drain and roll up the rest
- */
-
- try {
- rollUp = null;
- rollUp = counterQueue.take();
- }
- catch ( InterruptedException e ) {
- LOG.error( "Unable to read from counter queue", e );
- throw new RuntimeException( "Unable to read from counter queue", e );
-
- }
-
-
-
-
- //copy to the batch outside of the command for performance
- final MutationBatch batch = nodeShardCounterSerialization.flush( rollUp );
-
- /**
- * Execute the command in hystrix to avoid slamming cassandra
- */
- new HystrixCommand( COUNT_GROUP ) {
-
- @Override
- protected Void run() throws Exception {
- batch.execute();
-
- return null;
- }
-
-
- @Override
- protected Object getFallback() {
- //we've failed to mutate. Merge this count back into the current one
- counterQueue.offer( rollUp );
-
- return null;
- }
- }.execute();
- }
-
- }
-
-
- /**
- * Return true if we're in the process of flushing
- * @return
- */
- public boolean isFlushing(){
- return rollUp != null;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/591a2f1f/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardCounterSerialization.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardCounterSerialization.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardCounterSerialization.java
deleted file mode 100644
index aafbd26..0000000
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardCounterSerialization.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.usergrid.persistence.graph.serialization.impl.shard.count;
-
-
-import org.apache.usergrid.persistence.core.migration.schema.Migration;
-
-import com.netflix.astyanax.MutationBatch;
-
-
-/**
- * Serialization for flushing and reading counters
- */
-public interface NodeShardCounterSerialization extends Migration {
-
-
- /**
- * Flush the counter to the mutation batch
- * @param counter
- * @return
- */
- public MutationBatch flush(Counter counter);
-
-
- /**
- * Get the count of this shard, if it exists.
- * @param key The shard key to get
- * @return
- */
- public long getCount(ShardKey key);
-
-}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/591a2f1f/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardCounterSerializationImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardCounterSerializationImpl.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardCounterSerializationImpl.java
deleted file mode 100644
index 6934275..0000000
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardCounterSerializationImpl.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.usergrid.persistence.graph.serialization.impl.shard.count;
-
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicLong;
-
-import org.apache.cassandra.db.marshal.BytesType;
-import org.apache.cassandra.db.marshal.CounterColumnType;
-
-import org.apache.usergrid.persistence.core.astyanax.CassandraConfig;
-import org.apache.usergrid.persistence.core.astyanax.ColumnTypes;
-import org.apache.usergrid.persistence.core.astyanax.CompositeFieldSerializer;
-import org.apache.usergrid.persistence.core.astyanax.IdRowCompositeSerializer;
-import org.apache.usergrid.persistence.core.astyanax.MultiTennantColumnFamily;
-import org.apache.usergrid.persistence.core.astyanax.MultiTennantColumnFamilyDefinition;
-import org.apache.usergrid.persistence.core.astyanax.ScopedRowKey;
-import org.apache.usergrid.persistence.core.astyanax.ScopedRowKeySerializer;
-import org.apache.usergrid.persistence.core.scope.ApplicationScope;
-import org.apache.usergrid.persistence.core.scope.ApplicationScopeImpl;
-import org.apache.usergrid.persistence.graph.GraphFig;
-import org.apache.usergrid.persistence.graph.serialization.impl.shard.DirectedEdgeMeta;
-import org.apache.usergrid.persistence.graph.serialization.impl.shard.Shard;
-import org.apache.usergrid.persistence.graph.serialization.impl.shard.impl.serialize.EdgeShardRowKeySerializer;
-import org.apache.usergrid.persistence.model.entity.Id;
-
-import com.google.common.base.Preconditions;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import com.netflix.astyanax.Keyspace;
-import com.netflix.astyanax.MutationBatch;
-import com.netflix.astyanax.connectionpool.OperationResult;
-import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
-import com.netflix.astyanax.connectionpool.exceptions.NotFoundException;
-import com.netflix.astyanax.model.Column;
-import com.netflix.astyanax.model.CompositeBuilder;
-import com.netflix.astyanax.model.CompositeParser;
-import com.netflix.astyanax.serializers.BooleanSerializer;
-
-
-@Singleton
-public class NodeShardCounterSerializationImpl implements NodeShardCounterSerialization {
-
-
- private static final ShardKeySerializer SHARD_KEY_SERIALIZER = new ShardKeySerializer();
-
- /**
- * Edge shards
- */
- private static final MultiTennantColumnFamily<ScopedRowKey<ShardKey>, Boolean> EDGE_SHARD_COUNTS =
- new MultiTennantColumnFamily<>( "Edge_Shard_Counts",
- new ScopedRowKeySerializer<>( SHARD_KEY_SERIALIZER ), BooleanSerializer.get() );
-
-
- protected final Keyspace keyspace;
- protected final CassandraConfig cassandraConfig;
- protected final GraphFig graphFig;
-
-
- @Inject
- public NodeShardCounterSerializationImpl( final Keyspace keyspace, final CassandraConfig cassandraConfig,
- final GraphFig graphFig ) {
- this.keyspace = keyspace;
- this.cassandraConfig = cassandraConfig;
- this.graphFig = graphFig;
- }
-
-
- @Override
- public MutationBatch flush( final Counter counter ) {
-
-
- Preconditions.checkNotNull( counter, "counter must be specified" );
-
-
- final MutationBatch batch = keyspace.prepareMutationBatch();
-
- for ( Map.Entry<ShardKey, AtomicLong> entry : counter.getEntries() ) {
-
- final ShardKey key = entry.getKey();
- final long value = entry.getValue().get();
-
-
- final ScopedRowKey rowKey = ScopedRowKey.fromKey( key.scope.getApplication(), key );
-
-
- batch.withRow( EDGE_SHARD_COUNTS, rowKey ).incrementCounterColumn(true , value );
- }
-
-
- return batch;
- }
-
-
- @Override
- public long getCount( final ShardKey key ) {
-
- final ScopedRowKey rowKey = ScopedRowKey.fromKey( key.scope.getApplication(), key );
-
-
- OperationResult<Column<Boolean>> column = null;
- try {
- column = keyspace.prepareQuery( EDGE_SHARD_COUNTS ).getKey( rowKey ).getColumn( true ).execute();
- }
- //column not found, return 0
- catch ( NotFoundException nfe ) {
- return 0;
- }
- catch ( ConnectionException e ) {
- throw new RuntimeException( "Unable to read from cassandra", e );
- }
-
- return column.getResult().getLongValue();
- }
-
-
- @Override
- public Collection<MultiTennantColumnFamilyDefinition> getColumnFamilies() {
- return Collections.singleton(
- new MultiTennantColumnFamilyDefinition( EDGE_SHARD_COUNTS, BytesType.class.getSimpleName(),
- ColumnTypes.BOOLEAN, CounterColumnType.class.getSimpleName(),
- MultiTennantColumnFamilyDefinition.CacheOption.ALL ) );
- }
-
-
-
- private static class ShardKeySerializer implements CompositeFieldSerializer<ShardKey> {
-
-
- private static final IdRowCompositeSerializer ID_SER = IdRowCompositeSerializer.get();
-
- private static final EdgeShardRowKeySerializer EDGE_SHARD_ROW_KEY_SERIALIZER = EdgeShardRowKeySerializer.INSTANCE;
-
-
- @Override
- public void toComposite( final CompositeBuilder builder, final ShardKey key ) {
-
- ID_SER.toComposite( builder, key.scope.getApplication() );
-
- EDGE_SHARD_ROW_KEY_SERIALIZER.toComposite( builder, key.directedEdgeMeta );
-
- builder.addLong( key.shard.getShardIndex() );
-
- builder.addLong( key.shard.getCreatedTime() );
- }
-
-
- @Override
- public ShardKey fromComposite( final CompositeParser composite ) {
-
- final Id applicationId = ID_SER.fromComposite( composite );
-
- final ApplicationScope scope = new ApplicationScopeImpl( applicationId );
-
- final DirectedEdgeMeta directedEdgeMeta = EDGE_SHARD_ROW_KEY_SERIALIZER.fromComposite( composite );
-
- final long shardIndex = composite.readLong();
-
- final long shardCreatedTime = composite.readLong();
-
- return new ShardKey( scope, new Shard( shardIndex, shardCreatedTime, false ), directedEdgeMeta );
- }
-
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/591a2f1f/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/ShardKey.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/ShardKey.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/ShardKey.java
deleted file mode 100644
index c976210..0000000
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/ShardKey.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.usergrid.persistence.graph.serialization.impl.shard.count;
-
-
-import org.apache.usergrid.persistence.core.scope.ApplicationScope;
-import org.apache.usergrid.persistence.graph.serialization.impl.shard.DirectedEdgeMeta;
-import org.apache.usergrid.persistence.graph.serialization.impl.shard.Shard;
-
-
-/**
- * Key for shards and counts
- */
-public class ShardKey {
- public final ApplicationScope scope;
- public final Shard shard;
- public final DirectedEdgeMeta directedEdgeMeta;
-
-
- public ShardKey( final ApplicationScope scope, final Shard shard, final DirectedEdgeMeta directedEdgeMeta ) {
- this.scope = scope;
- this.shard = shard;
- this.directedEdgeMeta = directedEdgeMeta;
- }
-
-
- @Override
- public boolean equals( final Object o ) {
- if ( this == o ) {
- return true;
- }
- if ( o == null || getClass() != o.getClass() ) {
- return false;
- }
-
- final ShardKey shardKey = ( ShardKey ) o;
-
- if ( !directedEdgeMeta.equals( shardKey.directedEdgeMeta ) ) {
- return false;
- }
- if ( !scope.equals( shardKey.scope ) ) {
- return false;
- }
- if ( !shard.equals( shardKey.shard ) ) {
- return false;
- }
-
- return true;
- }
-
-
- @Override
- public int hashCode() {
- int result = scope.hashCode();
- result = 31 * result + shard.hashCode();
- result = 31 * result + directedEdgeMeta.hashCode();
- return result;
- }
-}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/591a2f1f/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardAllocationImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardAllocationImpl.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardAllocationImpl.java
index b0875af..8943737 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardAllocationImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/NodeShardAllocationImpl.java
@@ -37,7 +37,6 @@ import org.apache.usergrid.persistence.graph.serialization.impl.shard.DirectedEd
import org.apache.usergrid.persistence.graph.serialization.impl.shard.EdgeColumnFamilies;
import org.apache.usergrid.persistence.graph.serialization.impl.shard.EdgeShardSerialization;
import org.apache.usergrid.persistence.graph.serialization.impl.shard.NodeShardAllocation;
-import org.apache.usergrid.persistence.graph.serialization.impl.shard.NodeShardApproximation;
import org.apache.usergrid.persistence.graph.serialization.impl.shard.Shard;
import org.apache.usergrid.persistence.graph.serialization.impl.shard.ShardEntryGroup;
import org.apache.usergrid.persistence.graph.serialization.impl.shard.ShardGroupCompaction;
@@ -63,7 +62,6 @@ public class NodeShardAllocationImpl implements NodeShardAllocation {
private final EdgeShardSerialization edgeShardSerialization;
private final EdgeColumnFamilies edgeColumnFamilies;
private final ShardedEdgeSerialization shardedEdgeSerialization;
- private final NodeShardApproximation nodeShardApproximation;
private final TimeService timeService;
private final GraphFig graphFig;
private final ShardGroupCompaction shardGroupCompaction;
@@ -72,13 +70,11 @@ public class NodeShardAllocationImpl implements NodeShardAllocation {
@Inject
public NodeShardAllocationImpl( final EdgeShardSerialization edgeShardSerialization,
final EdgeColumnFamilies edgeColumnFamilies,
- final ShardedEdgeSerialization shardedEdgeSerialization,
- final NodeShardApproximation nodeShardApproximation, final TimeService timeService,
+ final ShardedEdgeSerialization shardedEdgeSerialization, final TimeService timeService,
final GraphFig graphFig, final ShardGroupCompaction shardGroupCompaction ) {
this.edgeShardSerialization = edgeShardSerialization;
this.edgeColumnFamilies = edgeColumnFamilies;
this.shardedEdgeSerialization = shardedEdgeSerialization;
- this.nodeShardApproximation = nodeShardApproximation;
this.timeService = timeService;
this.graphFig = graphFig;
this.shardGroupCompaction = shardGroupCompaction;
@@ -166,18 +162,11 @@ public class NodeShardAllocationImpl implements NodeShardAllocation {
* Check out if we have a count for our shard allocation
*/
- final long count = nodeShardApproximation.getCount( scope, shard, directedEdgeMeta );
+
final long shardSize = graphFig.getShardSize();
- if ( count < shardSize ) {
- return false;
- }
-
- if ( LOG.isDebugEnabled() ) {
- LOG.debug( "Count of {} has exceeded shard config of {} will begin compacting", count, shardSize );
- }
/**
* We want to allocate a new shard as close to the max value as possible. This way if we're filling up a
@@ -234,10 +223,10 @@ public class NodeShardAllocationImpl implements NodeShardAllocation {
/**
- * Sanity check in case our counters become severely out of sync with our edge state in cassandra.
+ * Sanity check in case we audit before we have a full shard
*/
if ( marked == null ) {
- LOG.warn( "Incorrect shard count for shard group {}", shardEntryGroup );
+ LOG.info( "Shard {} in shard group {} not full, not splitting", shardEntryGroup );
return false;
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/591a2f1f/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupDeletionImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupDeletionImpl.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupDeletionImpl.java
index 6d2a009..ea10ed5 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupDeletionImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardGroupDeletionImpl.java
@@ -167,6 +167,13 @@ public class ShardGroupDeletionImpl implements ShardGroupDeletion {
continue;
}
+ //The shard is not compacted, we cannot remove it. This should never happen, a bit of an "oh shit" scenario.
+ //the isCompactionPending should return false in this case
+ if(!shard.isCompacted()){
+ logger.warn( "Shard {} in group {} is not compacted yet was checked. Short circuiting", shard, shardEntryGroup );
+ return DeleteResult.NO_OP;
+ }
+
final MutationBatch shardRemovalMutation =
edgeShardSerialization.removeShardMeta( applicationScope, shard, directedEdgeMeta );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/591a2f1f/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardedEdgeSerializationImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardedEdgeSerializationImpl.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardedEdgeSerializationImpl.java
index 2ef50f5..1060495 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardedEdgeSerializationImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardedEdgeSerializationImpl.java
@@ -123,10 +123,6 @@ public class ShardedEdgeSerializationImpl implements ShardedEdgeSerialization {
final Shard shard, final boolean isDeleted ) {
batch.withRow( columnFamily, ScopedRowKey.fromKey( scope.getApplication(), rowKey ) ).putColumn( edge, isDeleted );
-
- if ( !isDeleted ) {
- writeEdgeShardStrategy.increment( scope, shard, 1, directedEdgeMeta );
- }
}
}.createBatch( scope, shards, timestamp );
}
@@ -153,11 +149,6 @@ public class ShardedEdgeSerializationImpl implements ShardedEdgeSerialization {
batch.withRow( columnFamily, ScopedRowKey.fromKey( scope.getApplication(), rowKey ) ).putColumn( edge, isDeleted );
-
-
- if ( !isDeleted ) {
- writeEdgeShardStrategy.increment( scope, shard, 1, directedEdgeMeta );
- }
}
}.createBatch( scope, shards, timestamp );
}
@@ -182,10 +173,6 @@ public class ShardedEdgeSerializationImpl implements ShardedEdgeSerialization {
batch.withRow( columnFamily, ScopedRowKey.fromKey( scope.getApplication(), rowKey ) ).putColumn( edge, isDeleted );
-
- if ( !isDeleted ) {
- writeEdgeShardStrategy.increment( scope, shard, 1, targetEdgeMeta );
- }
}
}.createBatch( scope, shards, timestamp );
}
@@ -212,11 +199,6 @@ public class ShardedEdgeSerializationImpl implements ShardedEdgeSerialization {
batch.withRow( columnFamilies.getTargetNodeSourceTypeCfName(), ScopedRowKey.fromKey( scope.getApplication(), rowKey ) )
.putColumn( edge, isDeleted );
-
-
- if ( !isDeleted ) {
- writeEdgeShardStrategy.increment( scope, shard, 1, directedEdgeMeta );
- }
}
}.createBatch( scope, shards, timestamp );
}
@@ -241,11 +223,6 @@ public class ShardedEdgeSerializationImpl implements ShardedEdgeSerialization {
final boolean isDeleted ) {
batch.withRow( columnFamilies.getGraphEdgeVersions(), ScopedRowKey.fromKey( scope.getApplication(), rowKey ) )
.putColumn( column, isDeleted );
-
-
- if ( !isDeleted ) {
- writeEdgeShardStrategy.increment( scope, shard, 1, directedEdgeMeta );
- }
}
}.createBatch( scope, shards, timestamp );
}
@@ -265,7 +242,6 @@ public class ShardedEdgeSerializationImpl implements ShardedEdgeSerialization {
final Shard shard, final boolean isDeleted ) {
batch.withRow( columnFamily, ScopedRowKey.fromKey( scope.getApplication(), rowKey ) ).deleteColumn( edge );
- writeEdgeShardStrategy.increment( scope, shard, -1, directedEdgeMeta );
}
}.createBatch( scope, shards, timestamp );
}
@@ -288,7 +264,6 @@ public class ShardedEdgeSerializationImpl implements ShardedEdgeSerialization {
batch.withRow( columnFamilies.getSourceNodeTargetTypeCfName(), ScopedRowKey.fromKey( scope.getApplication(), rowKey ) )
.deleteColumn( edge );
- writeEdgeShardStrategy.increment( scope, shard, -1, directedEdgeMeta );
}
}.createBatch( scope, shards, timestamp );
}
@@ -308,7 +283,6 @@ public class ShardedEdgeSerializationImpl implements ShardedEdgeSerialization {
final Shard shard, final boolean isDeleted ) {
batch.withRow( columnFamily, ScopedRowKey.fromKey( scope.getApplication(), rowKey ) ).deleteColumn( edge );
- writeEdgeShardStrategy.increment( scope, shard, -1, directedEdgeMeta );
}
}.createBatch( scope, shards, timestamp );
}
@@ -331,7 +305,6 @@ public class ShardedEdgeSerializationImpl implements ShardedEdgeSerialization {
batch.withRow( columnFamilies.getTargetNodeSourceTypeCfName(), ScopedRowKey.fromKey( scope.getApplication(), rowKey ) )
.deleteColumn( edge );
- writeEdgeShardStrategy.increment( scope, shard, -1, directedEdgeMeta );
}
}.createBatch( scope, shards, timestamp );
}
@@ -351,7 +324,6 @@ public class ShardedEdgeSerializationImpl implements ShardedEdgeSerialization {
final boolean isDeleted ) {
batch.withRow( columnFamilies.getGraphEdgeVersions(), ScopedRowKey.fromKey( scope.getApplication(), rowKey ) )
.deleteColumn( column );
- writeEdgeShardStrategy.increment( scope, shard, -1, directedEdgeMeta );
}
}.createBatch( scope, shards, timestamp );
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/591a2f1f/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/SizebasedEdgeShardStrategy.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/SizebasedEdgeShardStrategy.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/SizebasedEdgeShardStrategy.java
index 8787d97..cf164ba 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/SizebasedEdgeShardStrategy.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/SizebasedEdgeShardStrategy.java
@@ -25,9 +25,7 @@ import java.util.Iterator;
import org.apache.usergrid.persistence.core.scope.ApplicationScope;
import org.apache.usergrid.persistence.graph.serialization.impl.shard.DirectedEdgeMeta;
import org.apache.usergrid.persistence.graph.serialization.impl.shard.EdgeShardStrategy;
-import org.apache.usergrid.persistence.graph.serialization.impl.shard.NodeShardApproximation;
import org.apache.usergrid.persistence.graph.serialization.impl.shard.NodeShardCache;
-import org.apache.usergrid.persistence.graph.serialization.impl.shard.Shard;
import org.apache.usergrid.persistence.graph.serialization.impl.shard.ShardEntryGroup;
import com.google.inject.Inject;
@@ -42,14 +40,11 @@ public class SizebasedEdgeShardStrategy implements EdgeShardStrategy {
private final NodeShardCache shardCache;
- private final NodeShardApproximation shardApproximation;
@Inject
- public SizebasedEdgeShardStrategy( final NodeShardCache shardCache,
- final NodeShardApproximation shardApproximation ) {
+ public SizebasedEdgeShardStrategy( final NodeShardCache shardCache) {
this.shardCache = shardCache;
- this.shardApproximation = shardApproximation;
}
@@ -65,10 +60,4 @@ public class SizebasedEdgeShardStrategy implements EdgeShardStrategy {
return shardCache.getReadShardGroup( scope, maxTimestamp, directedEdgeMeta );
}
-
- @Override
- public void increment( final ApplicationScope scope, final Shard shard,
- final long count, final DirectedEdgeMeta directedEdgeMeta) {
- shardApproximation.increment( scope, shard, count, directedEdgeMeta );
- }
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/591a2f1f/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerShardingIT.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerShardingIT.java b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerShardingIT.java
deleted file mode 100644
index 2951efe..0000000
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerShardingIT.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- *
- * * Licensed to the Apache Software Foundation (ASF) under one
- * * or more contributor license agreements. See the NOTICE file
- * * distributed with this work for additional information
- * * regarding copyright ownership. The ASF licenses this file
- * * to you under the Apache License, Version 2.0 (the
- * * "License"); you may not use this file except in compliance
- * * with the License. You may obtain a copy of the License at
- * *
- * * http://www.apache.org/licenses/LICENSE-2.0
- * *
- * * Unless required by applicable law or agreed to in writing,
- * * software distributed under the License is distributed on an
- * * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * * KIND, either express or implied. See the License for the
- * * specific language governing permissions and limitations
- * * under the License.
- *
- */
-package org.apache.usergrid.persistence.graph;
-
-
-import java.util.concurrent.TimeoutException;
-
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import org.apache.usergrid.persistence.core.guice.MigrationManagerRule;
-import org.apache.usergrid.persistence.core.scope.ApplicationScope;
-import org.apache.usergrid.persistence.core.scope.ApplicationScopeImpl;
-import org.apache.usergrid.persistence.core.test.ITRunner;
-import org.apache.usergrid.persistence.core.test.UseModules;
-import org.apache.usergrid.persistence.core.util.IdGenerator;
-import org.apache.usergrid.persistence.graph.guice.TestGraphModule;
-import org.apache.usergrid.persistence.graph.serialization.impl.shard.DirectedEdgeMeta;
-import org.apache.usergrid.persistence.graph.serialization.impl.shard.NodeShardApproximation;
-import org.apache.usergrid.persistence.graph.serialization.impl.shard.Shard;
-import org.apache.usergrid.persistence.model.entity.Id;
-
-import com.google.inject.Inject;
-
-import static org.apache.usergrid.persistence.graph.test.util.EdgeTestUtils.createEdge;
-import static org.apache.usergrid.persistence.core.util.IdGenerator.createId;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-
-@RunWith( ITRunner.class )
-@UseModules( TestGraphModule.class )
-@Ignore("Kills cassandra")
-public class GraphManagerShardingIT {
-
-
- @Inject
- @Rule
- public MigrationManagerRule migrationManagerRule;
-
-
- @Inject
- protected GraphManagerFactory emf;
-
-
- @Inject
- protected GraphFig graphFig;
-
- @Inject
- protected NodeShardApproximation nodeShardApproximation;
-
- protected ApplicationScope scope;
-
-
-
-
- @Before
- public void mockApp() {
- this.scope = new ApplicationScopeImpl( IdGenerator.createId( "application" ) );
- }
-
-
- @Test
- public void testWriteSourceType() throws TimeoutException, InterruptedException {
-
- GraphManager gm = emf.createEdgeManager( scope ) ;
-
- final Id sourceId = IdGenerator.createId( "source" );
- final String edgeType = "test";
-
-
-
-
- final long flushCount = graphFig.getCounterFlushCount();
- final long maxShardSize = graphFig.getShardSize();
-
-
-
-
- final long startTime = System.currentTimeMillis();
-
- //each edge causes 4 counts
- final long writeCount = flushCount/4;
-
- assertTrue( "Shard size must be >= beginFlush Count", maxShardSize >= flushCount );
-
- Id targetId = null;
-
- for(long i = 0; i < writeCount; i ++){
- targetId = IdGenerator.createId( "target" ) ;
-
- final Edge edge = createEdge( sourceId, edgeType, targetId);
-
- gm.writeEdge( edge ).toBlocking().last();
-
- }
-
-
-
- final DirectedEdgeMeta sourceEdgeMeta = DirectedEdgeMeta.fromSourceNodeTargetType( sourceId, edgeType,
- targetId.getType() );
- final Shard shard = new Shard(0, 0, true);
-
-
- long shardCount = nodeShardApproximation.getCount( scope, shard, sourceEdgeMeta );
-
- assertEquals("Shard count for source node should be the same as write count", writeCount, shardCount);
-
-
- //now verify it's correct for the target
- final DirectedEdgeMeta targetEdgeMeta = DirectedEdgeMeta.fromTargetNodeSourceType(targetId, edgeType, sourceId.getType() );
-
-
- shardCount = nodeShardApproximation.getCount( scope, shard, targetEdgeMeta );
-
- assertEquals(1, shardCount);
-
- }
-
-
- @Test
- public void testWriteTargetType() throws TimeoutException, InterruptedException {
-
- GraphManager gm = emf.createEdgeManager( scope ) ;
-
- final Id targetId = IdGenerator.createId( "target" );
- final String edgeType = "test";
-
-
-
-
- final long flushCount = graphFig.getCounterFlushCount();
- final long maxShardSize = graphFig.getShardSize();
-
-
- //each edge causes 4 counts
- final long writeCount = flushCount/4;
-
- assertTrue( "Shard size must be >= beginFlush Count", maxShardSize >= flushCount );
-
- Id sourceId = null;
-
- for(long i = 0; i < writeCount; i ++){
- sourceId = IdGenerator.createId( "source" ) ;
-
- final Edge edge = createEdge( sourceId, edgeType, targetId);
-
- gm.writeEdge( edge ).toBlocking().last();
-
- }
-
-
- //this is from target->source, since the target id doesn't change
- final DirectedEdgeMeta targetMeta = DirectedEdgeMeta.fromTargetNode( targetId, edgeType );
- final Shard shard = new Shard(0l, 0l, true);
-
- long targetWithType = nodeShardApproximation.getCount( scope, shard, targetMeta );
-
- assertEquals("Shard count for target node should be the same as write count", writeCount, targetWithType);
-
-
- final DirectedEdgeMeta targetNodeSource = DirectedEdgeMeta.fromTargetNodeSourceType( targetId, edgeType, "source" );
-
- long shardCount = nodeShardApproximation.getCount( scope, shard, targetNodeSource );
-
- assertEquals("Shard count for target node should be the same as write count", writeCount, shardCount);
-
-
- //now verify it's correct for the target
-
- final DirectedEdgeMeta sourceMeta = DirectedEdgeMeta.fromSourceNode( sourceId, edgeType );
-
- shardCount = nodeShardApproximation.getCount( scope, shard, sourceMeta );
-
- assertEquals(1, shardCount);
-
- }
-
-
-
-
-}
-
-
-
-
-
http://git-wip-us.apache.org/repos/asf/usergrid/blob/591a2f1f/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/NodeShardAllocationTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/NodeShardAllocationTest.java b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/NodeShardAllocationTest.java
index ac965cd..bc364cc 100644
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/NodeShardAllocationTest.java
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/NodeShardAllocationTest.java
@@ -98,15 +98,13 @@ public class NodeShardAllocationTest {
final ShardedEdgeSerialization shardedEdgeSerialization = mock( ShardedEdgeSerialization.class );
- final NodeShardApproximation nodeShardCounterSerialization = mock( NodeShardApproximation.class );
-
final TimeService timeService = mock( TimeService.class );
NodeShardAllocation approximation =
new NodeShardAllocationImpl( edgeShardSerialization, edgeColumnFamilies, shardedEdgeSerialization,
- nodeShardCounterSerialization, timeService, graphFig, shardGroupCompaction );
+ timeService, graphFig, shardGroupCompaction );
final long timeservicetime = System.currentTimeMillis();
@@ -131,15 +129,12 @@ public class NodeShardAllocationTest {
final ShardedEdgeSerialization shardedEdgeSerialization = mock( ShardedEdgeSerialization.class );
- final NodeShardApproximation nodeShardCounterSerialization = mock( NodeShardApproximation.class );
-
-
final TimeService timeService = mock( TimeService.class );
NodeShardAllocation approximation =
new NodeShardAllocationImpl( edgeShardSerialization, edgeColumnFamilies, shardedEdgeSerialization,
- nodeShardCounterSerialization, timeService, graphFig, shardGroupCompaction );
+ timeService, graphFig, shardGroupCompaction );
final Id nodeId = IdGenerator.createId( "test" );
final String type = "type";
@@ -175,14 +170,11 @@ public class NodeShardAllocationTest {
final ShardedEdgeSerialization shardedEdgeSerialization = mock( ShardedEdgeSerialization.class );
- final NodeShardApproximation nodeShardApproximation = mock( NodeShardApproximation.class );
-
-
final TimeService timeService = mock( TimeService.class );
NodeShardAllocation approximation =
new NodeShardAllocationImpl( edgeShardSerialization, edgeColumnFamilies, shardedEdgeSerialization,
- nodeShardApproximation, timeService, graphFig, shardGroupCompaction );
+ timeService, graphFig, shardGroupCompaction );
final Id nodeId = IdGenerator.createId( "test" );
final String type = "type";
@@ -205,8 +197,6 @@ public class NodeShardAllocationTest {
final long count = graphFig.getShardSize() - 1;
- when( nodeShardApproximation.getCount( scope, futureShard, targetEdgeMeta ) ).thenReturn( count );
-
final boolean result = approximation.auditShard( scope, shardEntryGroup, targetEdgeMeta );
assertFalse( "Shard allocated", result );
@@ -223,14 +213,12 @@ public class NodeShardAllocationTest {
final ShardedEdgeSerialization shardedEdgeSerialization = mock( ShardedEdgeSerialization.class );
- final NodeShardApproximation nodeShardApproximation = mock( NodeShardApproximation.class );
-
final TimeService timeService = mock( TimeService.class );
NodeShardAllocation approximation =
new NodeShardAllocationImpl( edgeShardSerialization, edgeColumnFamilies, shardedEdgeSerialization,
- nodeShardApproximation, timeService, graphFig, shardGroupCompaction );
+ timeService, graphFig, shardGroupCompaction );
final Id nodeId = IdGenerator.createId( "test" );
final String type = "type";
@@ -255,9 +243,6 @@ public class NodeShardAllocationTest {
final long shardCount = ( long ) ( graphFig.getShardSize() * 2.5 );
- //return a shard size equal to our max
- when( nodeShardApproximation.getCount( scope, futureShard, targetEdgeMeta ) ).thenReturn( shardCount );
-
//this is how many we should be iterating and should set the value of the last shard we keep
final int numToIterate = ( int ) ( graphFig.getShardSize() * 2 );
@@ -338,14 +323,12 @@ public class NodeShardAllocationTest {
final ShardedEdgeSerialization shardedEdgeSerialization = mock( ShardedEdgeSerialization.class );
- final NodeShardApproximation nodeShardApproximation = mock( NodeShardApproximation.class );
-
final TimeService timeService = mock( TimeService.class );
NodeShardAllocation approximation =
new NodeShardAllocationImpl( edgeShardSerialization, edgeColumnFamilies, shardedEdgeSerialization,
- nodeShardApproximation, timeService, graphFig, shardGroupCompaction );
+ timeService, graphFig, shardGroupCompaction );
final Id nodeId = IdGenerator.createId( "test" );
final String type = "type";
@@ -378,9 +361,6 @@ public class NodeShardAllocationTest {
iteratedEdges.add( returnedEdge );
- //return a shard size equal to our max
- when( nodeShardApproximation.getCount( scope, futureShard, targetEdgeMeta ) ).thenReturn( shardCount );
-
ArgumentCaptor<Shard> shardValue = ArgumentCaptor.forClass( Shard.class );
@@ -429,14 +409,12 @@ public class NodeShardAllocationTest {
final ShardedEdgeSerialization shardedEdgeSerialization = mock( ShardedEdgeSerialization.class );
- final NodeShardApproximation nodeShardApproximation = mock( NodeShardApproximation.class );
-
final TimeService timeService = mock( TimeService.class );
NodeShardAllocation approximation =
new NodeShardAllocationImpl( edgeShardSerialization, edgeColumnFamilies, shardedEdgeSerialization,
- nodeShardApproximation, timeService, graphFig, shardGroupCompaction );
+ timeService, graphFig, shardGroupCompaction );
final Id nodeId = IdGenerator.createId( "test" );
final String type = "type";
@@ -456,8 +434,6 @@ public class NodeShardAllocationTest {
final long shardCount = graphFig.getShardSize();
- //return a shard size equal to our max
- when( nodeShardApproximation.getCount( scope, futureShard, targetEdgeMeta ) ).thenReturn( shardCount );
ArgumentCaptor<Shard> shardValue = ArgumentCaptor.forClass( Shard.class );
@@ -495,7 +471,6 @@ public class NodeShardAllocationTest {
final ShardedEdgeSerialization shardedEdgeSerialization = mock( ShardedEdgeSerialization.class );
- final NodeShardApproximation nodeShardApproximation = mock( NodeShardApproximation.class );
final TimeService timeService = mock( TimeService.class );
@@ -503,7 +478,7 @@ public class NodeShardAllocationTest {
NodeShardAllocation approximation =
new NodeShardAllocationImpl( edgeShardSerialization, edgeColumnFamilies, shardedEdgeSerialization,
- nodeShardApproximation, timeService, graphFig, shardGroupCompaction );
+ timeService, graphFig, shardGroupCompaction );
final Id nodeId = IdGenerator.createId( "test" );
final String type = "type";
@@ -630,9 +605,6 @@ public class NodeShardAllocationTest {
final ShardedEdgeSerialization shardedEdgeSerialization = mock( ShardedEdgeSerialization.class );
- final NodeShardApproximation nodeShardApproximation = mock( NodeShardApproximation.class );
-
-
final TimeService timeService = mock( TimeService.class );
final long returnTime = System.currentTimeMillis() + graphFig.getShardCacheTimeout() * 2;
@@ -643,7 +615,7 @@ public class NodeShardAllocationTest {
NodeShardAllocation approximation =
new NodeShardAllocationImpl( edgeShardSerialization, edgeColumnFamilies, shardedEdgeSerialization,
- nodeShardApproximation, timeService, graphFig, shardGroupCompaction );
+ timeService, graphFig, shardGroupCompaction );
final Id nodeId = IdGenerator.createId( "test" );
final String type = "type";
@@ -712,8 +684,6 @@ public class NodeShardAllocationTest {
final ShardedEdgeSerialization shardedEdgeSerialization = mock( ShardedEdgeSerialization.class );
- final NodeShardApproximation nodeShardApproximation = mock( NodeShardApproximation.class );
-
/**
* Return 100000 milliseconds
@@ -736,7 +706,7 @@ public class NodeShardAllocationTest {
NodeShardAllocation approximation =
new NodeShardAllocationImpl( edgeShardSerialization, edgeColumnFamilies, shardedEdgeSerialization,
- nodeShardApproximation, timeService, graphFig, shardGroupCompaction );
+ timeService, graphFig, shardGroupCompaction );
/**
http://git-wip-us.apache.org/repos/asf/usergrid/blob/591a2f1f/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardApproximationTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardApproximationTest.java b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardApproximationTest.java
deleted file mode 100644
index 32a0cda..0000000
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/count/NodeShardApproximationTest.java
+++ /dev/null
@@ -1,627 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.usergrid.persistence.graph.serialization.impl.shard.count;
-
-
-import java.beans.PropertyChangeListener;
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-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 java.util.concurrent.atomic.AtomicLong;
-
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.safehaus.guicyfig.Bypass;
-import org.safehaus.guicyfig.OptionState;
-import org.safehaus.guicyfig.Overrides;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.usergrid.persistence.core.astyanax.MultiTennantColumnFamilyDefinition;
-import org.apache.usergrid.persistence.core.consistency.TimeService;
-import org.apache.usergrid.persistence.core.scope.ApplicationScope;
-import org.apache.usergrid.persistence.core.util.IdGenerator;
-import org.apache.usergrid.persistence.graph.GraphFig;
-import org.apache.usergrid.persistence.graph.serialization.impl.shard.DirectedEdgeMeta;
-import org.apache.usergrid.persistence.graph.serialization.impl.shard.NodeShardApproximation;
-import org.apache.usergrid.persistence.graph.serialization.impl.shard.Shard;
-import org.apache.usergrid.persistence.model.entity.Id;
-import org.apache.usergrid.persistence.model.util.UUIDGenerator;
-
-import com.google.common.util.concurrent.ListenableFuture;
-import com.netflix.astyanax.ColumnListMutation;
-import com.netflix.astyanax.MutationBatch;
-import com.netflix.astyanax.WriteAheadLog;
-import com.netflix.astyanax.connectionpool.Host;
-import com.netflix.astyanax.connectionpool.OperationResult;
-import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
-import com.netflix.astyanax.model.ColumnFamily;
-import com.netflix.astyanax.model.ConsistencyLevel;
-import com.netflix.astyanax.retry.RetryPolicy;
-
-import static org.apache.usergrid.persistence.core.util.IdGenerator.createId;
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-
-public class NodeShardApproximationTest {
-
- private static final Logger LOG = LoggerFactory.getLogger( NodeShardApproximation.class );
-
- private GraphFig graphFig;
-
- private NodeShardCounterSerialization nodeShardCounterSerialization;
- private TimeService timeService;
-
- protected ApplicationScope scope;
-
-
- @Before
- public void setup() {
- scope = mock( ApplicationScope.class );
-
- Id orgId = mock( Id.class );
-
- when( orgId.getType() ).thenReturn( "organization" );
- when( orgId.getUuid() ).thenReturn( UUIDGenerator.newTimeUUID() );
-
- when( scope.getApplication() ).thenReturn( orgId );
-
- graphFig = mock( GraphFig.class );
-
- when( graphFig.getShardCacheSize() ).thenReturn( 10000l );
- when( graphFig.getShardSize() ).thenReturn( 250000l );
- when( graphFig.getCounterFlushQueueSize() ).thenReturn( 10000 );
-
- nodeShardCounterSerialization = mock( NodeShardCounterSerialization.class );
-
- when( nodeShardCounterSerialization.flush( any( Counter.class ) ) ).thenReturn( mock( MutationBatch.class ) );
-
-
- timeService = mock( TimeService.class );
-
- when( timeService.getCurrentTime() ).thenReturn( System.currentTimeMillis() );
- }
-
-
- @Test
- public void testSingleShard() throws InterruptedException {
-
-
- when( graphFig.getCounterFlushCount() ).thenReturn( 100000l );
- NodeShardApproximation approximation =
- new NodeShardApproximationImpl( graphFig, nodeShardCounterSerialization, timeService );
-
-
- final Id id = IdGenerator.createId( "test" );
- final Shard shard = new Shard( 0, 0, true );
- final String type = "type";
- final String type2 = "subType";
-
- final DirectedEdgeMeta directedEdgeMeta = DirectedEdgeMeta.fromTargetNodeSourceType( id, type, type2 );
-
- long count = approximation.getCount( scope, shard, directedEdgeMeta );
-
- waitForFlush( approximation );
-
- assertEquals( 0, count );
- }
-
-
- @Ignore("outdated and no longer relevant test")
- @Test
- public void testSingleShardMultipleThreads() throws ExecutionException, InterruptedException {
-
-
- NodeShardCounterSerialization serialization = new TestNodeShardCounterSerialization();
-
- final NodeShardApproximation approximation =
- new NodeShardApproximationImpl( new TestGraphFig(), serialization, new TestTimeService() );
-
-
- final int increments = 1000000;
- final int workers = Runtime.getRuntime().availableProcessors() * 2;
-
- final Id id = IdGenerator.createId( "test" );
- final String type = "type";
- final String type2 = "subType";
-
- final Shard shard = new Shard( 10000, 0, true );
-
- final DirectedEdgeMeta directedEdgeMeta = DirectedEdgeMeta.fromTargetNodeSourceType( id, type, type2 );
-
- ExecutorService executor = Executors.newFixedThreadPool( workers );
-
- List<Future<Long>> futures = new ArrayList<>( workers );
-
- for ( int i = 0; i < workers; i++ ) {
-
- final Future<Long> future = executor.submit( new Callable<Long>() {
- @Override
- public Long call() throws Exception {
-
- for ( int i = 0; i < increments; i++ ) {
- approximation.increment( scope, shard, 1, directedEdgeMeta );
- }
-
- return 0l;
- }
- } );
-
- futures.add( future );
- }
-
-
- for ( Future<Long> future : futures ) {
- future.get();
- }
-
- waitForFlush( approximation );
- //get our count. It should be accurate b/c we only have 1 instance
-
- final long returnedCount = approximation.getCount( scope, shard, directedEdgeMeta );
- final long expected = workers * increments;
-
-
- assertEquals( expected, returnedCount );
-
- //test we get nothing with the other type
-
- final long emptyCount =
- approximation.getCount( scope, shard, DirectedEdgeMeta.fromSourceNodeTargetType( id, type, type2 ) );
-
-
- assertEquals( 0, emptyCount );
- }
-
-
- @Ignore("outdated and no longer relevant test")
- @Test
- public void testMultipleShardMultipleThreads() throws ExecutionException, InterruptedException {
-
-
- NodeShardCounterSerialization serialization = new TestNodeShardCounterSerialization();
-
- final NodeShardApproximation approximation =
- new NodeShardApproximationImpl( new TestGraphFig(), serialization, new TestTimeService() );
-
-
- final int increments = 1000000;
- final int workers = Runtime.getRuntime().availableProcessors() * 2;
-
- final Id id = IdGenerator.createId( "test" );
- final String type = "type";
- final String type2 = "subType";
-
- final AtomicLong shardIdCounter = new AtomicLong();
-
-
- final DirectedEdgeMeta directedEdgeMeta = DirectedEdgeMeta.fromTargetNodeSourceType( id, type, type2 );
-
-
- ExecutorService executor = Executors.newFixedThreadPool( workers );
-
- List<Future<Shard>> futures = new ArrayList<>( workers );
-
- for ( int i = 0; i < workers; i++ ) {
-
- final Future<Shard> future = executor.submit( new Callable<Shard>() {
- @Override
- public Shard call() throws Exception {
-
- final long threadShardId = shardIdCounter.incrementAndGet();
-
- final Shard shard = new Shard( threadShardId, 0, true );
-
- for ( int i = 0; i < increments; i++ ) {
- approximation.increment( scope, shard, 1, directedEdgeMeta );
- }
-
- return shard;
- }
- } );
-
- futures.add( future );
- }
-
-
- for ( Future<Shard> future : futures ) {
- final Shard shardId = future.get();
-
- waitForFlush( approximation );
-
- final long returnedCount = approximation.getCount( scope, shardId, directedEdgeMeta );
-
- assertEquals( increments, returnedCount );
- }
- }
-
-
- private void waitForFlush( NodeShardApproximation approximation ) throws InterruptedException {
-
- approximation.beginFlush();
-
- while ( approximation.flushPending() ) {
-
- LOG.info( "Waiting on beginFlush to complete" );
-
- Thread.sleep( 100 );
- }
- }
-
-
- /**
- * These are created b/c we can't use Mockito. It OOM's with keeping track of all the mock invocations
- */
-
- private static class TestNodeShardCounterSerialization implements NodeShardCounterSerialization {
-
- private Counter copy = new Counter();
-
-
- @Override
- public MutationBatch flush( final Counter counter ) {
- copy.merge( counter );
- return new TestMutationBatch();
- }
-
-
- @Override
- public long getCount( final ShardKey key ) {
- return copy.get( key );
- }
-
-
- @Override
- public Collection<MultiTennantColumnFamilyDefinition> getColumnFamilies() {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
- }
-
-
- /**
- * Simple test mutation to no-op during tests
- */
- private
- static class TestMutationBatch implements MutationBatch {
-
- @Override
- public <K, C> ColumnListMutation<C> withRow( final ColumnFamily<K, C> columnFamily, final K rowKey ) {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public <K> void deleteRow( final Iterable<? extends ColumnFamily<K, ?>> columnFamilies, final K rowKey ) {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public void discardMutations() {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public void mergeShallow( final MutationBatch other ) {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public boolean isEmpty() {
- return false; //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public int getRowCount() {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public Map<ByteBuffer, Set<String>> getRowKeys() {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public MutationBatch pinToHost( final Host host ) {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public MutationBatch setConsistencyLevel( final ConsistencyLevel consistencyLevel ) {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public MutationBatch withConsistencyLevel( final ConsistencyLevel consistencyLevel ) {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public MutationBatch withRetryPolicy( final RetryPolicy retry ) {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public MutationBatch usingWriteAheadLog( final WriteAheadLog manager ) {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public MutationBatch lockCurrentTimestamp() {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public MutationBatch setTimeout( final long timeout ) {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public MutationBatch setTimestamp( final long timestamp ) {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public MutationBatch withTimestamp( final long timestamp ) {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public MutationBatch withAtomicBatch( final boolean condition ) {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public ByteBuffer serialize() throws Exception {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public void deserialize( final ByteBuffer data ) throws Exception {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public OperationResult<Void> execute() throws ConnectionException {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public ListenableFuture<OperationResult<Void>> executeAsync() throws ConnectionException {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
- }
-
-
- private static class TestGraphFig implements GraphFig {
-
- @Override
- public int getScanPageSize() {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public int getRepairConcurrentSize() {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public double getShardRepairChance() {
- return 0;
- }
-
-
- @Override
- public long getShardSize() {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public long getShardCacheTimeout() {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public long getShardMinDelta() {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public long getShardCacheSize() {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public int getShardCacheRefreshWorkerCount() {
- return 0;
- }
-
-
- @Override
- public int getShardAuditWorkerCount() {
- return 0;
- }
-
-
- @Override
- public int getShardAuditWorkerQueueSize() {
- return 0;
- }
-
-
- @Override
- public long getCounterFlushCount() {
- return 100000l;
- }
-
-
- @Override
- public long getCounterFlushInterval() {
- return 30000l;
- }
-
-
- @Override
- public int getCounterFlushQueueSize() {
- return 10000;
- }
-
-
- @Override
- public void addPropertyChangeListener( final PropertyChangeListener propertyChangeListener ) {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public void removePropertyChangeListener( final PropertyChangeListener propertyChangeListener ) {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public OptionState[] getOptions() {
- return new OptionState[0]; //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public OptionState getOption( final String s ) {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public String getKeyByMethod( final String s ) {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public Object getValueByMethod( final String s ) {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public Properties filterOptions( final Properties properties ) {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public Map<String, Object> filterOptions( final Map<String, Object> stringObjectMap ) {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public void override( final String s, final String s2 ) {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public boolean setOverrides( final Overrides overrides ) {
- return false; //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public Overrides getOverrides() {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public void bypass( final String s, final String s2 ) {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public boolean setBypass( final Bypass bypass ) {
- return false; //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public Bypass getBypass() {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public Class getFigInterface() {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- @Override
- public boolean isSingleton() {
- return false; //To change body of implemented methods use File | Settings | File Templates.
- }
- }
-
-
- private static class TestTimeService implements TimeService {
-
- @Override
- public long getCurrentTime() {
- return System.currentTimeMillis();
- }
- }
-}
[21/32] usergrid git commit: fix exclusion with new version of wns lib
Posted by sf...@apache.org.
fix exclusion with new version of wns lib
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/3c20c67f
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/3c20c67f
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/3c20c67f
Branch: refs/heads/master
Commit: 3c20c67f50ecaad1136feea3e9a070b2a993b22f
Parents: d42d82c ad07e2b
Author: Shawn Feldman <sf...@apache.org>
Authored: Fri Nov 6 16:02:36 2015 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Fri Nov 6 16:02:36 2015 -0700
----------------------------------------------------------------------
.../asyncevents/AmazonAsyncEventService.java | 8 +-
.../read/traverse/AbstractReadGraphFilter.java | 8 +-
.../usergrid/corepersistence/index/RxTest.java | 5 +-
.../persistence/graph/guice/GraphModule.java | 7 -
.../impl/shard/DirectedEdgeMeta.java | 4 +-
.../impl/shard/EdgeShardStrategy.java | 10 +-
.../impl/shard/NodeShardApproximation.java | 66 --
.../impl/shard/ShardEntryGroup.java | 3 +-
.../impl/shard/ShardedEdgeSerialization.java | 2 +-
.../serialization/impl/shard/count/Counter.java | 131 ----
.../shard/count/NodeShardApproximationImpl.java | 272 --------
.../count/NodeShardCounterSerialization.java | 48 --
.../NodeShardCounterSerializationImpl.java | 186 ------
.../impl/shard/count/ShardKey.java | 75 ---
.../shard/impl/NodeShardAllocationImpl.java | 19 +-
.../impl/shard/impl/ShardGroupDeletionImpl.java | 158 ++---
.../impl/ShardedEdgeSerializationImpl.java | 28 -
.../shard/impl/SizebasedEdgeColumnFamilies.java | 4 +-
.../shard/impl/SizebasedEdgeShardStrategy.java | 13 +-
.../graph/GraphManagerShardConsistencyIT.java | 5 +
.../graph/GraphManagerShardingIT.java | 208 ------
.../impl/shard/NodeShardAllocationTest.java | 48 +-
.../impl/shard/ShardEntryGroupTest.java | 28 +
.../shard/count/NodeShardApproximationTest.java | 627 -------------------
.../NodeShardCounterSerializationTest.java | 124 ----
.../shard/impl/ShardGroupDeletionImplTest.java | 5 +
.../index/impl/IndexOperationMessage.java | 4 +-
.../exceptions/AbstractExceptionMapper.java | 8 +-
stack/services/pom.xml | 7 -
.../services/AbstractCollectionService.java | 6 +-
30 files changed, 164 insertions(+), 1953 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/3c20c67f/stack/services/pom.xml
----------------------------------------------------------------------
diff --cc stack/services/pom.xml
index 5560079,2daa8f6..754b74c
--- a/stack/services/pom.xml
+++ b/stack/services/pom.xml
@@@ -438,14 -437,13 +438,7 @@@
<dependency>
<groupId>com.github.fernandospr</groupId>
<artifactId>java-wns</artifactId>
- <version>1.3</version>
- <exclusions>
- <exclusion>
- <artifactId>jackson-jaxrs</artifactId>
- <groupId>org.codehaus.jackson</groupId>
- </exclusion>
- </exclusions>
+ <version>1.3.1-USERGRID</version>
- <exclusions>
- <exclusion>
- <artifactId>jackson-jaxrs</artifactId>
- <groupId>org.codehaus.jackson</groupId>
- </exclusion>
- </exclusions>
</dependency>
-
</dependencies>
</project>
[15/32] usergrid git commit: Don't log ERROR stack traces for errors
< 500 (especially 504s).
Posted by sf...@apache.org.
Don't log ERROR stack traces for errors < 500 (especially 504s).
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/6b58d3e4
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/6b58d3e4
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/6b58d3e4
Branch: refs/heads/master
Commit: 6b58d3e42417335a40be99671cde1451eec28252
Parents: 6dfa2e2
Author: Mike Dunker <md...@apigee.com>
Authored: Fri Nov 6 12:28:45 2015 -0800
Committer: Mike Dunker <md...@apigee.com>
Committed: Fri Nov 6 12:28:45 2015 -0800
----------------------------------------------------------------------
.../usergrid/rest/exceptions/AbstractExceptionMapper.java | 8 ++------
.../apache/usergrid/services/AbstractCollectionService.java | 6 ++++--
2 files changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/6b58d3e4/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/AbstractExceptionMapper.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/AbstractExceptionMapper.java b/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/AbstractExceptionMapper.java
index a359618..9e0f359 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/AbstractExceptionMapper.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/AbstractExceptionMapper.java
@@ -69,15 +69,11 @@ public abstract class AbstractExceptionMapper<E extends java.lang.Throwable> imp
if ( status >= 500 ) {
// only log real errors as errors
- logger.error( e.getClass().getCanonicalName() + " Server Error (" + status + ")", e );
+ logger.error( e.getClass().getCanonicalName() + " 5XX Uncaught Exception (" + status + ")", e );
} else {
if (logger.isDebugEnabled()) {
- logger.debug(e.getClass().getCanonicalName() + " Server Error (" + status + ")", e);
- }
- switch (status){
- case 200 : logger.debug("Uncaught Exception", e); break;
- default: logger.error("Uncaught Exception", e);
+ logger.debug(e.getClass().getCanonicalName() + " Uncaught Exception (" + status + ")", e);
}
}
http://git-wip-us.apache.org/repos/asf/usergrid/blob/6b58d3e4/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java b/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java
index 25c3fd8..607c476 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java
@@ -55,7 +55,7 @@ public class AbstractCollectionService extends AbstractService {
if ( !isRootService() ) {
return null;
}
- Entity entity = em.get( new SimpleEntityRef( getEntityType(), uuid ));
+ Entity entity = em.get(new SimpleEntityRef(getEntityType(), uuid));
if ( entity != null ) {
entity = importEntity( request, entity );
}
@@ -94,7 +94,9 @@ public class AbstractCollectionService extends AbstractService {
}
if ( entity == null ) {
- logger.info( "miss on entityType: {} with uuid: {}", getEntityType(), id );
+ if (logger.isDebugEnabled()) {
+ logger.debug("miss on entityType: {} with uuid: {}", getEntityType(), id);
+ }
String msg = "Cannot find entity associated with uuid: " + id;
throw new EntityNotFoundException( msg );
}
[18/32] usergrid git commit: Fixes race condition in test
Posted by sf...@apache.org.
Fixes race condition in test
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/5ef62bba
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/5ef62bba
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/5ef62bba
Branch: refs/heads/master
Commit: 5ef62bbaf295a88bd2c999827cc45d0c43ad247b
Parents: 39ccdb1
Author: Todd Nine <tn...@apigee.com>
Authored: Fri Oct 30 17:32:19 2015 -0600
Committer: Michael Russo <mi...@gmail.com>
Committed: Fri Nov 6 13:39:29 2015 -0800
----------------------------------------------------------------------
.../java/org/apache/usergrid/corepersistence/index/RxTest.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/5ef62bba/stack/core/src/test/java/org/apache/usergrid/corepersistence/index/RxTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/corepersistence/index/RxTest.java b/stack/core/src/test/java/org/apache/usergrid/corepersistence/index/RxTest.java
index 1d940d0..a0e9118 100644
--- a/stack/core/src/test/java/org/apache/usergrid/corepersistence/index/RxTest.java
+++ b/stack/core/src/test/java/org/apache/usergrid/corepersistence/index/RxTest.java
@@ -45,10 +45,10 @@ public class RxTest {
final int count = 10;
- final CountDownLatch latch = new CountDownLatch( count );
+ final CountDownLatch latch = new CountDownLatch( count+1 );
final Subscription connectedObservable =
- Observable.range( 0, count ).doOnNext( integer -> latch.countDown() ).subscribeOn( Schedulers.io() )
+ Observable.range( 0, count ).doOnNext( integer -> latch.countDown() ).doOnCompleted( () -> latch.countDown() ).subscribeOn( Schedulers.io() )
.subscribe();