Documentation ¶
Index ¶
- Constants
- func FreeSpaceRatio(st *elliptics.StatBackend, content_length uint64) float64
- func URIOffsetSize(req *http.Request) (offset uint64, size uint64, err error)
- type BctlStat
- type Bucket
- type BucketACL
- type BucketCtl
- func (bctl *BucketCtl) AllBuckets() []*Bucket
- func (bctl *BucketCtl) BucketStatUpdate() (err error)
- func (bctl *BucketCtl) BucketStatUpdateNolock(stat *elliptics.DnetStat) (err error)
- func (bctl *BucketCtl) BucketUpload(bucket_name, key string, req *http.Request) (reply *reply.LookupResult, bucket *Bucket, err error)
- func (bctl *BucketCtl) BulkDelete(bname string, keys []string, req *http.Request) (reply map[string]interface{}, err error)
- func (bctl *BucketCtl) Delete(bname, key string, req *http.Request) (err error)
- func (bctl *BucketCtl) DumpProfile(out io.Writer, types []string)
- func (bctl *BucketCtl) DumpProfileFile(add_time bool)
- func (bctl *BucketCtl) DumpProfileSingle(out io.Writer, name string)
- func (bctl *BucketCtl) EllipticsReadBackrunnerConfig(conf *config.ProxyConfig, conf_key string) (err error)
- func (bctl *BucketCtl) EllipticsReadBucketList() (data []byte, err error)
- func (bctl *BucketCtl) FindBucket(name string) (bucket *Bucket, err error)
- func (bctl *BucketCtl) FindBucketRO(name string) *Bucket
- func (bctl *BucketCtl) GetBucket(key string, req *http.Request) (bucket *Bucket)
- func (bctl *BucketCtl) Lookup(bname, key string, req *http.Request) (reply *reply.LookupResult, err error)
- func (bctl *BucketCtl) NewBucketCtlStat() *BucketCtlStat
- func (bctl *BucketCtl) ReadBucketConfig() (err error)
- func (bctl *BucketCtl) ReadBucketsMetaNolock(names []string) (new_buckets []*Bucket, err error)
- func (bctl *BucketCtl) ReadConfig() (err error)
- func (bctl *BucketCtl) ReadProxyConfig() error
- func (bctl *BucketCtl) SetContentType(key string, w http.ResponseWriter)
- func (bctl *BucketCtl) SetGroupsTimeout(s *elliptics.Session, bucket *Bucket, key string)
- func (bctl *BucketCtl) Stat(req *http.Request, bnames []string) (reply *BctlStat, err error)
- func (bctl *BucketCtl) Stream(bname, key string, w http.ResponseWriter, req *http.Request) (err error)
- func (bctl *BucketCtl) UpdateMetadata(key string, jsi interface{}) (err error)
- func (bctl *BucketCtl) Upload(key string, req *http.Request) (reply *reply.LookupResult, bucket *Bucket, err error)
- type BucketCtlStat
- type BucketMsgpack
- type BucketStat
Constants ¶
View Source
const ( ProfilePath string = "backrunner.profile" PainNoFreeSpaceSoft float64 = 5000000000.0 PainNoFreeSpaceHard float64 = 50000000000000.0 // pain for read-only groups PainStatRO float64 = PainNoFreeSpaceHard / 2 // this is randomly selected error gain for buckets where upload has failed BucketWriteErrorPain float64 = PainNoFreeSpaceHard / 2 // pain for group without statistics PainNoStats float64 = PainNoFreeSpaceHard / 2 // pain for group where statistics contains error field PainStatError float64 = PainNoFreeSpaceHard / 2 // pain for bucket which do not have its group in stats PainNoGroup float64 = PainNoFreeSpaceHard / 2 PainDiscrepancy float64 = 1000.0 )
View Source
const ( // a placeholder for /get/ request which doesn't enforce additional checks besides auth check, // i.e. it is not admin, it is not modification BucketAuthEmpty uint64 = 0 // when ACL contains this flag, no further auth checks are ever performed for given user BucketAuthNoToken uint64 = 1 // ACL must contain this flag to allow user to upload data BucketAuthWrite uint64 = 2 // currently unused ACL flag which was introduced to split admin role (bucket modification) from usual writers // it is unused since backrunner doesn't support bucket modification or creation, // there is special tool @bmeta for this BucketAuthAdmin uint64 = 4 )
View Source
const BucketNamespace string = "bucket"
Variables ¶
This section is empty.
Functions ¶
func FreeSpaceRatio ¶
func FreeSpaceRatio(st *elliptics.StatBackend, content_length uint64) float64
Types ¶
type BctlStat ¶
type BctlStat struct { Buckets map[string]*BucketStat StatTime string }
type Bucket ¶
type Bucket struct { Name string Group map[uint32]*elliptics.StatGroup Meta BucketMsgpack }
func ReadBucket ¶
func ReadBucket(ell *etransport.Elliptics, name string) (bucket *Bucket, err error)
func WriteBucket ¶
func WriteBucket(ell *etransport.Elliptics, meta *BucketMsgpack) (bucket *Bucket, err error)
type BucketCtl ¶
type BucketCtl struct { sync.RWMutex Conf *config.ProxyConfig // after config has been locally updated via HTTP request, // it disables automatic config update for time period specified in config DisableConfigUpdateUntil time.Time BucketTimer *time.Timer BucketStatTimer *time.Timer // time when previous statistics update has been performed StatTime time.Time // time when backrunner proxy started StartTime time.Time // time when the last time config update was done ConfigTime time.Time // buckets used for automatic write bucket selection, // i.e. when client doesn't provide bucket name and we select it // according to its performance and capacity Bucket []*Bucket // buckets used by clients directly, i.e. when client explicitly says // he wants to work with bucket named 'X' BackBucket []*Bucket // contains filtered or unexported fields }
func NewBucketCtl ¶
func NewBucketCtl(ell *etransport.Elliptics, bucket_path, proxy_config_path string) (bctl *BucketCtl, err error)
func (*BucketCtl) AllBuckets ¶
func (*BucketCtl) BucketStatUpdate ¶
func (*BucketCtl) BucketStatUpdateNolock ¶
func (*BucketCtl) BucketUpload ¶
func (*BucketCtl) BulkDelete ¶
func (*BucketCtl) DumpProfileFile ¶
func (*BucketCtl) DumpProfileSingle ¶
func (*BucketCtl) EllipticsReadBackrunnerConfig ¶
func (bctl *BucketCtl) EllipticsReadBackrunnerConfig(conf *config.ProxyConfig, conf_key string) (err error)
func (*BucketCtl) EllipticsReadBucketList ¶
func (*BucketCtl) FindBucket ¶
func (*BucketCtl) FindBucketRO ¶
func (*BucketCtl) NewBucketCtlStat ¶
func (bctl *BucketCtl) NewBucketCtlStat() *BucketCtlStat
func (*BucketCtl) ReadBucketConfig ¶
func (*BucketCtl) ReadBucketsMetaNolock ¶
func (*BucketCtl) ReadConfig ¶
func (*BucketCtl) ReadProxyConfig ¶
func (*BucketCtl) SetContentType ¶
func (bctl *BucketCtl) SetContentType(key string, w http.ResponseWriter)
func (*BucketCtl) SetGroupsTimeout ¶
func (*BucketCtl) UpdateMetadata ¶
type BucketCtlStat ¶
type BucketCtlStat struct { StartTime int64 StartTimeString string StatTime int64 StatTimeString string ConfigTime int64 ConfigTimeString string CurrentTime int64 CurrentTimeString string BucketNum int Hostname string ConfigUpdateInterval int StatUpdateInterval int BuildDate string LastCommit string EllipticsGoLastCommit string ProxyConfig config.ProxyConfig }
type BucketMsgpack ¶
type BucketMsgpack struct { Version int32 `json:"-"` Name string `json:"-"` Acl map[string]BucketACL `json:"-"` Groups []uint32 `json:"groups"` Flags uint64 `json:"flags"` MaxSize uint64 `json:"max-size"` MaxKeyNum uint64 `json:"max-key-num"` // contains filtered or unexported fields }
func NewBucketMsgpack ¶
func NewBucketMsgpack(name string) *BucketMsgpack
func (*BucketMsgpack) ExtractJson ¶
func (meta *BucketMsgpack) ExtractJson(iface interface{}) (err error)
func (*BucketMsgpack) ExtractMsgpack ¶
func (meta *BucketMsgpack) ExtractMsgpack(out []interface{}) (err error)
func (*BucketMsgpack) PackMsgpack ¶
func (meta *BucketMsgpack) PackMsgpack() (interface{}, error)
func (*BucketMsgpack) String ¶
func (meta *BucketMsgpack) String() string
type BucketStat ¶
type BucketStat struct { Group map[string]*elliptics.StatGroupData Meta *BucketMsgpack }
Click to show internal directories.
Click to hide internal directories.