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

rocksdb_iter_value

上级 c64a7d3e
...@@ -45,8 +45,9 @@ int streamStateValueIsStale(char* vv) { ...@@ -45,8 +45,9 @@ int streamStateValueIsStale(char* vv) {
return ts < taosGetTimestampSec() ? 1 : 0; return ts < taosGetTimestampSec() ? 1 : 0;
} }
int iterValueIsStale(rocksdb_iterator_t* iter) { int iterValueIsStale(rocksdb_iterator_t* iter) {
char* vv = (char*)rocksdb_iter_value(iter, NULL); size_t len;
return streamStateValueIsStale(vv); char* v = (char*)rocksdb_iter_value(iter, &len);
return streamStateValueIsStale(v);
} }
int defaultKeyEncode(void* k, char* buf) { int defaultKeyEncode(void* k, char* buf) {
int len = strlen((char*)k); int len = strlen((char*)k);
...@@ -997,7 +998,8 @@ SStreamStateCur* streamStateGetCur_rocksdb(SStreamState* pState, const SWinKey* ...@@ -997,7 +998,8 @@ SStreamStateCur* streamStateGetCur_rocksdb(SStreamState* pState, const SWinKey*
rocksdb_iter_seek(pCur->iter, buf, len); rocksdb_iter_seek(pCur->iter, buf, len);
if (rocksdb_iter_valid(pCur->iter) && !iterValueIsStale(pCur->iter)) { if (rocksdb_iter_valid(pCur->iter) && !iterValueIsStale(pCur->iter)) {
char* val = (char*)rocksdb_iter_value(pCur->iter, NULL); size_t vlen;
char* val = (char*)rocksdb_iter_value(pCur->iter, &vlen);
if (!streamStateValueIsStale(val)) { if (!streamStateValueIsStale(val)) {
SStateKey curKey; SStateKey curKey;
size_t kLen = 0; size_t kLen = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册