go-daos: github.com/daos-stack/go-daos/pkg/daos Index | Files

package daos

import "github.com/daos-stack/go-daos/pkg/daos"

Index

Package Files

array.go daos.go errno.go object_io.go object_list_key.go

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",
    }
)

func Fini Uses

func Fini()

Fini shutsdown DAOS connection

func HandleIsInvalid Uses

func HandleIsInvalid(h Handle) bool

HandleIsInvalid returns a boolean indicating whether or not the handle is invalid.

func Init Uses

func Init() error

Init initializes the DAOS connection

func ObjectClassList Uses

func ObjectClassList() []OClassID

ObjectClassList returns a slice of known ObjectClasses

func PoolCreate Uses

func PoolCreate(mode uint32, uid uint32, gid uint32, group string, size int64) (string, error)

PoolCreate creates a new pool of specfied size.

func PoolDestroy Uses

func PoolDestroy(pool string, group string, force int) error

PoolDestroy deletes the passed pool uuid.

type Anchor Uses

type Anchor C.daos_hash_out_t

Anchor is used for pagination

func (Anchor) EOF Uses

func (a Anchor) EOF() bool

EOF indicates whether or not the final record has been retrieved

func (*Anchor) Pointer Uses

func (a *Anchor) Pointer() *C.daos_hash_out_t

Pointer returns a *C.daos_hash_out_t

type Array Uses

type Array struct {
    // contains filtered or unexported fields
}

Array provides an idiomatic interface to DAOS Arrays

func NewArray Uses

func NewArray(oh *ObjectHandle) *Array

NewArray wraps an *ObjectHandle with DAOS Array methods

func (*Array) Close Uses

func (a *Array) Close() error

Close closes the Array's object handle

func (*Array) GetSize Uses

func (a *Array) GetSize(e Epoch) (int64, error)

GetSize returns the size of the Array

func (*Array) Read Uses

func (a *Array) Read(e Epoch, req *ArrayRequest) (int64, error)

func (*Array) SetSize Uses

func (a *Array) SetSize(e Epoch, size int64) error

SetSize preallocates an Array up to the given size

func (*Array) Write Uses

func (a *Array) Write(e Epoch, req *ArrayRequest) (int64, error)

type ArrayRanges Uses

type ArrayRanges []*BufferedRange

ArrayRanges describes a list of RangeBuffers within a DAOS array

type ArrayRecordRequest Uses

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 Uses

type ArrayRequest struct {
    Ranges ArrayRanges
}

ArrayRequest describes a data structure used for writing to or reading from a DAOS Array

func NewArrayRequest Uses

func NewArrayRequest(rl ...*BufferedRange) *ArrayRequest

NewArrayRequest accepts an optional list of *BufferedRange items to add to a new *ArrayRequest

func (*ArrayRequest) AddRange Uses

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 Uses

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 Uses

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 Uses

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 Uses

func (ar *ArrayRequest) Size() (total int64)

Size returns the total size of all ranges in the request.

type BufferedRange Uses

type BufferedRange struct {
    Buffer []byte
    Length int64
    Offset int64
}

BufferedRange describes a byte range within a DAOS Array

type ContHandle Uses

type ContHandle C.daos_handle_t

ContHandle refers to an open container.

func (*ContHandle) ArrayOpen Uses

func (coh *ContHandle) ArrayOpen(oid *ObjectID, e Epoch, mode ObjectOpenFlag) (*Array, error)

ArrayOpen opens an Array Object

func (*ContHandle) AttributeGet Uses

func (coh *ContHandle) AttributeGet(names []string) ([]byte, error)

AttributeGet returns values for given set of attributes.

func (*ContHandle) AttributeSet Uses

func (coh *ContHandle) AttributeSet(names []string, values []byte) error

AttributeSet set named attributes to the provided values.

func (*ContHandle) Attributes Uses

func (coh *ContHandle) Attributes() ([]string, error)

Attributes returns slide of attribute names

func (*ContHandle) Close Uses

func (coh *ContHandle) Close() error

Close the container handle

func (*ContHandle) Destroy Uses

func (coh *ContHandle) Destroy(uuid string, force bool) error

Destroy the container identified by the UUID

func (*ContHandle) EpochCommit Uses

func (coh *ContHandle) EpochCommit(e Epoch) (*EpochState, error)

