我正在尝试在DynamoDB上使用复合索引,但该索引从INSTALLED
状态永远无法切换到REGISTERED
状态。
以下是我用来创建它的代码:
graph.tx().rollback(); //Never create new indexes while a transaction is active
TitanManagement mgmt=graph.openManagement();
PropertyKey propertyKey=getOrCreateIfNotExist(mgmt, "propertyKeyName");
String indexName = makePropertyKeyIndexName(propertyKey);
if (mgmt.getGraphIndex(indexName)==null) {
mgmt.buildIndex(indexName, Vertex.class).addKey(propertyKey).buildCompositeIndex();
mgmt.commit();
graph.tx().commit();
ManagementSystem.awaitGraphIndexStatus(graph, indexName).status(SchemaStatus.REGISTERED).call();
}else {
mgmt.rollback();
}
以下是日志样本:
... ...
612775 [main] 信息 com.thinkaurelius.titan.graphdb.database.management.GraphIndexStatusWatcher - 索引 myIndex 上的某些键当前没有状态 REGISTERED:type=INSTALLED 613275 [main] 信息 com.thinkaurelius.titan.graphdb.database.management.GraphIndexStatusWatcher - 索引 typeIndex 上的某些键当前没有状态 REGISTERED:type=INSTALLED 613275 [main] 信息 com.thinkaurelius.titan.graphdb.database.management.GraphIndexStatusWatcher - 在等待索引 typeIndex 收敛到状态 REGISTERED 时超时 (PT1M)
注意:本文只是翻译,不提供解释。保留了HTML标签,请勿删除。