Skip to content

Commit

Permalink
Merge remote-tracking branch 'source/crud' into crud2
Browse files Browse the repository at this point in the history
  • Loading branch information
yhmo committed Feb 26, 2020
2 parents bfe012a + ccd8074 commit ad69e8f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 0 additions & 4 deletions core/src/server/delivery/request/DeleteByIDRequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@ DeleteByIDRequest::OnExecute() {

rc.RecordSection("check validation");

#ifdef MILVUS_ENABLE_PROFILING
std::string fname = "/tmp/search_nq_" + this->delete_by_range_param_->table_name() + ".profiling";
ProfilerStart(fname.c_str());
#endif
status = DBWrapper::DB()->DeleteVectors(table_name_, vector_ids_);
if (!status.ok()) {
return status;
Expand Down
8 changes: 6 additions & 2 deletions core/src/server/delivery/request/SearchByIDRequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,15 @@

#include "server/Config.h"
#include "server/DBWrapper.h"
#include "utils/CommonUtil.h"
#include "utils/Log.h"
#include "utils/TimeRecorder.h"
#include "utils/ValidationUtil.h"

#ifdef MILVUS_ENABLE_PROFILING
#include <gperftools/profiler.h>
#endif

namespace milvus {
namespace server {

Expand Down Expand Up @@ -129,8 +134,7 @@ SearchByIDRequest::OnExecute() {
engine::ResultDistances result_distances;

#ifdef MILVUS_ENABLE_PROFILING
std::string fname =
"/tmp/search_nq_" + std::to_string(this->search_param_->query_record_array_size()) + ".profiling";
std::string fname = "/tmp/search_by_id_" + CommonUtil::GetCurrentTimeStr() + ".profiling";
ProfilerStart(fname.c_str());
#endif

Expand Down
12 changes: 6 additions & 6 deletions tests/milvus_python_test/test_get_vector_by_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,22 +361,22 @@ def test_get_vector_table_not_existed(self, connect, jac_table):
status, res = connect.get_vector_by_id(table_new, 1)
assert not status.OK()

def test_get_vector_partition(self, connect, table):
def test_get_vector_partition(self, connect, jac_table):
'''
target: test get_vector_by_id
method: add vector, and get
expected: status ok, vector returned
'''
tmp, vectors = gen_binary_vectors(nb, dim)
status = connect.create_partition(table, tag)
status, ids = connect.add_vectors(table, vectors, partition_tag=tag)
status = connect.create_partition(jac_table, tag)
status, ids = connect.add_vectors(jac_table, vectors, partition_tag=tag)
assert status.OK()
status = connect.flush([table])
status = connect.flush([jac_table])
assert status.OK()
status, res = connect.get_vector_by_id(table, ids[0])
status, res = connect.get_vector_by_id(jac_table, ids[0])
logging.getLogger().info(res)
assert status.OK()
assert res == vectors[0]
assert res == vectors[0]


class TestGetVectorIdIngalid(object):
Expand Down

0 comments on commit ad69e8f

Please sign in to comment.