【发布时间】:2016-10-12 12:06:18
【问题描述】:
我想使用 Cassandra 和 Java 设置 Titan。
我使用以下方法将库导入到我的项目中:
compile group: 'com.thinkaurelius.titan', name: 'titan-cassandra', version: '1.0.0'
我从以下位置复制了源示例:
但是下面的事情不起作用:
import com.thinkaurelius.titan.core.TitanKey;
import com.thinkaurelius.titan.core.attribute.Geoshape;
import static com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.INDEX_BACKEND_KEY;
import static com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.STORAGE_DIRECTORY_KEY;
不存在
以下抛出错误,因为他无法解析引用:
Configuration storage = config.subset(GraphDatabaseConfiguration.STORAGE_NAME_SPACE);
storage.setProperty(GraphDatabaseConfiguration.STORAGE_BACKEND_KEY, "local");
storage.setProperty(GraphDatabaseConfiguration.STORAGE_DIRECTORY_KEY, directory);
Configuration index = storage.subset(GraphDatabaseConfiguration.INDEX_NAMESPACE).subset(INDEX_NAME);
index.setProperty(INDEX_BACKEND_KEY, "elasticsearch");
index.setProperty(STORAGE_DIRECTORY_KEY, directory + File.separator + "es");
【问题讨论】: