Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
daos.h File Reference
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <uuid/uuid.h>
#include <ctype.h>
Include dependency graph for daos.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  d_iov_t
 iovec for memory buffer More...
 
struct  d_sg_list_t
 Scatter/gather list for memory buffers. More...
 
struct  daos_cont_info_t
 Container information. More...
 
struct  daos_event
 Event and event queue. More...
 
struct  daos_handle_t
 Generic handle for various DAOS components like container, object, etc. More...
 
struct  daos_iod_t
 
struct  daos_iom_t
 
struct  daos_obj_id_t
 
struct  daos_pool_info_t
 Storage pool. More...
 
struct  daos_prop_t
 daos properties, for pool or container More...
 
struct  daos_recx_t
 

Macros

#define DAOS_COO_RO   (1U << 0)
 
#define DAOS_COO_RW   (1U << 1)
 
#define DAOS_EQ_NOWAIT   0
 Always return immediately.
 
#define DAOS_EQ_WAIT   -1
 Wait for completion event forever.
 
#define DAOS_HDL_INVAL   ((daos_handle_t){0})
 
#define DAOS_OBJ_NIL   ((daos_obj_id_t){0})
 
#define DAOS_PC_EX   (1U << 2)
 
#define DAOS_PC_RO   (1U << 0)
 
#define DAOS_PC_RW   (1U << 1)
 
#define DAOS_PROP_LABEL_MAX_LEN   (127)
 
#define DAOS_PROP_MAX_LABEL_BUF_LEN   (DAOS_PROP_LABEL_MAX_LEN + 1)
 
#define DAOS_TX_NONE   DAOS_HDL_INVAL
 
#define DAOS_UUID_STR_SIZE   (37)
 
#define DER_ERR_GURT_BASE   1000
 
#define DER_EXIST   (DER_ERR_GURT_BASE + 4)
 
#define DER_INVAL   (DER_ERR_GURT_BASE + 3)
 
#define OID_FMT_CLASS_BITS   8
 
#define OID_FMT_CLASS_SHIFT   (OID_FMT_TYPE_SHIFT - OID_FMT_CLASS_BITS)
 
#define OID_FMT_INTR_BITS   32
 
#define OID_FMT_META_BITS   16
 
#define OID_FMT_META_SHIFT   (OID_FMT_CLASS_SHIFT - OID_FMT_META_BITS)
 
#define OID_FMT_TYPE_BITS   8
 
#define OID_FMT_TYPE_SHIFT   (64 - OID_FMT_TYPE_BITS)
 

Typedefs

typedef struct daos_event daos_event_t
 Event and event queue.
 
typedef d_iov_t daos_key_t
 
typedef uint16_t daos_oclass_hints_t
 
typedef uint16_t daos_oclass_id_t
 
typedef uint64_t daos_size_t
 

Enumerations

enum  {
  OC_UNKNOWN = 0 , OC_RP_XSF = 80 , OC_S1 = 200 , OC_S2 ,
  OC_S4 , OC_S8 , OC_S16 , OC_S32 ,
  OC_S64 , OC_S128 , OC_S256 , OC_S512 ,
  OC_S1K , OC_S2K , OC_S4K , OC_S8K ,
  OC_SX , OC_RESERVED = (1U << 10)
}
 Predefined object classes. More...
 
enum  { DAOS_COND_DKEY_FETCH = (1 << 3) , DAOS_COND_AKEY_FETCH = (1 << 6) }
 
enum  { DAOS_OO_RO = (1 << 1) , DAOS_OO_RW = (1 << 2) }
 Object open modes. More...
 
enum  { DAOS_REC_ANY = 0 }
 
enum  { DAOS_OCH_RDD_DEF = (1 << 0) , DAOS_OCH_SHD_DEF = (1 << 4) }
 Flags for oclass hints. More...
 
enum  daos_eq_query_t { DAOS_EQR_COMPLETED = (1) , DAOS_EQR_WAITING = (1 << 1) , DAOS_EQR_ALL = (DAOS_EQR_COMPLETED | DAOS_EQR_WAITING) }
 
