Cassandra lose datas

2014-07-15 Thread ilhami Kalkan

Hi all,
I'm new to Gora. I want to insert datas to cassandra with gora. I have 
successfully saved datas to db but about 1 minute they are removed from 
db. Do you know why? I add my source codes below


public class CassandraTest {

public static void main(String[] args) {

DataStoreString, users datastore = null;

try {
datastore = DataStoreFactory.createDataStore(
(Class? extends DataStoreString, users) Class
.forName(org.apache.gora.cassandra.store.CassandraStore),
String.class, users.class, new Configuration());
} catch (GoraException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}


users user = users.newBuilder().build();
user.setAge(1);
user.setName(new Utf8(foo1));
user.setSurname(new Utf8(example));

datastore.put(user.getName().toString(), user);
datastore.flush();

datastore.close();
}


Re: Cassandra lose datas

2014-07-15 Thread Lewis John Mcgibbney
Hi ilhami,

On Tue, Jul 15, 2014 at 5:37 AM, ilhami Kalkan ilhami.kal...@intellica.net
wrote:

 Hi all,
 I'm new to Gora.


WELCOME :) :)


 I want to insert datas to cassandra with gora. I have successfully saved
 datas to db but about 1 minute they are removed from db. Do you know why? I
 add my source codes below


You're code is absolutely fine. The 'problem' is with your mapping settings
in gora-cassandra-mapping.xml. Please see the documentation [0],
specifically relating to the values for 'gc_grace_seconds' and also 'ttl'.
If you have some other problems then please write here and we will help you
out on this one.
Thanks
Lewis

[0] http://gora.apache.org/current/gora-cassandra.html