refactor code
This commit is contained in:
parent
99379fd5a6
commit
49ef94fb69
|
@ -401,7 +401,7 @@ int indexFlushCacheTFile(SIndex* sIdx, void* cache) {
|
||||||
|
|
||||||
IndexCache* pCache = (IndexCache*)cache;
|
IndexCache* pCache = (IndexCache*)cache;
|
||||||
TFileReader* pReader = tfileGetReaderByCol(sIdx->tindex, pCache->suid, pCache->colName);
|
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
|
// handle flush
|
||||||
Iterate* cacheIter = indexCacheIteratorCreate(pCache);
|
Iterate* cacheIter = indexCacheIteratorCreate(pCache);
|
||||||
Iterate* tfileIter = tfileIteratorCreate(pReader);
|
Iterate* tfileIter = tfileIteratorCreate(pReader);
|
||||||
|
@ -512,6 +512,7 @@ static int indexGenTFile(SIndex* sIdx, IndexCache* cache, SArray* batch) {
|
||||||
return ret;
|
return ret;
|
||||||
END:
|
END:
|
||||||
tfileWriterClose(tw);
|
tfileWriterClose(tw);
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t indexSerialCacheKey(ICacheKey* key, char* buf) {
|
int32_t indexSerialCacheKey(ICacheKey* key, char* buf) {
|
||||||
|
|
|
@ -934,6 +934,7 @@ TEST_F(IndexEnv2, testIndex_read_performance) {
|
||||||
index->PutOneTarge("tag1", "Hello", 15);
|
index->PutOneTarge("tag1", "Hello", 15);
|
||||||
index->ReadMultiMillonData("tag1", "Hello");
|
index->ReadMultiMillonData("tag1", "Hello");
|
||||||
std::cout << "reader sz: " << index->SearchOne("tag1", "Hello") << std::endl;
|
std::cout << "reader sz: " << index->SearchOne("tag1", "Hello") << std::endl;
|
||||||
|
assert(3 == index->SearchOne("tag1", "Hello"));
|
||||||
}
|
}
|
||||||
TEST_F(IndexEnv2, testIndexMultiTag) {
|
TEST_F(IndexEnv2, testIndexMultiTag) {
|
||||||
std::string path = "/tmp/test3";
|
std::string path = "/tmp/test3";
|
||||||
|
|
Loading…
Reference in New Issue