1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
15 #ifndef CEPH_MDSTABLETYPES_H
16 #define CEPH_MDSTABLETYPES_H
20 #include <string_view>
27 inline std::string_view
get_mdstable_name(int t
) {
29 case TABLE_ANCHOR
: return "anchortable";
30 case TABLE_SNAP
: return "snaptable";
31 default: ceph_abort(); return std::string_view();
36 TABLESERVER_OP_QUERY
= 1,
37 TABLESERVER_OP_QUERY_REPLY
= -2,
38 TABLESERVER_OP_PREPARE
= 3,
39 TABLESERVER_OP_AGREE
= -4,
40 TABLESERVER_OP_COMMIT
= 5,
41 TABLESERVER_OP_ACK
= -6,
42 TABLESERVER_OP_ROLLBACK
= 7,
43 TABLESERVER_OP_SERVER_UPDATE
= 8,
44 TABLESERVER_OP_SERVER_READY
= -9,
45 TABLESERVER_OP_NOTIFY_ACK
= 10,
46 TABLESERVER_OP_NOTIFY_PREP
= -11,
49 inline std::string_view
get_mdstableserver_opname(int op
) {
51 case TABLESERVER_OP_QUERY
: return "query";
52 case TABLESERVER_OP_QUERY_REPLY
: return "query_reply";
53 case TABLESERVER_OP_PREPARE
: return "prepare";
54 case TABLESERVER_OP_AGREE
: return "agree";
55 case TABLESERVER_OP_COMMIT
: return "commit";
56 case TABLESERVER_OP_ACK
: return "ack";
57 case TABLESERVER_OP_ROLLBACK
: return "rollback";
58 case TABLESERVER_OP_SERVER_UPDATE
: return "server_update";
59 case TABLESERVER_OP_SERVER_READY
: return "server_ready";
60 case TABLESERVER_OP_NOTIFY_ACK
: return "notify_ack";
61 case TABLESERVER_OP_NOTIFY_PREP
: return "notify_prep";
62 default: ceph_abort(); return std::string_view();
72 inline std::string_view
get_mdstable_opname(int op
) {
74 case TABLE_OP_CREATE
: return "create";
75 case TABLE_OP_UPDATE
: return "update";
76 case TABLE_OP_DESTROY
: return "destroy";
77 default: ceph_abort(); return std::string_view();