我正在尝试使用以下代码,但它表示无效的构造函数ColumnSliceIterator
SliceQuery<String, UUID, String> query = HFactory
.createSliceQuery(keyspaceOperator, StringSerializer.get(),
UUIDSerializer.get(), StringSerializer.get())
.setKey(login).setColumnFamily(FRIENDS_CF);
ColumnSliceIterator<String , UUID, String> iterator = new ColumnSliceIterator<String, UUID, String>(query, null, "\uFFFF", false);
我该如何解决这个问题?
答案 0 :(得分:0)
SliceQuery<String, UUID, String> query = HFactory
.createSliceQuery(keyspaceOperator, StringSerializer.get(),
UUIDSerializer.get(), StringSerializer.get())
.setKey(login).setColumnFamily(FRIENDS_CF);
ColumnSliceIterator.ColumnSliceFinish<UUID> FINISH = new ColumnSliceIterator.ColumnSliceFinish<UUID>() {
@Override
public UUID function() {
return TimeUUIDUtils.getUniqueTimeUUIDinMillis();
}
};
ColumnSliceIterator<String, UUID, String> iterator = new ColumnSliceIterator<String, UUID, String>(query, null, FINISH, false, 100);
List<String> friendIds = new LinkedList<String>();
while (iterator.hasNext()) {
friendIds.add(iterator.next().getName().toString());
}
return friendIds;