// statemgr.Reader impl.
325730
func (s *State) State() *states.State {
	s.mu.Lock()
	defer s.mu.Unlock()

	return s.state.DeepCopy()
}
1172537
func (s *OvsDriverOperState) Read(id string) error {
	key := fmt.Sprintf(ovsOperPath, id)
	return s.StateDriver.ReadState(key, s, json.Unmarshal)
}
1036142
func NewStateCorrection(XERR float32, YERR float32, ZERR float32, ROLLERR float32, PITCHERR float32, YAWERR float32, VXERR float32, VYERR float32, VZERR float32) *StateCorrection {
	m := StateCorrection{}
	m.XERR = XERR
	m.YERR = YERR
	m.ZERR = ZERR
	m.ROLLERR = ROLLERR
	m.PITCHERR = PITCHERR
	m.YAWERR = YAWERR
	m.VXERR = VXERR
	m.VYERR = VYERR
	m.VZERR = VZERR
	return &m
}
1358881
func (n *nomadFSM) State() *state.StateStore {
	n.stateLock.RLock()
	defer n.stateLock.RUnlock()
	return n.state
}
596649
func (s *EndpointGroupState) Read(id string) error {
	key := fmt.Sprintf(epGroupConfigPath, id)
	return s.StateDriver.ReadState(key, s, json.Unmarshal)
}
1082909
func readStateFile(dirPath string, tag names.StorageTag) (d *stateFile, err error) {
	filename := strings.Replace(tag.Id(), "/", "-", -1)
	d = &stateFile{
		filepath.Join(dirPath, filename),
		state{storage: tag},
	}
	defer errors.DeferredAnnotatef(&err, "cannot load storage %q state from %q", tag.Id(), d.path)
	if _, err := os.Stat(d.path); os.IsNotExist(err) {
		return d, nil
	} else if err != nil {
		return nil, err
	}
	var info diskInfo
	if err := utils.ReadYaml(d.path, &info); err != nil {
		return nil, errors.Errorf("invalid storage state file %q: %v", d.path, err)
	}
	if info.Attached == nil {
		return nil, errors.Errorf("invalid storage state file %q: missing 'attached'", d.path)
	}
	d.state.attached = *info.Attached
	return d, nil
}
1360011
func state1(s *Scanner, c int) int {
	if '0' <= c && c <= '9' {
		s.Step = state1
		return ScanContinue
	}
	return state0(s, c)
}
1344728
func (gp *EpgPolicy) ReadAll() ([]core.State, error) {
	return gp.StateDriver.ReadAllState(policyConfigPathPrefix, gp, json.Unmarshal)
}
930647
func (s *CfgServiceLBState) ReadAll() ([]core.State, error) {
	return s.StateDriver.ReadAllState(serviceLBConfigPathPrefix, s, json.Unmarshal)
}
808409
func (l *State) Load(r io.Reader, chunkName string, mode string) error {
	if chunkName == "" {
		chunkName = "?"
	}

	if err := protectedParser(l, r, chunkName, mode); err != nil {
		return err
	}

	if f := l.stack[l.top-1].(*luaClosure); f.upValueCount() == 1 {
		f.setUpValue(0, l.global.registry.atInt(RegistryIndexGlobals))
	}
	return nil
}
1229695
func readMachineState(node *etcd.Node) (mach machine.MachineState, err error) {
	var metadata map[string]string

	for _, obj := range node.Nodes {
		if strings.HasSuffix(obj.Key, "/object") {
			err = unmarshal(obj.Value, &mach)
			if err != nil {
				return
			}
		} else if strings.HasSuffix(obj.Key, "/metadata") {
			// Load metadata into a separate map to avoid stepping on it when deserializing the object key
			metadata = make(map[string]string, len(obj.Nodes))
			for _, mdnode := range obj.Nodes {
				metadata[path.Base(mdnode.Key)] = mdnode.Value
			}
		}
	}

	mach.Metadata = mergeMetadata(mach.Metadata, metadata)
	return
}
1055335
func RefreshAndRead(mgr Storage) (*states.State, error) {
	err := mgr.RefreshState()
	if err != nil {
		return nil, err
	}
	return mgr.State(), nil
}
169167
func (f *StateFile) Read() (string, string, *Disconnected, error) {
	var st state
	if err := utils.ReadYaml(f.path, &st); err != nil {
		if os.IsNotExist(err) {
			return "", "", nil, nil
		}
		return "", "", nil, errors.Trace(err)
	}

	return st.Code, st.Info, st.Disconnected, nil
}
1281637
func UrandomReader() (io.Reader, error) {
	urandomOnce.Do(func() {
		urandom, err := os.Open(urandomPath)
		if err != nil {
			urandomErr = fmt.Errorf("unable to open %s: %s", urandomPath, err)
			return
		}
		urandomCached = urandom
	})

	return urandomCached, urandomErr
}
575902
func (w *SegmentWAL) Reader() WALReader {
	return &repairingWALReader{
		wal: w,
		r:   newWALReader(w.files, w.logger),
	}
}
277590
func Reader() io.Reader {
	var in bytes.Buffer

	for _, page := range pages {
		in.WriteString(fmt.Sprintf("\n# %s\n", page.Name))
		in.Write(MustAsset(page.File))
	}

	md := markdown.New(markdown.XHTMLOutput(true), markdown.Nofollow(true))
	v := &renderer{}
	s := v.visit(md.Parse(in.Bytes()))
	return strings.NewReader(s)
}
849527
func (f *StateFile) Read() (*State, error) {
	var st State
	if err := utils.ReadYaml(f.path, &st); err != nil {
		if os.IsNotExist(err) {
			return nil, ErrNoStateFile
		}
	}
	if err := st.validate(); err != nil {
		return nil, errors.Errorf("cannot read %q: %v", f.path, err)
	}
	return &st, nil
}