EpochCommit commits an epoch for the container handle.

func (*ContHandle) EpochDiscard Uses

func (coh *ContHandle) EpochDiscard(e Epoch) (*EpochState, error)

EpochDiscard discards the epoch and returns current epoch state.

func (*ContHandle) EpochFlush Uses

func (coh *ContHandle) EpochFlush(e Epoch) (*EpochState, error)

EpochFlush completes the epoch and returns the epoch state.

func (*ContHandle) EpochHold Uses

func (coh *ContHandle) EpochHold(e Epoch) (Epoch, error)

EpochHold propose a new lowest held epoch on this container handle.

func (*ContHandle) EpochQuery Uses

func (coh *ContHandle) EpochQuery() (*EpochState, error)

EpochQuery returns current epoch state.

func (*ContHandle) EpochSlip Uses

func (coh *ContHandle) EpochSlip(e Epoch) (*EpochState, error)

EpochSlip increases the lowest referenced epoch of the container handle.

func (*ContHandle) EpochWait Uses

func (coh *ContHandle) EpochWait(e Epoch) (*EpochState, error)

EpochWait waits an epoch to be committed.

func (*ContHandle) H Uses

func (coh *ContHandle) H() C.daos_handle_t

H returns C-typed handle

func (*ContHandle) Info Uses

func (coh *ContHandle) Info() (*ContInfo, error)

Info returns current container info

func (*ContHandle) ObjectDeclare Uses

func (coh *ContHandle) ObjectDeclare(oid *ObjectID, e Epoch, oa *ObjectAttribute) error

ObjectDeclare declares the object with the specified attributes

func (*ContHandle) ObjectOpen Uses

func (coh *ContHandle) ObjectOpen(oid *ObjectID, e Epoch, mode ObjectOpenFlag) (*ObjectHandle, error)

ObjectOpen opens the specified object with the supplied flags

func (*ContHandle) Pointer Uses

func (coh *ContHandle) Pointer() *C.daos_handle_t

Pointer returns pointer C-typed container handle

func (*ContHandle) Zero Uses

func (coh *ContHandle) Zero()

Zero resets the handle to the invalid state

type ContInfo Uses

type ContInfo C.daos_cont_info_t

ContInfo is current status of a container.

func (*ContInfo) EpochState Uses

func (info *ContInfo) EpochState() *EpochState

EpochState returns a pointer to the container's current EpochState

func (*ContInfo) Snapshots Uses

func (info *ContInfo) Snapshots() []Epoch

Snapshots returns a slice of Epochs representing stable snapshots

func (*ContInfo) UUID Uses

func (info *ContInfo) UUID() string

UUID returns the container's UUID as a string

type Epoch Uses

type Epoch C.daos_epoch_t

Epoch identifiers (uint64)

func (Epoch) Native Uses

func (e Epoch) Native() C.daos_epoch_t

Native returns native C-type epoch

func (*Epoch) Pointer Uses

func (e *Epoch) Pointer() *C.daos_epoch_t

Pointer returns a pointer to the native C-type epoch

func (Epoch) String Uses

func (e Epoch) String() string

type EpochState Uses

type EpochState C.daos_epoch_state_t

EpochState is current epoch status.

func (*EpochState) GHCE Uses

func (s *EpochState) GHCE() Epoch

GHCE Global Highest Committted Epoch

func (*EpochState) GHPCE Uses

func (s *EpochState) GHPCE() Epoch

GHPCE Global Highest Partially Committted Epoch

func (*EpochState) GLRE Uses

func (s *EpochState) GLRE() Epoch

GLRE Global Lowest Referenced Epoch

func (*EpochState) HCE Uses

func (s *EpochState) HCE() Epoch

HCE returns Highest Committed Epoch

func (*EpochState) LHE Uses

func (s *EpochState) LHE() Epoch

LHE returns Lowest Held Epoch

func (*EpochState) LRE Uses

func (s *EpochState) LRE() Epoch

LRE returns Lowest Referenced Epoch

func (*EpochState) Pointer Uses

func (s *EpochState) Pointer() *C.daos_epoch_state_t

Pointer turns C-typed EpochState pointer

func (*EpochState) String Uses

func (s *EpochState) String() string

type Error Uses

type Error int

func (Error) String Uses

