Permalink
Browse files

hector-636: config gc_grace=ttl

  • Loading branch information...
1 parent 74944cc commit 006ee75c566c756793c66bcc628a87f4390439c7 Jackson Chung committed Oct 22, 2013
Showing with 4 additions and 0 deletions.
  1. +4 −0 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 006ee75

Please sign in to comment.