usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mru...@apache.org
Subject [03/50] usergrid git commit: Merge branch 'release-2.1.1' into usergrid-1268-akka-211
Date Thu, 14 Jul 2016 05:38:09 GMT
Merge branch 'release-2.1.1' into usergrid-1268-akka-211

Conflicts:
	stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java
	stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/EntityCollectionManagerIT.java


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

Branch: refs/heads/master
Commit: 25303e6d04faf47162c8ac94466deec178b45326
Parents: 2fb3ab3 c4f72ef
Author: Dave Johnson <snoopdave@apache.org>
Authored: Fri Jun 24 15:04:22 2016 -0400
Committer: Dave Johnson <snoopdave@apache.org>
Committed: Fri Jun 24 15:04:22 2016 -0400

----------------------------------------------------------------------
 deployment/pcf/LICENSE                          | 201 ++++++++
 deployment/pcf/README.md                        |  44 ++
 deployment/pcf/addBlobs.sh                      |  25 +
 deployment/pcf/apache-usergrid-tile-1.6.yml     | 510 +++++++++++++++++++
 deployment/pcf/config/blobs.yml                 |  19 +
 deployment/pcf/config/final.yml                 |  24 +
 deployment/pcf/content_migrations.yml           |  53 ++
 deployment/pcf/createRelease.sh                 |  24 +
 deployment/pcf/createTile.sh                    |  32 ++
 deployment/pcf/jobs/delete-all/monit            |  17 +
 deployment/pcf/jobs/delete-all/spec             |  44 ++
 .../jobs/delete-all/templates/delete-all.sh.erb | 131 +++++
 deployment/pcf/jobs/deploy-all/monit            |  18 +
 deployment/pcf/jobs/deploy-all/spec             | 145 ++++++
 .../jobs/deploy-all/templates/deploy-all.sh.erb | 384 ++++++++++++++
 .../pcf/jobs/docker-bosh-cassandra_docker/monit |  23 +
 .../pcf/jobs/docker-bosh-cassandra_docker/spec  |  26 +
 .../docker-bosh-cassandra_docker.sh.erb         |  69 +++
 .../jobs/docker-bosh-elasticsearch_docker/monit |  23 +
 .../jobs/docker-bosh-elasticsearch_docker/spec  |  26 +
 .../docker-bosh-elasticsearch_docker.sh.erb     |  69 +++
 .../pcf/packages/cassandra_docker/packaging     |  26 +
 deployment/pcf/packages/cassandra_docker/spec   |  26 +
 deployment/pcf/packages/cf_cli/packaging        |  26 +
 deployment/pcf/packages/cf_cli/spec             |  25 +
 deployment/pcf/packages/common/packaging        |  23 +
 deployment/pcf/packages/common/spec             |  25 +
 .../pcf/packages/elasticsearch_docker/packaging |  26 +
 .../pcf/packages/elasticsearch_docker/spec      |  26 +
 deployment/pcf/packages/usergrid_app/packaging  |  27 +
 deployment/pcf/packages/usergrid_app/spec       |  27 +
 deployment/pcf/run.sh                           |  25 +
 deployment/pcf/src/common/utils.sh              | 107 ++++
 deployment/pcf/src/templates/all_open.json      |   6 +
 deployment/pcf/src/usergrid_app/manifest.yml    |  22 +
 docs/orgs-and-apps/application.md               | 104 ++++
 .../main/resources/usergrid-default.properties  |   4 +
 .../corepersistence/CpEntityManager.java        |  36 +-
 .../corepersistence/CpRelationManager.java      |  32 +-
 .../asyncevents/AsyncEventServiceImpl.java      |  34 +-
 .../usergrid/persistence/EntityManager.java     |   2 +-
 .../collection/EntityCollectionManager.java     |   3 +-
 .../impl/EntityCollectionManagerImpl.java       |  34 +-
 .../mvcc/stage/write/WriteUniqueVerify.java     |  48 +-
 .../UniqueValueSerializationStrategy.java       |   3 +-
 .../UniqueValueSerializationStrategyImpl.java   | 139 ++++-
 .../collection/EntityCollectionManagerIT.java   |   6 +-
 ...niqueValueSerializationStrategyImplTest.java | 218 +++++++-
 .../graph/impl/GraphManagerImpl.java            |   4 +
 stack/pom.xml                                   |   2 -
 .../security/SecuredResourceFilterFactory.java  |  72 ++-
 .../collection/devices/DevicesResourceIT.java   |   3 +-
 .../usergrid/rest/management/AdminUsersIT.java  |  80 +++
 .../cassandra/ManagementServiceImpl.java        |  33 +-
 .../services/AbstractCollectionService.java     |  49 +-
 .../services/AbstractConnectionsService.java    |   6 +-
 .../services/devices/DevicesService.java        |   2 +
 stack/tools/pom.xml                             |   1 +
 .../org/apache/usergrid/tools/ToolBase.java     |  28 +-
 .../usergrid/tools/UniqueValueScanner.java      | 276 ++++++++++
 .../main/resources/toolsApplicationContext.xml  |   7 +
 61 files changed, 3446 insertions(+), 104 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/25303e6d/stack/config/src/main/resources/usergrid-default.properties
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/usergrid/blob/25303e6d/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
----------------------------------------------------------------------

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