func (e Error) String() string

type Extent Uses

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 Uses

type Handle interface {
    Pointer() *C.daos_handle_t
    H() C.daos_handle_t
    Zero()
}

Handle is an interface for DAOS handle types

type Hash Uses

type Hash C.daos_hash_out_t

Hash wraps a C.daos_hash_out_t

type IoRequest Uses

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 Uses

func NewIoRequest(key []byte, records ...RecordRequest) *IoRequest

NewIoRequest creates a new *IoRequest

func (*IoRequest) AddRecordRequest Uses

func (ir *IoRequest) AddRecordRequest(rr RecordRequest)

AddRecordRequest adds a RecordRequest to the list

func (*IoRequest) Complete Uses

func (ir *IoRequest) Complete() error

Complete performs any necessary data copying between C/Go memory and other housekeeping after a Fetch or Inspect

func (*IoRequest) DKey Uses

func (ir *IoRequest) DKey() *C.daos_key_t

DKey returns a *C.daos_key_t representing the distribution key for the request

func (*IoRequest) Free Uses

func (ir *IoRequest) Free()

Free releases all C memory used by the request

func (*IoRequest) IODs Uses

func (ir *IoRequest) IODs() *C.daos_iod_t

IODs returns a pointer to a slice of IODs

func (*IoRequest) Length Uses

func (ir *IoRequest) Length() int

Length returns the number of record requests

func (*IoRequest) NeedsPrefetch Uses

func (ir *IoRequest) NeedsPrefetch() bool

NeedsPrefetch indicates whether or not we need to determine the size of any of the records being fetched before fetching them

func (*IoRequest) SGLs Uses

func (ir *IoRequest) SGLs() *C.daos_sg_list_t

SGLs returns a pointer to a slice of SGLs

func (*IoRequest) StringKey Uses

func (ir *IoRequest) StringKey() string

StringKey returns the request's distribution key as a string

type IoVector Uses

type IoVector C.daos_iov_t

IoVector wraps a C.daos_iov_t

func NewIoVector Uses

func NewIoVector(buf []byte) *IoVector

NewIoVector returns a new *IoVector for the given []byte

func (*IoVector) Free Uses

func (iov *IoVector) Free()

Free releases the allocated C memory for the IoVector

func (*IoVector) String Uses

func (iov *IoVector) String() string

type KeyDescriptor Uses

type KeyDescriptor C.daos_key_desc_t

KeyDescriptor wraps a C.daos_key_desc_t

type KeyDescriptorSlice Uses

type KeyDescriptorSlice []KeyDescriptor

KeyDescriptorSlice is a slice of KeyDescriptor

func (KeyDescriptorSlice) Pointer Uses

func (kdl KeyDescriptorSlice) Pointer() *C.daos_key_desc_t

Pointer returns a *C.daos_key_desc_t

type OClassID Uses

type OClassID C.daos_oclass_id_t

OClassID wraps a C.daos_oclass_id_t

func (OClassID) Native Uses

func (c OClassID) Native() C.daos_oclass_id_t

Native returns a C.daos_oclass_id_t

func (*OClassID) Set Uses

func (c *OClassID) Set(value string) error

Set attempts to parse the supplied string as an OClassID

func (OClassID) String Uses

func (c OClassID) String() string

type ObjectAttribute Uses

type ObjectAttribute C.daos_obj_attr_t

ObjectAttribute is an object attribute

func (*ObjectAttribute) Pointer Uses

func (oa *ObjectAttribute) Pointer() *C.daos_obj_attr_t

Pointer returns a *C.daos_obj_attr_t

type ObjectHandle Uses

type ObjectHandle C.daos_handle_t

ObjectHandle refers to an open object

func (ObjectHandle) AttrKeys Uses

func (oh ObjectHandle) AttrKeys(e Epoch, dkey []byte, anchor *Anchor) ([][]byte, error)

AttrKeys returns a slice of akeys as []bytes

func (*ObjectHandle) Close Uses

func (oh *ObjectHandle) Close() error

Close closes the object

func (ObjectHandle) DistKeys Uses

func (oh ObjectHandle) DistKeys(e Epoch, anchor *Anchor) ([][]byte, error)

DistKeys returns a slice of dkeys as []bytes

func (*ObjectHandle) Fetch Uses

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) Get Uses

