-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
32 lines (21 loc) · 666 Bytes
/
main.cpp
File metadata and controls
32 lines (21 loc) · 666 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <iostream>
#include <ConsistencyHash.h>
using namespace std;
int main()
{
ConsistencyHash hash(5);
hash.addHashNodesFromString("192.168.1.1:8899");
hash.addHashNodesFromString("192.168.1.1:7799");
hash.addHashNodesFromString("192.168.1.1:6699");
hash.addHashNodesFromString("192.168.1.1:5599");
hash.ShowNodeMsg();
MD5 md5;
for (int i = 0; i < 8000; i++) {
string str = "Start";
string str2 = str + "test" + std::to_string(i * 100);
md5.GenerateMD5(str2.c_str(), str2.length());
hash.getMappingNodeFromKey(md5.ToULong32());
}
hash.ShowMappingStatisticMsg();
return 0;
}