enum  daos_iod_type_t { DAOS_IOD_SINGLE = 1 }
 Type of the value accessed in an IOD. More...
 
enum  daos_otype_t {
  DAOS_OT_MULTI_HASHED = 0 , DAOS_OT_DKEY_UINT64 = 2 , DAOS_OT_AKEY_UINT64 = 3 , DAOS_OT_MULTI_UINT64 = 4 ,
  DAOS_OT_ARRAY = 11 , DAOS_OT_ARRAY_BYTE = 13 , DAOS_OT_MAX = 13
}
 DAOS object type. More...
 

Functions

const char * d_errstr (int rc)
 
static void d_iov_set (d_iov_t *iov, void *buf, size_t size)
 
int daos_cont_close (daos_handle_t coh, 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_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)
 
int daos_eq_create (daos_handle_t *eqh)
 
int daos_eq_destroy (daos_handle_t eqh, int flags)
 
int daos_eq_poll (daos_handle_t eqh, int wait_running, int64_t timeout, unsigned int nevents, daos_event_t **events)
 
int daos_event_fini (daos_event_t *ev)
 
int daos_event_init (daos_event_t *ev, daos_handle_t eqh, daos_event_t *parent)
 
int daos_event_parent_barrier (daos_event_t *ev)
 
int daos_event_test (daos_event_t *ev, int64_t timeout, bool *flag)
 
int daos_fini (void)
 
int daos_init (void)
 
static bool daos_label_is_valid (const char *)
 
int daos_obj_close (daos_handle_t oh, 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)
 
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_open (daos_handle_t coh, daos_obj_id_t oid, unsigned int mode, daos_handle_t *oh, daos_event_t *ev)
 
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_oclass_id2name (daos_oclass_id_t oc_id, char *name)
 
int daos_oclass_name2id (const char *name)
 
static bool daos_otype_t_is_valid (enum daos_otype_t type)
 
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_pool_disconnect (daos_handle_t poh, daos_event_t *ev)
 

Detailed Description

This file is a reduced version of daos_xxx.h headers that provides (simplified) declarations for use in libdaos_mock.

Definition in file daos.h.

Macro Definition Documentation

◆ DAOS_COO_RO

#define DAOS_COO_RO   (1U << 0)

Definition at line 255 of file daos.h.

◆ DAOS_COO_RW

#define DAOS_COO_RW   (1U << 1)

Definition at line 256 of file daos.h.

◆ DAOS_EQ_NOWAIT

#define DAOS_EQ_NOWAIT   0

Always return immediately.

Definition at line 90 of file daos.h.

◆ DAOS_EQ_WAIT

#define DAOS_EQ_WAIT   -1

Wait for completion event forever.

Definition at line 88 of file daos.h.

◆ DAOS_HDL_INVAL

#define DAOS_HDL_INVAL   ((daos_handle_t){0})

Definition at line 69 of file daos.h.

◆ DAOS_OBJ_NIL

#define DAOS_OBJ_NIL   ((daos_obj_id_t){0})

Definition at line 150 of file daos.h.

◆ DAOS_PC_EX

#define DAOS_PC_EX   (1U << 2)

Definition at line 74 of file daos.h.

◆ DAOS_PC_RO

#define DAOS_PC_RO   (1U << 0)

Definition at line 72 of file daos.h.

◆ DAOS_PC_RW

#define DAOS_PC_RW   (1U << 1)

Definition at line 73 of file daos.h.

◆ DAOS_PROP_LABEL_MAX_LEN

#define DAOS_PROP_LABEL_MAX_LEN   (127)

Definition at line 243 of file daos.h.

◆ DAOS_PROP_MAX_LABEL_BUF_LEN

#define DAOS_PROP_MAX_LABEL_BUF_LEN   (DAOS_PROP_LABEL_MAX_LEN + 1)

Definition at line 244 of file daos.h.

◆ DAOS_TX_NONE

#define DAOS_TX_NONE   DAOS_HDL_INVAL

Definition at line 70 of file daos.h.

◆ DAOS_UUID_STR_SIZE

#define DAOS_UUID_STR_SIZE   (37)

