File tree Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -1893,3 +1893,13 @@ void BinprotEWBCommand::encode(std::vector<uint8_t>& buf) const {
18931893 buf.insert (buf.end (), extraBuf.begin (), extraBuf.end ());
18941894 buf.insert (buf.end (), key.begin (), key.end ());
18951895}
1896+
1897+ BinprotCompactDbCommand::BinprotCompactDbCommand ()
1898+ : BinprotGenericCommand(cb::mcbp::ClientOpcode::CompactDb) {
1899+ }
1900+
1901+ void BinprotCompactDbCommand::encode (std::vector<uint8_t >& buf) const {
1902+ writeHeader (buf, 0 , sizeof (extras));
1903+ auto extraBuf = extras.getBuffer ();
1904+ buf.insert (buf.end (), extraBuf.begin (), extraBuf.end ());
1905+ }
Original file line number Diff line number Diff line change @@ -1116,3 +1116,38 @@ class BinprotEWBCommand : public BinprotGenericCommand {
11161116 ENGINE_ERROR_CODE err_code;
11171117 uint32_t value;
11181118};
1119+
1120+ class BinprotCompactDbCommand : public BinprotGenericCommand {
1121+ public:
1122+ BinprotCompactDbCommand ();
1123+
1124+ void encode (std::vector<uint8_t >& buf) const override ;
1125+
1126+ uint64_t getPurgeBeforeTs () const {
1127+ return extras.getPurgeBeforeTs ();
1128+ }
1129+ void setPurgeBeforeTs (uint64_t purge_before_ts) {
1130+ extras.setPurgeBeforeTs (purge_before_ts);
1131+ }
1132+ uint64_t getPurgeBeforeSeq () const {
1133+ return extras.getPurgeBeforeSeq ();
1134+ }
1135+ void setPurgeBeforeSeq (uint64_t purge_before_seq) {
1136+ extras.setPurgeBeforeSeq (purge_before_seq);
1137+ }
1138+ uint8_t getDropDeletes () const {
1139+ return extras.getDropDeletes ();
1140+ }
1141+ void setDropDeletes (uint8_t drop_deletes) {
1142+ extras.setDropDeletes (drop_deletes);
1143+ }
1144+ const Vbid getDbFileId () const {
1145+ return extras.getDbFileId ();
1146+ }
1147+ void setDbFileId (Vbid db_file_id) {
1148+ extras.setDbFileId (db_file_id);
1149+ }
1150+
1151+ protected:
1152+ cb::mcbp::request::CompactDbPayload extras;
1153+ };
You can’t perform that action at this time.
0 commit comments