Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cassandra/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/unity3d/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Cassandra创建自定义索引错误java.lang.ClassNotFoundException_Cassandra_Cqlsh - Fatal编程技术网

Cassandra创建自定义索引错误java.lang.ClassNotFoundException

Cassandra创建自定义索引错误java.lang.ClassNotFoundException,cassandra,cqlsh,Cassandra,Cqlsh,->表: cassandra@cqlsh:coba> CREATE TABLE data( ... nim int, ... nama text, ... alamat text, ... PRIMARY KEY (nim, alamat) ... ); ->制作索引: CREATE CUSTOM INDEX cari_alamat ON coba.data (alamat) USING 'org.apach

->表:

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

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

ServerError: java.lang.RuntimeException: java.lang.ClassNotFoundException: org.apache.cassandra.index.sasi.SASIIndex
->如果你能帮助我,我将非常高兴


->感谢您

正如最初所看到的,我认为您运行的是低于3.4的cassandra版本

(这就是为什么我要这个版本)

我试过了,在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'
理论上,您可以通过以下方式实现自己的功能:

但我想它只是更容易升级

还要注意,Sasi索引可能存在一些错误:


但是我想最好搜索cassandra Jira来查找这个,这只是一个小小的警告。

您正在运行什么版本的cassandra?在cassandra 3.4和更高版本中,提供了一个新的二级索引实现,即SSTable Attached secondary indexes(SASI)