Reputation: 11
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 ?
Upvotes: 0
Views: 101
Reputation: 12830
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.
Upvotes: 1