How to install GCGraceSeconds in Cassandra using astyanax?

I need to set GCGraceSeconds to 0 because I have only one node, but I can not find where I can set the value for this. Is it possible to install from astyanax or is it in some settings files?

+4
source share
2 answers

In later versions of cassandra, you actually set gc_grace_seconds for each column family as part of the schema. From what I can tell, Astyanax does not currently support setting this property. There is no corresponding method in the ColumnFamilyDefinition class.

https://github.com/Netflix/astyanax/blob/master/src/main/java/com/netflix/astyanax/ddl/ColumnFamilyDefinition.java

You can use the cassandra-cli tool to set the property in any existing column families if you want.

Also, it seems too complicated to add Astyanax support. I am sure they will agree to a pull request.

Update

Astyanax (for a while) now supports this setting. See ColumnFamilyDefinition . This can be set up in creating the astyanax column family as follows:

 OperationResult<SchemaChangeResult> opres = keyspace.createColumnFamily(cf, ImmutableMap.<String, Object> builder() .put("comparator", "UTF8Type") .put("key_validation_class", "UTF8Type") .put("gc_grace_seconds", 60*60*24) // gc grace seconds of one day .build() ); 
+4
source

This is done in conf / cassandra.yaml (Cassandra configuration file)

Preview 0.7: conf / storage-conf.xml

Remember: “Set this value large enough to make sure that the delete token will be distributed to all replicas by the time many seconds have passed, even in the event of a hardware failure. The default value is ten days.

The default value is " 864000 " seconds or 10 days.

+2
source

All Articles