【问题标题】:Index state never change to ENABLED on Titan with Amazon DynamoDB backend在具有 Amazon DynamoDB 后端的 Titan 上,索引状态永远不会更改为 ENABLED
【发布时间】:2016-05-07 10:15:35
【问题描述】:

我正在尝试在 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 [主要] 信息 com.thinkaurelius.titan.graphdb.database.management.GraphIndexStatusWatcher - 索引 myIndex 上的某些键当前没有注册状态:type=INSTALLED 613275 [main] INFO com.thinkaurelius.titan.graphdb.database.management.GraphIndexStatusWatcher - 索引 typeIndex 上的某些键当前没有状态已注册:type=INSTALLED 613275 [main] INFO com.thinkaurelius.titan.graphdb.database.management.GraphIndexStatusWatcher - 等待索引 typeIndex 收敛到 REGISTERED 状态时超时 (PT1M)

【问题讨论】:

  • 嘿 M-T-A,你能做到吗,我在使用 titan + cassandra 时遇到了类似的问题。
  • 不,希望能得到泰坦人对此的回应。
  • 我观察到的是,如果给定标签没有数据,则索引会转移到启用状态,但如果已经存在一些数据,则它会卡在已安装状态
  • 此外,即使没有其他实例处于停滞/非活动状态,这也是相同的行为

标签: amazon-dynamodb titan


【解决方案1】:

等待更长的时间就可以解决问题。示例:

ManagementSystem.awaitGraphIndexStatus(graph, propertyKeyIndexName)
                    .status(SchemaStatus.ENABLED)
                    .timeout(10, ChronoUnit.MINUTES) // set timeout to 10 min
                    .call();

【讨论】:

    猜你喜欢
    • 2016-05-10
    • 1970-01-01
    • 2013-09-25
    • 2017-01-31
    • 1970-01-01
    • 2019-02-05
    • 1970-01-01
    • 1970-01-01
    • 2016-11-24
    相关资源
    最近更新 更多