http://git-wip-us.apache.org/repos/asf/usergrid/blob/25303e6d/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManager.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/usergrid/blob/25303e6d/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/EntityCollectionManager.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/usergrid/blob/25303e6d/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/impl/EntityCollectionManagerImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/usergrid/blob/25303e6d/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java
----------------------------------------------------------------------
diff --cc stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java
index 848ed2e,7b76dc8..92ea6aa
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java
@@@ -47,15 -39,20 +47,12 @@@ import org.apache.usergrid.persistence.
  import org.apache.usergrid.persistence.model.entity.Id;
  import org.apache.usergrid.persistence.model.field.Field;
  import org.apache.usergrid.persistence.model.util.EntityUtils;
 -
 -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.exceptions.ConnectionException;
 -import com.netflix.astyanax.model.ConsistencyLevel;
 -import com.netflix.hystrix.HystrixCommand;
 -import com.netflix.hystrix.HystrixCommandGroupKey;
 -import com.netflix.hystrix.HystrixThreadPoolProperties;
 -
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
  import rx.functions.Action1;
  
- import java.util.ArrayList;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
++import java.util.*;
 +
  
  /**
   * This phase execute all unique value verification on the MvccEntity.
@@@ -163,6 -119,28 +161,29 @@@ public class WriteUniqueVerify implemen
              // use write-first then read strategy
              final UniqueValue written = new UniqueValueImpl( field, mvccEntity.getId(),
mvccEntity.getVersion() );
  
+             try {
+ 
+                 // loading will retrieve the oldest unique value entry for the field
 -                UniqueValueSet set = uniqueValueStrat.load(scope, written.getEntityId().getType(),
Collections.singletonList(written.getField()));
++                UniqueValueSet set = uniqueValueStrat.load(
++                    scope, written.getEntityId().getType(), Collections.singletonList(written.getField()));
+ 
+ 
+                 set.forEach(uniqueValue -> {
+ 
+                     if(!uniqueValue.getEntityId().getUuid().equals(written.getEntityId().getUuid())){
+ 
+                         preWriteUniquenessViolations.put(field.getName(), field);
+ 
+                     }
+ 
+                 });
+ 
+ 
+             } catch (ConnectionException e) {
+ 
+                 throw new RuntimeException("Error connecting to cassandra", e);
+             }
+ 
              // use TTL in case something goes wrong before entity is finally committed
              final MutationBatch mb = uniqueValueStrat.write( scope, written, serializationFig.getTimeout()
);
  
@@@ -226,7 -207,7 +252,8 @@@
  
          @Override
          protected Map<String, Field> getFallback() {
--            // fallback with same CL as there are many reasons the 1st execution failed,
not just due to consistency problems
++            // fallback with same CL as there are many reasons the 1st execution failed,
++            // not just due to consistency problems
              return executeStrategy(fig.getReadCL());
          }
  
@@@ -257,6 -239,16 +285,16 @@@
                  final Id returnedEntityId = uniqueValue.getEntityId();
  
                  if ( !entity.getId().equals(returnedEntityId) ) {
+ 
+                     if(logger.isTraceEnabled()) {
 -                        logger.trace("Violation occurred when verifying unique value [{}={}].
Returned entity id [{}] " +
 -                            "does not match expected entity id [{}]",
++                        logger.trace("Violation occurred when verifying unique value [{}={}].
" +
++                            "Returned entity id [{}] does not match expected entity id [{}]",
+                             field.getName(), field.getValue().toString(),
+                             returnedEntityId,
+                             entity.getId()
+                         );
+                     }
+ 
                      uniquenessViolations.put( field.getName(), field );
                  }
              }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/25303e6d/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/EntityCollectionManagerIT.java
----------------------------------------------------------------------
diff --cc stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/EntityCollectionManagerIT.java
index bb2377a,0f3daa4..f8322c6
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/EntityCollectionManagerIT.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/EntityCollectionManagerIT.java
@@@ -29,8 -34,6 +29,7 @@@ import org.apache.usergrid.persistence.
  import org.apache.usergrid.persistence.collection.serialization.SerializationFig;
  import org.apache.usergrid.persistence.collection.serialization.UniqueValueSerializationStrategy;
  import org.apache.usergrid.persistence.collection.serialization.UniqueValueSet;
- import org.apache.usergrid.persistence.collection.uniquevalues.UniqueValueActor;
 +import org.apache.usergrid.persistence.collection.uniquevalues.UniqueValuesService;
  import org.apache.usergrid.persistence.collection.util.EntityHelper;
  import org.apache.usergrid.persistence.core.guice.MigrationManagerRule;
  import org.apache.usergrid.persistence.core.guicyfig.SetConfigTestBypass;
@@@ -46,19 -49,20 +45,18 @@@ import org.apache.usergrid.persistence.
  import org.apache.usergrid.persistence.model.field.Field;
  import org.apache.usergrid.persistence.model.field.IntegerField;
  import org.apache.usergrid.persistence.model.field.StringField;
 -
 -import com.fasterxml.uuid.UUIDComparator;
 -import com.google.inject.Inject;
 -import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
 -
 +import org.junit.Before;
 +import org.junit.Rule;
 +import org.junit.Test;
 +import org.junit.runner.RunWith;
  import rx.Observable;
  
 -import static org.junit.Assert.assertEquals;
 -import static org.junit.Assert.assertFalse;
 -import static org.junit.Assert.assertNotEquals;
 -import static org.junit.Assert.assertNotNull;
 -import static org.junit.Assert.assertNull;
 -import static org.junit.Assert.assertTrue;
 -import static org.junit.Assert.fail;
 +import java.util.ArrayList;
 +import java.util.Arrays;
 +import java.util.List;
 +import java.util.UUID;
- import java.util.concurrent.atomic.AtomicBoolean;
 +
 +import static org.junit.Assert.*;
  
  
  /** @author tnine */

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

http://git-wip-us.apache.org/repos/asf/usergrid/blob/25303e6d/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/usergrid/blob/25303e6d/stack/services/src/main/java/org/apache/usergrid/services/AbstractConnectionsService.java
----------------------------------------------------------------------


Mime
View raw message