From bcac5666e3c9d3d04a9cc656e4bd4f159595639a Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Fri, 14 Jul 2017 16:19:31 -0700 Subject: [PATCH] cls_kvs: adjust objclass api Signed-off-by: Yehuda Sadeh --- src/key_value_store/cls_kvs.cc | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/key_value_store/cls_kvs.cc b/src/key_value_store/cls_kvs.cc index 2a6f3ab67bd..183c8d6f946 100644 --- a/src/key_value_store/cls_kvs.cc +++ b/src/key_value_store/cls_kvs.cc @@ -30,7 +30,9 @@ static int get_idata_from_key(cls_method_context_t hctx, const string &key, int r = 0; std::map kvmap; - r = cls_cxx_map_get_vals(hctx, key_data(key).encoded(), "", 2, &kvmap); + bool more; + + r = cls_cxx_map_get_vals(hctx, key_data(key).encoded(), "", 2, &kvmap, &more); if (r < 0) { CLS_LOG(20, "error reading index for range %s: %d", key.c_str(), r); return r; @@ -99,7 +101,8 @@ static int get_next_idata(cls_method_context_t hctx, const index_data &idata, index_data &out_data) { int r = 0; std::map kvs; - r = cls_cxx_map_get_vals(hctx, idata.kdata.encoded(), "", 1, &kvs); + bool more; + r = cls_cxx_map_get_vals(hctx, idata.kdata.encoded(), "", 1, &kvs, &more); if (r < 0){ CLS_LOG(20, "getting kvs failed with error %d", r); return r; @@ -150,7 +153,8 @@ static int get_prev_idata(cls_method_context_t hctx, const index_data &idata, index_data &out_data) { int r = 0; std::map kvs; - r = cls_cxx_map_get_vals(hctx, "", "", LONG_MAX, &kvs); + bool more; + r = cls_cxx_map_get_vals(hctx, "", "", LONG_MAX, &kvs, &more); if (r < 0){ CLS_LOG(20, "getting kvs failed with error %d", r); return r; @@ -202,10 +206,11 @@ static int get_prev_idata_op(cls_method_context_t hctx, static int read_many(cls_method_context_t hctx, const set &keys, map * out) { int r = 0; + bool more; CLS_ERR("reading from a map of size %d, first key encoded is %s", (int)keys.size(), key_data(*keys.begin()).encoded().c_str()); r = cls_cxx_map_get_vals(hctx, key_data(*keys.begin()).encoded().c_str(), - "", LONG_MAX, out); + "", LONG_MAX, out, &more); if (r < 0) { CLS_ERR("getting omap vals failed with error %d", r); } @@ -599,7 +604,8 @@ static int maybe_read_for_balance(cls_method_context_t hctx, } //if the assert succeeded, it needs to be balanced - r = cls_cxx_map_get_vals(hctx, "", "", LONG_MAX, &odata.omap); + bool more; + r = cls_cxx_map_get_vals(hctx, "", "", LONG_MAX, &odata.omap, &more); if (r < 0){ CLS_LOG(20, "rebalance read: getting kvs failed with error %d", r); return r; -- 2.39.5