架构师训练营第五周作业
一致性 Hash 实现(go):
单元测试:
测试结果:
server_95(keys on the server: 11899, difference: 0.19)
server_35(keys on the server: 12468, difference: 0.25)
server_40(keys on the server: 9616, difference: -0.04)
server_57(keys on the server: 9019, difference: -0.10)
server_63(keys on the server: 8324, difference: -0.17)
server_67(keys on the server: 10539, difference: 0.05)
server_73(keys on the server: 9428, difference: -0.06)
server_94(keys on the server: 10668, difference: 0.07)
server_31(keys on the server: 10800, difference: 0.08)
server_43(keys on the server: 11304, difference: 0.13)
server_64(keys on the server: 9238, difference: -0.08)
server_77(keys on the server: 10561, difference: 0.06)
server_84(keys on the server: 10870, difference: 0.09)
server_87(keys on the server: 11374, difference: 0.14)
server_88(keys on the server: 9878, difference: -0.01)
server_93(keys on the server: 8944, difference: -0.11)
server_10(keys on the server: 10111, difference: 0.01)
server_15(keys on the server: 10060, difference: 0.01)
server_29(keys on the server: 9746, difference: -0.03)
server_30(keys on the server: 10463, difference: 0.05)
server_33(keys on the server: 9279, difference: -0.07)
server_42(keys on the server: 7877, difference: -0.21)
server_47(keys on the server: 10379, difference: 0.04)
server_99(keys on the server: 9845, difference: -0.02)
server_2(keys on the server: 10440, difference: 0.04)
server_21(keys on the server: 8640, difference: -0.14)
server_22(keys on the server: 9792, difference: -0.02)
server_38(keys on the server: 8439, difference: -0.16)
server_60(keys on the server: 9499, difference: -0.05)
server_76(keys on the server: 9780, difference: -0.02)
server_92(keys on the server: 9640, difference: -0.04)
server_58(keys on the server: 10464, difference: 0.05)
server_5(keys on the server: 9117, difference: -0.09)
server_16(keys on the server: 8575, difference: -0.14)
server_17(keys on the server: 10745, difference: 0.07)
server_27(keys on the server: 10128, difference: 0.01)
server_41(keys on the server: 11191, difference: 0.12)
server_53(keys on the server: 9994, difference: -0.00)
server_56(keys on the server: 10487, difference: 0.05)
server_74(keys on the server: 10944, difference: 0.09)
server_96(keys on the server: 10185, difference: 0.02)
server_1(keys on the server: 8716, difference: -0.13)
server_3(keys on the server: 10516, difference: 0.05)
server_9(keys on the server: 8609, difference: -0.14)
server_18(keys on the server: 12556, difference: 0.26)
server_45(keys on the server: 11134, difference: 0.11)
server_61(keys on the server: 9694, difference: -0.03)
server_7(keys on the server: 8494, difference: -0.15)
server_11(keys on the server: 9293, difference: -0.07)
server_26(keys on the server: 11392, difference: 0.14)
server_68(keys on the server: 8541, difference: -0.15)
server_34(keys on the server: 9288, difference: -0.07)
server_39(keys on the server: 10201, difference: 0.02)
server_54(keys on the server: 9225, difference: -0.08)
server_70(keys on the server: 10451, difference: 0.05)
server_79(keys on the server: 10036, difference: 0.00)
server_46(keys on the server: 9066, difference: -0.09)
server_69(keys on the server: 11278, difference: 0.13)
server_78(keys on the server: 10296, difference: 0.03)
server_85(keys on the server: 7540, difference: -0.25)
server_86(keys on the server: 9892, difference: -0.01)
server_89(keys on the server: 11760, difference: 0.18)
server_97(keys on the server: 11134, difference: 0.11)
server_13(keys on the server: 11109, difference: 0.11)
server_20(keys on the server: 9924, difference: -0.01)
server_80(keys on the server: 10647, difference: 0.06)
server_82(keys on the server: 8748, difference: -0.13)
server_66(keys on the server: 10918, difference: 0.09)
server_4(keys on the server: 9560, difference: -0.04)
server_19(keys on the server: 10321, difference: 0.03)
server_23(keys on the server: 9902, difference: -0.01)
server_25(keys on the server: 10809, difference: 0.08)
server_44(keys on the server: 9818, difference: -0.02)
server_48(keys on the server: 7635, difference: -0.24)
server_62(keys on the server: 12490, difference: 0.25)
server_59(keys on the server: 9881, difference: -0.01)
server_0(keys on the server: 10842, difference: 0.08)
server_6(keys on the server: 9320, difference: -0.07)
server_14(keys on the server: 10896, difference: 0.09)
server_28(keys on the server: 10147, difference: 0.01)
server_32(keys on the server: 9267, difference: -0.07)
server_36(keys on the server: 9313, difference: -0.07)
server_55(keys on the server: 10647, difference: 0.06)
server_65(keys on the server: 10996, difference: 0.10)
server_72(keys on the server: 10081, difference: 0.01)
server_75(keys on the server: 7991, difference: -0.20)
server_24(keys on the server: 11371, difference: 0.14)
server_50(keys on the server: 11255, difference: 0.13)
server_83(keys on the server: 9169, difference: -0.08)
server_98(keys on the server: 9754, difference: -0.02)
server_8(keys on the server: 8953, difference: -0.10)
server_37(keys on the server: 11078, difference: 0.11)
server_49(keys on the server: 11421, difference: 0.14)
server_51(keys on the server: 7361, difference: -0.26)
server_71(keys on the server: 10767, difference: 0.08)
server_90(keys on the server: 8716, difference: -0.13)
server_12(keys on the server: 10565, difference: 0.06)
server_52(keys on the server: 9412, difference: -0.06)
server_81(keys on the server: 8643, difference: -0.14)
server_91(keys on the server: 10411, difference: 0.04)
评论