summaryrefslogtreecommitdiffstats
path: root/src/crimson/os/seastore/omap_manager.cc
blob: 7ad37a2e95977c9035d84b51ad2267cc8145847d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
#include <experimental/iterator>
#include <iostream>

#include "crimson/os/seastore/transaction_manager.h"
#include "crimson/os/seastore/omap_manager.h"
#include "crimson/os/seastore/omap_manager/btree/btree_omap_manager.h"

namespace crimson::os::seastore::omap_manager {

OMapManagerRef create_omap_manager(TransactionManager &trans_manager) {
  return OMapManagerRef(new BtreeOMapManager(trans_manager));
}

}

namespace std {
std::ostream &operator<<(std::ostream &out, const std::pair<std::string, std::string> &rhs)
{
  return out << "key_value_map (" << rhs.first<< "->" << rhs.second << ")";
}
}

namespace crimson::os::seastore {

std::ostream &operator<<(std::ostream &out, const std::list<std::string> &rhs)
{
  out << '[';
  std::copy(std::begin(rhs), std::end(rhs), std::experimental::make_ostream_joiner(out, ", "));
  return out << ']';
}

std::ostream &operator<<(std::ostream &out, const std::vector<std::pair<std::string, std::string>> &rhs)
{
  out << '[';
  std::ostream_iterator<std::pair<std::string, std::string>> out_it(out, ", ");
  std::copy(rhs.begin(), rhs.end(), out_it);
  return out << ']';
}

}