Permalink
Browse files

Merge pull request #637 from cywjackson/master

hector-636: config gc_grace=ttl
  • Loading branch information...
2 parents 74944cc + 006ee75 commit dbf8d40c793b05758231ab8162c116af8591edaf @zznate zznate committed Oct 22, 2013
Showing with 4 additions and 0 deletions.
  1. +4 −0 core/src/main/java/me/prettyprint/cassandra/locking/AbstractLockManager.java
View
4 core/src/main/java/me/prettyprint/cassandra/locking/AbstractLockManager.java
@@ -1,6 +1,7 @@
package me.prettyprint.cassandra.locking;
import java.util.Arrays;
+import java.util.concurrent.TimeUnit;
import me.prettyprint.cassandra.service.AbstractCluster;
import me.prettyprint.cassandra.service.CassandraHostConfigurator;
@@ -17,6 +18,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import com.google.common.primitives.Ints;
+
/**
*
* @author patricioe (Patricio Echague - patricioe@gmail.com)
@@ -106,6 +109,7 @@ private ColumnFamilyDefinition createColumnFamilyDefinition() {
lockManagerConfigurator.getLockManagerCF(), ComparatorType.UTF8TYPE);
cfDef.setKeyValidationClass(ComparatorType.UTF8TYPE.getClassName());
cfDef.setRowCacheSize(lockManagerConfigurator.isRowsCacheEnabled() ? 10000 : 0);
+ cfDef.setGcGraceSeconds(Ints.saturatedCast(TimeUnit.MILLISECONDS.toSeconds(lockManagerConfigurator.getLocksTTLInMillis())));
return cfDef;
}

0 comments on commit dbf8d40

Please sign in to comment.