package etcd
import "k8s.io/kubernetes/pkg/registry/service/allocator/etcd"
Index ¶
- type Etcd
- func NewEtcd(alloc allocator.Snapshottable, baseKey string, kind string, storage storage.Interface) *Etcd
- func (e *Etcd) Allocate(offset int) (bool, error)
- func (e *Etcd) AllocateNext() (int, bool, error)
- func (e *Etcd) CreateOrUpdate(snapshot *api.RangeAllocation) error
- func (e *Etcd) Free() int
- func (e *Etcd) Get() (*api.RangeAllocation, error)
- func (e *Etcd) Has(item int) bool
- func (e *Etcd) Refresh() (*api.RangeAllocation, error)
- func (e *Etcd) Release(item int) error
Types ¶
type Etcd ¶
type Etcd struct {
// contains filtered or unexported fields
}
Etcd exposes a service.Allocator that is backed by etcd. TODO: allow multiple allocations to be tried at once TODO: subdivide the keyspace to reduce conflicts TODO: investigate issuing a CAS without reading first
func NewEtcd ¶
func NewEtcd(alloc allocator.Snapshottable, baseKey string, kind string, storage storage.Interface) *Etcd
NewEtcd returns an allocator that is backed by Etcd and can manage persisting the snapshot state of allocation after each allocation is made.
func (*Etcd) Allocate ¶
Allocate attempts to allocate the item locally and then in etcd.
func (*Etcd) AllocateNext ¶
AllocateNext attempts to allocate the next item locally and then in etcd.
func (*Etcd) CreateOrUpdate ¶
func (e *Etcd) CreateOrUpdate(snapshot *api.RangeAllocation) error
CreateOrUpdate attempts to update the current etcd state with the provided allocation.
func (*Etcd) Free ¶
Implements allocator.Interface::Free
func (*Etcd) Get ¶
func (e *Etcd) Get() (*api.RangeAllocation, error)
Get returns an api.RangeAllocation that represents the current state in etcd. If the key does not exist, the object will have an empty ResourceVersion.
func (*Etcd) Has ¶
Implements allocator.Interface::Has
func (*Etcd) Refresh ¶
func (e *Etcd) Refresh() (*api.RangeAllocation, error)
Refresh reloads the RangeAllocation from etcd.
func (*Etcd) Release ¶
Release attempts to release the provided item locally and then in etcd.
Source Files ¶
etcd.go
- Version
- v1.1.3
- Published
- Dec 7, 2015
- Platform
- js/wasm
- Imports
- 11 packages
- Last checked
- 11 seconds ago –
Tools for package owners.