// NewDesiredStateOfWorld returns a new instance of DesiredStateOfWorld.
17861
func NewDesiredStateOfWorld(volumePluginMgr *volume.VolumePluginMgr) DesiredStateOfWorld {
	return &desiredStateOfWorld{
		nodesManaged:    make(map[k8stypes.NodeName]nodeManaged),
		volumePluginMgr: volumePluginMgr,
	}
}
209715
func MakeGenesisStateFromFile(genDocFile string) (State, error) {
	genDoc, err := MakeGenesisDocFromFile(genDocFile)
	if err != nil {
		return State{}, err
	}
	return MakeGenesisState(genDoc)
}
1292393
func (s *UpdateEndpointWeightsAndCapacitiesInput) SetDesiredWeightsAndCapacities(v []*DesiredWeightAndCapacity) *UpdateEndpointWeightsAndCapacitiesInput {
	s.DesiredWeightsAndCapacities = v
	return s
}
1137656
func NewHilStateQuaternion(TIME_USEC uint64, ATTITUDE_QUATERNION [4]float32, ROLLSPEED float32, PITCHSPEED float32, YAWSPEED float32, LAT int32, LON int32, ALT int32, VX int16, VY int16, VZ int16, IND_AIRSPEED uint16, TRUE_AIRSPEED uint16, XACC int16, YACC int16, ZACC int16) *HilStateQuaternion {
	m := HilStateQuaternion{}
	m.TIME_USEC = TIME_USEC
	m.ATTITUDE_QUATERNION = ATTITUDE_QUATERNION
	m.ROLLSPEED = ROLLSPEED
	m.PITCHSPEED = PITCHSPEED
	m.YAWSPEED = YAWSPEED
	m.LAT = LAT
	m.LON = LON
	m.ALT = ALT
	m.VX = VX
	m.VY = VY
	m.VZ = VZ
	m.IND_AIRSPEED = IND_AIRSPEED
	m.TRUE_AIRSPEED = TRUE_AIRSPEED
	m.XACC = XACC
	m.YACC = YACC
	m.ZACC = ZACC
	return &m
}
488572
func (s *Service) SetDesiredCount(v int64) *Service {
	s.DesiredCount = &v
	return s
}
185010
func NewGlueState(stateName string,
	parameters GlueParameters) *GlueState {

	sns := &GlueState{
		BaseTask: BaseTask{
			baseInnerState: baseInnerState{
				name: stateName,
				id:   rand.Int63(),
			},
		},
		parameters: parameters,
	}
	return sns
}
537130
func New(p *dt.Plugin, t Type, label string) []dt.State {
	switch t {
	case RequestAddress:
		return getAddress(p, label)
	}
	return []dt.State{}
}
1136260
func NewState() *State {
	return &State{
		store:                        store.NewNilStore(),
		monitor:                      monitor.NewNilMonitor(),
		invokeGlobalCallbacksOnFlush: true,
	}
}
666625
func (s *State) RefreshState() error {
	s.mu.Lock()
	defer s.mu.Unlock()
	return s.refreshState()
}
1291096
func New(value interface{}) *StateMachine {
	return &StateMachine{
		states: map[string]*State{},
		events: map[string]*Event{},
	}
}
1338652
func (f *FSM) AddCanceledState(state *FSMState) {
	f.AddState(state)
	f.canceledState = state
}
761711
func NewParallelState(parallelStateName string, states StateMachine) *ParallelState {
	return &ParallelState{
		baseInnerState: baseInnerState{
			name: parallelStateName,
			id:   rand.Int63(),
		},
		States: states,
	}
}
589739
func New(root common.Hash, db Database) (*StateDB, error) {
	tr, err := db.OpenTrie(root)
	if err != nil {
		return nil, err
	}
	return &StateDB{
		db:                db,
		trie:              tr,
		stateObjects:      make(map[common.Address]*stateObject),
		stateObjectsDirty: make(map[common.Address]struct{}),
		logs:              make(map[common.Hash][]*types.Log),
		preimages:         make(map[common.Hash][]byte),
		journal:           newJournal(),
	}, nil
}
1316935
func (e *Endpoint) updateRealizedState(stats *regenerationStatistics, origDir string, revision uint64, compilationExecuted bool) error {
	// Update desired policy for endpoint because policy has now been realized
	// in the datapath. PolicyMap state is not updated here, because that is
	// performed in endpoint.syncPolicyMap().
	stats.waitingForLock.Start()
	err := e.LockAlive()
	stats.waitingForLock.End(err == nil)
	if err != nil {
		return err
	}

	defer e.Unlock()

	// Depending upon result of BPF regeneration (compilation executed),
	// shift endpoint directories to match said BPF regeneration
	// results.
	err = e.synchronizeDirectories(origDir, compilationExecuted)
	if err != nil {
		return fmt.Errorf("error synchronizing endpoint BPF program directories: %s", err)
	}

	// Keep PolicyMap for this endpoint in sync with desired / realized state.
	if !option.Config.DryMode {
		e.syncPolicyMapController()
	}

	e.realizedBPFConfig = e.desiredBPFConfig

	// Set realized state to desired state fields.
	e.realizedPolicy.Realizes(e.desiredPolicy)

	// Mark the endpoint to be running the policy revision it was
	// compiled for
	e.setPolicyRevision(revision)

	return nil
}
1215420
func (s *CampaignResponse) SetDefaultState(v *CampaignState) *CampaignResponse {
	s.DefaultState = v
	return s
}
805964
func (s *CreateServiceInput) SetDesiredCount(v int64) *CreateServiceInput {
	s.DesiredCount = &v
	return s
}
392012
func DesiredStateIsRedundant(desiredState DesiredState, emergency bool, currentState ServiceCurrentState) bool {
	switch desiredState {
	case SVCRun:
		return currentState == SVCCSRunning || currentState == SVCCSStarting || currentState == SVCCSPendingStart
	case SVCRestart:
		return currentState == SVCCSRestarting || currentState == SVCCSPendingRestart
	case SVCStop:
		if emergency {
			return currentState == SVCCSEmergencyStopped || currentState == SVCCSEmergencyStopping || currentState == SVCCSPendingEmergencyStop
		} else {
			return currentState == SVCCSStopped || currentState == SVCCSStopping || currentState == SVCCSPendingStop
		}
	case SVCPause:
		return currentState == SVCCSPaused || currentState == SVCCSPausing || currentState == SVCCSPendingPause
	}

	return false
}