<commit_before>// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- 
// vim: ts=8 sw=2 smarttab
/*
 * Ceph - scalable distributed file system
 *
 * Copyright (C) 2004-2006 <NAME> <<EMAIL>>
 *
 * This is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License version 2.1, as published by the Free Software 
 * Foundation.  See file COPYING.
 * 
 */


#ifndef CEPH_MOSDREPSCRUB_H
#define CEPH_MOSDREPSCRUB_H

#include "msg/Message.h"

/*
 * instruct an OSD initiate a replica scrub on a specific PG
 */

struct MOSDRepScrub : public Message {
  pg_t pgid;             // PG to scrub
  eversion_t scrub_from; // only scrub log entries after scrub_from
  eversion_t scrub_to;   // last_update_applied when message sent
  epoch_t map_epoch;

  MOSDRepScrub() {}
  MOSDRepScrub(pg_t pgid, eversion_t scrub_from, eversion_t scrub_to,
	       epoch_t map_epoch) :
    Message(MSG_OSD_REP_SCRUB),
    pgid(pgid),
    scrub_from(scrub_from),
    scrub_to(scrub_to),
    map_epoch(map_epoch) {}
  
private:
  ~MOSDRepScrub() {}

public:
  const char *get_type_name() { return "replica scrub"; }
  void print(ostream& out) {
    out << "replica scrub(pg: ";
    out << pgid << ",from:" << scrub_from << ",to:" << scrub_to
	<< "epoch:" << map_epoch;
    out << ")";
  }

  void encode_payload(CephContext *cct) {
    __u8 v = 0;
    ::encode(v, payload);
    ::encode(pgid, payload);
    ::encode(scrub_from, payload);
    ::encode(scrub_to, payload);
    ::encode(map_epoch, payload);
  }
  void decode_payload(CephContext *cct) {
    __u8 v = -1;
    bufferlist::iterator p = payload.begin();
    ::decode(v, p);
    assert(v == 0);
    ::decode(pgid, p);
    ::decode(scrub_from, p);
    ::decode(scrub_to, p);
    ::decode(map_epoch, p);
  }
};

#endif
<commit_msg>MOSDRepScrub: use header.version for payload version<commit_after>// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- 
// vim: ts=8 sw=2 smarttab
/*
 * Ceph - scalable distributed file system
 *
 * Copyright (C) 2004-2006 <NAME> <<EMAIL>>
 *
 * This is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License version 2.1, as published by the Free Software 
 * Foundation.  See file COPYING.
 * 
 */


#ifndef CEPH_MOSDREPSCRUB_H
#define CEPH_MOSDREPSCRUB_H

#include "msg/Message.h"

/*
 * instruct an OSD initiate a replica scrub on a specific PG
 */

struct MOSDRepScrub : public Message {
  pg_t pgid;             // PG to scrub
  eversion_t scrub_from; // only scrub log entries after scrub_from
  eversion_t scrub_to;   // last_update_applied when message sent
  epoch_t map_epoch;

  MOSDRepScrub() {}
  MOSDRepScrub(pg_t pgid, eversion_t scrub_from, eversion_t scrub_to,
	       epoch_t map_epoch) :
    Message(MSG_OSD_REP_SCRUB),
    pgid(pgid),
    scrub_from(scrub_from),
    scrub_to(scrub_to),
    map_epoch(map_epoch) {}
  
private:
  ~MOSDRepScrub() {}

public:
  const char *get_type_name() { return "replica scrub"; }
  void print(ostream& out) {
    out << "replica scrub(pg: ";
    out << pgid << ",from:" << scrub_from << ",to:" << scrub_to
	<< "epoch:" << map_epoch;
    out << ")";
  }

  void encode_payload(CephContext *cct) {
    header.version = 2
    ::encode(pgid, payload);
    ::encode(scrub_from, payload);
    ::encode(scrub_to, payload);
    ::encode(map_epoch, payload);
  }
  void decode_payload(CephContext *cct) {
    assert(header.version == 2);
    bufferlist::iterator p = payload.begin();
    ::decode(pgid, p);
    ::decode(scrub_from, p);
    ::decode(scrub_to, p);
    ::decode(map_epoch, p);
  }
};

#endif

{'fraction_non_alphanumeric': 0.13725490196078433, 'fraction_numerical': 0.009531590413943355, 'mean_word_length': 3.430639324487334, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6245983', 'n_tokens_mistral': 1374, 'n_tokens_neox': 1355, 'n_words': 337}