0

I had view the source code of titan db, titan assign ids for vertex , property , label and so on. But it is difficult to understand how it works for assigning ?

rabbage
  • 11
  • 2
  • Possible duplicate of [Titan+Cassandra and String Vertex Ids](http://stackoverflow.com/questions/38229312/titancassandra-and-string-vertex-ids) – Filipe Teixeira May 17 '17 at 12:47

1 Answers1

1

A Titan ID have the following format

╔═════════╦═══════════╦══════════════════╗
║ Counter ║ Partition ║   IDTypePadding  ║
╚═════════╩═══════════╩══════════════════╝
  • Every ID has IDTypePadding suffix. Suffix define type of ID. This is implemented in IDManager class VertexIDType enum.

  • By default there are 32 partition value available. Each titan instance by default randomly choose 10 partition.

  • For each partition, titan allocate ID Block. Default ID Block size is 10000. Titan make sure, ID block is unique across cluster at partition level using Backend Storage's titan_ids table.

  • ID Assigning : First titan select the IDTypePadding. then choose a partition randomly. At last get the incremented counter from the ID Block.

Ashraful Islam
  • 12,470
  • 3
  • 32
  • 53