refactor backend

This commit is contained in:
yihaoDeng 2023-10-11 16:36:43 +08:00
parent 722d72659b
commit 4f47162512
1 changed files with 7 additions and 20 deletions

View File

@ -145,14 +145,16 @@ void snapFileDebugInfo(SBackendSnapFile2* pSnapFile) {
sprintf(buf, "[current: %s,", pSnapFile->pCurrent);
sprintf(buf + strlen(buf), "MANIFEST: %s,", pSnapFile->pMainfest);
sprintf(buf + strlen(buf), "options: %s,", pSnapFile->pOptions);
for (int i = 0; i < taosArrayGetSize(pSnapFile->pSst); i++) {
char* name = taosArrayGetP(pSnapFile->pSst, i);
sprintf(buf + strlen(buf), "%s,", name);
if (pSnapFile->pSst) {
for (int i = 0; i < taosArrayGetSize(pSnapFile->pSst); i++) {
char* name = taosArrayGetP(pSnapFile->pSst, i);
sprintf(buf + strlen(buf), "%s,", name);
}
}
sprintf(buf + strlen(buf) - 1, "]");
qInfo("%s get file list: %s", STREAM_STATE_TRANSFER, buf);
qInfo("%s %" PRId64 "-%" PRId64 " get file list: %s", STREAM_STATE_TRANSFER, pSnapFile->snapInfo.streamId,
pSnapFile->snapInfo.taskId, buf);
taosMemoryFree(buf);
}
}
@ -584,21 +586,6 @@ int32_t streamSnapWrite(SStreamSnapWriter* pWriter, uint8_t* pData, uint32_t nDa
}
int32_t streamSnapWriterClose(SStreamSnapWriter* pWriter, int8_t rollback) {
SStreamSnapHandle* handle = &pWriter->handle;
// if (qDebugFlag & DEBUG_DEBUG) {
// char* buf = (char*)taosMemoryMalloc(1024);
// int n = sprintf(buf, "[");
// for (int i = 0; i < taosArrayGetSize(handle->pFileList); i++) {
// SBackendFileItem* item = taosArrayGet(handle->pFileList, i);
// if (i != taosArrayGetSize(handle->pFileList) - 1) {
// n += sprintf(buf + n, "%s %" PRId64 ",", item->name, item->size);
// } else {
// n += sprintf(buf + n, "%s %" PRId64 "]", item->name, item->size);
// }
// }
// qDebug("%s snap get file list, %s", STREAM_STATE_TRANSFER, buf);
// taosMemoryFree(buf);
// }
streamSnapHandleDestroy(handle);
taosMemoryFree(pWriter);