~ubuntu-branches/ubuntu/raring/ceph/raring

« back to all changes in this revision

Viewing changes to src/messages/MOSDPGLog.h

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-06-08 15:54:37 UTC
  • mfrom: (1.1.8) (0.1.13 sid)
  • Revision ID: package-import@ubuntu.com-20120608155437-gy3j9k6wzv7w4gn9
Tags: 0.44.1-1ubuntu1
* Merge from Debian unstable.  Remaining changes:
  - d/control: Switch from libcryptopp to libnss as libcryptopp
    is not seeded.
  - d/control,d/rules: Move from python-support to dh_python2.
  - d/patches/manpage_updates*.patch: cherry picked upstream manpage
    updates warning about lack of encryption, per MIR review.
  - d/rules,d/control: Drop radosgw since libfcgi is not in main and
    the code may not be suitable for LTS.
  - d/rules,d/control: Drop tcmalloc since google perftools is not
    in main yet.
  - d/rules,d/control: Drop ceph-fuse entirely per MIR review
    recommendation.
* d/patches/fix-radosgw-tests.patch: Cherry picked patch from upstream
  VCS to fixup tests to conditionally use radosgw if enabled.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#include "msg/Message.h"
20
20
 
21
21
class MOSDPGLog : public Message {
 
22
 
 
23
  static const int HEAD_VERSION = 2;
 
24
 
22
25
  epoch_t epoch;
23
26
  /// query_epoch is the epoch of the query being responded to, or
24
27
  /// the current epoch if this is not being sent in response to a
27
30
  epoch_t query_epoch;
28
31
 
29
32
public:
30
 
  PG::Info info;
31
 
  PG::Log log;
32
 
  PG::Missing missing;
 
33
  pg_info_t info;
 
34
  pg_log_t log;
 
35
  pg_missing_t missing;
33
36
 
34
37
  epoch_t get_epoch() { return epoch; }
35
38
  pg_t get_pgid() { return info.pgid; }
36
39
  epoch_t get_query_epoch() { return query_epoch; }
37
40
 
38
 
  MOSDPGLog() {}
39
 
  MOSDPGLog(version_t mv, PG::Info& i) :
40
 
    Message(MSG_OSD_PG_LOG),
41
 
    epoch(mv), query_epoch(mv), info(i)  { }
42
 
  MOSDPGLog(version_t mv, PG::Info& i, epoch_t query_epoch) :
43
 
    Message(MSG_OSD_PG_LOG),
44
 
    epoch(mv), query_epoch(query_epoch), info(i)  { }
 
41
  MOSDPGLog() : Message(MSG_OSD_PG_LOG, HEAD_VERSION) { }
 
42
  MOSDPGLog(version_t mv, pg_info_t& i)
 
43
    : Message(MSG_OSD_PG_LOG, HEAD_VERSION),
 
44
      epoch(mv), query_epoch(mv), info(i)  { }
 
45
  MOSDPGLog(version_t mv, pg_info_t& i, epoch_t query_epoch)
 
46
    : Message(MSG_OSD_PG_LOG, HEAD_VERSION),
 
47
      epoch(mv), query_epoch(query_epoch), info(i)  { }
 
48
 
45
49
private:
46
50
  ~MOSDPGLog() {}
47
51
 
48
52
public:
49
 
  const char *get_type_name() { return "PGlog"; }
50
 
  void print(ostream& out) {
 
53
  const char *get_type_name() const { return "PGlog"; }
 
54
  void print(ostream& out) const {
51
55
    out << "pg_log(" << info.pgid << " epoch " << epoch
52
56
        << " query_epoch " << query_epoch << ")";
53
57
  }
54
58
 
55
 
  void encode_payload(CephContext *cct) {
56
 
    header.version = 2;
 
59
  void encode_payload(uint64_t features) {
57
60
    ::encode(epoch, payload);
58
61
    ::encode(info, payload);
59
62
    ::encode(log, payload);
60
63
    ::encode(missing, payload);
61
64
    ::encode(query_epoch, payload);
62
65
  }
63
 
  void decode_payload(CephContext *cct) {
 
66
  void decode_payload() {
64
67
    bufferlist::iterator p = payload.begin();
65
68
    ::decode(epoch, p);
66
69
    ::decode(info, p);
67
70
    ::decode(log, p);
68
71
    ::decode(missing, p);
69
 
    if (header.version > 1) {
 
72
    if (header.version >= 2) {
70
73
      ::decode(query_epoch, p);
71
74
    }
72
75
  }