You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by gr...@apache.org on 2015/03/30 22:09:53 UTC

incubator-usergrid git commit: [USERGRID-505] Added changes to see if hysterix does better with a smaller coreSize.

Repository: incubator-usergrid
Updated Branches:
  refs/heads/two-dot-o_exception_verification e4a9c742f -> 3b3ec5476


[USERGRID-505] Added changes to see if hysterix does better with a smaller coreSize.


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

Branch: refs/heads/two-dot-o_exception_verification
Commit: 3b3ec5476972d5b247e164c45da08905e9c21d85
Parents: e4a9c74
Author: GERey <gr...@apigee.com>
Authored: Mon Mar 30 13:09:52 2015 -0700
Committer: GERey <gr...@apigee.com>
Committed: Mon Mar 30 13:09:52 2015 -0700

----------------------------------------------------------------------
 .../apache/usergrid/corepersistence/CpEntityManager.java |  3 ++-
 .../collection/mvcc/stage/write/WriteUniqueVerify.java   | 11 +++++++++--
 2 files changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3b3ec547/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
index 4126186..9984264 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
@@ -629,11 +629,12 @@ public class CpEntityManager implements EntityManager {
             handleWriteUniqueVerifyException( entity, wuve );
         }
         catch ( HystrixRuntimeException hre ) {
-
+            logger.error( "Hysterix returned an exception during update" );
             if ( hre.getCause() instanceof WriteUniqueVerifyException ) {
                 WriteUniqueVerifyException wuve = ( WriteUniqueVerifyException ) hre.getCause();
                 handleWriteUniqueVerifyException( entity, wuve );
             }
+            logger.error( "EXACT EXCEPTION IS BELOW" );
 
             throw hre;
         }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3b3ec547/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java
index 5bdf3b9..4a6f7e3 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerify.java
@@ -78,6 +78,7 @@ public class WriteUniqueVerify implements Action1<CollectionIoEvent<MvccEntity>>
     private final CassandraConfig cassandraFig;
 
 
+
     @Inject
     public WriteUniqueVerify( final UniqueValueSerializationStrategy uniqueValueSerializiationStrategy,
                               final SerializationFig serializationFig, final Keyspace keyspace, final CassandraConfig cassandraFig ) {
@@ -111,7 +112,12 @@ public class WriteUniqueVerify implements Action1<CollectionIoEvent<MvccEntity>>
         // Construct all the functions for verifying we're unique
         //
 
+        //create a new configuration param with a stronger consistency level write
+        //then read it back at a stronger consistency.
+        //SErialization fig,
+        //In the batch set the consistency level in the batch before it goes off to do the write.
 
+        batch.setConsistencyLevel( cassandraFig.getWriteCL() );
         for ( final Field field : EntityUtils.getUniqueFields(entity)) {
 
             // if it's unique, create a function to validate it and add it to the list of
@@ -194,8 +200,9 @@ public class WriteUniqueVerify implements Action1<CollectionIoEvent<MvccEntity>>
             for ( final Field field : uniqueFields ) {
 
                 final UniqueValue uniqueValue = uniqueValues.getValue( field.getName() );
-
                 if ( uniqueValue == null ) {
+                    LOG.error( "Could not get uniqueValue from the field name." );
+
                     throw new RuntimeException(
                         String.format( "Could not retrieve unique value for field %s, unable to verify",
                             field.getName() ) );
@@ -218,5 +225,5 @@ public class WriteUniqueVerify implements Action1<CollectionIoEvent<MvccEntity>>
     public static final HystrixCommand.Setter
         REPLAY_GROUP = HystrixCommand.Setter.withGroupKey(
             HystrixCommandGroupKey.Factory.asKey( "user" ) ).andThreadPoolPropertiesDefaults(
-                HystrixThreadPoolProperties.Setter().withCoreSize( 1000 ) );
+                HystrixThreadPoolProperties.Setter().withCoreSize( 100 ) );
 }