提交 ffd27259 编写于 作者: dengyihao's avatar dengyihao

add backend

上级 78f22d71
...@@ -746,16 +746,25 @@ int32_t streamStateFillGetKVByCur_rocksdb(SStreamStateCur* pCur, SWinKey* pKey, ...@@ -746,16 +746,25 @@ int32_t streamStateFillGetKVByCur_rocksdb(SStreamStateCur* pCur, SWinKey* pKey,
if (!pCur) { if (!pCur) {
return -1; return -1;
} }
SWinKey winKey; SWinKey winKey;
SWinKey* pKTmp = &winKey;
if (rocksdb_iter_valid(pCur->iter)) { if (rocksdb_iter_valid(pCur->iter)) {
size_t tlen; size_t tlen;
char* keyStr = (char*)rocksdb_iter_key(pCur->iter, &tlen); char* keyStr = (char*)rocksdb_iter_key(pCur->iter, &tlen);
winKeyDecode(&winKey, keyStr); winKeyDecode(&winKey, keyStr);
size_t vlen = 0;
const char* valStr = rocksdb_iter_value(pCur->iter, &vlen);
if (pVal != NULL) {
char* dst = taosMemoryCalloc(1, vlen);
memcpy(dst, valStr, vlen);
*pVal = dst;
}
if (pVLen != NULL) *pVLen = vlen;
} else { } else {
return -1; return -1;
} }
*pKey = *pKTmp; *pKey = winKey;
return 0; return 0;
} }
int32_t streamStateGetGroupKVByCur_rocksdb(SStreamStateCur* pCur, SWinKey* pKey, const void** pVal, int32_t* pVLen) { int32_t streamStateGetGroupKVByCur_rocksdb(SStreamStateCur* pCur, SWinKey* pKey, const void** pVal, int32_t* pVLen) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册