search context id

Former-commit-id: 7e8bafac6b78d879edb8a09cd2ffb83c46d44401
pull/191/head
groot 2019-06-05 12:29:31 +08:00
parent db1b37d45c
commit ab3c9649c6
1 changed files with 5 additions and 4 deletions

View File

@ -6,7 +6,8 @@
#include "SearchContext.h"
#include "utils/Log.h"
#include <time.h>
#include <chrono>
namespace zilliz {
namespace vecwise {
@ -17,9 +18,9 @@ SearchContext::SearchContext(uint64_t topk, uint64_t nq, const float* vectors)
nq_(nq),
vectors_(vectors) {
//use current time to identify this context
time_t t;
time(&t);
identity_ = std::to_string(t);
std::chrono::system_clock::time_point tp = std::chrono::system_clock::now();
long id = tp.time_since_epoch().count();
identity_ = std::to_string(id);
}
bool