usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sfeld...@apache.org
Subject [60/68] [abbrv] incubator-usergrid git commit: add hector locking consistency levels
Date Fri, 17 Apr 2015 22:48:05 GMT
add hector locking consistency levels


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

Branch: refs/heads/two-dot-o-dev
Commit: 51894bc7e197985c444405c2a5fab042db4ced92
Parents: cdaabe3
Author: Yi Ding <yding37@gmail.com>
Authored: Wed Apr 15 18:46:22 2015 -0700
Committer: Yi Ding <yding37@gmail.com>
Committed: Wed Apr 15 18:46:22 2015 -0700

----------------------------------------------------------------------
 .../main/resources/usergrid-default.properties  |  9 +++--
 .../main/resources/usergrid-core-context.xml    | 37 +++++++++++---------
 2 files changed, 27 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/51894bc7/stack/config/src/main/resources/usergrid-default.properties
----------------------------------------------------------------------
diff --git a/stack/config/src/main/resources/usergrid-default.properties b/stack/config/src/main/resources/usergrid-default.properties
index 37acfc5..c1207b8 100644
--- a/stack/config/src/main/resources/usergrid-default.properties
+++ b/stack/config/src/main/resources/usergrid-default.properties
@@ -62,6 +62,9 @@ cassandra.mutation.flushsize=2000
 #Note that if this is deployed in a production cluster, the RF on the keyspace MUST be updated
to use an odd number for it's replication Factor.
 #Even numbers for RF can potentially case the locks to fail, via "split brain" when read
at QUORUM on lock verification
 cassandra.lock.keyspace=Locks
+#locking read & write policies
+cassandra.lock.readcl=QUORUM
+cassandra.lock.writecl=QUORUM
 
 # Timeout in ms before hector considers a thrift socket dead
 cassandra.thriftSocketTimeout=0
@@ -128,7 +131,7 @@ usergrid.queue.lock.timeout=5
 #Scheduler setup
 ######
 
-#Time in milliseconds that a job can be started without a heartbeat before being considered
dead.  
+#Time in milliseconds that a job can be started without a heartbeat before being considered
dead.
 #Note that this must be high enough so that jobs that are iteration based can run an iteration
and update the heartbeat
 usergrid.scheduler.job.timeout=120000
 #The path to the queue in the managment app to get jobs from
@@ -137,7 +140,7 @@ usergrid.scheduler.job.queueName=/jobs
 usergrid.scheduler.job.workers=4
 #Poll interval to check for new jobs in millseconds.  5 seconds is the default.  It will
run all jobs up to current so this won't limit throughput
 usergrid.scheduler.job.interval=5000
-#The max number of times a job can fail before removing it permanently. Note that this count
is INCLUSIVE.  
+#The max number of times a job can fail before removing it permanently. Note that this count
is INCLUSIVE.
 #If the value is 10, the 11th fail will mark the job as dead
 usergrid.scheduler.job.maxfail=10
 
@@ -288,7 +291,7 @@ usergrid.management.email.admin-password-reset=\
 # User approval flow
 #
 
-# email to admin to approve and activate new app user 
+# email to admin to approve and activate new app user
 usergrid.management.email.admin-user-activation=\
     <p>To activate the user account for ${user_email}, click here:</p>\n\
     <p><a href="${activation_url}">${activation_url}</a></p>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/51894bc7/stack/core/src/main/resources/usergrid-core-context.xml
----------------------------------------------------------------------
diff --git a/stack/core/src/main/resources/usergrid-core-context.xml b/stack/core/src/main/resources/usergrid-core-context.xml
index 917ee9c..3e49455 100644
--- a/stack/core/src/main/resources/usergrid-core-context.xml
+++ b/stack/core/src/main/resources/usergrid-core-context.xml
@@ -31,7 +31,7 @@
     <aop:config proxy-target-class="true"/>
 
 
-	
+
 	<bean id="propertyPlaceholderConfigurer"
 		class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
 		<property name="properties" ref="properties" />
@@ -40,7 +40,7 @@
 		</property>
 	</bean>
 
