refactor code

This commit is contained in:
yihaoDeng 2022-01-04 22:58:52 +08:00
parent 99379fd5a6
commit 49ef94fb69
2 changed files with 3 additions and 1 deletions

View File

@ -401,7 +401,7 @@ int indexFlushCacheTFile(SIndex* sIdx, void* cache) {
IndexCache* pCache = (IndexCache*)cache;
TFileReader* pReader = tfileGetReaderByCol(sIdx->tindex, pCache->suid, pCache->colName);
if (pReader == NULL) { indexWarn("empty pReader found"); }
if (pReader == NULL) { indexWarn("empty tfile reader found"); }
// handle flush
Iterate* cacheIter = indexCacheIteratorCreate(pCache);
Iterate* tfileIter = tfileIteratorCreate(pReader);
@ -512,6 +512,7 @@ static int indexGenTFile(SIndex* sIdx, IndexCache* cache, SArray* batch) {
return ret;
END:
tfileWriterClose(tw);
return -1;
}
int32_t indexSerialCacheKey(ICacheKey* key, char* buf) {

View File

@ -934,6 +934,7 @@ TEST_F(IndexEnv2, testIndex_read_performance) {
index->PutOneTarge("tag1", "Hello", 15);
index->ReadMultiMillonData("tag1", "Hello");
std::cout << "reader sz: " << index->SearchOne("tag1", "Hello") << std::endl;
assert(3 == index->SearchOne("tag1", "Hello"));
}
TEST_F(IndexEnv2, testIndexMultiTag) {
std::string path = "/tmp/test3";