Definition at line 245 of file daos.h.

◆ DER_ERR_GURT_BASE

#define DER_ERR_GURT_BASE   1000

Definition at line 283 of file daos.h.

◆ DER_EXIST

#define DER_EXIST   (DER_ERR_GURT_BASE + 4)

Definition at line 285 of file daos.h.

◆ DER_INVAL

#define DER_INVAL   (DER_ERR_GURT_BASE + 3)

Definition at line 284 of file daos.h.

◆ OID_FMT_CLASS_BITS

#define OID_FMT_CLASS_BITS   8

Definition at line 154 of file daos.h.

◆ OID_FMT_CLASS_SHIFT

#define OID_FMT_CLASS_SHIFT   (OID_FMT_TYPE_SHIFT - OID_FMT_CLASS_BITS)

Definition at line 158 of file daos.h.

◆ OID_FMT_INTR_BITS

#define OID_FMT_INTR_BITS   32

Definition at line 152 of file daos.h.

◆ OID_FMT_META_BITS

#define OID_FMT_META_BITS   16

Definition at line 155 of file daos.h.

◆ OID_FMT_META_SHIFT

#define OID_FMT_META_SHIFT   (OID_FMT_CLASS_SHIFT - OID_FMT_META_BITS)

Definition at line 159 of file daos.h.

◆ OID_FMT_TYPE_BITS

#define OID_FMT_TYPE_BITS   8

Definition at line 153 of file daos.h.

◆ OID_FMT_TYPE_SHIFT

#define OID_FMT_TYPE_SHIFT   (64 - OID_FMT_TYPE_BITS)

Definition at line 157 of file daos.h.

Typedef Documentation

◆ daos_event_t

typedef struct daos_event daos_event_t

Event and event queue.

◆ daos_key_t

Definition at line 76 of file daos.h.

◆ daos_oclass_hints_t

typedef uint16_t daos_oclass_hints_t

Definition at line 136 of file daos.h.

◆ daos_oclass_id_t

typedef uint16_t daos_oclass_id_t

Definition at line 135 of file daos.h.

◆ daos_size_t

typedef uint64_t daos_size_t

Definition at line 56 of file daos.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Predefined object classes.

Enumerator
OC_UNKNOWN 
OC_RP_XSF 

Replicated object class which is extremely scalable for fetch.

OC_S1 

Object classes with explicit layout.

OC_S2 
OC_S4 
OC_S8 
OC_S16 
OC_S32 
OC_S64 
OC_S128 
OC_S256 
OC_S512 
OC_S1K 
OC_S2K 
OC_S4K 
OC_S8K 
OC_SX 
OC_RESERVED 

Class ID equal or higher than this is reserved.

Definition at line 108 of file daos.h.

◆ anonymous enum

anonymous enum
Enumerator
DAOS_COND_DKEY_FETCH 
DAOS_COND_AKEY_FETCH 

Definition at line 177 of file daos.h.

◆ anonymous enum

anonymous enum

Object open modes.

Enumerator
DAOS_OO_RO 
DAOS_OO_RW 

Definition at line 183 of file daos.h.

◆ anonymous enum

anonymous enum
Enumerator
DAOS_REC_ANY 

Any record size, it is used by fetch.

Definition at line 211 of file daos.h.

◆ anonymous enum

anonymous enum

Flags for oclass hints.

Enumerator
DAOS_OCH_RDD_DEF 
DAOS_OCH_SHD_DEF 

Definition at line 217 of file daos.h.

◆ daos_eq_query_t

Enumerator
DAOS_EQR_COMPLETED 
DAOS_EQR_WAITING 
DAOS_EQR_ALL 

Definition at line 63 of file daos.h.

◆ daos_iod_type_t

Type of the value accessed in an IOD.

Enumerator
DAOS_IOD_SINGLE 

Definition at line 194 of file daos.h.

◆ daos_otype_t

DAOS object type.

