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_MDS_ETABLESERVER_H
16 #define CEPH_MDS_ETABLESERVER_H
18 #include "common/config.h"
19 #include "include/types.h"
21 #include "../mds_table_types.h"
22 #include "../LogEvent.h"
24 struct ETableServer : public LogEvent {
33 ETableServer() : LogEvent(EVENT_TABLESERVER), table(0), op(0),
34 reqid(0), bymds(MDS_RANK_NONE), tid(0), version(0) { }
35 ETableServer(int t, int o, uint64_t ri, mds_rank_t m, version_t ti, version_t v) :
36 LogEvent(EVENT_TABLESERVER),
37 table(t), op(o), reqid(ri), bymds(m), tid(ti), version(v) { }
39 void encode(bufferlist& bl, uint64_t features) const override;
40 void decode(bufferlist::iterator& bl) override;
41 void dump(Formatter *f) const override;
42 static void generate_test_instances(list<ETableServer*>& ls);
44 void print(ostream& out) const override {
45 out << "ETableServer " << get_mdstable_name(table)
46 << " " << get_mdstableserver_opname(op);
47 if (reqid) out << " reqid " << reqid;
48 if (bymds >= 0) out << " mds." << bymds;
49 if (tid) out << " tid " << tid;
50 if (version) out << " version " << version;
51 if (mutation.length()) out << " mutation=" << mutation.length() << " bytes";
54 void update_segment() override;
55 void replay(MDSRank *mds) override;
57 WRITE_CLASS_ENCODER_FEATURES(ETableServer)