使用 Amazon DynamoDB 后端的 Titan 上的索引状态永远不会更改为 ENABLED
Index state never change to ENABLED on Titan with Amazon DynamoDB backend
我正在尝试在 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] 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
等待更长的时间就可以了。示例:
ManagementSystem.awaitGraphIndexStatus(graph, propertyKeyIndexName)
.status(SchemaStatus.ENABLED)
.timeout(10, ChronoUnit.MINUTES) // set timeout to 10 min
.call();
我正在尝试在 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] 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
等待更长的时间就可以了。示例:
ManagementSystem.awaitGraphIndexStatus(graph, propertyKeyIndexName)
.status(SchemaStatus.ENABLED)
.timeout(10, ChronoUnit.MINUTES) // set timeout to 10 min
.call();