From: Alain Spineux Date: Mon, 20 Apr 2020 14:49:58 +0000 (+0200) Subject: BEE Backport bacula/src/lib/bget_msg.h X-Git-Tag: Release-11.3.2~1823 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c790bcced704a9e8a4469091a78fac05bfd861e1;p=thirdparty%2Fbacula.git BEE Backport bacula/src/lib/bget_msg.h This commit is the result of the squash of the following main commits: Author: Eric Bollengier Date: Thu Oct 31 11:06:59 2019 +0100 Fix compilation warning on bget_msg.h Author: Alain Spineux Date: Tue Sep 24 10:17:51 2019 +0200 dedup: move all dedup code into the plugin - remove global variables: dedupengine and bucker_manager - update protocol SD<->DIR - extend dedup_dev and BufferedMsgSD to suuport all function - create "dummy" functions in dev.h Warning : - include a dedupengine use counter - .status storage=XXX dedupengine display all the dedupengine on the SD instead of the one(s) related to the "device" Author: Alain Spineux Date: Tue Aug 4 11:09:05 2015 +0200 dedup: create "loaded reference", a reference that hold embeded data - A reference can hold data, that is not in the DDE. this is mostly for small chunk of data. This is useful when we know a chunk will not dedup or when a chunk is too small. The metadata in STREAM_WIN32_DATA is a good candidate - DedupEngine::decode_ref() help in decoding reference Author: Alain Spineux Date: Tue Jul 14 21:00:47 2015 +0200 add new file bget_msg.h --- diff --git a/bacula/src/lib/bget_msg.h b/bacula/src/lib/bget_msg.h index ad9ede9b65..5a3185486d 100644 --- a/bacula/src/lib/bget_msg.h +++ b/bacula/src/lib/bget_msg.h @@ -22,6 +22,8 @@ #include "bacula.h" +struct DEV_RECORD; + typedef uint64_t blockaddr; typedef int64_t blockidx; @@ -33,6 +35,12 @@ typedef int64_t blockidx; #endif +/* + * class bmessage and class GetMsg are used by client side rehydartion + * to control latency + * + */ + class bmessage: public SMARTALLOC { public: @@ -47,6 +55,15 @@ public: int ret; // return value from bget_msg() int jobbytes; // must be added to jcr->JobBytes if block is downloaded + unsigned char *hash; // point to an offset of msg, the hash + char *eraw; // point to an offset of msg, lz4encoded raw data + blockaddr *paddr; // point to an offset of msg + blockaddr addr; // the block address + int32_t dedup_size; // block size from reference + bool is_sparse; // is a SPARSE stream + bool is_header; // is a header record + bool is_dedup; // is a dedup reference + bool do_flowcontrol; bmessage(int bufsize); virtual ~bmessage(); void swap(BSOCK *sock); @@ -92,6 +109,14 @@ public: bmessage *new_msg() { return New(bmessage(bufsize)); }; + /* used by inherited classes to commit any pending operations at the end */ + virtual int commit(POOLMEM *&/*errmsg*/, uint32_t /*jobid*/) { return 0; }; + + /* used by classes to commit any pending operations at the end */ + virtual bool dedup_store_chunk(DEV_RECORD */*rec*/, const char */*rbuf*/, int /*rbuflen*/, + char */*dedup_ref_buf*/, char */*wdedup_ref_buf*/, POOLMEM *&/*errmsg*/) + { return true; /* OK */ }; + }; /* Call this function to release the memory associated with the message queue