TTL 列の有効期限で値を挿入すると、予期しない出力が表示されます
public static void setTTL()
{
try
{
Class.forName("org.apache.cassandra.cql.jdbc.CassandraDriver");
Connection con = DriverManager.getConnection("jdbc:cassandra://192.168.1.32/temp");
String qry = "INSERT INTO userscql3(user_name,password)VALUES('yogesh','temp@123') USING TTL 5";
Statement smt = con.createStatement();
smt.executeUpdate(qry);
System.out.println(" TTL has been set");
}
catch(Exception e)
{
System.out.println(" : " + e.getMessage());
e.printStackTrace();
}
}
私が得たものをトレースした後
Caused by: UnavailableException()
at org.apache.cassandra.thrift.Cassandra$execute_cql_query_result.read(Cassandra.java:33485)
at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78)
at org.apache.cassandra.thrift.Cassandra$Client.recv_execute_cql_query(Cassandra.java:1402)
at org.apache.cassandra.thrift.Cassandra$Client.execute_cql_query(Cassandra.java:1388)
at org.apache.cassandra.cql.jdbc.CassandraConnection.execute(CassandraConnection.java:392)
at org.apache.cassandra.cql.jdbc.CassandraConnection.execute(CassandraConnection.java:416)
at org.apache.cassandra.cql.jdbc.CassandraStatement.doExecute(CassandraStatement.java:161)
... 3 more