func (oh *ObjectHandle) Get(e Epoch, dkey string, akey string) ([]byte, error)

Get returns first record for a-key.

func (*ObjectHandle) GetKeys Uses

func (oh *ObjectHandle) GetKeys(e Epoch, dkey string, akeys []string) (map[string][]byte, error)

GetKeys returns first record for each a-key available in the specified epoch.

func (*ObjectHandle) Getb Uses

func (oh *ObjectHandle) Getb(e Epoch, dkey []byte, akey []byte) ([]byte, error)

Getb returns first record for a-key.

func (*ObjectHandle) H Uses

func (oh *ObjectHandle) H() C.daos_handle_t

H returns a C.daos_daos_handle_t

func (*ObjectHandle) Inspect Uses

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 Uses

func (oh *ObjectHandle) Pointer() *C.daos_handle_t

Pointer returns a *C.daos_daos_handle_t

func (*ObjectHandle) Punch Uses

func (oh *ObjectHandle) Punch(e Epoch) error

Punch performs a punch operation on the object

func (*ObjectHandle) Put Uses

func (oh *ObjectHandle) Put(e Epoch, dkey string, akey string, value []byte) error

Put sets the first record of a-key to value, with record size is len(value).

func (*ObjectHandle) PutKeys Uses

func (oh *ObjectHandle) PutKeys(e Epoch, dkey string, akeys map[string][]byte) error

PutKeys stores a map of akey->val on the specified dkey

func (*ObjectHandle) Putb Uses

func (oh *ObjectHandle) Putb(e Epoch, dkey []byte, akey []byte, value []byte) error

Putb sets the first record of a-key to value, with record size is len(value).

func (*ObjectHandle) Query Uses

func (oh *ObjectHandle) Query(e Epoch) (*ObjectAttribute, error)

Query queries the object's attributes

func (*ObjectHandle) Update Uses

func (oh *ObjectHandle) Update(e Epoch, ir *IoRequest) error

Update submits the extents and buffers to the object.

func (*ObjectHandle) Zero Uses

func (oh *ObjectHandle) Zero()

Zero resets the handle to the invalid state

type ObjectID Uses

type ObjectID C.daos_obj_id_t

ObjectID wraps a C.daos_obj_id_t

func GenerateOID Uses

func GenerateOID(oc OClassID) *ObjectID

GenerateOID returns a random OID The ID is derived from a Random UUID, so should reasonably unique.

func ObjectIDInit Uses

func ObjectIDInit(hi uint32, mid, lo uint64, class OClassID) *ObjectID

ObjectIDInit initializes an ObjectID

func ParseOID Uses

func ParseOID(s string) (*ObjectID, error)

ParseOID attempts to parse the supplied string as an ObjectID

func (*ObjectID) Class Uses

func (o *ObjectID) Class() OClassID

Class returns the OClassID for the ObjectID

func (*ObjectID) Hi Uses

func (o *ObjectID) Hi() uint32

Hi returns the top part of the ObjectID

func (*ObjectID) Lo Uses

func (o *ObjectID) Lo() uint64

Lo returns the lower part of the ObjectID

func (*ObjectID) MarshalBinary Uses

func (o *ObjectID) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface

func (*ObjectID) MarshalJSON Uses

func (o *ObjectID) MarshalJSON() ([]byte, error)

MarshalJSON marshals the ObjectID to a JSON-formatted []byte

func (*ObjectID) Mid Uses

func (o *ObjectID) Mid() uint64

Mid returns the middle part of the ObjectID

func (*ObjectID) Native Uses

func (o *ObjectID) Native() C.daos_obj_id_t

Native returns a C.daos_obj_id_t

func (*ObjectID) Pointer Uses

func (o *ObjectID) Pointer() *C.daos_obj_id_t

Pointer returns a pointer to a C.daos_obj_id_t

func (*ObjectID) Set Uses

func (o *ObjectID) Set(value string) error

Set attempts to parse the supplied string as an ObjectID and replaces the pointer if successful

func (ObjectID) String Uses

func (o ObjectID) String() string

func (*ObjectID) UnmarshalBinary Uses

func (o *ObjectID) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface

func (*ObjectID) UnmarshalJSON Uses

func (o *ObjectID) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the ObjectID from a JSON-formatted []byte

