MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / scanMode

Function scanMode

src/redis-cli.c:6956–6976  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6954 *--------------------------------------------------------------------------- */
6955
6956static void scanMode(void) {
6957 redisReply *reply;
6958 unsigned long long cur = 0;
6959
6960 do {
6961 reply = sendScan(&cur);
6962 for (unsigned int j = 0; j < reply->element[1]->elements; j++) {
6963 if (config.output == OUTPUT_STANDARD) {
6964 sds out = sdscatrepr(sdsempty(), reply->element[1]->element[j]->str,
6965 reply->element[1]->element[j]->len);
6966 printf("%s\n", out);
6967 sdsfree(out);
6968 } else {
6969 printf("%s\n", reply->element[1]->element[j]->str);
6970 }
6971 }
6972 freeReplyObject(reply);
6973 } while(cur != 0);
6974
6975 exit(0);
6976}
6977
6978/*------------------------------------------------------------------------------
6979 * LRU test mode

Callers 1

mainFunction · 0.85

Calls 5

sendScanFunction · 0.85
sdscatreprFunction · 0.85
sdsemptyFunction · 0.85
sdsfreeFunction · 0.85
freeReplyObjectFunction · 0.85

Tested by

no test coverage detected