Enumerator
DAOS_OT_MULTI_HASHED 
DAOS_OT_DKEY_UINT64 
DAOS_OT_AKEY_UINT64 
DAOS_OT_MULTI_UINT64 
DAOS_OT_ARRAY 
DAOS_OT_ARRAY_BYTE 
DAOS_OT_MAX 

Definition at line 162 of file daos.h.

Function Documentation

◆ d_errstr()

const char * d_errstr ( int  rc)

Definition at line 251 of file libdaos_mock.cxx.

◆ d_iov_set()

static void d_iov_set ( d_iov_t iov,
void *  buf,
size_t  size 
)
inlinestatic

Definition at line 50 of file daos.h.

◆ daos_cont_close()

int daos_cont_close ( daos_handle_t  coh,
daos_event_t ev 
)

Definition at line 311 of file libdaos_mock.cxx.

◆ daos_cont_create_with_label()

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 
)

Definition at line 280 of file libdaos_mock.cxx.

◆ daos_cont_open()

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 
)

Definition at line 294 of file libdaos_mock.cxx.

◆ daos_eq_create()

int daos_eq_create ( daos_handle_t eqh)

Definition at line 319 of file libdaos_mock.cxx.

◆ daos_eq_destroy()

int daos_eq_destroy ( daos_handle_t  eqh,
int  flags 
)

Definition at line 324 of file libdaos_mock.cxx.

◆ daos_eq_poll()

int daos_eq_poll ( daos_handle_t  eqh,
int  wait_running,
int64_t  timeout,
unsigned int  nevents,
daos_event_t **  events 
)

Definition at line 329 of file libdaos_mock.cxx.

◆ daos_event_fini()

int daos_event_fini ( daos_event_t ev)

Definition at line 352 of file libdaos_mock.cxx.

◆ daos_event_init()

int daos_event_init ( daos_event_t ev,
daos_handle_t  eqh,
daos_event_t parent 
)

Definition at line 347 of file libdaos_mock.cxx.

◆ daos_event_parent_barrier()

int daos_event_parent_barrier ( daos_event_t ev)

Definition at line 342 of file libdaos_mock.cxx.

◆ daos_event_test()

int daos_event_test ( daos_event_t ev,
int64_t  timeout,
bool flag 
)

Definition at line 335 of file libdaos_mock.cxx.

◆ daos_fini()

int daos_fini ( void  )

Definition at line 246 of file libdaos_mock.cxx.

◆ daos_init()

int daos_init ( void  )

Definition at line 240 of file libdaos_mock.cxx.

◆ daos_label_is_valid()

static bool daos_label_is_valid ( const char *  )
inlinestatic

Definition at line 247 of file daos.h.

◆ daos_obj_close()

int daos_obj_close ( daos_handle_t  oh,
daos_event_t ev 
)

Definition at line 369 of file libdaos_mock.cxx.

◆ daos_obj_fetch()

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 
)

Definition at line 398 of file libdaos_mock.cxx.

◆ daos_obj_generate_oid()

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 
)

Definition at line 375 of file libdaos_mock.cxx.

◆ daos_obj_open()

int daos_obj_open ( daos_handle_t  coh,
daos_obj_id_t  oid,
unsigned int  mode,
daos_handle_t oh,
daos_event_t ev 
)

Definition at line 359 of file libdaos_mock.cxx.

◆ daos_obj_update()

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 
)

Definition at line 407 of file libdaos_mock.cxx.

◆ daos_oclass_id2name()

int daos_oclass_id2name ( daos_oclass_id_t  oc_id,
char *  name 
)

Definition at line 265 of file libdaos_mock.cxx.

◆ daos_oclass_name2id()

int daos_oclass_name2id ( const char *  name)

Definition at line 256 of file libdaos_mock.cxx.

◆ daos_otype_t_is_valid()

static bool daos_otype_t_is_valid ( enum daos_otype_t  type)
inlinestatic

Definition at line 172 of file daos.h.

◆ daos_pool_connect()

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 
)

Definition at line 418 of file libdaos_mock.cxx.

◆ daos_pool_disconnect()

int daos_pool_disconnect ( daos_handle_t  poh,
daos_event_t ev 
)

Definition at line 426 of file libdaos_mock.cxx.