]> git.proxmox.com Git - ceph.git/blame - ceph/src/mds/events/EExport.h
import quincy beta 17.1.0
[ceph.git] / ceph / src / mds / events / EExport.h
CommitLineData
7c673cae
FG
1// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2// vim: ts=8 sw=2 smarttab
3/*
4 * Ceph - scalable distributed file system
5 *
6 * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
7 *
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.
12 *
13 */
14
15#ifndef CEPH_EEXPORT_H
16#define CEPH_EEXPORT_H
17
18#include "common/config.h"
19#include "include/types.h"
20
21#include "../MDSRank.h"
22
23#include "EMetaBlob.h"
24#include "../LogEvent.h"
25
26class EExport : public LogEvent {
27public:
28 EMetaBlob metablob; // exported dir
29protected:
30 dirfrag_t base;
20effc67 31 std::set<dirfrag_t> bounds;
31f18b77 32 mds_rank_t target;
7c673cae
FG
33
34public:
31f18b77
FG
35 EExport() :
36 LogEvent(EVENT_EXPORT), target(MDS_RANK_NONE) { }
37 EExport(MDLog *mdlog, CDir *dir, mds_rank_t t) :
11fdf7f2 38 LogEvent(EVENT_EXPORT),
31f18b77 39 base(dir->dirfrag()), target(t) { }
7c673cae 40
20effc67 41 std::set<dirfrag_t> &get_bounds() { return bounds; }
7c673cae 42
20effc67 43 void print(std::ostream& out) const override {
31f18b77 44 out << "EExport " << base << " to mds." << target << " " << metablob;
7c673cae
FG
45 }
46
47 EMetaBlob *get_metablob() override { return &metablob; }
48
49 void encode(bufferlist& bl, uint64_t features) const override;
11fdf7f2 50 void decode(bufferlist::const_iterator &bl) override;
7c673cae 51 void dump(Formatter *f) const override;
9f95a23c 52 static void generate_test_instances(std::list<EExport*>& ls);
7c673cae
FG
53 void replay(MDSRank *mds) override;
54
55};
56WRITE_CLASS_ENCODER_FEATURES(EExport)
57
58#endif