Documentation ¶
Overview ¶
Package provides interface to work with Elliptics. Elliptics is distributed fault-tolerant key-value storage system, it also supports secondary indexes.
More information about Elliptics here: http://reverbrain.com/.
Index ¶
- Constants
- Variables
- func ErrorCode(err error) int
- func ErrorData(err error) string
- func NextContext() uint64
- type AddressBackend
- type Backend
- type BackendError
- type BlobStats
- type ByRawID
- type CStat
- type Cflag
- type Command
- type CommandStat
- type Config
- type DChannel
- type DStat
- type DStatRaw
- type DnetAddr
- type DnetBackendStatus
- type DnetBackendsStatus
- type DnetCmd
- type DnetError
- type DnetFileInfo
- type DnetID
- type DnetIOAttr
- type DnetIteratorRange
- type DnetIteratorResponse
- type DnetRawID
- type DnetRawIDKeys
- type DnetStat
- func (stat *DnetStat) AddRouteEntry(entry *RouteEntry)
- func (stat *DnetStat) AddStatEntry(entry *StatEntry)
- func (stat *DnetStat) Diff(prev *DnetStat)
- func (stat *DnetStat) Finalize()
- func (stat *DnetStat) FindCreateBackend(group uint32, addr *DnetAddr, backend_id int32) *StatBackend
- func (stat *DnetStat) StatData() (reply map[string]interface{})
- type DstStat
- type GlobalStats
- type IOflag
- type IteratorResult
- type Key
- type Keys
- type LayerStat
- type Logger
- type Lookuper
- type Node
- type NodeConfig
- type PID
- type PacketOnlyCommandStat
- type RawAddr
- type ReadResult
- type ReadSeeker
- func NewEmptyReadSeeker() (*ReadSeeker, error)
- func NewReadSeeker(session *Session, kstr string) (*ReadSeeker, error)
- func NewReadSeekerKeyOffsetSize(session *Session, key *Key, offset, size uint64) (*ReadSeeker, error)
- func NewReadSeekerOffsetSize(session *Session, kstr string, offset, size uint64) (*ReadSeeker, error)
- type Remover
- type Response
- type RouteEntry
- type Session
- func (s *Session) BackendDisable(addr *DnetAddr, backend_id int32) *DChannel
- func (s *Session) BackendEnable(addr *DnetAddr, backend_id int32) *DChannel
- func (s *Session) BackendMakeReadOnly(addr *DnetAddr, backend_id int32) *DChannel
- func (s *Session) BackendMakeWritable(addr *DnetAddr, backend_id int32) *DChannel
- func (s *Session) BackendSetDelay(addr *DnetAddr, backend_id int32, delay uint32) *DChannel
- func (s *Session) BackendStartDefrag(addr *DnetAddr, backend_id int32) *DChannel
- func (s *Session) BackendsStatus(addr *DnetAddr) *DChannel
- func (s *Session) BulkRemove(keys_str []string) <-chan Remover
- func (s *Session) CopyIteratorStart(id *DnetRawID, ranges []DnetIteratorRange, groups []uint32, iflags uint64, ...) *DChannel
- func (s *Session) Delete()
- func (s *Session) DnetStat() *DnetStat
- func (s *Session) GetCflags() Cflag
- func (s *Session) GetGroups() []uint32
- func (s *Session) GetIOflags() IOflag
- func (s *Session) GetRoutes(stat *DnetStat)
- func (s *Session) GetTimeout() int
- func (s *Session) GetTimestamp() time.Time
- func (s *Session) GetTraceID() TraceID
- func (s *Session) IteratorCancel(id *DnetRawID, iteratorId uint64) *DChannel
- func (s *Session) IteratorContinue(id *DnetRawID, iteratorId uint64) *DChannel
- func (s *Session) IteratorPause(id *DnetRawID, iteratorId uint64) *DChannel
- func (s *Session) IteratorStart(id *DnetRawID, ranges []DnetIteratorRange, itype uint64, iflags uint64, ...) *DChannel
- func (s *Session) Lookup(key *Key) <-chan Lookuper
- func (s *Session) LookupBackend(key string, group_id uint32) (addr *DnetAddr, backend_id int32, err error)
- func (s *Session) ParallelLookup(kstr string) <-chan Lookuper
- func (s *Session) ParallelLookupID(id *DnetRawID) <-chan Lookuper
- func (s *Session) ParallelLookupKey(key *Key) <-chan Lookuper
- func (s *Session) ReadData(key string, offset, size uint64) <-chan ReadResult
- func (s *Session) ReadInto(key *Key, offset uint64, p []byte) <-chan ReadResult
- func (s *Session) ReadKey(key *Key, offset, size uint64) <-chan ReadResult
- func (s *Session) Remove(key string) <-chan Remover
- func (s *Session) RemoveKey(key *Key) <-chan Remover
- func (s *Session) ServerSend(keys []DnetRawID, flags uint64, groups []uint32) (*DChannel, error)
- func (s *Session) SetCflags(cflags Cflag)
- func (s *Session) SetFilter(filter int)
- func (s *Session) SetGroups(groups []uint32)
- func (s *Session) SetIOflags(ioflags IOflag)
- func (s *Session) SetNamespace(namespace string)
- func (s *Session) SetTimeout(timeout int)
- func (s *Session) SetTimestamp(ts time.Time)
- func (s *Session) SetTraceID(trace TraceID)
- func (s *Session) Transform(key string) string
- func (s *Session) WriteChunk(key string, input io.Reader, initial_offset, total_size uint64) <-chan Lookuper
- func (s *Session) WriteData(key string, input io.Reader, offset, total_size uint64) <-chan Lookuper
- func (s *Session) WriteKey(key *Key, input io.Reader, offset, total_size uint64) <-chan Lookuper
- type StatBackend
- type StatBackendData
- type StatEntry
- type StatGroup
- type StatGroupData
- type Status
- type Time
- type TraceID
- type VFS
- type VNode
- type VStat
- type WriteSeeker
- func (w *WriteSeeker) Flush(buf []byte, final bool) (err error)
- func (w *WriteSeeker) Free()
- func (w *WriteSeeker) Seek(offset int64, whence int) (int64, error)
- func (w *WriteSeeker) SetKey(session *Session, key *Key, remote_offset int64, ...) error
- func (w *WriteSeeker) Write(p []byte) (int, error)
Constants ¶
const ( DNET_IO_FLAGS_SKIP_SENDING = IOflag(C.DNET_IO_FLAGS_SKIP_SENDING) DNET_IO_FLAGS_MIX_STATES = IOflag(C.DNET_IO_FLAGS_MIX_STATES) DNET_IO_FLAGS_APPEND = IOflag(C.DNET_IO_FLAGS_APPEND) DNET_IO_FLAGS_PREPARE = IOflag(C.DNET_IO_FLAGS_PREPARE) DNET_IO_FLAGS_COMMIT = IOflag(C.DNET_IO_FLAGS_COMMIT) DNET_IO_FLAGS_REMOVED = IOflag(C.DNET_IO_FLAGS_REMOVED) DNET_IO_FLAGS_OVERWRITE = IOflag(C.DNET_IO_FLAGS_OVERWRITE) DNET_IO_FLAGS_NOCSUM = IOflag(C.DNET_IO_FLAGS_NOCSUM) DNET_IO_FLAGS_PLAIN_WRITE = IOflag(C.DNET_IO_FLAGS_PLAIN_WRITE) DNET_IO_FLAGS_NODATA = IOflag(C.DNET_IO_FLAGS_NODATA) DNET_IO_FLAGS_CACHE = IOflag(C.DNET_IO_FLAGS_CACHE) DNET_IO_FLAGS_CACHE_ONLY = IOflag(C.DNET_IO_FLAGS_CACHE_ONLY) DNET_IO_FLAGS_CACHE_REMOVE_FROM_DISK = IOflag(C.DNET_IO_FLAGS_CACHE_REMOVE_FROM_DISK) DNET_IO_FLAGS_COMPARE_AND_SWAP = IOflag(C.DNET_IO_FLAGS_COMPARE_AND_SWAP) DNET_IO_FLAGS_CHECKSUM = IOflag(C.DNET_IO_FLAGS_CHECKSUM) DNET_IO_FLAGS_WRITE_NO_FILE_INFO = IOflag(C.DNET_IO_FLAGS_WRITE_NO_FILE_INFO) DNET_IO_FLAGS_CAS_TIMESTAMP = IOflag(C.DNET_IO_FLAGS_CAS_TIMESTAMP) )
const ( DNET_FLAGS_NEED_ACK = Cflag(C.DNET_FLAGS_NEED_ACK) DNET_FLAGS_MORE = Cflag(C.DNET_FLAGS_MORE) DNET_FLAGS_DESTROY = Cflag(C.DNET_FLAGS_DESTROY) DNET_FLAGS_DIRECT = Cflag(C.DNET_FLAGS_DIRECT) DNET_FLAGS_NOLOCK = Cflag(C.DNET_FLAGS_NOLOCK) DNET_FLAGS_CHECKSUM = Cflag(C.DNET_FLAGS_CHECKSUM) DNET_FLAGS_NOCACHE = Cflag(C.DNET_FLAGS_NOCACHE) DNET_FLAGS_DIRECT_BACKEND = Cflag(C.DNET_FLAGS_DIRECT_BACKEND) DNET_FLAGS_TRACE_BIT = Cflag(C.DNET_FLAGS_TRACE_BIT) DNET_FLAGS_REPLY = Cflag(C.DNET_FLAGS_REPLY) )
const ( DNET_ITYPE_NETWORK = uint64(C.DNET_ITYPE_NETWORK) DNET_ITYPE_SERVER_SEND = uint64(C.DNET_ITYPE_SERVER_SEND) DNET_IFLAGS_DATA = uint64(C.DNET_IFLAGS_DATA) DNET_IFLAGS_KEY_RANGE = uint64(C.DNET_IFLAGS_KEY_RANGE) DNET_IFLAGS_TS_RANGE = uint64(C.DNET_IFLAGS_TS_RANGE) DNET_IFLAGS_NO_META = uint64(C.DNET_IFLAGS_NO_META) DNET_IFLAGS_MOVE = uint64(C.DNET_IFLAGS_MOVE) DNET_IFLAGS_OVERWRITE = uint64(C.DNET_IFLAGS_OVERWRITE) )
const ( DNET_RECORD_FLAGS_REMOVE = uint64(C.DNET_RECORD_FLAGS_REMOVE) DNET_RECORD_FLAGS_NOCSUM = uint64(C.DNET_RECORD_FLAGS_NOCSUM) DNET_RECORD_FLAGS_APPEND = uint64(C.DNET_RECORD_FLAGS_APPEND) DNET_RECORD_FLAGS_EXTHDR = uint64(C.DNET_RECORD_FLAGS_EXTHDR) DNET_RECORD_FLAGS_UNCOMMITTED = uint64(C.DNET_RECORD_FLAGS_UNCOMMITTED) DNET_RECORD_FLAGS_CHUNKED_CSUM = uint64(C.DNET_RECORD_FLAGS_CHUNKED_CSUM) )
const ( SessionFilterAll = iota SessionFilterPositive = iota SessionFilterMax = iota )
const ( StatCategoryCache int64 = 1 << 0 StatCategoryIO int64 = 1 << 1 StatCategoryCommands int64 = 1 << 2 StatCategoryBackend int64 = 1 << 4 StatCategoryProcFS int64 = 1 << 6 StatSectorSize uint64 = 512 BackendStateDisabled int32 = 0 BackendStateEnabled int32 = 1 BackendStateActivating int32 = 2 BackendStateDeactivating int32 = 3 DefragStateNotStarted int32 = 0 DefragStateInProgress int32 = 1 )
const ( PIDKe float64 = 1.0 // Integral part has to be zero in this case // since there is no continuous 'force' to check/change in our case // we can not infinitely increase integral part in attempt to compensate // for difference of the error from zero (or no-matter-what like 100 MB/s) // integral part has to compensate speed of wind when we are trying to achieve // desired velocity, but in our case there is no engine controller which // can output continuous power to driver the vehicle, instead we have to // determine which of the backends is currently the fastest PIDKi float64 = 0 PIDKd float64 = 0.3 )
Variables ¶
var ( InvalidKeyArgument = errors.New("InvalidKeyArgument") DNET_ID_SIZE = int(C.DNET_ID_SIZE) ErrInvalidDnetID = fmt.Errorf("Id must be shorter than %d", DNET_ID_SIZE) )
var ( BackendStateString = map[int32]string{ BackendStateDisabled: "disabled", BackendStateEnabled: "enabled", BackendStateActivating: "activating", BackendStateDeactivating: "deactivating", } DefragStateString = map[int32]string{ DefragStateNotStarted: "not-started", DefragStateInProgress: "in-progress", } )
var (
KeyError = errors.New("No key")
)
var Pool = contextPool{/* contains filtered or unexported fields */}
Functions ¶
func NextContext ¶
func NextContext() uint64
Types ¶
type AddressBackend ¶
func NewAddressBackend ¶
func NewAddressBackend(addr *DnetAddr, backend int32) AddressBackend
func (*AddressBackend) String ¶
func (ab *AddressBackend) String() string
type Backend ¶
type Backend struct { Config Config `json:"config"` GlobalStats GlobalStats `json:"global_stats"` SummaryStats BlobStats `json:"summary_stats"` BaseStats map[string]BlobStats `json:"base_stats"` VFS VStat `json:"vfs"` DStat DStatRaw `json:"dstat"` Error BackendError `json:"error"` }
type BackendError ¶
type BackendError struct {
Code int32 `json:"code"`
}
type BlobStats ¶
type BlobStats struct { RecordsTotal uint64 `json:"records_total"` RecordsRemoved uint64 `json:"records_removed"` RecordsRemovedSize uint64 `json:"records_removed_size"` RecordsCorrupted uint64 `json:"records_corrupted"` BaseSize uint64 `json:"base_size"` WantDefrag int32 `json:"want_defrag"` IsSorted int32 `json:"is_sorted"` }
type Command ¶
type Command struct { Cache LayerStat `json:"cache"` Disk LayerStat `json:"disk"` Total DstStat `json:"total"` }
func (*Command) RequestsFailures ¶
func (*Command) RequestsSuccess ¶
type CommandStat ¶
type CommandStat struct { Success uint64 `json:"successes"` Failures uint64 `json:"failures"` Size uint64 `json:"size"` Time uint64 `json:"time"` }
func (*CommandStat) Bytes ¶
func (c *CommandStat) Bytes() uint64
func (*CommandStat) RequestsFailures ¶
func (c *CommandStat) RequestsFailures() uint64
func (*CommandStat) RequestsSuccess ¶
func (c *CommandStat) RequestsSuccess() uint64
type Config ¶
type Config struct { Group uint32 `json:"group"` Data string `json:"data"` Sync int32 `json:"sync"` BlobFlags uint64 `json:"blob_flags"` BlobSize uint64 `json:"blob_size"` BlobSizeLimit uint64 `json:"blob_size_limit"` MaxRecords uint64 `json:"records_in_blob"` DefragPercentage uint64 `json:"defrag_percentage"` DefragTimeout uint64 `json:"defrag_timeout"` DefragTime uint64 `json:"defrag_time"` DefragSplay uint64 `json:"defrag_splay"` }
type DChannel ¶
type DChannel struct { In chan interface{} Out chan interface{} // contains filtered or unexported fields }
func NewDChannel ¶
func NewDChannel() *DChannel
type DStatRaw ¶
type DStatRaw struct { ReadIOs uint64 `json:"read_ios"` ReadMerges uint64 `json:"read_merges"` ReadSectors uint64 `json:"read_sectors"` ReadTicks uint64 `json:"read_ticks"` WriteIOs uint64 `json:"write_ios"` WriteMerges uint64 `json:"write_merges"` WriteSectors uint64 `json:"write_sectors"` WriteTicks uint64 `json:"write_ticks"` InFlight uint64 `json:"in_flight"` IOTicks uint64 `json:"io_ticks"` TimeInQueue uint64 `json:"time_in_queue"` }
type DnetAddr ¶
func NewDnetAddr ¶
func NewDnetAddr(addr *C.struct_dnet_addr) DnetAddr
func NewDnetAddrStr ¶
func (*DnetAddr) CAddr ¶
func (a *DnetAddr) CAddr(tmp *C.struct_dnet_addr)
func (*DnetAddr) HostString ¶
type DnetBackendStatus ¶
type DnetBackendsStatus ¶
type DnetBackendsStatus struct { Backends []DnetBackendStatus Error error }
type DnetCmd ¶
type DnetCmd struct { ID DnetID Status int32 Cmd int32 Backend int32 Trace uint64 Flags uint64 Trans uint64 Size uint64 }
func NewDnetCmd ¶
func NewDnetCmd(cmd *C.struct_dnet_cmd) DnetCmd
type DnetError ¶
func DnetErrorFromError ¶
type DnetFileInfo ¶
func NewDnetFileInfo ¶
func NewDnetFileInfo(info *C.struct_dnet_file_info) DnetFileInfo
type DnetIOAttr ¶
type DnetIOAttr struct { Parent []byte ID []byte Start uint64 Num uint64 Timestamp time.Time UserFlags uint64 TotalSize uint64 Flags uint32 Offset uint64 Size uint64 RecordFlags uint64 }
func NewDnetIOAttr ¶
func NewDnetIOAttr(io *C.struct_dnet_io_attr) DnetIOAttr
type DnetIteratorRange ¶
type DnetIteratorRange struct {
Begin, End DnetRawID
}
type DnetIteratorResponse ¶
type DnetRawID ¶
type DnetRawID struct {
ID []byte
}
func NewDnetRawID ¶
func NewDnetRawID() *DnetRawID
func NewDnetRawIDraw ¶
func NewDnetRawIDraw(raw *C.struct_dnet_raw_id) *DnetRawID
type DnetRawIDKeys ¶
type DnetRawIDKeys struct {
// contains filtered or unexported fields
}
func NewDnetRawIDKeys ¶
func NewDnetRawIDKeys(ids []DnetRawID) (kk *DnetRawIDKeys, err error)
func (*DnetRawIDKeys) Free ¶
func (kk *DnetRawIDKeys) Free()
func (*DnetRawIDKeys) InsertID ¶
func (kk *DnetRawIDKeys) InsertID(id *DnetRawID)
func (*DnetRawIDKeys) Size ¶
func (kk *DnetRawIDKeys) Size() int
type DnetStat ¶
func (*DnetStat) AddRouteEntry ¶
func (stat *DnetStat) AddRouteEntry(entry *RouteEntry)
func (*DnetStat) AddStatEntry ¶
func (*DnetStat) Diff ¶
@Diff() updates differential counters like success/failure RPS and BPS i.e. those counters which require difference measured for some time
func (*DnetStat) FindCreateBackend ¶
func (stat *DnetStat) FindCreateBackend(group uint32, addr *DnetAddr, backend_id int32) *StatBackend
type DstStat ¶
type DstStat struct { Storage PacketOnlyCommandStat `json:"storage"` Proxy PacketOnlyCommandStat `json:"proxy"` }
type GlobalStats ¶
type IteratorResult ¶
type IteratorResult interface { Reply() *DnetIteratorResponse ReplyData() []byte ID() uint64 Error() error }
type LayerStat ¶
type LayerStat struct { Outside CommandStat `json:"outside"` Internal CommandStat `json:"internal"` }
func (*LayerStat) RequestsFailures ¶
func (*LayerStat) RequestsSuccess ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger provides file logger for Elliptics Node.
type Lookuper ¶
type Lookuper interface { // server's reply Cmd() *DnetCmd // server's address Addr() *DnetAddr // dnet_file_info structure contains basic information about key location Info() *DnetFileInfo // address of the node which hosts given key StorageAddr() *DnetAddr //Path returns a path to file hosting given key on the storage. Path() string //Error returns string respresentation of error. Error() error }
Lookuper represents one result of Write and Lookup operations.
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
A Node is responsible for the connection with a server side. Also it is responsible for checking timeouts, maintenance and checking of communication. To initialize the Node you should use NewNode.
func NewNodeConfig ¶
func NewNodeConfig(logfile string, level string, cfg *NodeConfig) (node *Node, err error)
NewNode returns new Node with a given Logger.
func (*Node) AddRemote ¶
* AddRemote adds a connection to elliptics servers. * * Address is specified as Host:Port:Family. Family can be omitted. * Suitable Family values are: 2 (AF_INET) and 10 (AF_INET6).
func (*Node) AddRemotes ¶
func (*Node) Free ¶
func (node *Node) Free()
Free disposes given Node instance. Do not destroy the Node used by any Session.
func (*Node) GetRawPointer ¶
Get raw elliptics node pointer
func (*Node) SetTimeouts ¶
* SetTimeouts overrides the default values for timeouts. * * waitTimeout affects to any transaction, which is sent to the cluster. * Default value is 5 seconds. * * checkTimeout is responsible for updating the routing table * and checking the network connection. * By default it's 60 seconds.
type NodeConfig ¶
type NodeConfig struct { IOThreadNum int `json:"io-thread-num"` NonBlockingIOThreadNum int `json:"nonblocking-io-thread-num"` NetThreadNum int `json:"net-thread-num"` WaitTimeout uint64 `json:"wait-timeout"` CheckTimeout uint64 `json:"check-timeout"` Flags int `json:"flags"` StallCount int `json:"stall-count"` }
type PID ¶
type PID struct { sync.RWMutex Error float64 IntegralError float64 ErrorTime time.Time Pain float64 }
func NewPIDController ¶
func NewPIDController() *PID
type PacketOnlyCommandStat ¶
type ReadResult ¶
type ReadResult interface { // server's reply Cmd() *DnetCmd // server's address Addr() *DnetAddr // IO parameters for given IO() *DnetIOAttr //Data returns string represntation of read data Data() []byte // read error Error() error }
ReadResult wraps one result of read operation.
type ReadSeeker ¶
type ReadSeeker struct { TotalSize uint64 RecordFlags uint64 Mtime time.Time // contains filtered or unexported fields }
implements Reader and Seeker interfaces
func NewEmptyReadSeeker ¶
func NewEmptyReadSeeker() (*ReadSeeker, error)
func NewReadSeeker ¶
func NewReadSeeker(session *Session, kstr string) (*ReadSeeker, error)
func NewReadSeekerKeyOffsetSize ¶
func NewReadSeekerKeyOffsetSize(session *Session, key *Key, offset, size uint64) (*ReadSeeker, error)
func NewReadSeekerOffsetSize ¶
func NewReadSeekerOffsetSize(session *Session, kstr string, offset, size uint64) (*ReadSeeker, error)
func (*ReadSeeker) Free ¶
func (r *ReadSeeker) Free()
func (*ReadSeeker) ReadInternal ¶
func (r *ReadSeeker) ReadInternal(buf []byte) (n int, err error)
type Remover ¶
type Remover interface { // server's reply Cmd() *DnetCmd // key to be removed, only set for error results Key() string //Error of remove operation. Error() error }
Remover wraps information about remove operation.
type RouteEntry ¶
type RouteEntry struct {
// contains filtered or unexported fields
}
func NewRouteEntry ¶
func NewRouteEntry(entry *C.struct_dnet_route_entry) *RouteEntry
func (*RouteEntry) ID ¶
func (entry *RouteEntry) ID() []byte
func (*RouteEntry) String ¶
func (r *RouteEntry) String() string
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session allows to perfom any operations with data and indexes.
Most of methods return channel. Channel will be closed after results end or error occurs. In case of error last value received from channel returns non nil value from Error method.
For example Remove:
if rm, ok := <-session.Remove(KEY); !ok { //Remove normally doesn't return any value, so chanel was closed. log.Println("Remove successfully") } else { //We's received value from channel. It should be error message. log.Println("Error occured: ", rm.Error()) }
func CloneSession ¶
CloneSession returns clone of the given Session.
func NewSession ¶
NewSession returns Session connected with given Node.
func (*Session) BackendDisable ¶
func (*Session) BackendEnable ¶
func (*Session) BackendMakeReadOnly ¶
func (*Session) BackendMakeWritable ¶
func (*Session) BackendSetDelay ¶
func (*Session) BackendStartDefrag ¶
func (*Session) BackendsStatus ¶
func (*Session) BulkRemove ¶
BulkRemove removes keys from array. It returns error for every key it could not delete.
func (*Session) CopyIteratorStart ¶
func (*Session) GetIOflags ¶
func (*Session) GetTimeout ¶
func (*Session) GetTimestamp ¶
func (*Session) GetTraceID ¶
func (*Session) IteratorCancel ¶
func (*Session) IteratorContinue ¶
func (*Session) IteratorPause ¶
func (*Session) IteratorStart ¶
func (*Session) Lookup ¶
Lookup returns an information about given Key. It only returns the first group where key has been found.
func (*Session) LookupBackend ¶
func (*Session) ParallelLookup ¶
func (*Session) ParallelLookupID ¶
func (*Session) ParallelLookupKey ¶
ParallelLookupKey returns all information about given Key, it sends multiple lookup requests in parallel to all session groups and returns information about all specified group where given key has been found.
func (*Session) ReadData ¶
func (s *Session) ReadData(key string, offset, size uint64) <-chan ReadResult
ReadKey performs a read operation by string representation of key.
func (*Session) ReadInto ¶
func (s *Session) ReadInto(key *Key, offset uint64, p []byte) <-chan ReadResult
ReadInto reads data into specified buffer.
func (*Session) ReadKey ¶
func (s *Session) ReadKey(key *Key, offset, size uint64) <-chan ReadResult
ReadKey performs a read operation by key.
func (*Session) ServerSend ¶
func (*Session) SetCflags ¶
SetCflags sets command flags (DNET_FLAGS_* in API documentation) like nolock
func (*Session) SetIOflags ¶
SetIOflags sets IO flags (DNET_IO_FLAGS_* in API documentation), i.e. flags for IO operations like read/write/delete
func (*Session) SetNamespace ¶
* @SetNamespace sets the namespace for the Session. Default namespace is empty string. * * This feature allows you to share a single storage between services. * And each service which uses own namespace will have own independent space of keys.
func (*Session) SetTimeout ¶
SetTimeout sets wait timeout in seconds (time to wait for operation to complete) for all subsequent session operations
func (*Session) SetTimestamp ¶
func (*Session) SetTraceID ¶
func (*Session) WriteChunk ¶
type StatBackend ¶
type StatBackend struct { // Address+Backend for given stats, do not put it into json // since @RawAddr is an array of bytes and it can not be parsed by human Ab AddressBackend `json:"-"` Error BackendError `json:"error"` // All range starts (IDs) for given node (server address + backend) ID []DnetRawID `json:"-"` // percentage of the whole IDs ring currently occupied by given ids // and thus node (address + backend) Percentage float64 // defragmentation status: 0 - not started, 1 - in progress DefragState int32 DefragStateStr string DefragStartTime time.Time DefragCompletionTime time.Time DefragCompletionStatus int32 // backend is in read-only mode RO bool // backend has delay of @Delay ms for every operation Delay uint32 // VFS statistics: available, used and total space VFS VFS // PID-controller used for data writing PID *PID // per-command size/number counters // difference between the two divided by the time difference equals to RPS/BPS Commands map[string]*CStat // contains filtered or unexported fields }
func NewStatBackend ¶
func NewStatBackend(ab AddressBackend) *StatBackend
func (*StatBackend) IDString ¶
func (sb *StatBackend) IDString() string
func (*StatBackend) Len ¶
func (sb *StatBackend) Len() int
func (*StatBackend) Less ¶
func (sb *StatBackend) Less(i, j int) bool
func (*StatBackend) PIDPain ¶
func (backend *StatBackend) PIDPain() float64
func (*StatBackend) PIDUpdate ¶
func (backend *StatBackend) PIDUpdate(e float64)
func (*StatBackend) Swap ¶
func (sb *StatBackend) Swap(i, j int)
type StatBackendData ¶
type StatBackendData struct { Address string Backend int32 Stat *StatBackend }
type StatEntry ¶
type StatEntry struct {
// contains filtered or unexported fields
}
func (*StatEntry) AddressBackend ¶
func (entry *StatEntry) AddressBackend() AddressBackend
type StatGroup ¶
type StatGroup struct {
Ab map[AddressBackend]*StatBackend
}
@StatGroup hosts mapping from node address + backend into per-backend statistics Every group in elliptics contains one or more servers each of which contains one or more backends Basically, the lowest IO entitiy is backend which is tightly bound with server node (or node's address)
func NewStatGroup ¶
func NewStatGroup() StatGroup
func (*StatGroup) FindStatBackend ¶
func (sg *StatGroup) FindStatBackend(addr *DnetAddr, backend_id int32) (*StatBackend, error)
func (*StatGroup) FindStatBackendKey ¶
func (*StatGroup) StatGroupData ¶
func (sg *StatGroup) StatGroupData() (reply *StatGroupData)
type StatGroupData ¶
type StatGroupData struct {
Backends []*StatBackendData
}
type TraceID ¶
type TraceID C.trace_id_t
type VFS ¶
type VFS struct {
// space in bytes for given backend
Total, Avail uint64
// logical size limitation for backends which support it
// blob backend may set this (configuration must allow blob size checks, bit-4 must be zero)
// for all others this field equals to @VFS.Total
TotalSizeLimit uint64
BackendRemovedSize uint64
BackendUsedSize uint64
RecordsTotal uint64
RecordsRemoved uint64
RecordsCorrupted uint64
}
type WriteSeeker ¶
type WriteSeeker struct {
// contains filtered or unexported fields
}
implements Writer and Seeker interfaces
func NewEmptyWriteSeeker ¶
func NewEmptyWriteSeeker() (*WriteSeeker, error)
func NewWriteSeeker ¶
func NewWriteSeekerKey ¶
func (*WriteSeeker) Free ¶
func (w *WriteSeeker) Free()