kubernetes.v0: gopkg.in/kubernetes/kubernetes.v0/pkg/registry/service/allocator/etcd Index | Files

package etcd

import "gopkg.in/kubernetes/kubernetes.v0/pkg/registry/service/allocator/etcd"

Index

Package Files

etcd.go

type Etcd Uses

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 Uses

func NewEtcd(alloc allocator.Snapshottable, baseKey string, kind string, helper tools.EtcdHelper) *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 Uses

func (e *Etcd) Allocate(offset int) (bool, error)

Allocate attempts to allocate the item locally and then in etcd.

func (*Etcd) AllocateNext Uses

func (e *Etcd) AllocateNext() (int, bool, error)

AllocateNext attempts to allocate the next item locally and then in etcd.

func (*Etcd) CreateOrUpdate Uses

func (e *Etcd) CreateOrUpdate(snapshot *api.RangeAllocation) error

CreateOrUpdate attempts to update the current etcd state with the provided allocation.

func (*Etcd) Free Uses

func (e *Etcd) Free() int

Implements allocator.Interface::Free

func (*Etcd) Get Uses

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 Uses

func (e *Etcd) Has(item int) bool

Implements allocator.Interface::Has

func (*Etcd) Refresh Uses

func (e *Etcd) Refresh() (*api.RangeAllocation, error)

Refresh reloads the RangeAllocation from etcd.

func (*Etcd) Release Uses

func (e *Etcd) Release(item int) error

Release attempts to release the provided item locally and then in etcd.

Package etcd imports 10 packages (graph). Updated 2018-06-03. Refresh now. Tools for package owners.