私は次の列ファミリーを持っています:
CREATE COLUMN FAMILY messages with comparator=DateType and key_validation_class=UTF8Type and default_validation_class=UTF8Type;
現在、CassandraThriftを使用して新しいデータを保存しています。
TTransport tr = this.dataSource.getConnection();
TProtocol proto = new TBinaryProtocol(tr);
Cassandra.Client client = new Cassandra.Client(proto);
long timestamp = System.currentTimeMillis();
client.set_keyspace("myTestSPace");
ColumnParent parent = new ColumnParent("messages");
Column messageColumn = new Column();
String time = String.valueOf(timestamp);
messageColumn.setName(time.getBytes());
messageColumn.setValue(toByteBuffer(msg.getText));
messageColumn.setTimestamp(timestamp);
client.insert(toByteBuffer(msg.getAuthor()), parent, messageColumn, ConsistencyLevel.ONE);
しかし、私は例外を得ています:
InvalidRequestException(why:Expected 8 or 0 byte long for date (16))
at org.apache.cassandra.thrift.Cassandra$insert_result.read(Cassandra.java:15198)
at org.apache.cassandra.thrift.Cassandra$Client.recv_insert(Cassandra.java:858)
at org.apache.cassandra.thrift.Cassandra$Client.insert(Cassandra.java:830)
at com.vanilla.cassandra.DaoService.addMessage(DaoService.java:57)
それを修正する方法は?