虽然在cassandra中错误地给两个索引指定了相同的目录路径( directory_path ),但是在删除索引时可能会产生错误,因此创建新索引。并能够删除指向唯一的不同目录路径的其他索引。请分享您的想法,即如何删除指向现有索引相同目录路径的新索引。
新索引
CREATE CUSTOM INDEX inbound_idx ON inventory.inbound (p_index) USING 'com.stratio.cassandra.lucene.Index' WITH OPTIONS = {'schema': '{
fields : {
symbol : {type : "string",case_sensitive: false},
destination : {type : "string",case_sensitive: false},
ticket_id : {type : "string",case_sensitive: false}
}
}', 'refresh_seconds': '1', 'directory_path': '/c05/stratio_index/inventory/inbound'};
CREATE CUSTOM INDEX inbound_idx_new ON inventory.inbound (p_index_new) USING 'com.stratio.cassandra.lucene.Index' WITH OPTIONS = {'schema': '{
fields : {
symbol : {type : "string",case_sensitive: false},
destination : {type : "string",case_sensitive: false},
ticket_id : {type : "string",case_sensitive: false}
}
}', 'refresh_seconds': '1', 'directory_path': '/c05/stratio_index/inventory/inbound'};
错误:
inventory_admin@cqlsh:inventory> drop index inbound_idx_new;
ServerError: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.NullPointerException
inventory_admin@cqlsh:inventory> drop INDEX inbound_idx;
ServerError: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.AssertionError: attempted to delete non-existing file inbound
inventory_admin@cqlsh:inventory> drop index inbound_idx1;
inventory_admin@cqlsh:inventory>