MCPcopy Create free account
hub / github.com/acl-dev/acl / main

Function main

lib_acl_cpp/samples/redis/redis_hyperloglog/redis_hyperloglog.cpp:105–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105int main(int argc, char* argv[])
106{
107 int ch, n = 1, conn_timeout = 10, rw_timeout = 10;
108 acl::string addr("127.0.0.1:6379"), cmd;
109 bool slice_req = false, cluster_mode = false;
110
111 while ((ch = getopt(argc, argv, "hs:n:C:I:a:Sc")) > 0)
112 {
113 switch (ch)
114 {
115 case 'h':
116 usage(argv[0]);
117 return 0;
118 case 's':
119 addr = optarg;
120 break;
121 case 'n':
122 n = atoi(optarg);
123 break;
124 case 'C':
125 conn_timeout = atoi(optarg);
126 break;
127 case 'I':
128 rw_timeout = atoi(optarg);
129 break;
130 case 'a':
131 cmd = optarg;
132 break;
133 case 'S':
134 slice_req = true;
135 break;
136 case 'c':
137 cluster_mode = true;
138 break;
139 default:
140 break;
141 }
142 }
143
144 acl::acl_cpp_init();
145
146 acl::redis_client_cluster cluster;
147 cluster.set(addr.c_str(), 100, conn_timeout, rw_timeout);
148
149 acl::redis_client client(addr.c_str(), conn_timeout, rw_timeout);
150 client.set_slice_request(slice_req);
151
152 acl::redis_hyperloglog redis;
153
154 if (cluster_mode)
155 redis.set_cluster(&cluster);
156 else
157 redis.set_client(&client);
158
159 bool ret;
160
161 if (cmd == "pfadd")
162 ret = test_pfadd(redis, n);

Callers

nothing calls this directly

Calls 11

acl_cpp_initFunction · 0.85
test_pfaddFunction · 0.85
test_pfcountFunction · 0.85
test_pfmergeFunction · 0.85
set_clusterMethod · 0.80
set_clientMethod · 0.80
usageFunction · 0.70
getoptFunction · 0.50
setMethod · 0.45
c_strMethod · 0.45
set_slice_requestMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…