add backend
This commit is contained in:
parent
1c21d67570
commit
ca5f813c5e
|
@ -17,6 +17,7 @@
|
||||||
#include "rocksdb/c.h"
|
#include "rocksdb/c.h"
|
||||||
#include "streamBackendRocksdb.h"
|
#include "streamBackendRocksdb.h"
|
||||||
#include "tcommon.h"
|
#include "tcommon.h"
|
||||||
|
#include "tlog.h"
|
||||||
//
|
//
|
||||||
// SStateKey
|
// SStateKey
|
||||||
// |--groupid--|---ts------|--opNum----|
|
// |--groupid--|---ts------|--opNum----|
|
||||||
|
@ -562,18 +563,27 @@ int32_t streamStateClear_rocksdb(SStreamState* pState) {
|
||||||
qDebug("streamStateClear_rocksdb");
|
qDebug("streamStateClear_rocksdb");
|
||||||
|
|
||||||
SStateKey sKey = {.key = {.ts = 0, .groupId = 0}, .opNum = pState->number};
|
SStateKey sKey = {.key = {.ts = 0, .groupId = 0}, .opNum = pState->number};
|
||||||
SStateKey eKey = {.key = {.ts = UINT64_MAX, .groupId = INT64_MAX}, .opNum = pState->number};
|
SStateKey eKey = {.key = {.ts = INT64_MAX, .groupId = UINT64_MAX}, .opNum = pState->number};
|
||||||
char sKeyStr[128] = {0};
|
char sKeyStr[128] = {0};
|
||||||
char eKeyStr[128] = {0};
|
char eKeyStr[128] = {0};
|
||||||
|
|
||||||
int sLen = stateKeyEncode(&sKey, sKeyStr);
|
int sLen = stateKeyEncode(&sKey, sKeyStr);
|
||||||
int eLen = stateKeyEncode(&sKey, eKeyStr);
|
int eLen = stateKeyEncode(&eKey, eKeyStr);
|
||||||
|
|
||||||
|
char toStringStart[128] = {0};
|
||||||
|
char toStringEnd[128] = {0};
|
||||||
|
|
||||||
|
if (qDebugFlag & DEBUG_TRACE) {
|
||||||
|
stateKeyToString(&sKey, toStringStart);
|
||||||
|
stateKeyToString(&eKey, toStringEnd);
|
||||||
|
}
|
||||||
|
|
||||||
char* err = NULL;
|
char* err = NULL;
|
||||||
rocksdb_delete_range_cf(pState->pTdbState->rocksdb, pState->pTdbState->writeOpts, pState->pTdbState->pHandle[0],
|
rocksdb_delete_range_cf(pState->pTdbState->rocksdb, pState->pTdbState->writeOpts, pState->pTdbState->pHandle[0],
|
||||||
sKeyStr, sLen, eKeyStr, eLen, &err);
|
sKeyStr, sLen, eKeyStr, eLen, &err);
|
||||||
if (err != NULL) {
|
if (err != NULL) {
|
||||||
qWarn("failed to delete range cf(default)");
|
qWarn("failed to delete range cf(default) err: %s, start: %s, end:%s", err, toStringStart, toStringEnd);
|
||||||
|
taosMemoryFree(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
// batch clear later
|
// batch clear later
|
||||||
|
|
Loading…
Reference in New Issue