refactor index
This commit is contained in:
parent
ce5f9fa9f3
commit
966b017986
|
@ -607,7 +607,8 @@ void validateTFile(char* arg) {
|
||||||
// std::vector<std::thread> threads;
|
// std::vector<std::thread> threads;
|
||||||
SIndex* index = (SIndex*)taosMemoryCalloc(1, sizeof(SIndex));
|
SIndex* index = (SIndex*)taosMemoryCalloc(1, sizeof(SIndex));
|
||||||
index->path = taosStrdup(arg);
|
index->path = taosStrdup(arg);
|
||||||
TFileReader* reader = tfileReaderOpen(index, 0, 20000000, "tag1");
|
TFileReader* reader = NULL;
|
||||||
|
int32_t code = tfileReaderOpen(index, 0, 20000000, "tag1", &reader);
|
||||||
|
|
||||||
for (int i = 0; i < NUM_OF_THREAD; i++) {
|
for (int i = 0; i < NUM_OF_THREAD; i++) {
|
||||||
threads[i] = std::thread(fst_get, reader->fst);
|
threads[i] = std::thread(fst_get, reader->fst);
|
||||||
|
@ -626,7 +627,8 @@ void iterTFileReader(char* path, char* uid, char* colName, char* ver) {
|
||||||
uint64_t suid = atoi(uid);
|
uint64_t suid = atoi(uid);
|
||||||
int version = atoi(ver);
|
int version = atoi(ver);
|
||||||
|
|
||||||
TFileReader* reader = tfileReaderOpen(NULL, suid, version, colName);
|
TFileReader* reader = NULL;
|
||||||
|
int32_t code = tfileReaderOpen(NULL, suid, version, colName, &reader);
|
||||||
|
|
||||||
Iterate* iter = tfileIteratorCreate(reader);
|
Iterate* iter = tfileIteratorCreate(reader);
|
||||||
bool tn = iter ? iter->next(iter) : false;
|
bool tn = iter ? iter->next(iter) : false;
|
||||||
|
|
|
@ -392,7 +392,7 @@ class TFileObj {
|
||||||
IFileCtx* ctx = idxFileCtxCreate(TFILE, path.c_str(), false, 64 * 1024 * 1024);
|
IFileCtx* ctx = idxFileCtxCreate(TFILE, path.c_str(), false, 64 * 1024 * 1024);
|
||||||
ctx->lru = taosLRUCacheInit(1024 * 1024 * 4, -1, .5);
|
ctx->lru = taosLRUCacheInit(1024 * 1024 * 4, -1, .5);
|
||||||
|
|
||||||
writer_ = tfileWriterCreate(ctx, &header);
|
int32_t code = tfileWriterCreate(ctx, &header, &writer_);
|
||||||
return writer_ != NULL ? true : false;
|
return writer_ != NULL ? true : false;
|
||||||
}
|
}
|
||||||
bool InitReader() {
|
bool InitReader() {
|
||||||
|
|
Loading…
Reference in New Issue