Skip to content

Commit aa2f606

Browse files
committed
crimson/os: drop off omap_get_values with start
Signed-off-by: chunmei liu <[email protected]>
1 parent 019a75c commit aa2f606

File tree

7 files changed

+1
-128
lines changed

7 files changed

+1
-128
lines changed

src/crimson/os/alienstore/alien_store.cc

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -424,47 +424,6 @@ auto AlienStore::omap_get_values(CollectionRef ch,
424424
});
425425
}
426426

427-
auto AlienStore::omap_get_values(CollectionRef ch,
428-
const ghobject_t &oid,
429-
const std::optional<string> &start,
430-
uint32_t op_flags)
431-
-> read_errorator::future<std::tuple<bool, omap_values_t>>
432-
{
433-
logger().debug("{} with_start", __func__);
434-
assert(tp);
435-
return do_with_op_gate(omap_values_t{}, [=, this] (auto &values) {
436-
return tp->submit(ch->get_cid().hash_to_shard(tp->size()), [=, this, &values] {
437-
auto c = static_cast<AlienCollection*>(ch.get());
438-
return store->omap_iterate(
439-
c->collection, oid,
440-
ObjectStore::omap_iter_seek_t{
441-
.seek_position = start.value_or(std::string{}),
442-
// FIXME: classical OSDs begins iteration from LOWER_BOUND
443-
// (or UPPER_BOUND if filter_prefix > start). However, these
444-
// bits are not implemented yet
445-
.seek_type = ObjectStore::omap_iter_seek_t::UPPER_BOUND
446-
},
447-
[&values]
448-
(std::string_view key, std::string_view value) mutable {
449-
values[std::string{key}].append(value);
450-
// FIXME: there is limit on number of entries yet
451-
return ObjectStore::omap_iter_ret_t::NEXT;
452-
});
453-
}).then([&values] (int r)
454-
-> read_errorator::future<std::tuple<bool, omap_values_t>> {
455-
if (r == -ENOENT) {
456-
return crimson::ct_error::enoent::make();
457-
} else if (r < 0){
458-
logger().error("omap_get_values(start): {}", r);
459-
return crimson::ct_error::input_output_error::make();
460-
} else {
461-
return read_errorator::make_ready_future<std::tuple<bool, omap_values_t>>(
462-
true, std::move(values));
463-
}
464-
});
465-
});
466-
}
467-
468427
AlienStore::read_errorator::future<ObjectStore::omap_iter_ret_t>
469428
AlienStore::omap_iterate(CollectionRef ch,
470429
const ghobject_t &oid,

src/crimson/os/alienstore/alien_store.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,6 @@ class AlienStore final : public FuturizedStore,
6666
const omap_keys_t& keys,
6767
uint32_t op_flags = 0) final;
6868

