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_ESESSIONS_H
16 #define CEPH_MDS_ESESSIONS_H
18 #include "common/config.h"
19 #include "include/types.h"
21 #include "../LogEvent.h"
23 class ESessions : public LogEvent {
25 version_t cmapv; // client map version
28 map<client_t,entity_inst_t> client_map;
29 bool old_style_encode;
31 ESessions() : LogEvent(EVENT_SESSIONS), cmapv(0), old_style_encode(false) { }
32 ESessions(version_t pv, map<client_t,entity_inst_t>& cm) :
33 LogEvent(EVENT_SESSIONS),
35 old_style_encode(false) {
39 void mark_old_encoding() { old_style_encode = true; }
41 void encode(bufferlist &bl, uint64_t features) const override;
42 void decode_old(bufferlist::iterator &bl);
43 void decode_new(bufferlist::iterator &bl);
44 void decode(bufferlist::iterator &bl) override {
45 if (old_style_encode) decode_old(bl);
48 void dump(Formatter *f) const override;
49 static void generate_test_instances(list<ESessions*>& ls);
51 void print(ostream& out) const override {
52 out << "ESessions " << client_map.size() << " opens cmapv " << cmapv;
55 void update_segment() override;
56 void replay(MDSRank *mds) override;
58 WRITE_CLASS_ENCODER_FEATURES(ESessions)