【问题标题】:How to assign titan ids in titan db internal?如何在titan db internal中分配titan id?
【发布时间】:2017-10-16 16:37:50
【问题描述】:

我查看了titan db的源代码,titan为顶点、属性、标签等分配了id。但是很难理解它是如何分配的?

【问题讨论】:

标签: database titan


【解决方案1】:

Titan ID 具有以下格式

╔═════════╦═══════════╦══════════════════╗
║ Counter ║ Partition ║   IDTypePadding  ║
╚═════════╩═══════════╩══════════════════╝
  • 每个 ID 都有IDTypePadding 后缀。后缀定义 ID 的类型。这是在IDManagerVertexIDType 枚举中实现的。

  • 默认情况下有 32 个可用分区值。每个titan实例默认随机选择10个分区。

  • 对于每个分区,titan 分配 ID 块。默认 ID 块大小为 10000。Titan 使用后端存储的 titan_ids 表确保 ID 块在分区级别的集群中是唯一的。

  • ID 分配:第一个泰坦选择IDTypePadding。然后随机选择一个分区。最后从 ID 块中获取递增的计数器。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-07-05
    • 2015-10-01
    • 1970-01-01
    • 2016-08-05
    • 2017-03-27
    • 1970-01-01
    • 2016-01-24
    • 2017-03-20
    相关资源
    最近更新 更多