如何在titan db internal中分配titan id?

时间:2017-05-17 09:38:23

标签: database titan

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

1 个答案:

答案 0 :(得分:1)

Titan ID具有以下格式

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

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

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

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

相关问题