@@ -409,7 +409,7 @@ void swapPersistCtxPersistKeys(swapPersistCtx *ctx);
409
409
sds genSwapPersistInfoString (sds info );
410
410
void swapPersistKeyRequestFinished (swapPersistCtx * ctx , int dbid , robj * key , uint64_t persist_version );
411
411
void loadDataFromDisk (void );
412
- void ctripLoadDataFromDisk (void );
412
+ void swap_loadDataFromDisk (void );
413
413
int submitEvictClientRequest (client * c , robj * key , int persist_keep , uint64_t persist_version );
414
414
415
415
#define setObjectPersistKeep (o ) do { \
@@ -864,7 +864,7 @@ void startSwapRewind(swap_rewind_type rewind_type);
864
864
void endSwapRewind (void );
865
865
void freeClientSwapCmdTrace (client * c );
866
866
867
- /* see server.req_submitted */
867
+ /* see server.swap_req_submitted */
868
868
#define REQ_SUBMITTED_NONE 0
869
869
#define REQ_SUBMITTED_BGSAVE (1ULL<<0)
870
870
#define REQ_SUBMITTED_REPL_START (1ULL<<1)
@@ -927,7 +927,7 @@ int swapDataSetupSet(swapData *d, OUT void **datactx);
927
927
928
928
unsigned long swap_setTypeSize (const objectMeta * meta , const robj * o );
929
929
unsigned long swap_setTypeSizeLookup (redisDb * db , robj * key , const robj * o );
930
- void ctrip_scardCommand (client * c );
930
+ void swap_scardCommand (client * c );
931
931
932
932
/* List */
933
933
typedef struct listSwapData {
@@ -964,10 +964,10 @@ void clientArgRewritesRestore(client *c);
964
964
void clientArgRewrite (client * c , argRewriteRequest arg_req , MOVE robj * new_arg );
965
965
966
966
967
- long ctripListTypeLength (robj * list , objectMeta * object_meta );
968
- void ctripListTypePush (robj * subject , robj * value , int where , redisDb * db , robj * key );
969
- robj * ctripListTypePop (robj * subject , int where , redisDb * db , robj * key );
970
- void ctripListMetaDelRange (redisDb * db , robj * key , long ltrim , long rtrim );
967
+ long swapListTypeLength (robj * list , objectMeta * object_meta );
968
+ void swapListTypePush (robj * subject , robj * value , int where , redisDb * db , robj * key );
969
+ robj * swapListTypePop (robj * subject , int where , redisDb * db , robj * key );
970
+ void swapListMetaDelRange (redisDb * db , robj * key , long ltrim , long rtrim );
971
971
/* zset */
972
972
typedef struct zsetSwapData {
973
973
swapData sd ;
@@ -1712,25 +1712,25 @@ typedef struct swapEvictKeysCtx {
1712
1712
int ended ;
1713
1713
} swapEvictKeysCtx ;
1714
1714
1715
- void ctrip_startEvictionTimeProc (void );
1716
- size_t ctrip_getMemoryToFree (size_t mem_used );
1717
- void ctrip_performEvictionStart (swapEvictKeysCtx * sectx );
1718
- int ctrip_performEvictionLoopStartShouldBreak (swapEvictKeysCtx * sectx );
1715
+ void swap_startEvictionTimeProc (void );
1716
+ size_t swap_getMemoryToFree (size_t mem_used );
1717
+ void swap_performEvictionStart (swapEvictKeysCtx * sectx );
1718
+ int swap_performEvictionLoopStartShouldBreak (swapEvictKeysCtx * sectx );
1719
1719
size_t performEvictionSwapSelectedKey (swapEvictKeysCtx * sectx , redisDb * db , robj * keyobj );
1720
- int ctrip_performEvictionLoopCheckShouldBreak (swapEvictKeysCtx * sectx );
1721
- void ctrip_performEvictionEnd (swapEvictKeysCtx * sectx );
1722
- static inline int ctrip_performEvictionLoopCheckInterval (int keys_freed ) {
1720
+ int swap_performEvictionLoopCheckShouldBreak (swapEvictKeysCtx * sectx );
1721
+ void swap_performEvictionEnd (swapEvictKeysCtx * sectx );
1722
+ static inline int swap_performEvictionLoopCheckInterval (int keys_freed ) {
1723
1723
return keys_freed % server .swap_evict_loop_check_interval == 0 ;
1724
1724
}
1725
1725
/* used memory in disk swap mode */
1726
1726
size_t coldFiltersUsedMemory (void ); /* cuckoo filter not counted in maxmemory */
1727
- static inline size_t ctrip_getUsedMemory (void ) {
1727
+ static inline size_t swap_getUsedMemory (void ) {
1728
1728
int swap_inprogress_memory ;
1729
1729
atomicGet (server .swap_inprogress_memory , swap_inprogress_memory );
1730
1730
return zmalloc_used_memory () - swap_inprogress_memory -
1731
1731
coldFiltersUsedMemory () - swapPersistCtxUsedMemory (server .swap_persist_ctx );
1732
1732
}
1733
- static inline int ctrip_evictionTimeProcGetDelayMillis (void ) {
1733
+ static inline int swap_evictionTimeProcGetDelayMillis (void ) {
1734
1734
if (swapEvictionReachedInprogressLimit ()) return 1 ;
1735
1735
else return 0 ;
1736
1736
}
@@ -2302,7 +2302,7 @@ typedef struct rdbSaveRocksStats {
2302
2302
} rdbSaveRocksStats ;
2303
2303
2304
2304
/* rdb save */
2305
- int rdbSaveKeyHeader (rio * rdb , robj * key , robj * evict , unsigned char rdbtype , long long expiretime );
2305
+ int rdbSaveKeyHeader (rio * rdb , robj * key , robj * o , unsigned char rdbtype , long long expiretime );
2306
2306
int rdbKeySaveHotExtensionInit (rdbKeySaveData * keydata , redisDb * db , sds keystr );
2307
2307
int rdbKeySaveWarmColdInit (rdbKeySaveData * keydata , redisDb * db , decodedResult * dr );
2308
2308
void rdbKeySaveDataDeinit (rdbKeySaveData * keydata );
@@ -2324,7 +2324,7 @@ int bitmapSaveInit(rdbKeySaveData *save, uint64_t version, const char *extend, s
2324
2324
#define RDB_LOAD_BATCH_COUNT 50
2325
2325
#define RDB_LOAD_BATCH_CAPACITY (4*1024*1024)
2326
2326
2327
- typedef struct ctripRdbLoadCtx {
2327
+ typedef struct swapRdbLoadObjectCtx {
2328
2328
size_t errors ;
2329
2329
size_t idx ;
2330
2330
struct {
@@ -2336,10 +2336,10 @@ typedef struct ctripRdbLoadCtx {
2336
2336
sds * rawkeys ;
2337
2337
sds * rawvals ;
2338
2338
} batch ;
2339
- } ctripRdbLoadCtx ;
2339
+ } swapRdbLoadObjectCtx ;
2340
2340
2341
- void evictStartLoading (void );
2342
- void evictStopLoading (int success );
2341
+ void swapStartLoading (void );
2342
+ void swapStopLoading (int success );
2343
2343
2344
2344
struct rdbKeyLoadData ;
2345
2345
@@ -2374,7 +2374,7 @@ static inline sds rdbVerbatimNew(unsigned char rdbtype) {
2374
2374
2375
2375
int rdbLoadStringVerbatim (rio * rdb , sds * verbatim );
2376
2376
int rdbLoadHashFieldsVerbatim (rio * rdb , unsigned long long len , sds * verbatim );
2377
- int ctripRdbLoadObject (int rdbtype , rio * rdb , redisDb * db , sds key , long long expire , long long now , rdbKeyLoadData * keydata );
2377
+ int swapRdbLoadObject (int rdbtype , rio * rdb , redisDb * db , sds key , long long expire , long long now , rdbKeyLoadData * keydata );
2378
2378
robj * rdbKeyLoadGetObject (rdbKeyLoadData * keydata );
2379
2379
int rdbKeyLoadDataInit (rdbKeyLoadData * keydata , int rdbtype , redisDb * db , sds key , long long expire , long long now );
2380
2380
void rdbKeyLoadDataDeinit (rdbKeyLoadData * keydata );
@@ -2610,11 +2610,22 @@ void swapDebugCommand(client *c);
2610
2610
void swapExpiredCommand (client * c );
2611
2611
const char * strObjectType (int type );
2612
2612
int timestampIsExpired (mstime_t expire );
2613
- size_t ctripDbSize (redisDb * db );
2613
+ size_t swap_dbSize (redisDb * db );
2614
2614
long get_dir_size (char * dirname );
2615
2615
robj * swapRandomKey (redisDb * db , metaScanResult * metas );
2616
2616
void dbPauseRehash (redisDb * db );
2617
2617
void dbResumeRehash (redisDb * db );
2618
+ int debugGetKeys (struct redisCommand * cmd , robj * * argv , int argc , getKeysResult * result );
2619
+ void commandProcessed (client * c );
2620
+ ssize_t rdbWriteRaw (rio * rdb , void * p , size_t len );
2621
+ void trackInstantaneousMetric (int metric , long long current_reading );
2622
+ long long getInstantaneousMetric (int metric );
2623
+ void swapInitServerConfig (void );
2624
+ void swapInitServer (void );
2625
+ void freeClientsInDeferedQueue (void );
2626
+ void swap_replicationStartPendingFork (void );
2627
+ void debugSwapOutCommand (client * c );
2628
+ size_t swapobjectComputeSize (robj * val , int samples , objectMeta * object_meta );
2618
2629
2619
2630
void notifyKeyspaceEventDirty (int type , char * event , robj * key , int dbid , ...);
2620
2631
void notifyKeyspaceEventDirtyKey (int type , char * event , robj * key , int dbid );
0 commit comments