type ObjectOpenFlag Uses

type ObjectOpenFlag uint

ObjectOpenFlag specifies the object open flags

type PoolHandle Uses

type PoolHandle C.daos_handle_t

PoolHandle is an open conection to a Pool

func PoolConnect Uses

func PoolConnect(pool string, group string, flags uint) (*PoolHandle, error)

PoolConnect returns the pool handle for given pool.

func (*PoolHandle) Disconnect Uses

func (poh *PoolHandle) Disconnect() error

Disconnect closes the pool handle.

func (*PoolHandle) Exclude Uses

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) H Uses

func (poh *PoolHandle) H() C.daos_handle_t

H returns C-typed handle

func (*PoolHandle) Info Uses

func (poh *PoolHandle) Info() (*PoolInfo, error)

Info returns current pool info

func (*PoolHandle) NewContainer Uses

func (poh *PoolHandle) NewContainer(uuid string) error

NewContainer creates a container identified by the UUID

func (*PoolHandle) Open Uses

func (poh *PoolHandle) Open(uuid string, flags int) (*ContHandle, error)

Open a the container identified by the UUID

func (*PoolHandle) Pointer Uses

func (poh *PoolHandle) Pointer() *C.daos_handle_t

Pointer returns C-typed handle pointer

func (*PoolHandle) Zero Uses

func (poh *PoolHandle) Zero()

Zero resets the handle to the invalid state

type PoolInfo Uses

type PoolInfo C.daos_pool_info_t

PoolInfo is current state of a pool

func (*PoolInfo) Mode Uses

func (info *PoolInfo) Mode() uint32

Mode returns the Pool's operating mode

func (*PoolInfo) NumDisabled Uses

func (info *PoolInfo) NumDisabled() int

NumDisabled returns the number of disabled targets in the Pool

func (*PoolInfo) NumTargets Uses

func (info *PoolInfo) NumTargets() int

NumTargets returns the number of targets in the Pool

func (*PoolInfo) Space Uses

func (info *PoolInfo) Space() uint64

Space returns the amount of space allocated for the Pool

func (*PoolInfo) UUID Uses

func (info *PoolInfo) UUID() string

UUID returns the Pool's UUID as a string

type Rank Uses

type Rank C.daos_rank_t

Rank is a target index

type RecordRequest Uses

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 RequestBuffers Uses

type RequestBuffers [][]byte

RequestBuffers is a slice of byte slices

type SGList Uses

type SGList struct {
    // contains filtered or unexported fields
}

SGList wraps a C.daos_sg_list_t

func NewSGList Uses

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) Complete Uses

func (sgl *SGList) Complete() error

Complete does any required housekeeping after a fetch

func (*SGList) Free Uses

func (sgl *SGList) Free()

Free releases all C-allocated memory used by the SGL

func (*SGList) Pointer Uses

func (sgl *SGList) Pointer() *C.daos_sg_list_t

Pointer returns *C.daos_sg_list_t

type SingleRecordRequest Uses

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 Uses

func NewSingleRecordRequest(name []byte, buffers ...[]byte) *SingleRecordRequest

NewSingleRecordRequest creates a new *SingleRecordRequest

func (*SingleRecordRequest) Buffers Uses

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 Uses

func (srr *SingleRecordRequest) Complete() error

Complete performs any necessary housekeeping after an Inspect/Fetch

func (*SingleRecordRequest) Free Uses

func (srr *SingleRecordRequest) Free()

Free releases all allocated C memory used by the request

func (*SingleRecordRequest) Name Uses

func (srr *SingleRecordRequest) Name() *C.daos_key_t

Name returns the request's attribute name as a *C.daos_key_t

func (*SingleRecordRequest) PrepareIOD Uses

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 Uses

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 Uses

func (srr *SingleRecordRequest) SetSize(newSize uint64)

SetSize adjusts the request's buffer to match the supplied size

func (*SingleRecordRequest) Size Uses

func (srr *SingleRecordRequest) Size() uint64

Size returns the length of the request's buffer

func (*SingleRecordRequest) StringKey Uses

func (srr *SingleRecordRequest) StringKey() string

StringKey returns the request's attribute name as a string

Package daos imports 10 packages (graph) and is imported by 3 packages. Updated 2017-04-28. Refresh now. Tools for package owners.