add checkpoint
This commit is contained in:
parent
d9e24566c0
commit
2f656f3854
|
@ -123,26 +123,26 @@ int32_t streamSnapHandleInit(SStreamSnapHandle* handle, char* path) {
|
||||||
SArray* list = taosArrayInit(64, sizeof(SBackendFileItem));
|
SArray* list = taosArrayInit(64, sizeof(SBackendFileItem));
|
||||||
|
|
||||||
SBackendFileItem item;
|
SBackendFileItem item;
|
||||||
|
// current
|
||||||
item.name = pFile->pCurrent;
|
item.name = pFile->pCurrent;
|
||||||
item.type = ROCKSDB_CURRENT_TYPE;
|
item.type = ROCKSDB_CURRENT_TYPE;
|
||||||
taosArrayPush(list, &item);
|
taosArrayPush(list, &item);
|
||||||
|
// mainfest
|
||||||
item.name = pFile->pMainfest;
|
item.name = pFile->pMainfest;
|
||||||
item.type = ROCKSDB_MAINFEST_TYPE;
|
item.type = ROCKSDB_MAINFEST_TYPE;
|
||||||
taosArrayPush(list, &item);
|
taosArrayPush(list, &item);
|
||||||
|
// options
|
||||||
item.name = pFile->pOptions;
|
item.name = pFile->pOptions;
|
||||||
item.type = ROCKSDB_OPTIONS_TYPE;
|
item.type = ROCKSDB_OPTIONS_TYPE;
|
||||||
taosArrayPush(list, &item);
|
taosArrayPush(list, &item);
|
||||||
|
// sst
|
||||||
for (int i = 0; i < taosArrayGetSize(pFile->pSst); i++) {
|
for (int i = 0; i < taosArrayGetSize(pFile->pSst); i++) {
|
||||||
char* sst = taosArrayGetP(pFile->pSst, i);
|
char* sst = taosArrayGetP(pFile->pSst, i);
|
||||||
item.name = sst;
|
item.name = sst;
|
||||||
item.type = ROCKSDB_SST_TYPE;
|
item.type = ROCKSDB_SST_TYPE;
|
||||||
taosArrayPush(list, &item);
|
taosArrayPush(list, &item);
|
||||||
}
|
}
|
||||||
|
// meta
|
||||||
item.name = pFile->pCheckpointMeta;
|
item.name = pFile->pCheckpointMeta;
|
||||||
item.type = ROCKSDB_CHECKPOINT_META_TYPE;
|
item.type = ROCKSDB_CHECKPOINT_META_TYPE;
|
||||||
taosArrayPush(list, &item);
|
taosArrayPush(list, &item);
|
||||||
|
@ -164,6 +164,7 @@ _err:
|
||||||
code = -1;
|
code = -1;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
void streamSnapHandleDestroy(SStreamSnapHandle* handle) {
|
void streamSnapHandleDestroy(SStreamSnapHandle* handle) {
|
||||||
SBanckendFile* pFile = handle->pBackendFile;
|
SBanckendFile* pFile = handle->pBackendFile;
|
||||||
taosMemoryFree(pFile->pCheckpointMeta);
|
taosMemoryFree(pFile->pCheckpointMeta);
|
||||||
|
@ -176,9 +177,10 @@ void streamSnapHandleDestroy(SStreamSnapHandle* handle) {
|
||||||
taosMemoryFree(sst);
|
taosMemoryFree(sst);
|
||||||
}
|
}
|
||||||
taosArrayDestroy(pFile->pSst);
|
taosArrayDestroy(pFile->pSst);
|
||||||
|
taosMemoryFree(pFile);
|
||||||
|
|
||||||
taosArrayDestroy(handle->pFileList);
|
taosArrayDestroy(handle->pFileList);
|
||||||
taosMemoryFree(pFile);
|
taosCloseFile(&handle->fd);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue