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
25 inline const char *get_mdstable_name(int t) {
27 case TABLE_ANCHOR: return "anchortable";
28 case TABLE_SNAP: return "snaptable";
29 default: ceph_abort();
34 TABLESERVER_OP_QUERY = 1,
35 TABLESERVER_OP_QUERY_REPLY = -2,
36 TABLESERVER_OP_PREPARE = 3,
37 TABLESERVER_OP_AGREE = -4,
38 TABLESERVER_OP_COMMIT = 5,
39 TABLESERVER_OP_ACK = -6,
40 TABLESERVER_OP_ROLLBACK = 7,
41 TABLESERVER_OP_SERVER_UPDATE = 8,
42 TABLESERVER_OP_SERVER_READY = -9,
45 inline const char *get_mdstableserver_opname(int op) {
47 case TABLESERVER_OP_QUERY: return "query";
48 case TABLESERVER_OP_QUERY_REPLY: return "query_reply";
49 case TABLESERVER_OP_PREPARE: return "prepare";
50 case TABLESERVER_OP_AGREE: return "agree";
51 case TABLESERVER_OP_COMMIT: return "commit";
52 case TABLESERVER_OP_ACK: return "ack";
53 case TABLESERVER_OP_ROLLBACK: return "rollback";
54 case TABLESERVER_OP_SERVER_UPDATE: return "server_update";
55 case TABLESERVER_OP_SERVER_READY: return "server_ready";
56 default: ceph_abort(); return 0;
66 inline const char *get_mdstable_opname(int op) {
68 case TABLE_OP_CREATE: return "create";
69 case TABLE_OP_UPDATE: return "update";
70 case TABLE_OP_DESTROY: return "destroy";
71 default: ceph_abort(); return 0;