Documentation
¶
Index ¶
- Constants
- Variables
- func Fini()
- func HandleIsInvalid(h Handle) bool
- func Init() error
- func PoolCreate(mode uint32, uid uint32, gid uint32, group string, size int64) (string, error)
- func PoolDestroy(pool string, group string, force int) error
- type Anchor
- type Array
- type ArrayRanges
- type ArrayRecordRequest
- type ArrayRequest
- type BufferedRange
- type ContHandle
- func (coh *ContHandle) ArrayOpen(oid *ObjectID, e Epoch, mode ObjectOpenFlag) (*Array, error)
- func (coh *ContHandle) AttributeGet(names []string) ([]byte, error)
- func (coh *ContHandle) AttributeSet(names []string, values []byte) error
- func (coh *ContHandle) Attributes() ([]string, error)
- func (coh *ContHandle) Close() error
- func (coh *ContHandle) Destroy(uuid string, force bool) error
- func (coh *ContHandle) EpochCommit(e Epoch) (*EpochState, error)
- func (coh *ContHandle) EpochDiscard(e Epoch) (*EpochState, error)
- func (coh *ContHandle) EpochFlush(e Epoch) (*EpochState, error)
- func (coh *ContHandle) EpochHold(e Epoch) (Epoch, error)
- func (coh *ContHandle) EpochQuery() (*EpochState, error)
- func (coh *ContHandle) EpochSlip(e Epoch) (*EpochState, error)
- func (coh *ContHandle) EpochWait(e Epoch) (*EpochState, error)
- func (coh *ContHandle) H() C.daos_handle_t
- func (coh *ContHandle) Info() (*ContInfo, error)
- func (coh *ContHandle) ObjectDeclare(oid *ObjectID, e Epoch, oa *ObjectAttribute) error
- func (coh *ContHandle) ObjectOpen(oid *ObjectID, e Epoch, mode ObjectOpenFlag) (*ObjectHandle, error)
- func (coh *ContHandle) Pointer() *C.daos_handle_t
- func (coh *ContHandle) Zero()
- type ContInfo
- type Epoch
- type EpochState
- type Error
- type Extent
- type Handle
- type Hash
- type IoRequest
- func (ir *IoRequest) AddRecordRequest(rr RecordRequest)
- func (ir *IoRequest) Complete() error
- func (ir *IoRequest) DKey() *C.daos_key_t
- func (ir *IoRequest) Free()
- func (ir *IoRequest) IODs() *C.daos_iod_t
- func (ir *IoRequest) Length() int
- func (ir *IoRequest) NeedsPrefetch() bool
- func (ir *IoRequest) SGLs() *C.daos_sg_list_t
- func (ir *IoRequest) StringKey() string
- type IoVector
- type KeyDescriptor
- type KeyDescriptorSlice
- type OClassID
- type ObjectAttribute
- type ObjectHandle
- func (oh ObjectHandle) AttrKeys(e Epoch, dkey []byte, anchor *Anchor) ([][]byte, error)
- func (oh *ObjectHandle) Close() error
- func (oh ObjectHandle) DistKeys(e Epoch, anchor *Anchor) ([][]byte, error)
- func (oh *ObjectHandle) Fetch(e Epoch, ir *IoRequest) error
- func (oh *ObjectHandle) Get(e Epoch, dkey string, akey string) ([]byte, error)
- func (oh *ObjectHandle) GetKeys(e Epoch, dkey string, akeys []string) (map[string][]byte, error)
- func (oh *ObjectHandle) Getb(e Epoch, dkey []byte, akey []byte) ([]byte, error)
- func (oh *ObjectHandle) H() C.daos_handle_t
- func (oh *ObjectHandle) Inspect(e Epoch, ir *IoRequest) error
- func (oh *ObjectHandle) Pointer() *C.daos_handle_t
- func (oh *ObjectHandle) Punch(e Epoch) error
- func (oh *ObjectHandle) Put(e Epoch, dkey string, akey string, value []byte) error
- func (oh *ObjectHandle) PutKeys(e Epoch, dkey string, akeys map[string][]byte) error
- func (oh *ObjectHandle) Putb(e Epoch, dkey []byte, akey []byte, value []byte) error
- func (oh *ObjectHandle) Query(e Epoch) (*ObjectAttribute, error)
- func (oh *ObjectHandle) Update(e Epoch, ir *IoRequest) error
- func (oh *ObjectHandle) Zero()
- type ObjectID
- func (o *ObjectID) Class() OClassID
- func (o *ObjectID) Hi() uint32
- func (o *ObjectID) Lo() uint64
- func (o *ObjectID) MarshalBinary() ([]byte, error)
- func (o *ObjectID) MarshalJSON() ([]byte, error)
- func (o *ObjectID) Mid() uint64
- func (o *ObjectID) Native() C.daos_obj_id_t
- func (o *ObjectID) Pointer() *C.daos_obj_id_t
- func (o *ObjectID) Set(value string) error
- func (o ObjectID) String() string
- func (o *ObjectID) UnmarshalBinary(data []byte) error
- func (o *ObjectID) UnmarshalJSON(b []byte) error
- type ObjectOpenFlag
- type PoolHandle
- func (poh *PoolHandle) Disconnect() error
- func (poh *PoolHandle) Exclude(targets []Rank) error
- func (poh *PoolHandle) H() C.daos_handle_t
- func (poh *PoolHandle) Info() (*PoolInfo, error)
- func (poh *PoolHandle) NewContainer(uuid string) error
- func (poh *PoolHandle) Open(uuid string, flags int) (*ContHandle, error)
- func (poh *PoolHandle) Pointer() *C.daos_handle_t
- func (poh *PoolHandle) Zero()
- type PoolInfo
- type Rank
- type RecordRequest
- type RequestBuffers
- type SGList
- type SingleRecordRequest
- func (srr *SingleRecordRequest) Buffers() RequestBuffers
- func (srr *SingleRecordRequest) Complete() error
- func (srr *SingleRecordRequest) Free()
- func (srr *SingleRecordRequest) Name() *C.daos_key_t
- func (srr *SingleRecordRequest) PrepareIOD(iod *C.daos_iod_t)
- func (srr *SingleRecordRequest) PrepareSGL(sgl *C.daos_sg_list_t)
- func (srr *SingleRecordRequest) SetSize(newSize uint64)
- func (srr *SingleRecordRequest) Size() uint64
- func (srr *SingleRecordRequest) StringKey() string
Constants ¶
const ( // RecAny signals that the record needs to be prefetched in order // to determine its size RecAny = C.DAOS_REC_ANY // EpochMax is the highest possible epoch -- usually used in read // operations to get the latest data regardless of what's committed // NB: Can't use C.DAOS_EPOCH_MAX because it's interpreted as -1 EpochMax = Epoch(1<<64 - 1) )
const ( PoolConnectRO = C.DAOS_PC_RO PoolConnectRW = C.DAOS_PC_RW PoolConnectEX = C.DAOS_PC_EX )
PoolConnect flags
const ( // ContOpenRO indicates that the container should be opened Read-Only ContOpenRO = C.DAOS_COO_RO // ContOpenRW indicates that the container should be opened Read/Write ContOpenRW = C.DAOS_COO_RW // ContOpenNoSlip indicates that the container should not allow // slip operations to succeed ContOpenNoSlip = C.DAOS_COO_NOSLIP )
const ( // ClassUnknown is an unknown Object Class ClassUnknown = OClassID(C.DAOS_OC_UNKNOWN) // ClassTinyRW is tiny i/o ClassTinyRW = OClassID(C.DAOS_OC_TINY_RW) // ClassSmallRW is mall i/o ClassSmallRW = OClassID(C.DAOS_OC_SMALL_RW) // ClassLargeRW is large i/o ClassLargeRW = OClassID(C.DAOS_OC_LARGE_RW) // ClassRepl2RW is 2-way replicated i/o ClassRepl2RW = OClassID(C.DAOS_OC_REPL_2_RW) // ClassReplMaxRW is fully-replicated i/o ClassReplMaxRW = OClassID(C.DAOS_OC_REPL_MAX_RW) )
const ( // ObjOpenRO indicates that the object should be opened Read Only ObjOpenRO = ObjectOpenFlag(C.DAOS_OO_RO) // ObjOpenRW indicates that the object should be opened Read/Write ObjOpenRW = ObjectOpenFlag(C.DAOS_OO_RW) // ObjOpenExcl indicates that the object should be opened for exclusive i/o ObjOpenExcl = ObjectOpenFlag(C.DAOS_OO_EXCL) // ObjOpenIORand indicates that the object will be used for random i/o ObjOpenIORand = ObjectOpenFlag(C.DAOS_OO_IO_RAND) // ObjOpenIOSeq indicates that the object will be used for sequential i/o ObjOpenIOSeq = ObjectOpenFlag(C.DAOS_OO_IO_SEQ) )
const ( DER_NO_PERM = Error(C.DER_NO_PERM) DER_NO_HDL = Error(C.DER_NO_HDL) DER_INVAL = Error(C.DER_INVAL) DER_EXIST = Error(C.DER_EXIST) DER_NONEXIST = Error(C.DER_NONEXIST) DER_UNREACH = Error(C.DER_UNREACH) DER_NOSPACE = Error(C.DER_NOSPACE) DER_ALREADY = Error(C.DER_ALREADY) DER_NOMEM = Error(C.DER_NOMEM) DER_NOSYS = Error(C.DER_NOSYS) DER_TIMEDOUT = Error(C.DER_TIMEDOUT) DER_BUSY = Error(C.DER_BUSY) DER_AGAIN = Error(C.DER_AGAIN) DER_PROTO = Error(C.DER_PROTO) DER_UNINIT = Error(C.DER_UNINIT) DER_TRUNC = Error(C.DER_TRUNC) DER_OVERFLOW = Error(C.DER_OVERFLOW) DER_CANCELED = Error(C.DER_CANCELED) DER_OOG = Error(C.DER_OOG) DER_CRT_HG = Error(C.DER_CRT_HG) DER_CRT_UNREG = Error(C.DER_CRT_UNREG) DER_CRT_ADDRSTR_GEN = Error(C.DER_CRT_ADDRSTR_GEN) DER_CRT_PMIX = Error(C.DER_CRT_PMIX) DER_IVCB_FORWARD = Error(C.DER_IVCB_FORWARD) DER_MISC = Error(C.DER_MISC) DER_BADPATH = Error(C.DER_BADPATH) DER_NOTDIR = Error(C.DER_NOTDIR) DER_UNKNOWN = Error(C.DER_UNKNOWN) DER_IO = Error(C.DER_IO) DER_FREE_MEM = Error(C.DER_FREE_MEM) DER_ENOENT = Error(C.DER_ENOENT) DER_NOTYPE = Error(C.DER_NOTYPE) DER_NOSCHEMA = Error(C.DER_NOSCHEMA) DER_NOLOCAL = Error(C.DER_NOLOCAL) DER_STALE = Error(C.DER_STALE) DER_TGT_CREATE = Error(C.DER_TGT_CREATE) DER_EP_RO = Error(C.DER_EP_RO) DER_EP_OLD = Error(C.DER_EP_OLD) DER_KEY2BIG = Error(C.DER_KEY2BIG) DER_REC2BIG = Error(C.DER_REC2BIG) DER_IO_INVAL = Error(C.DER_IO_INVAL) DER_EQ_BUSY = Error(C.DER_EQ_BUSY) DER_DOMAIN = Error(C.DER_DOMAIN) )
Variables ¶
var ( Errors map[Error]string = map[Error]string{ DER_NO_PERM: "No permission", DER_NO_HDL: "Invalid handle", DER_INVAL: "Invalid parameters", DER_EXIST: "Entity already exists", DER_NONEXIST: "Nonexistent entity", DER_UNREACH: "Unreachable node", DER_NOSPACE: "No space on storage target", DER_ALREADY: "Already did sth", DER_NOMEM: "NO memory", DER_NOSYS: "Function not implemented", DER_TIMEDOUT: "Timed out", DER_BUSY: "Busy", DER_AGAIN: "Try again", DER_PROTO: "incompatible protocol", DER_UNINIT: "Un-initialized", DER_TRUNC: "Buffer too short, larger buffer needed", DER_OVERFLOW: "Value too large for defined data type", DER_CANCELED: "Operation cancelled", DER_OOG: "Out-Of-Group or member list", DER_CRT_HG: "Transport layer mercury error", DER_CRT_UNREG: "CRT RPC", DER_CRT_ADDRSTR_GEN: "CRT failed to generate an address string", DER_CRT_PMIX: "CRT PMIx layer error", DER_IVCB_FORWARD: "CRT IV callback - cannot handle locally", DER_MISC: "CRT miscellaneous error", DER_BADPATH: "Bad path name", DER_NOTDIR: "Not a directory", DER_UNKNOWN: "Unknown error", DER_IO: "Generic I/O error", DER_FREE_MEM: "Memory free error", DER_ENOENT: "Entry not found", DER_NOTYPE: "Unknown object type", DER_NOSCHEMA: "Unknown object schema", DER_NOLOCAL: "Object is not local", DER_STALE: "stale pool map version", DER_TGT_CREATE: "Target create error", DER_EP_RO: "Epoch is read-only", DER_EP_OLD: "Epoch is too old, all data have been recycled", DER_KEY2BIG: "Key is too large", DER_REC2BIG: "Record is too large", DER_IO_INVAL: "IO buffers can't match object extents", DER_EQ_BUSY: "Event queue is busy", DER_DOMAIN: "Domain of cluster component can't match", } )
Functions ¶
func HandleIsInvalid ¶
HandleIsInvalid returns a boolean indicating whether or not the handle is invalid.
func PoolCreate ¶
PoolCreate creates a new pool of specfied size.
Types ¶
type Anchor ¶
type Anchor C.daos_hash_out_t
Anchor is used for pagination
func (*Anchor) Pointer ¶
func (a *Anchor) Pointer() *C.daos_hash_out_t
Pointer returns a *C.daos_hash_out_t
type Array ¶
type Array struct {
// contains filtered or unexported fields
}
Array provides an idiomatic interface to DAOS Arrays
func NewArray ¶
func NewArray(oh *ObjectHandle) *Array
NewArray wraps an *ObjectHandle with DAOS Array methods
type ArrayRanges ¶
type ArrayRanges []*BufferedRange
ArrayRanges describes a list of RangeBuffers within a DAOS array
type ArrayRecordRequest ¶
type ArrayRecordRequest struct { // Key is the attribute key of the record Key []byte // Extents is a slice of extents, where each extent // defines the index of the first record in the extent // and the number of records to access Extents []Extent // Epochs is an optional slice of epochs which if supplied // will override the epoch given to daos_obj_(fetch|update) Epochs []Epoch // Buffers is a slice of Go-allocated memory for reading or // writing the records Buffers RequestBuffers }
ArrayRecordRequest represents an IOD for a multi-record fetch/update on an akey
type ArrayRequest ¶
type ArrayRequest struct {
Ranges ArrayRanges
}
ArrayRequest describes a data structure used for writing to or reading from a DAOS Array
func NewArrayRequest ¶
func NewArrayRequest(rl ...*BufferedRange) *ArrayRequest
NewArrayRequest accepts an optional list of *BufferedRange items to add to a new *ArrayRequest
func (*ArrayRequest) AddRange ¶
func (ar *ArrayRequest) AddRange(br *BufferedRange)
AddRange adds a BufferedRange to the ArrayRequest and allocates a buffer for it if one was not provided
func (*ArrayRequest) Buffers ¶
func (ar *ArrayRequest) Buffers() []RequestBuffers
Buffers implements the RequestBufferSlicer interface. In this case, we'll only ever need a single SGL buffer per request.
func (*ArrayRequest) Length ¶
func (ar *ArrayRequest) Length() int
Length implements the RequestBufferSlicer interface. In this case, we only ever want to create a single SGL per request.
func (*ArrayRequest) Native ¶
func (ar *ArrayRequest) Native() (*C.daos_array_ranges_t, func(), error)
Native constructs a C.daos_array_ranges_t from the request's Range list and returns a pointer to it along with a callback to free the C memory that was allocated for it.
func (*ArrayRequest) Size ¶
func (ar *ArrayRequest) Size() (total int64)
Size returns the total size of all ranges in the request.
type BufferedRange ¶
BufferedRange describes a byte range within a DAOS Array
type ContHandle ¶
type ContHandle C.daos_handle_t
ContHandle refers to an open container.
func (*ContHandle) ArrayOpen ¶
func (coh *ContHandle) ArrayOpen(oid *ObjectID, e Epoch, mode ObjectOpenFlag) (*Array, error)
ArrayOpen opens an Array Object
func (*ContHandle) AttributeGet ¶
func (coh *ContHandle) AttributeGet(names []string) ([]byte, error)
AttributeGet returns values for given set of attributes.
func (*ContHandle) AttributeSet ¶
func (coh *ContHandle) AttributeSet(names []string, values []byte) error
AttributeSet set named attributes to the provided values.
func (*ContHandle) Attributes ¶
func (coh *ContHandle) Attributes() ([]string, error)
Attributes returns slide of attribute names
func (*ContHandle) Destroy ¶
func (coh *ContHandle) Destroy(uuid string, force bool) error
Destroy the container identified by the UUID
func (*ContHandle) EpochCommit ¶
func (coh *ContHandle) EpochCommit(e Epoch) (*EpochState, error)
EpochCommit commits an epoch for the container handle.
func (*ContHandle) EpochDiscard ¶
func (coh *ContHandle) EpochDiscard(e Epoch) (*EpochState, error)
EpochDiscard discards the epoch and returns current epoch state.
func (*ContHandle) EpochFlush ¶
func (coh *ContHandle) EpochFlush(e Epoch) (*EpochState, error)
EpochFlush completes the epoch and returns the epoch state.
func (*ContHandle) EpochHold ¶
func (coh *ContHandle) EpochHold(e Epoch) (Epoch, error)
EpochHold propose a new lowest held epoch on this container handle.
func (*ContHandle) EpochQuery ¶
func (coh *ContHandle) EpochQuery() (*EpochState, error)
EpochQuery returns current epoch state.
func (*ContHandle) EpochSlip ¶
func (coh *ContHandle) EpochSlip(e Epoch) (*EpochState, error)
EpochSlip increases the lowest referenced epoch of the container handle.
func (*ContHandle) EpochWait ¶
func (coh *ContHandle) EpochWait(e Epoch) (*EpochState, error)
EpochWait waits an epoch to be committed.
func (*ContHandle) Info ¶
func (coh *ContHandle) Info() (*ContInfo, error)
Info returns current container info
func (*ContHandle) ObjectDeclare ¶
func (coh *ContHandle) ObjectDeclare(oid *ObjectID, e Epoch, oa *ObjectAttribute) error
ObjectDeclare declares the object with the specified attributes
func (*ContHandle) ObjectOpen ¶
func (coh *ContHandle) ObjectOpen(oid *ObjectID, e Epoch, mode ObjectOpenFlag) (*ObjectHandle, error)
ObjectOpen opens the specified object with the supplied flags
func (*ContHandle) Pointer ¶
func (coh *ContHandle) Pointer() *C.daos_handle_t
Pointer returns pointer C-typed container handle
type ContInfo ¶
type ContInfo C.daos_cont_info_t
ContInfo is current status of a container.
func (*ContInfo) EpochState ¶
func (info *ContInfo) EpochState() *EpochState
EpochState returns a pointer to the container's current EpochState
type Epoch ¶
type Epoch C.daos_epoch_t
Epoch identifiers (uint64)
func (*Epoch) Pointer ¶
func (e *Epoch) Pointer() *C.daos_epoch_t
Pointer returns a pointer to the native C-type epoch
type EpochState ¶
type EpochState C.daos_epoch_state_t
EpochState is current epoch status.
func (*EpochState) GHPCE ¶
func (s *EpochState) GHPCE() Epoch
GHPCE Global Highest Partially Committted Epoch
func (*EpochState) Pointer ¶
func (s *EpochState) Pointer() *C.daos_epoch_state_t
Pointer turns C-typed EpochState pointer
func (*EpochState) String ¶
func (s *EpochState) String() string
type Extent ¶
type Extent struct { // Index of the first record within the extent Index uint64 // Count is the number of contiguous records in the extent Count uint64 }
Extent is a range of contiguous records of the same size inside an array
type Handle ¶
type Handle interface { Pointer() *C.daos_handle_t H() C.daos_handle_t Zero() }
Handle is an interface for DAOS handle types
type IoRequest ¶
type IoRequest struct { DistKey []byte Records []RecordRequest // contains filtered or unexported fields }
IoRequest encapsulates a set of record requests which are co-located on the same distribution key
func NewIoRequest ¶
func NewIoRequest(key []byte, records ...RecordRequest) *IoRequest
NewIoRequest creates a new *IoRequest
func (*IoRequest) AddRecordRequest ¶
func (ir *IoRequest) AddRecordRequest(rr RecordRequest)
AddRecordRequest adds a RecordRequest to the list
func (*IoRequest) Complete ¶
Complete performs any necessary data copying between C/Go memory and other housekeeping after a Fetch or Inspect
func (*IoRequest) DKey ¶
func (ir *IoRequest) DKey() *C.daos_key_t
DKey returns a *C.daos_key_t representing the distribution key for the request
func (*IoRequest) IODs ¶
func (ir *IoRequest) IODs() *C.daos_iod_t
IODs returns a pointer to a slice of IODs
func (*IoRequest) NeedsPrefetch ¶
NeedsPrefetch indicates whether or not we need to determine the size of any of the records being fetched before fetching them
func (*IoRequest) SGLs ¶
func (ir *IoRequest) SGLs() *C.daos_sg_list_t
SGLs returns a pointer to a slice of SGLs
type IoVector ¶
type IoVector C.daos_iov_t
IoVector wraps a C.daos_iov_t
func NewIoVector ¶
NewIoVector returns a new *IoVector for the given []byte
type KeyDescriptorSlice ¶
type KeyDescriptorSlice []KeyDescriptor
KeyDescriptorSlice is a slice of KeyDescriptor
func (KeyDescriptorSlice) Pointer ¶
func (kdl KeyDescriptorSlice) Pointer() *C.daos_key_desc_t
Pointer returns a *C.daos_key_desc_t
type OClassID ¶
type OClassID C.daos_oclass_id_t
OClassID wraps a C.daos_oclass_id_t
func ObjectClassList ¶
func ObjectClassList() []OClassID
ObjectClassList returns a slice of known ObjectClasses
func (OClassID) Native ¶
func (c OClassID) Native() C.daos_oclass_id_t
Native returns a C.daos_oclass_id_t
type ObjectAttribute ¶
type ObjectAttribute C.daos_obj_attr_t
ObjectAttribute is an object attribute
func (*ObjectAttribute) Pointer ¶
func (oa *ObjectAttribute) Pointer() *C.daos_obj_attr_t
Pointer returns a *C.daos_obj_attr_t
type ObjectHandle ¶
type ObjectHandle C.daos_handle_t
ObjectHandle refers to an open object
func (ObjectHandle) DistKeys ¶
func (oh ObjectHandle) DistKeys(e Epoch, anchor *Anchor) ([][]byte, error)
DistKeys returns a slice of dkeys as []bytes
func (*ObjectHandle) Fetch ¶
func (oh *ObjectHandle) Fetch(e Epoch, ir *IoRequest) error
Fetch reads the specified extents and returns them in newly allocated KeyRequest Buffers. If any extents have a RecSize set to RecAny, then a second fetch will done iff all the extents have a valid record size after first fetch.
func (*ObjectHandle) GetKeys ¶
GetKeys returns first record for each a-key available in the specified epoch.
func (*ObjectHandle) H ¶
func (oh *ObjectHandle) H() C.daos_handle_t
H returns a C.daos_daos_handle_t
func (*ObjectHandle) Inspect ¶
func (oh *ObjectHandle) Inspect(e Epoch, ir *IoRequest) error
Inspect attempts to fetch the record size for each akey provided in the KeyRequest Buffers. No data will be fetched, but the updated
func (*ObjectHandle) Pointer ¶
func (oh *ObjectHandle) Pointer() *C.daos_handle_t
Pointer returns a *C.daos_daos_handle_t
func (*ObjectHandle) Punch ¶
func (oh *ObjectHandle) Punch(e Epoch) error
Punch performs a punch operation on the object
func (*ObjectHandle) Put ¶
Put sets the first record of a-key to value, with record size is len(value).
func (*ObjectHandle) Putb ¶
Putb sets the first record of a-key to value, with record size is len(value).
func (*ObjectHandle) Query ¶
func (oh *ObjectHandle) Query(e Epoch) (*ObjectAttribute, error)
Query queries the object's attributes
func (*ObjectHandle) Update ¶
func (oh *ObjectHandle) Update(e Epoch, ir *IoRequest) error
Update submits the extents and buffers to the object.
func (*ObjectHandle) Zero ¶
func (oh *ObjectHandle) Zero()
Zero resets the handle to the invalid state
type ObjectID ¶
type ObjectID C.daos_obj_id_t
ObjectID wraps a C.daos_obj_id_t
func GenerateOID ¶
GenerateOID returns a random OID The ID is derived from a Random UUID, so should reasonably unique.
func ObjectIDInit ¶
ObjectIDInit initializes an ObjectID
func (*ObjectID) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface
func (*ObjectID) MarshalJSON ¶
MarshalJSON marshals the ObjectID to a JSON-formatted []byte
func (*ObjectID) Native ¶
func (o *ObjectID) Native() C.daos_obj_id_t
Native returns a C.daos_obj_id_t
func (*ObjectID) Pointer ¶
func (o *ObjectID) Pointer() *C.daos_obj_id_t
Pointer returns a pointer to a C.daos_obj_id_t
func (*ObjectID) Set ¶
Set attempts to parse the supplied string as an ObjectID and replaces the pointer if successful
func (*ObjectID) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface
func (*ObjectID) UnmarshalJSON ¶
UnmarshalJSON unmarshals the ObjectID from a JSON-formatted []byte
type PoolHandle ¶
type PoolHandle C.daos_handle_t
PoolHandle is an open conection to a Pool
func PoolConnect ¶
func PoolConnect(pool string, group string, flags uint) (*PoolHandle, error)
PoolConnect returns the pool handle for given pool.
func (*PoolHandle) Disconnect ¶
func (poh *PoolHandle) Disconnect() error
Disconnect closes the pool handle.
func (*PoolHandle) Exclude ¶
func (poh *PoolHandle) Exclude(targets []Rank) error
Exclude ranks from pool.
https://github.com/golang/go/wiki/cgo Convert C array into Go slice
slice := (*[1 << 30]C.YourType)(unsafe.Pointer(theCArray))[:length:length]
func (*PoolHandle) Info ¶
func (poh *PoolHandle) Info() (*PoolInfo, error)
Info returns current pool info
func (*PoolHandle) NewContainer ¶
func (poh *PoolHandle) NewContainer(uuid string) error
NewContainer creates a container identified by the UUID
func (*PoolHandle) Open ¶
func (poh *PoolHandle) Open(uuid string, flags int) (*ContHandle, error)
Open a the container identified by the UUID
func (*PoolHandle) Pointer ¶
func (poh *PoolHandle) Pointer() *C.daos_handle_t
Pointer returns C-typed handle pointer
type PoolInfo ¶
type PoolInfo C.daos_pool_info_t
PoolInfo is current state of a pool
func (*PoolInfo) NumDisabled ¶
NumDisabled returns the number of disabled targets in the Pool
func (*PoolInfo) NumTargets ¶
NumTargets returns the number of targets in the Pool
type RecordRequest ¶
type RecordRequest interface { Name() *C.daos_key_t StringKey() string Buffers() RequestBuffers Size() uint64 SetSize(uint64) Free() Complete() error PrepareIOD(*C.daos_iod_t) PrepareSGL(*C.daos_sg_list_t) }
RecordRequest defines an interface which is implemented by either ArrayRecordRequest or SingleRecordRequest
type SGList ¶
type SGList struct {
// contains filtered or unexported fields
}
SGList wraps a C.daos_sg_list_t
func NewSGList ¶
func NewSGList(bufs RequestBuffers) *SGList
NewSGList creates a DAOS Scatter-Gather list set up to do I/O based on the supplied slice of buffers
func (*SGList) Free ¶
func (sgl *SGList) Free()
Free releases all C-allocated memory used by the SGL
func (*SGList) Pointer ¶
func (sgl *SGList) Pointer() *C.daos_sg_list_t
Pointer returns *C.daos_sg_list_t
type SingleRecordRequest ¶
type SingleRecordRequest struct { // Key is the attribute key of the record Key []byte // Buffer is Go-allocated memory for reading or writing // the record Buffer []byte // contains filtered or unexported fields }
SingleRecordRequest represents an IOD for a single record fetch/update on an akey
func NewSingleRecordRequest ¶
func NewSingleRecordRequest(name []byte, buffers ...[]byte) *SingleRecordRequest
NewSingleRecordRequest creates a new *SingleRecordRequest
func (*SingleRecordRequest) Buffers ¶
func (srr *SingleRecordRequest) Buffers() RequestBuffers
Buffers returns the request's single buffer wrapped in a slice in order to implement the RecordRequest interface
func (*SingleRecordRequest) Complete ¶
func (srr *SingleRecordRequest) Complete() error
Complete performs any necessary housekeeping after an Inspect/Fetch
func (*SingleRecordRequest) Free ¶
func (srr *SingleRecordRequest) Free()
Free releases all allocated C memory used by the request
func (*SingleRecordRequest) Name ¶
func (srr *SingleRecordRequest) Name() *C.daos_key_t
Name returns the request's attribute name as a *C.daos_key_t
func (*SingleRecordRequest) PrepareIOD ¶
func (srr *SingleRecordRequest) PrepareIOD(iod *C.daos_iod_t)
PrepareIOD sets up the supplied *C.daos_iod_t to reflect this request's layout
func (*SingleRecordRequest) PrepareSGL ¶
func (srr *SingleRecordRequest) PrepareSGL(sgl *C.daos_sg_list_t)
PrepareSGL sets up the supplied *C.daos_sg_list_t to do I/O
func (*SingleRecordRequest) SetSize ¶
func (srr *SingleRecordRequest) SetSize(newSize uint64)
SetSize adjusts the request's buffer to match the supplied size
func (*SingleRecordRequest) Size ¶
func (srr *SingleRecordRequest) Size() uint64
Size returns the length of the request's buffer
func (*SingleRecordRequest) StringKey ¶
func (srr *SingleRecordRequest) StringKey() string
StringKey returns the request's attribute name as a string