Cassandra CREATE CUSTOM INDEX ERROR java.lang.ClassNotFoundException

僤鯓⒐⒋嵵緔 提交于 2019-12-24 09:15:51

问题


-> Table :

cassandra@cqlsh:coba> CREATE TABLE data(
        ... nim int,
        ... nama text,
        ... alamat text,
        ... PRIMARY KEY (nim, alamat)
        ... );

-> Make Index :

CREATE CUSTOM INDEX cari_alamat ON coba.data (alamat) USING 'org.apache.cassandra.index.sasi.SASIIndex';

-> Error :

ServerError: java.lang.RuntimeException: java.lang.ClassNotFoundException: org.apache.cassandra.index.sasi.SASIIndex

-> I would be very happy if you can help me

-> Thanks You


回答1:


As initially susspected, I think you are running cassandra version lower than 3.4.

(that's why I asked for the version)

I tried it out and got the same error on 3.0.10:

cqlsh:test> CREATE CUSTOM INDEX cari_alamat ON test.data (alamat) USING 'org.apache.cassandra.index.sasi.SASIIndex';
ConfigurationException: Unable to find custom indexer class 'org.apache.cassandra.index.sasi.SASIIndex'

Theoretically you could implement your own with: Cassandra Custom Secondary Index

But I guess it's just easier to upgrade.

Also be aware there might be some bugs with Sasi indexes:

SASI Indexes in Cassandra seem to have some bugs

But I guess it's better to search cassandra Jira for this one, this is just as a small warning.



来源:https://stackoverflow.com/questions/43466847/cassandra-create-custom-index-error-java-lang-classnotfoundexception

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