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

update tindex reader

上级 28c358c3
...@@ -296,9 +296,7 @@ int indexTFileSearch(void* tfile, SIndexTermQuery* query, SArray* result) { ...@@ -296,9 +296,7 @@ int indexTFileSearch(void* tfile, SIndexTermQuery* query, SArray* result) {
TFileCacheKey key = {.suid = term->suid, .colType = term->colType, .colName = term->colName, .nColName = term->nColName}; TFileCacheKey key = {.suid = term->suid, .colType = term->colType, .colName = term->colName, .nColName = term->nColName};
TFileReader* reader = tfileCacheGet(pTfile->cache, &key); TFileReader* reader = tfileCacheGet(pTfile->cache, &key);
ret = tfileReaderSearch(reader, query, result); return tfileReaderSearch(reader, query, result);
return ret;
} }
int indexTFilePut(void* tfile, SIndexTerm* term, uint64_t uid) { int indexTFilePut(void* tfile, SIndexTerm* term, uint64_t uid) {
// TFileWriterOpt wOpt = {.suid = term->suid, .colType = term->colType, .colName = term->colName, .nColName = term->nColName, .version = // TFileWriterOpt wOpt = {.suid = term->suid, .colType = term->colType, .colName = term->colName, .nColName = term->nColName, .version =
...@@ -331,8 +329,7 @@ static int tfileWriteFstOffset(TFileWriter* tw, int32_t offset) { ...@@ -331,8 +329,7 @@ static int tfileWriteFstOffset(TFileWriter* tw, int32_t offset) {
return 0; return 0;
} }
static int tfileWriteHeader(TFileWriter* writer) { static int tfileWriteHeader(TFileWriter* writer) {
char buf[TFILE_HEADER_NO_FST] = {0}; char buf[TFILE_HEADER_NO_FST] = {0};
char* p = buf;
TFileHeader* header = &writer->header; TFileHeader* header = &writer->header;
memcpy(buf, (char*)header, sizeof(buf)); memcpy(buf, (char*)header, sizeof(buf));
...@@ -360,8 +357,7 @@ static int tfileWriteData(TFileWriter* write, TFileValue* tval) { ...@@ -360,8 +357,7 @@ static int tfileWriteData(TFileWriter* write, TFileValue* tval) {
} }
static int tfileReadLoadHeader(TFileReader* reader) { static int tfileReadLoadHeader(TFileReader* reader) {
// TODO simple tfile header later // TODO simple tfile header later
char buf[TFILE_HEADER_SIZE] = {0}; char buf[TFILE_HEADER_SIZE] = {0};
char* p = buf;
int64_t nread = reader->ctx->read(reader->ctx, buf, sizeof(buf)); int64_t nread = reader->ctx->read(reader->ctx, buf, sizeof(buf));
assert(nread == sizeof(buf)); assert(nread == sizeof(buf));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册