MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rdbLoad

Function rdbLoad

app/redis-6.2.6/src/rdb.c:2754–2766  ·  view source on GitHub ↗

Like rdbLoadRio() but takes a filename instead of a rio stream. The * filename is open for reading and a rio stream object created in order * to do the actual loading. Moreover the ETA displayed in the INFO * output is initialized and finalized. * * If you pass an 'rsi' structure initialied with RDB_SAVE_OPTION_INIT, the * loading code will fiil the information fields in the structure. */

Source from the content-addressed store, hash-verified

2752 * If you pass an 'rsi' structure initialied with RDB_SAVE_OPTION_INIT, the
2753 * loading code will fiil the information fields in the structure. */
2754int rdbLoad(char *filename, rdbSaveInfo *rsi, int rdbflags) {
2755 FILE *fp;
2756 rio rdb;
2757 int retval;
2758
2759 if ((fp = fopen(filename,"r")) == NULL) return C_ERR;
2760 startLoadingFile(fp, filename,rdbflags);
2761 rioInitWithFile(&rdb,fp);
2762 retval = rdbLoadRio(&rdb,rdbflags,rsi);
2763 fclose(fp);
2764 stopLoading(retval==C_OK);
2765 return retval;
2766}
2767
2768/* A background saving child (BGSAVE) terminated its work. Handle this.
2769 * This function covers the case of actual BGSAVEs. */

Callers 3

readSyncBulkPayloadFunction · 0.85
loadDataFromDiskFunction · 0.85
debugCommandFunction · 0.85

Calls 4

startLoadingFileFunction · 0.85
rioInitWithFileFunction · 0.85
rdbLoadRioFunction · 0.85
stopLoadingFunction · 0.85

Tested by

no test coverage detected