-	
+
 	<!-- The Time Resolution used for the cluster -->
 	<bean id="microsecondsTimeResolution" class="me.prettyprint.cassandra.service.clock.MicrosecondsClockResolution"
/>
   <bean id="traceTagManager" class="org.apache.usergrid.persistence.cassandra.util.TraceTagManager"/>
@@ -71,18 +71,23 @@
 
     <bean id="loadBalancingPolicy" class="me.prettyprint.cassandra.connection.DynamicLoadBalancingPolicy"/>
 
-	<!--  locking for a single node -->	
+	<!--  locking for a single node -->
     <!-- <bean name="lockManager" class="org.apache.usergrid.locking.singlenode.SingleNodeLockManagerImpl"
/> -->
-	
+
 	<!--  hector based locks -->
 	<!-- Note that if this is deployed in a production cluster, the RF on the keyspace MUST
be updated to use an odd number for it's replication Factor.
 		  Even numbers can potentially case the locks to fail, via "split brain" when read at QUORUM
on lock verification-->
-	
-	<bean name="lockManager" class="org.apache.usergrid.locking.cassandra.HectorLockManagerImpl"
>
+
+	<bean name="lockManager" class="org.apache.usergrid.locking.cassandra.HectorLockManagerImpl">
 		<property name="cluster" ref="cassandraCluster"/>
 		<property name="keyspaceName" value="${cassandra.lock.keyspace}"/>
+        <property name="consistencyLevelPolicy" ref="hlockConsistencyLevelPolicy" />
 	</bean>
-	
+    <bean name="hlockConsistencyLevelPolicy" class="me.prettyprint.cassandra.model.ConfigurableConsistencyLevel">
+        <property name="defaultReadConsistencyLevel" value="${cassandra.lock.readcl}"/>
+        <property name="defaultWriteConsistencyLevel" value="${cassandra.lock.writecl}"/>
+    </bean>
+
 	<!--  zookeeper locks -->
 	<!--
 	<bean name="lockManager" class="org.apache.usergrid.locking.zookeeper.ZooKeeperLockManagerImpl"
>
@@ -90,9 +95,9 @@
 		<property name="sessionTimeout" value="2000"/>
 		<property name="maxAttempts" value="10"/>
 	</bean>  -->
-	
-		
-	
+
+
+
 	<bean id="cassandraService"
 		class="org.apache.usergrid.persistence.cassandra.CassandraService" init-method="init" destroy-method="destroy">
 		<constructor-arg ref="properties" />
@@ -101,12 +106,12 @@
 		<constructor-arg ref="lockManager" />
 		<property name="consistencyLevelPolicy" ref="consistencyLevelPolicy"/>
 	</bean>
-	
+
 	<bean name="consistencyLevelPolicy" class="me.prettyprint.cassandra.model.ConfigurableConsistencyLevel">
         <property name="defaultReadConsistencyLevel" value="${cassandra.readcl}"/>
         <property name="defaultWriteConsistencyLevel" value="${cassandra.writecl}"/>
     </bean>
-	
+
 
 	<bean id="entityManagerFactory"
 		class="org.apache.usergrid.persistence.cassandra.EntityManagerFactoryImpl">
@@ -150,12 +155,12 @@
         <constructor-arg ref="cassandraCluster"/>
         <constructor-arg ref="properties"/>
     </bean>
-    
-        
+
+
    <bean id="indexBucketLocator" class="org.apache.usergrid.persistence.cassandra.SimpleIndexBucketLocatorImpl">
     	<constructor-arg value="${usergrid.index.defaultbucketsize}"/>
     </bean>
-    
+
     <bean id="mailUtils" class="org.apache.usergrid.utils.MailUtils" />
 
     <bean id="entityManager" class="org.apache.usergrid.persistence.cassandra.EntityManagerImpl"
scope="prototype"/>
@@ -175,7 +180,7 @@
            method="applyTrace"/>
       </aop:aspect>
     </aop:config>
-   
+
     <!-- ============================================================== -->
     <!-- Scheduler Settings from removed Scheduler Module's app context -->
     <!-- ============================================================== -->


Mime
View raw message