~ubuntu-branches/ubuntu/quantal/ceph/quantal

« back to all changes in this revision

Viewing changes to src/mds/Dumper.h

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum, Clint Byrum, Micah Gersten
  • Date: 2011-02-12 22:50:26 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110212225026-yyyw4tk0msgql3ul
Tags: 0.24.2-0ubuntu1
[ Clint Byrum <clint@ubuntu.com> ]
* New upstream release. (LP: #658670, LP: #684011)
* debian/patches/fix-mkcephfs.patch: dropped (applied upstream)
* Removed .la files from libceph1-dev, libcrush1-dev and 
  librados1-dev (per Debian policy v3.9.1 10.2).
* debian/control: adding pkg-config as a build dependency
* debian/control: depend on libcrypto++-dev instead of libssl-dev
* debian/watch: added watch file

[ Micah Gersten <micahg@ubuntu.com> ]
* debian/control: add Homepage

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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) 2010 Greg Farnum <gregf@hq.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
#ifndef JOURNAL_DUMPER_H_
 
15
#define JOURNAL_DUMPER_H_
 
16
 
 
17
#include "osd/OSDMap.h"
 
18
#include "osdc/Objecter.h"
 
19
#include "osdc/Journaler.h"
 
20
#include "msg/Dispatcher.h"
 
21
#include "msg/Messenger.h"
 
22
#include "msg/SimpleMessenger.h"
 
23
#include "auth/Auth.h"
 
24
 
 
25
/**
 
26
 * This class lets you dump out an mds journal for troubleshooting or whatever.
 
27
 *
 
28
 * It was built to work with cmds so some of the design choices are random.
 
29
 * To use, create a Dumper, call init(), and then call dump() with the name
 
30
 * of the file to dump to.
 
31
 */
 
32
 
 
33
class Dumper : public Dispatcher {
 
34
public:
 
35
  Objecter *objecter;
 
36
  Journaler *journaler;
 
37
  OSDMap *osdmap;
 
38
  SimpleMessenger *messenger;
 
39
  MonClient *monc;
 
40
  Mutex lock;
 
41
  SafeTimer timer;
 
42
 
 
43
  /*
 
44
   * The messenger should be a valid SimpleMessenger. You should call bind()
 
45
   * before passing it in, but not do anything else.
 
46
   * The MonClient needs to be valid, and you should have called
 
47
   * build_initial_monmap().
 
48
   */
 
49
  Dumper(SimpleMessenger *messenger_, MonClient *monc_) :
 
50
    messenger(messenger_),
 
51
    monc(monc_),
 
52
    lock("Dumper::lock"), timer(lock)
 
53
  {}
 
54
 
 
55
  virtual ~Dumper();
 
56
 
 
57
  bool ms_dispatch(Message *m) {
 
58
    switch (m->get_type()) {
 
59
    case CEPH_MSG_OSD_OPREPLY:
 
60
      objecter->handle_osd_op_reply((MOSDOpReply *)m);
 
61
      break;
 
62
    case CEPH_MSG_OSD_MAP:
 
63
      objecter->handle_osd_map((MOSDMap*)m);
 
64
      break;
 
65
    default:
 
66
      return false;
 
67
    }
 
68
    return true;
 
69
  }
 
70
  bool ms_handle_reset(Connection *con) { return false; }
 
71
  void ms_handle_remote_reset(Connection *con) {}
 
72
  bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer,
 
73
                         bool force_new);
 
74
  void init();
 
75
  void shutdown();
 
76
  void dump(const char *dumpfile);
 
77
};
 
78
 
 
79
#endif /* JOURNAL_DUMPER_H_ */