func (alloc *Allocator) Start() {
	loadedPersistedData := alloc.loadPersistedData()
	switch {
	case loadedPersistedData && len(alloc.seed) != 0:
		alloc.infof("Found persisted IPAM data, ignoring supplied IPAM seed")
	case loadedPersistedData:
		alloc.infof("Initialising with persisted data")
	case len(alloc.seed) != 0:
		alloc.infof("Initialising with supplied IPAM seed")
		alloc.createRing(alloc.seed)
	case alloc.paxos.IsElector():
		alloc.infof("Initialising via deferred consensus")
	default:
		alloc.infof("Initialising as observer - awaiting IPAM data from another peer")
	}
	if loadedPersistedData { // do any pre-claims right away
		alloc.tryOps(&alloc.pendingClaims)
	}
	actionChan := make(chan func(), mesh.ChannelSize)
	stopChan := make(chan struct{})
	alloc.actionChan = actionChan
	alloc.stopChan = stopChan
	alloc.ticker = time.NewTicker(tickInterval)
	go alloc.actorLoop(actionChan, stopChan)
}
// Start runs the allocator goroutine
Start runs the allocator goroutine
// Start runs the allocator goroutine
func (alloc *Allocator) Start() {
	loadedPersistedData := alloc.loadPersistedData()
	switch {
	case loadedPersistedData && len(alloc.seed) != 0:
		alloc.infof("Found persisted IPAM data, ignoring supplied IPAM seed")
	case loadedPersistedData:
		alloc.infof("Initialising with persisted data")
	case len(alloc.seed) != 0:
		alloc.infof("Initialising with supplied IPAM seed")
		alloc.createRing(alloc.seed)
	case alloc.paxos.IsElector():
		alloc.infof("Initialising via deferred consensus")
	default:
		alloc.infof("Initialising as observer - awaiting IPAM data from another peer")
	}
	if loadedPersistedData { 
		alloc.tryOps(&alloc.pendingClaims)
	}
	actionChan := make(chan func(), mesh.ChannelSize)
	stopChan := make(chan struct{})
	alloc.actionChan = actionChan
	alloc.stopChan = stopChan
	alloc.ticker = time.NewTicker(tickInterval)
	go alloc.actorLoop(actionChan, stopChan)
}
func ( alloc * Allocator ) Start ( ) { loadedPersistedData := alloc . loadPersistedData ( ) switch { case loadedPersistedData && len ( alloc . seed ) != 0 : alloc . infof ( " " ) case loadedPersistedData : alloc . infof ( " " ) case len ( alloc . seed ) != 0 : alloc . infof ( " " ) alloc . createRing ( alloc . seed ) case alloc . paxos . IsElector ( ) : alloc . infof ( " " ) default : alloc . infof ( " " ) } if loadedPersistedData { alloc . tryOps ( & alloc . pendingClaims ) } actionChan := make ( chan func ( ) , mesh . ChannelSize ) stopChan := make ( chan struct { } ) alloc . actionChan = actionChan alloc . stopChan = stopChan alloc . ticker = time . NewTicker ( tickInterval ) go alloc . actorLoop ( actionChan , stopChan ) }
Start runs the allocator goroutine
Start runs the allocator goroutine
// do any pre-claims right away