gpt4 book ai didi

amazon-dynamodb - 使用 Amazon DynamoDB 后端的 Titan 上的索引状态永远不会更改为 ENABLED

转载 作者:行者123 更新时间:2023-12-01 13:47:09 25 4
gpt4 key购买 nike

我正在尝试在 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();

关于amazon-dynamodb - 使用 Amazon DynamoDB 后端的 Titan 上的索引状态永远不会更改为 ENABLED,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35088574/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com