二级索引更新问题 [英] Secondary index update issue

查看:100
本文介绍了二级索引更新问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了KS& CF使用cassandra-0.7.8,并插入了一些行和列值(约1000行)。后来,我想索引2个列值。因此,我发出了更新列族..命令。之后,当我基于索引值进行查询时,显示未找到行。
索引后1.发出nodetool flush 2.重新启动Cassandra一次。虽然一样。但是,我可以在cassandra数据目录上看到一些XXX-Index.db文件。
我想念什么?

I have created KS & CF using cassandra-0.7.8 and inserted some rows and column values(around 1000 rows). Later, I wanted to index 2 column values. So, I issued 'update column family..' command. After, when I query based on indexed value it says "Row does not found". After indexing 1. Issued nodetool flush 2.restarted Cassandra once. Though it is same. But, I could see some XXX-Index.db file on cassandra data directory. What am I missing?

以下是CF详细信息,

create column family ipinfo with column_type=Standard and 
default_validation_class =   UTF8Type and comparator=UTF8Type and
keys_cached=25000 and rows_cached=5000 and column_metadata=[
{ column_name : country, validation_class : UTF8Type},
{ column_name : ip, validation_class : LongType},
{ column_name : domain, validation_class : UTF8Type },
];

update column family ip with column_type=Standard and 
default_validation_class = UTF8Type and comparator=UTF8Type and
keys_cached=25000 and rows_cached=5000 and column_metadata=[
{column_name : country, validation_class : UTF8Type },
{column_name : domain, validation_class : UTF8Type, index_type: KEYS},
{column_name : ip, validation_class : LongType, index_type: KEYS}
];

任何建议将不胜感激。

推荐答案

如果在拥有大量数据之后添加二级索引,则需要花费一些时间来构建。这不是同步添加,索引是异步构造的。您可以考虑等待一段时间,直到完成索引。不幸的是,我不知道确定该索引何时完成的好方法。

Secondary indexes take a while to build if they are added after you already have a bunch of data. It's not a synchronous addition, the indexes are constructed asynchronously. You might consider waiting a while until the indexing is done. Unfortunately I don't know a good way to determine when that indexing has completed.

这篇关于二级索引更新问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