25 static struct RDaosRAII {
52 uuid_unparse(fPoolUuid,
id);
53 return std::string(
id);
60 char name[kOCNameMaxLength + 1] = {};
62 return std::string{
name};
67 fRequests(fua.fRequests),
68 fIods(std::move(fua.fIods)),
69 fSgls(std::move(fua.fSgls)),
72 d_iov_set(&fDistributionKey, &fDkey,
sizeof(fDkey));
76 std::span<RAkeyRequest> rs,
bool is_async)
77 : fDkey(
d), fRequests(rs)
90 std::accumulate(
r.fIovs.begin(),
r.fIovs.end(), 0, [](
size_t c,
d_iov_t &iov) { return c + iov.iov_len; });
98 sgl.
sg_nr =
r.fIovs.size();
100 fSgls.push_back(sgl);
106 return fEvent ? &(fEvent.value()) :
nullptr;
176 std::string_view containerId,
bool create)
207 uuid_unparse(fContainerUuid,
id);
208 return std::string(
id);
215 std::vector<d_iov_t> iovs(1);
227 std::vector<d_iov_t> iovs(1);
240 std::vector<request_t> requests{};
241 requests.reserve(map.size());
245 if ((ret =
fPool->fEventQueue->InitializeEvent(&parent_event)) < 0)
248 for (
auto &[key, batch] : map) {
249 requests.emplace_back(
250 std::make_unique<RDaosObject>(*
this, batch.fOid, cid.
fCid),
253 if ((ret =
fPool->fEventQueue->InitializeEvent(std::get<1>(requests.back()).GetEventPointer(), &parent_event)) <
258 if ((ret = (std::get<0>(requests.back()).get()->*fn)(std::get<1>(requests.back()))) < 0)
263 if ((ret =
fPool->fEventQueue->WaitOnParentBarrier(&parent_event)) < 0)
266 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...
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.
RDaosContainer(std::shared_ptr< RDaosPool > pool, std::string_view containerId, bool create=false)
RDaosObject::DistributionKey_t DistributionKey_t
std::unordered_map< ROidDkeyPair, RWOperation, ROidDkeyPair::Hash > MultiObjectRWOperation_t
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 GetContainerUuid()
std::shared_ptr< RDaosPool > fPool
daos_handle_t fContainerHandle
RDaosObject::AttributeKey_t AttributeKey_t
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.
int VectorReadWrite(MultiObjectRWOperation_t &map, ObjClassId_t cid, int(RDaosObject::*fn)(RDaosObject::FetchUpdateArgs &))
Perform a vector read/write operation on different objects.
std::string fContainerLabel
Provides low-level access to DAOS objects in a container.
int Fetch(FetchUpdateArgs &args)
daos_handle_t fObjectHandle
int Update(FetchUpdateArgs &args)
std::uint64_t AttributeKey_t
std::uint64_t DistributionKey_t
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)
int InitializeEvent(daos_event_t *ev_ptr, daos_event_t *parent_ptr=nullptr) const
Reserve event in queue, optionally tied to a parent event.
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...
Contains required information for a single fetch/update operation.
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::vector< daos_iod_t > fIods
daos_event_t * GetEventPointer()
std::optional< daos_event_t > fEvent
daos_key_t fDistributionKey
The distribution key, as used by the daos_obj_{fetch,update} functions.
DistributionKey_t fDkey
A daos_key_t is a type alias of d_iov_t.
FetchUpdateArgs()=default
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.