66// / is welcome!
77
88/* ************************************************************************
9- * Copyright (C) 1995-2020 , Rene Brun and Fons Rademakers. *
9+ * Copyright (C) 1995-2021 , Rene Brun and Fons Rademakers. *
1010 * All rights reserved. *
1111 * *
1212 * For the licensing terms see $ROOTSYS/LICENSE. *
@@ -43,13 +43,14 @@ class RDaosPool {
4343 friend class RDaosContainer ;
4444private:
4545 daos_handle_t fPoolHandle {};
46- daos_pool_info_t fPoolInfo {};
4746 uuid_t fPoolUuid {};
4847
4948public:
50- RDaosPool () = delete ;
49+ RDaosPool (const RDaosPool& ) = delete ;
5150 RDaosPool (std::string_view poolUuid, std::string_view serviceReplicas);
5251 ~RDaosPool ();
52+
53+ RDaosPool& operator =(const RDaosPool&) = delete ;
5354};
5455
5556/* *
@@ -85,9 +86,15 @@ public:
8586 FetchUpdateArgs (const FetchUpdateArgs&) = delete ;
8687 FetchUpdateArgs (FetchUpdateArgs&& fua);
8788 FetchUpdateArgs (DistributionKey_t &d, AttributeKey_t &a, std::vector<d_iov_t > &v, daos_event_t *p = nullptr );
89+ FetchUpdateArgs& operator =(const FetchUpdateArgs&) = delete ;
8890
91+ // / \brief A `daos_key_t` is a type alias of `d_iov_t`. This type stores a pointer and a length.
92+ // / In order for `fDistributionKey` and `fIods` to point to memory that we own, `fDkey` and
93+ // / `fAkey` store a copy of the distribution and attribute key, respectively.
8994 DistributionKey_t fDkey {};
9095 AttributeKey_t fAkey {};
96+
97+ // / \brief The distribution key, as used by the `daos_obj_{fetch,update}` functions.
9198 daos_key_t fDistributionKey {};
9299 daos_iod_t fIods [1 ] = {};
93100 d_sg_list_t fSgls [1 ] = {};
@@ -130,19 +137,24 @@ private:
130137 daos_handle_t fQueue ;
131138 DaosEventQueue (std::size_t size);
132139 ~DaosEventQueue ();
140+ /* *
141+ \brief Wait for all events in this event queue to complete.
142+ \return Number of events still in the queue. This should be 0 on success.
143+ */
133144 int Poll ();
134145 };
135146
136147 daos_handle_t fContainerHandle {};
137- daos_cont_info_t fContainerInfo {};
138148 uuid_t fContainerUuid {};
139149 std::shared_ptr<RDaosPool> fPool ;
140150 // / OID that will be used by the next call to `WriteObject(const void *, std::size_t, DKeyT, AKeyT)`.
141151 daos_obj_id_t fSequentialWrOid {};
142152
143- /* * \brief Perform a vector read/write operation on different objects.
153+ /* *
154+ \brief Perform a vector read/write operation on different objects.
144155 \param vec A `std::vector<RWOperation>` that describes read/write operations to perform.
145156 \param fn Either `std::mem_fn<&RDaosObject::Fetch>` (read) or `std::mem_fn<&RDaosObject::Update>` (write).
157+ \return Number of requests that did not complete; this should be 0 after a successful call.
146158 */
147159 template <typename Fn, typename DKeyT, typename AKeyT>
148160 int VectorReadWrite (std::vector<RWOperation<DKeyT, AKeyT>> &vec, Fn fn) {
@@ -168,7 +180,15 @@ public:
168180 RDaosContainer (std::shared_ptr<RDaosPool> pool, std::string_view containerUuid, bool create = false );
169181 ~RDaosContainer ();
170182
171- /* * \brief Read data from an object in this container to the given buffer. */
183+ /* *
184+ \brief Read data from an object in this container to the given buffer.
185+ \param oid A 128-bit DAOS object identifier.
186+ \param buffer The address of a buffer that has capacity for at least `length` bytes.
187+ \param length Length of the buffer.
188+ \param dkey The distribution key used for this operation.
189+ \param akey The attribute key used for this operation.
190+ \return 0 if the operation succeeded; a negative DAOS error number otherwise.
191+ */
172192 template <typename DKeyT, typename AKeyT>
173193 int ReadObject (daos_obj_id_t oid, void *buffer, std::size_t length, DKeyT dkey, AKeyT akey)
174194 {
@@ -178,7 +198,15 @@ public:
178198 return RDaosObject<DKeyT, AKeyT>(*this , oid).Fetch (args);
179199 }
180200
181- /* * \brief Write the given buffer to an object in this container. */
201+ /* *
202+ \brief Write the given buffer to an object in this container.
203+ \param oid A 128-bit DAOS object identifier.
204+ \param buffer The address of the source buffer.
205+ \param length Length of the buffer.
206+ \param dkey The distribution key used for this operation.
207+ \param akey The attribute key used for this operation.
208+ \return 0 if the operation succeeded; a negative DAOS error number otherwise.
209+ */
182210 template <typename DKeyT, typename AKeyT>
183211 int WriteObject (daos_obj_id_t oid, const void *buffer, std::size_t length, DKeyT dkey, AKeyT akey)
184212 {
@@ -188,7 +216,14 @@ public:
188216 return RDaosObject<DKeyT, AKeyT>(*this , oid).Update (args);
189217 }
190218
191- /* * \brief Write the given buffer to an object in this container and return a generated OID. */
219+ /* *
220+ \brief Write the given buffer to an object in this container and return a generated OID.
221+ \param buffer The address of the source buffer.
222+ \param length Length of the buffer.
223+ \param dkey The distribution key used for this operation.
224+ \param akey The attribute key used for this operation.
225+ \return A `std::tuple<>` that contains the generated OID and a DAOS error number (0 if the operation succeeded).
226+ */
192227 template <typename DKeyT, typename AKeyT>
193228 std::tuple<daos_obj_id_t , int > WriteObject (const void *buffer, std::size_t length, DKeyT dkey, AKeyT akey)
194229 {
@@ -198,14 +233,20 @@ public:
198233 return ret;
199234 }
200235
201- /* * \brief Perform a vector read operation on (possibly) multiple objects.
202- \param vec A `std::vector<RWOperation>` that describes read operations to perform. */
236+ /* *
237+ \brief Perform a vector read operation on (possibly) multiple objects.
238+ \param vec A `std::vector<RWOperation>` that describes read operations to perform.
239+ \return Number of operations that could not complete.
240+ */
203241 template <typename DKeyT, typename AKeyT>
204242 int ReadV (std::vector<RWOperation<DKeyT, AKeyT>> &vec)
205243 { return VectorReadWrite (vec, std::mem_fn (&RDaosObject<DKeyT, AKeyT>::Fetch)); }
206244
207- /* * \brief Perform a vector write operation on (possibly) multiple objects.
208- \param vec A `std::vector<RWOperation>` that describes write operations to perform. */
245+ /* *
246+ \brief Perform a vector write operation on (possibly) multiple objects.
247+ \param vec A `std::vector<RWOperation>` that describes write operations to perform.
248+ \return Number of operations that could not complete.
249+ */
209250 template <typename DKeyT, typename AKeyT>
210251 int WriteV (std::vector<RWOperation<DKeyT, AKeyT>> &vec)
211252 { return VectorReadWrite (vec, std::mem_fn (&RDaosObject<DKeyT, AKeyT>::Update)); }
0 commit comments