feat(db): cache merged file

Former-commit-id: d236a8dbfcb01d07b6b544aa98a7e1dd179fc477
pull/191/head
Xu Peng 2019-04-24 15:16:19 +08:00
parent d6044cfc32
commit 2e8d45aad3
1 changed files with 6 additions and 1 deletions

View File

@ -6,10 +6,11 @@
#include <faiss/MetaIndexes.h>
#include <faiss/index_io.h>
#include <faiss/AutoTune.h>
#include <wrapper/IndexBuilder.h>
#include <cstring>
#include <wrapper/Topk.h>
#include <easylogging++.h>
#include <wrapper/IndexBuilder.h>
#include <cache/CpuCacheMgr.h>
#include "DBImpl.h"
#include "DBMetaImpl.h"
#include "Env.h"
@ -238,6 +239,10 @@ Status DBImpl::merge_files(const std::string& group_id, const meta::DateT& date,
LOG(DEBUG) << "New merged file " << group_file.file_id <<
" of size=" << group_file.rows;
/* auto to_cache = zilliz::vecwise::cache::DataObj(std::make_shared<Index>(index)); */
zilliz::vecwise::cache::CpuCacheMgr::GetInstance()->InsertItem(
group_file.location, std::make_shared<Index>(index));
return status;
}