Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 3 Next »

Map object into hash space + Map cache into hash space

1- Define the interface (3 core functions)

ConsistentHash interface {
    Add(node Node)
    AddWithReplicas(node Node, replicas int)
    AddWithWeight(node Node, weight int) //When specifying weight: actual number of virtual nodes = configured virtual nodes * weight/100
    Get(key Node) Node
    Remove(node Node)
}

  • No labels