在具有 Amazon DynamoDB 后端的 Titan 上,索引状态永远不会更改为 ENABLED [英] Index state never change to ENABLED on Titan with Amazon DynamoDB backend
问题描述
我正在尝试在 DynamoDB 上使用复合索引,但索引永远不会从 INSTALLED
切换到 REGISTERED
状态.
I'm trying to use composite index on DynamoDB and the index never switches from from INSTALLED
to REGISTERED
state.
这是我用来创建它的代码
Here is the code I used to create it
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 [主要] 信息com.thinkaurelius.titan.graphdb.database.management.GraphIndexStatusWatcher- 索引 myIndex 上的某些键当前没有注册状态:type=INSTALLED 613275 [main] INFOcom.thinkaurelius.titan.graphdb.database.management.GraphIndexStatusWatcher- 索引 typeIndex 上的某些键当前没有状态已注册:type=INSTALLED 613275 [main] INFOcom.thinkaurelius.titan.graphdb.database.management.GraphIndexStatusWatcher- 等待索引 typeIndex 收敛到 REGISTERED 状态时超时 (PT1M)
612775 [main] INFO com.thinkaurelius.titan.graphdb.database.management.GraphIndexStatusWatcher - Some key(s) on index myIndex do not currently have status REGISTERED: type=INSTALLED 613275 [main] INFO com.thinkaurelius.titan.graphdb.database.management.GraphIndexStatusWatcher - Some key(s) on index typeIndex do not currently have status REGISTERED: type=INSTALLED 613275 [main] INFO com.thinkaurelius.titan.graphdb.database.management.GraphIndexStatusWatcher - Timed out (PT1M) while waiting for index typeIndex to converge on status REGISTERED
推荐答案
等待更长的时间才能解决问题.示例:
Waiting for a longer time does the trick. Example:
ManagementSystem.awaitGraphIndexStatus(graph, propertyKeyIndexName)
.status(SchemaStatus.ENABLED)
.timeout(10, ChronoUnit.MINUTES) // set timeout to 10 min
.call();
这篇关于在具有 Amazon DynamoDB 后端的 Titan 上,索引状态永远不会更改为 ENABLED的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!