25 static struct RDaosRAII {
52 uuid_unparse(fPoolUuid,
id);
53 return std::string(
id);
60 char name[kOCNameMaxLength + 1] = {};
62 return std::string{
name};
66 : fDkey(fua.fDkey), fRequests(fua.fRequests), fIods(std::move(fua.fIods)), fSgls(std::move(fua.fSgls)),
69 d_iov_set(&fDistributionKey, &fDkey,
sizeof(fDkey));
73 std::span<RAkeyRequest> rs,
bool is_async)
74 : fDkey(
d), fRequests(rs)
87 std::accumulate(
r.fIovs.begin(),
r.fIovs.end(), 0, [](
size_t c,
d_iov_t &iov) { return c + iov.iov_len; });
95 sgl.
sg_nr =
r.fIovs.size();
103 return fEvent ? &(fEvent.value()) :
nullptr;
173 std::string_view containerId,
bool create)
204 uuid_unparse(fContainerUuid,
id);
205 return std::string(
id);
212 std::vector<d_iov_t> iovs(1);
224 std::vector<d_iov_t> iovs(1);
237 std::vector<request_t> requests{};
238 requests.reserve(map.size());
242 if ((ret =
fPool->fEventQueue->InitializeEvent(&parent_event)) < 0)
245 for (
auto &[key, batch] : map) {
246 requests.emplace_back(
247 std::make_unique<RDaosObject>(*
this, batch.fOid, cid.
fCid),
250 if ((ret =
fPool->fEventQueue->InitializeEvent(std::get<1>(requests.back()).GetEventPointer(), &parent_event)) <
255 if ((ret = (std::get<0>(requests.back()).get()->*fn)(std::get<1>(requests.back()))) < 0)
260 if ((ret =
fPool->fEventQueue->WaitOnParentBarrier(&parent_event)) < 0)
263 return fPool->fEventQueue->FinalizeEvent(&parent_event);
#define R__FAIL(msg)
Short-hand to return an RResult<T> in an error state; the RError is implicitly converted into RResult...
RooAbsTestStatistic * create(const char *name, const char *title, RooAbsReal &real, RooAbsData &adata, const RooArgSet &projDeps, RooAbsTestStatistic::Configuration const &cfg) override
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h length
A RDaosContainer provides read/write access to objects in a given container.
std::shared_ptr< RDaosPool > fPool
RDaosContainer(std::shared_ptr< RDaosPool > pool, std::string_view containerId, bool create=false)
std::unordered_map< ROidDkeyPair, RWOperation, ROidDkeyPair::Hash > MultiObjectRWOperation_t
daos_handle_t fContainerHandle
int ReadSingleAkey(void *buffer, std::size_t length, daos_obj_id_t oid, DistributionKey_t dkey, AttributeKey_t akey, ObjClassId_t cid)
Read data from a single object attribute key to the given buffer.
std::string fContainerLabel
RDaosObject::DistributionKey_t DistributionKey_t
std::string GetContainerUuid()
RDaosObject::AttributeKey_t AttributeKey_t
int VectorReadWrite(MultiObjectRWOperation_t &map, ObjClassId_t cid, int(RDaosObject::*fn)(RDaosObject::FetchUpdateArgs &))
Perform a vector read/write operation on different objects.
int WriteSingleAkey(const void *buffer, std::size_t length, daos_obj_id_t oid, DistributionKey_t dkey, AttributeKey_t akey, ObjClassId_t cid)
Write the given buffer to a single object attribute key.
Provides low-level access to DAOS objects in a container.
std::uint64_t DistributionKey_t
int Update(FetchUpdateArgs &args)
daos_handle_t fObjectHandle
std::uint64_t AttributeKey_t
int Fetch(FetchUpdateArgs &args)
std::string GetPoolUuid()
daos_handle_t fPoolHandle
std::unique_ptr< RDaosEventQueue > fEventQueue
RDaosPool(const RDaosPool &)=delete
Base class for all ROOT issued exceptions.
int daos_oclass_id2name(daos_oclass_id_t oc_id, char *name)
const char * d_errstr(int rc)
int daos_pool_disconnect(daos_handle_t poh, daos_event_t *ev)
int daos_obj_fetch(daos_handle_t oh, daos_handle_t th, uint64_t flags, daos_key_t *dkey, unsigned int nr, daos_iod_t *iods, d_sg_list_t *sgls, daos_iom_t *ioms, daos_event_t *ev)
static void d_iov_set(d_iov_t *iov, void *buf, size_t size)
int daos_obj_open(daos_handle_t coh, daos_obj_id_t oid, unsigned int mode, daos_handle_t *oh, daos_event_t *ev)
int daos_pool_connect(const char *pool, const char *grp, unsigned int flags, daos_handle_t *poh, daos_pool_info_t *info, daos_event_t *ev)
int daos_event_fini(daos_event_t *ev)
#define DAOS_UUID_STR_SIZE
int daos_obj_generate_oid(daos_handle_t coh, daos_obj_id_t *oid, enum daos_otype_t type, daos_oclass_id_t cid, daos_oclass_hints_t hints, uint32_t args)
int daos_obj_update(daos_handle_t oh, daos_handle_t th, uint64_t flags, daos_key_t *dkey, unsigned int nr, daos_iod_t *iods, d_sg_list_t *sgls, daos_event_t *ev)
int daos_cont_close(daos_handle_t coh, daos_event_t *ev)
static bool daos_label_is_valid(const char *)
int daos_event_init(daos_event_t *ev, daos_handle_t eqh, daos_event_t *parent)
int daos_event_test(daos_event_t *ev, int64_t timeout, bool *flag)
int daos_eq_create(daos_handle_t *eqh)
int daos_obj_close(daos_handle_t oh, daos_event_t *ev)
int daos_cont_create_with_label(daos_handle_t poh, const char *label, daos_prop_t *cont_prop, uuid_t *uuid, daos_event_t *ev)
int daos_eq_destroy(daos_handle_t eqh, int flags)
int daos_cont_open(daos_handle_t poh, const char *uuid, unsigned int flags, daos_handle_t *coh, daos_cont_info_t *info, daos_event_t *ev)
#define DAOS_EQ_WAIT
Wait for completion event forever.
int daos_event_parent_barrier(daos_event_t *ev)
static int FinalizeEvent(daos_event_t *ev_ptr)
Release event data from queue.
static int WaitOnParentBarrier(daos_event_t *ev_ptr)
Sets event barrier for a given parent event and waits for the completion of all children launched bef...
int InitializeEvent(daos_event_t *ev_ptr, daos_event_t *parent_ptr=nullptr) const
Reserve event in queue, optionally tied to a parent event.
Contains required information for a single fetch/update operation.
std::vector< daos_iod_t > fIods
FetchUpdateArgs()=default
DistributionKey_t fDkey
A daos_key_t is a type alias of d_iov_t.
daos_key_t fDistributionKey
The distribution key, as used by the daos_obj_{fetch,update} functions.
std::span< RAkeyRequest > fRequests
fRequests is a sequential container assumed to remain valid throughout the fetch/update operation,...
std::vector< d_sg_list_t > fSgls
std::optional< daos_event_t > fEvent
daos_event_t * GetEventPointer()
Wrap around a daos_oclass_id_t.
std::string ToString() const
Contains an attribute key and the associated IOVs for a single scatter-gather I/O request.
Scatter/gather list for memory buffers.