69-
/// Retrieves paged set of values > start (if present)
70-
read_errorator::future<std::tuple<bool, omap_values_t>> omap_get_values(
71-
CollectionRef c, ///< [in] collection
72-
const ghobject_t &oid, ///< [in] oid
73-
const std::optional<std::string> &start, ///< [in] start, empty for begin
74-
uint32_t op_flags = 0
75-
) final; ///< @return <done, values> values.empty() iff done
76-
7769
seastar::future<std::tuple<std::vector<ghobject_t>, ghobject_t>> list_objects(
7870
CollectionRef c,
7971
const ghobject_t& start,

src/crimson/os/cyanstore/cyan_store.cc

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -390,29 +390,6 @@ auto CyanStore::Shard::omap_get_values(
390390
return seastar::make_ready_future<omap_values_t>(std::move(values));
391391
}
392392

393-
auto CyanStore::Shard::omap_get_values(
394-
CollectionRef ch,
395-
const ghobject_t &oid,
396-
const std::optional<string> &start,
397-
uint32_t op_flags)
398-
-> CyanStore::Shard::read_errorator::future<std::tuple<bool, omap_values_t>>
399-
{
400-
auto c = static_cast<Collection*>(ch.get());
401-
logger().debug("{} {} {}", __func__, c->get_cid(), oid);
402-
auto o = c->get_object(oid);
403-
if (!o) {
404-
return crimson::ct_error::enoent::make();
405-
}
406-
omap_values_t values;
407-
for (auto i = start ? o->omap.upper_bound(*start) : o->omap.begin();
408-
i != o->omap.end();
409-
++i) {
410-
values.insert(*i);
411-
}
412-
return seastar::make_ready_future<std::tuple<bool, omap_values_t>>(
413-
std::make_tuple(true, std::move(values)));
414-
}
415-
416393
auto CyanStore::Shard::omap_iterate(
417394
CollectionRef ch,
418395
const ghobject_t &oid,

src/crimson/os/cyanstore/cyan_store.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,6 @@ class CyanStore final : public FuturizedStore {
7272
const omap_keys_t& keys,
7373
uint32_t op_flags = 0) final;
7474

75-
read_errorator::future<std::tuple<bool, omap_values_t>> omap_get_values(
76-
CollectionRef c, ///< [in] collection
77-
const ghobject_t &oid, ///< [in] oid
78-
const std::optional<std::string> &start, ///< [in] start, empty for begin
79-
uint32_t op_flags = 0
80-
) final;
81-
8275
read_errorator::future<ObjectStore::omap_iter_ret_t> omap_iterate(
8376
CollectionRef c,
8477
const ghobject_t &oid,

src/crimson/os/futurized_store.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,6 @@ class FuturizedStore {
8888
const omap_keys_t& keys,
8989
uint32_t op_flags = 0) = 0;
9090

91-
using omap_values_paged_t = std::tuple<bool, omap_values_t>;
92-
virtual read_errorator::future<omap_values_paged_t> omap_get_values(
93-
CollectionRef c, ///< [in] collection
94-
const ghobject_t &oid, ///< [in] oid
95-
const std::optional<std::string> &start, ///< [in] start, empty for begin
96-
uint32_t op_flags = 0
97-
) = 0; ///< @return <done, values> values.empty() only if done
98-
9991
/**
10092
* Iterate over object map with user-provided callable
10193
*

src/crimson/os/seastore/seastore.cc

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@ template <> struct fmt::formatter<crimson::os::seastore::op_type_t>
6262
case op_type_t::OMAP_GET_VALUES:
6363
name = "omap_get_values";
6464
break;
65-
case op_type_t::OMAP_GET_VALUES2:
66-
name = "omap_get_values2";
67-
break;
6865
case op_type_t::OMAP_ITERATE:
6966
name = "omap_iterate";
7067
break;
@@ -166,7 +163,6 @@ void SeaStore::Shard::register_metrics()
166163
{op_type_t::GET_ATTRS, sm::label_instance("latency", "GET_ATTRS")},
167164
{op_type_t::STAT, sm::label_instance("latency", "STAT")},
168165
{op_type_t::OMAP_GET_VALUES, sm::label_instance("latency", "OMAP_GET_VALUES")},
169-
{op_type_t::OMAP_GET_VALUES2, sm::label_instance("latency", "OMAP_GET_VALUES2")},
170166
{op_type_t::OMAP_ITERATE, sm::label_instance("latency", "OMAP_ITERATE")},
171167
};
172168

@@ -1430,34 +1426,6 @@ SeaStore::Shard::omap_get_values(
14301426
});
14311427
}
14321428

1433-
SeaStore::Shard::read_errorator::future<SeaStore::Shard::omap_values_paged_t>
1434-
SeaStore::Shard::omap_get_values(
1435-
CollectionRef ch,
1436-
const ghobject_t &oid,
1437-
const std::optional<std::string> &start,
1438-
uint32_t op_flags)
1439-
{
1440-
++(shard_stats.read_num);
1441-
++(shard_stats.pending_read_num);
1442-
1443-
return repeat_with_onode<omap_values_paged_t>(
1444-
ch,
1445-
oid,
1446-
Transaction::src_t::READ,
1447-
"omap_get_values2",
1448-
op_type_t::OMAP_GET_VALUES2,
1449-
op_flags,
1450-
[this, start](auto &t, auto &onode)
1451-
{
1452-
auto root = select_log_omap_root(onode);
1453-
return omaptree_get_values(
1454-
t, std::move(root), start);
1455-
}).finally([this] {
1456-
assert(shard_stats.pending_read_num);
1457-
--(shard_stats.pending_read_num);
1458-
});
1459-
}
1460-
14611429
SeaStore::Shard::read_errorator::future<ObjectStore::omap_iter_ret_t>
14621430
SeaStore::Shard::omap_iterate(
14631431
CollectionRef ch,

src/crimson/os/seastore/seastore.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ enum class op_type_t : uint8_t {
4242
GET_ATTRS,
4343
STAT,
4444
OMAP_GET_VALUES,
45-
OMAP_GET_VALUES2,
4645
OMAP_ITERATE,
4746
MAX
4847
};
@@ -140,14 +139,6 @@ class SeaStore final : public FuturizedStore {
140139
const omap_keys_t& keys,
141140
uint32_t op_flags = 0) final;
142141

143-
/// Retrieves paged set of values > start (if present)
144-
read_errorator::future<omap_values_paged_t> omap_get_values(
145-
CollectionRef c, ///< [in] collection
146-
const ghobject_t &oid, ///< [in] oid
147-
const std::optional<std::string> &start, ///< [in] start, empty for begin
148-
uint32_t op_flags = 0
149-
) final; ///< @return <done, values> values.empty() iff done
150-
151142
read_errorator::future<ObjectStore::omap_iter_ret_t> omap_iterate(
152143
CollectionRef c,
153144
const ghobject_t &oid,
@@ -514,6 +505,7 @@ class SeaStore final : public FuturizedStore {
514505
omap_root_t&& root,
515506
const omap_keys_t& keys) const;
516507

508+
using omap_values_paged_t = std::tuple<bool, omap_values_t>;
517509
base_iertr::future<omap_values_paged_t> omaptree_get_values(
518510
Transaction& t,
519511
omap_root_t&& root,

0 commit comments

Comments
 (0)