Secondary index update issue

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-25 06:45:12

问题


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?

Here are CF details,

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}
];

Any suggestions would be appreciated.


回答1:


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.



来源:https://stackoverflow.com/questions/7334447/secondary-index-update-issue

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!