Atom feed of this document
  

 分区调整值

分区调整值在内部即是环类的_part_shift。此值用于调整MD5哈希,从而来计算分区上的哪里的数据应驻留。在此过程中只有顶级的4byte哈希用得到。例如,要计算/account/container/object 路径的分区,Python代码类似下面的代码:

partition = unpack_from('>I',
md5('/account/container/object').digest())[0] >>
self._part_shift

对于part_power P生成的环,分区调整值是 32 - P

Questions? Discuss on ask.openstack.org
Found an error? Report a bug against this page


loading table of contents...