当我插入带有 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