2 * Ceph - scalable distributed file system
4 * This is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License version 2.1, as published by the Free Software
7 * Foundation. See file COPYING.
10 #ifndef CLS_REPLICA_LOG_OPS_H_
11 #define CLS_REPLICA_LOG_OPS_H_
13 #include "cls_replica_log_types.h"
15 struct cls_replica_log_delete_marker_op
{
17 cls_replica_log_delete_marker_op() {}
18 explicit cls_replica_log_delete_marker_op(const string
& id
) : entity_id(id
) {}
20 void encode(bufferlist
& bl
) const {
21 ENCODE_START(1, 1, bl
);
22 ::encode(entity_id
, bl
);
26 void decode(bufferlist::iterator
& bl
) {
28 ::decode(entity_id
, bl
);
32 void dump(Formatter
*f
) const;
33 static void generate_test_instances(std::list
<cls_replica_log_delete_marker_op
*>& ls
);
36 WRITE_CLASS_ENCODER(cls_replica_log_delete_marker_op
)
38 struct cls_replica_log_set_marker_op
{
39 cls_replica_log_progress_marker marker
;
40 cls_replica_log_set_marker_op() {}
41 explicit cls_replica_log_set_marker_op(const cls_replica_log_progress_marker
& m
) :
44 void encode(bufferlist
& bl
) const {
45 ENCODE_START(1, 1, bl
);
50 void decode(bufferlist::iterator
& bl
) {
56 void dump(Formatter
*f
) const;
57 static void generate_test_instances(std::list
<cls_replica_log_set_marker_op
*>& ls
);
59 WRITE_CLASS_ENCODER(cls_replica_log_set_marker_op
)
61 struct cls_replica_log_get_bounds_op
{
62 cls_replica_log_get_bounds_op() {}
64 void encode(bufferlist
& bl
) const {
65 ENCODE_START(1, 1, bl
);
69 void decode(bufferlist::iterator
& bl
) {
74 void dump(Formatter
*f
) const;
75 static void generate_test_instances(std::list
<cls_replica_log_get_bounds_op
*>& ls
);
77 WRITE_CLASS_ENCODER(cls_replica_log_get_bounds_op
)
79 struct cls_replica_log_get_bounds_ret
{
80 string position_marker
; // oldest log listing position on the master
81 utime_t oldest_time
; // oldest timestamp associated with position or an item
82 std::list
<cls_replica_log_progress_marker
> markers
;
84 cls_replica_log_get_bounds_ret() {}
85 cls_replica_log_get_bounds_ret(const string
& pos_marker
,
87 const std::list
<cls_replica_log_progress_marker
>& m
) :
88 position_marker(pos_marker
), oldest_time(time
), markers(m
)
90 void encode(bufferlist
& bl
) const {
91 ENCODE_START(1, 1, bl
);
92 ::encode(position_marker
, bl
);
93 ::encode(oldest_time
, bl
);
94 ::encode(markers
, bl
);
98 void decode(bufferlist::iterator
& bl
) {
100 ::decode(position_marker
, bl
);
101 ::decode(oldest_time
, bl
);
102 ::decode(markers
, bl
);
106 void dump(Formatter
*f
) const;
107 static void generate_test_instances(std::list
<cls_replica_log_get_bounds_ret
*>& ls
);
109 WRITE_CLASS_ENCODER(cls_replica_log_get_bounds_ret
)
111 #endif /* CLS_REPLICA_LOG_OPS_H_ */