Home
last modified time | relevance | path

Searched refs:db (Results 1 – 25 of 28) sorted by relevance

12

/redis-3.2.3/src/
H A Ddb.c137 expireIfNeeded(db,key); in lookupKeyWrite()
186 dbAdd(db,key,val); in setKey()
191 removeExpire(db,key); in setKey()
192 signalModifiedKey(db,key); in setKey()
229 if (dictSize(db->expires) > 0) dictDelete(db->expires,key->ptr); in dbDelete()
292 c->db = &server.db[id]; in selectDb()
306 touchWatchedKey(db,key); in signalModifiedKey()
550 ht = c->db->dict; in scanGenericCommand()
793 src = c->db; in moveCommand()
794 srcid = c->db->id; in moveCommand()
[all …]
H A Dt_list.c212 dbAdd(c->db,c->argv[1],lobj); in pushGenericCommand()
374 dbDelete(c->db,c->argv[1]); in popGenericCommand()
473 dbDelete(c->db,c->argv[1]); in ltrimCommand()
476 signalModifiedKey(c->db,c->argv[1]); in ltrimCommand()
518 dbDelete(c->db,c->argv[1]); in lremCommand()
547 dbAdd(c->db,dstkey,dstobj); in rpoplpushHandlePush()
549 signalModifiedKey(c->db,dstkey); in rpoplpushHandlePush()
583 dbDelete(c->db,touchedkey); in rpoplpushCommand()
699 rl->db = db; in signalListAsReady()
757 db->id,argv,2, in serveClientBlockedOnList()
[all …]
H A Dt_string.c86 setKey(c->db,key,val); in setGenericCommand()
91 "expire",key,c->db->id); in setGenericCommand()
179 setKey(c->db,c->argv[1],c->argv[2]); in getsetCommand()
197 o = lookupKeyWrite(c->db,c->argv[1]); in setrangeCommand()
210 dbAdd(c->db,c->argv[1],o); in setrangeCommand()
345 o = lookupKeyWrite(c->db,c->argv[1]); in incrDecrCommand()
368 dbAdd(c->db,c->argv[1],new); in incrDecrCommand()
371 signalModifiedKey(c->db,c->argv[1]); in incrDecrCommand()
420 dbAdd(c->db,c->argv[1],new); in incrbyfloatCommand()
421 signalModifiedKey(c->db,c->argv[1]); in incrbyfloatCommand()
[all …]
H A Dt_set.c279 dbAdd(c->db,c->argv[1],set); in saddCommand()
359 dbDelete(c->db,c->argv[1]); in smoveCommand()
366 dbAdd(c->db,c->argv[2],dstset); in smoveCommand()
369 signalModifiedKey(c->db,c->argv[1]); in smoveCommand()
370 signalModifiedKey(c->db,c->argv[2]); in smoveCommand()
451 dbDelete(c->db,c->argv[1]); in spopWithCountCommand()
605 dbDelete(c->db,c->argv[1]); in spopCommand()
911 dstkey,c->db->id); in sinterGenericCommand()
917 dstkey,c->db->id); in sinterGenericCommand()
1084 dstkey,c->db->id); in sunionDiffGenericCommand()
[all …]
H A Dmulti.c109 propagate(server.multiCommand,c->db->id,&multistring,1, in execCommandPropagateMulti()
198 redisDb *db; member
212 if (wk->db == c->db && equalStringObjects(key,wk->key)) in watchForKey()
216 clients = dictFetchValue(c->db->watched_keys,key); in watchForKey()
219 dictAdd(c->db->watched_keys,key,clients); in watchForKey()
226 wk->db = c->db; in watchForKey()
251 dictDelete(wk->db->watched_keys, wk->key); in unwatchAllKeys()
261 void touchWatchedKey(redisDb *db, robj *key) { in touchWatchedKey() argument
266 if (dictSize(db->watched_keys) == 0) return; in touchWatchedKey()
267 clients = dictFetchValue(db->watched_keys, key); in touchWatchedKey()
[all …]
H A Dt_hash.c419 robj *o = lookupKeyWrite(c->db,key); in hashTypeLookupWriteOrCreate()
422 dbAdd(c->db,key,o); in hashTypeLookupWriteOrCreate()
495 signalModifiedKey(c->db,c->argv[1]); in hsetCommand()
511 signalModifiedKey(c->db,c->argv[1]); in hsetnxCommand()
533 signalModifiedKey(c->db,c->argv[1]); in hmsetCommand()
567 signalModifiedKey(c->db,c->argv[1]); in hincrbyCommand()
594 signalModifiedKey(c->db,c->argv[1]); in hincrbyfloatCommand()
662 o = lookupKeyRead(c->db, c->argv[1]); in hmgetCommand()
685 dbDelete(c->db,c->argv[1]); in hdelCommand()
692 signalModifiedKey(c->db,c->argv[1]); in hdelCommand()
[all …]
H A Dsort.c61 robj *lookupKeyByPattern(redisDb *db, robj *pattern, robj *subst) { in lookupKeyByPattern() argument
109 o = lookupKeyRead(db,keyobj); in lookupKeyByPattern()
202 sortval = lookupKeyRead(c->db,c->argv[1]); in sortCommand()
453 byval = lookupKeyByPattern(c->db,sortby,vector[j].obj); in sortCommand()
517 robj *val = lookupKeyByPattern(c->db,sop->pattern, in sortCommand()
547 robj *val = lookupKeyByPattern(c->db,sop->pattern, in sortCommand()
566 setKey(c->db,storekey,sobj); in sortCommand()
568 c->db->id); in sortCommand()
570 } else if (dbDelete(c->db,storekey)) { in sortCommand()
571 signalModifiedKey(c->db,storekey); in sortCommand()
[all …]
H A Dserver.c733 propagateExpire(db,keyobj); in activeExpireCycleTryExpire()
734 dbDelete(db,keyobj); in activeExpireCycleTryExpire()
736 "expired",keyobj,db->id); in activeExpireCycleTryExpire()
810 redisDb *db = server.db+(current_db % server.dbnum); in activeExpireCycle() local
826 db->avg_ttl = 0; in activeExpireCycle()
868 if (db->avg_ttl == 0) db->avg_ttl = avg_ttl; in activeExpireCycle()
869 db->avg_ttl = (db->avg_ttl/50)*49 + (avg_ttl/50); in activeExpireCycle()
1914 server.db[j].id = j; in initServer()
1915 server.db[j].avg_ttl = 0; in initServer()
3492 redisDb *db = server.db+j; in freeMemoryIfNeeded() local
[all …]
H A Dbitops.c473 robj *o = lookupKeyWrite(c->db,c->argv[1]); in lookupStringForBitCommand()
477 dbAdd(c->db,c->argv[1],o); in lookupStringForBitCommand()
480 o = dbUnshareStringValue(c->db,c->argv[1],o); in lookupStringForBitCommand()
550 signalModifiedKey(c->db,c->argv[1]); in setbitCommand()
621 o = lookupKeyRead(c->db,c->argv[j+3]); in bitopCommand()
746 setKey(c->db,targetkey,o); in bitopCommand()
749 } else if (dbDelete(c->db,targetkey)) { in bitopCommand()
750 signalModifiedKey(c->db,targetkey); in bitopCommand()
826 if ((o = lookupKeyRead(c->db,c->argv[1])) == NULL) { in bitposCommand()
984 o = lookupKeyRead(c->db,c->argv[1]); in bitfieldCommand()
[all …]
H A Dhyperloglog.c1156 robj *o = lookupKeyWrite(c->db,c->argv[1]); in pfaddCommand()
1165 dbAdd(c->db,c->argv[1],o); in pfaddCommand()
1186 signalModifiedKey(c->db,c->argv[1]); in pfaddCommand()
1236 o = lookupKeyWrite(c->db,c->argv[1]); in pfcountCommand()
1277 signalModifiedKey(c->db,c->argv[1]); in pfcountCommand()
1296 robj *o = lookupKeyRead(c->db,c->argv[j]); in pfmergeCommand()
1309 robj *o = lookupKeyWrite(c->db,c->argv[1]); in pfmergeCommand()
1315 dbAdd(c->db,c->argv[1],o); in pfmergeCommand()
1337 signalModifiedKey(c->db,c->argv[1]); in pfmergeCommand()
1461 o = lookupKeyWrite(c->db,c->argv[2]); in pfdebugCommand()
[all …]
H A Dserver.h559 redisDb *db; member
711 redisDb *db; member
1178 void touchWatchedKey(redisDb *db, robj *key);
1400 int removeExpire(redisDb *db, robj *key);
1401 void propagateExpire(redisDb *db, robj *key);
1402 int expireIfNeeded(redisDb *db, robj *key);
1403 long long getExpire(redisDb *db, robj *key);
1406 robj *lookupKeyRead(redisDb *db, robj *key);
1416 int dbExists(redisDb *db, robj *key);
1417 robj *dbRandomKey(redisDb *db);
[all …]
H A Ddebug.c124 redisDb *db = server.db+j; in computeDatasetDigest() local
126 if (dictSize(db->dict) == 0) continue; in computeDatasetDigest()
127 di = dictGetIterator(db->dict); in computeDatasetDigest()
150 expiretime = getExpire(db,keyobj); in computeDatasetDigest()
439 dictExpand(c->db->dict,keys); in debugCommand()
444 if (lookupKeyWrite(c->db,key) != NULL) { in debugCommand()
450 dbAdd(c->db,key,val); in debugCommand()
451 signalModifiedKey(c->db,key); in debugCommand()
515 dictGetStats(buf,sizeof(buf),server.db[dbid].dict); in debugCommand()
519 dictGetStats(buf,sizeof(buf),server.db[dbid].expires); in debugCommand()
[all …]
H A Drdb.c777 redisDb *db = server.db+j; in rdbSaveRio() local
778 dict *d = db->dict; in rdbSaveRio()
792 db_size = (dictSize(db->dict) <= UINT32_MAX) ? in rdbSaveRio()
793 dictSize(db->dict) : in rdbSaveRio()
796 dictSize(db->expires) : in rdbSaveRio()
809 expire = getExpire(db,&key); in rdbSaveRio()
1278 redisDb *db = server.db+0; in rdbLoad() local
1344 db = server.db+dbid; in rdbLoad()
1354 dictExpand(db->dict,db_size); in rdbLoad()
1355 dictExpand(db->expires,expires_size); in rdbLoad()
[all …]
H A Dt_zset.c1279 zobj = lookupKeyWrite(c->db,key); in zaddGenericCommand()
1289 dbAdd(c->db,key,zobj); in zaddGenericCommand()
1397 signalModifiedKey(c->db,key); in zaddGenericCommand()
1427 dbDelete(c->db,key); in zremCommand()
1465 signalModifiedKey(c->db,key); in zremCommand()
1535 dbDelete(c->db,key); in zremrangeGenericCommand()
1553 dbDelete(c->db,key); in zremrangeGenericCommand()
1563 signalModifiedKey(c->db,key); in zremrangeGenericCommand()
2151 if (dbDelete(c->db,dstkey)) in zunionInterGenericCommand()
2155 dbAdd(c->db,dstkey,dstobj); in zunionInterGenericCommand()
[all …]
H A Dgeo.c635 setKey(c->db,storekey,zobj); in georadiusGeneric()
638 c->db->id); in georadiusGeneric()
640 } else if (dbDelete(c->db,storekey)) { in georadiusGeneric()
641 signalModifiedKey(c->db,storekey); in georadiusGeneric()
642 notifyKeyspaceEvent(NOTIFY_GENERIC,"del",storekey,c->db->id); in georadiusGeneric()
H A Dcluster.c3598 if (dictSize(server.db[j].dict)) return C_ERR; in verifyClusterConfigWithData()
3919 if (dictSize(server.db[0].dict) != 0) { in clusterCommand()
4456 if ((o = lookupKeyRead(c->db,c->argv[1])) == NULL) { in dumpCommand()
4518 if (replace) dbDelete(c->db,c->argv[1]); in restoreCommand()
4521 dbAdd(c->db,c->argv[1],obj); in restoreCommand()
4522 if (ttl) setExpire(c->db,c->argv[1],mstime()+ttl); in restoreCommand()
4523 signalModifiedKey(c->db,c->argv[1]); in restoreCommand()
4746 expireat = getExpire(c->db,kv[j]); in migrateCommand()
4824 dbDelete(c->db,kv[j]); in migrateCommand()
4825 signalModifiedKey(c->db,kv[j]); in migrateCommand()
[all …]
H A Daof.c1041 redisDb *db = server.db+j; in rewriteAppendOnlyFile() local
1042 dict *d = db->dict; in rewriteAppendOnlyFile()
1064 expiretime = getExpire(db,&key); in rewriteAppendOnlyFile()
H A DMakefile120 … pqsort.o zipmap.o sha1.o ziplist.o release.o networking.o util.o object.o db.o replication.o rdb.…
H A DMakefile.dep41 db.o: db.c server.h fmacros.h config.h solarisfixes.h \
H A Dobject.c697 if ((de = dictFind(c->db->dict,key->ptr)) == NULL) return NULL; in objectCommandLookup()
/redis-3.2.3/utils/
H A Dredis-sha1.rb50 db = ARGV[2] || "0"
51 puts "Performing SHA1 of Redis server #{host} #{port} DB: #{db}"
52 p "Dataset SHA1: #{redisSha1(:host => host, :port => port.to_i, :db => db)}"
/redis-3.2.3/tests/helpers/
H A Dbg_complex_data.tcl4 proc bg_complex_data {host port db ops} {
6 $r select $db
/redis-3.2.3/tests/support/
H A Dutil.tcl265 for {set db 0} {$db < 16} {incr db} {
266 {*}$r select $db
269 append o [csvstring $db] , [csvstring $k] , [csvstring $type] ,
/redis-3.2.3/tests/integration/
H A Dreplication-psync.tcl1 proc start_bg_complex_data {host port db ops} {
3 exec $tclsh tests/helpers/bg_complex_data.tcl $host $port $db $ops &
H A Dreplication-4.tcl1 proc start_bg_complex_data {host port db ops} {
3 exec $tclsh tests/helpers/bg_complex_data.tcl $host $port $db $ops &

12