// LoadMetadata loads node metadata fields from the agent config and
// updates them on the local agent.
421962
func (l *State) LoadMetadata(data map[string]string) error {
	l.Lock()
	defer l.Unlock()

	for k, v := range data {
		l.metadata[k] = v
	}
	l.TriggerSyncChanges()
	return nil
}
520329
func (d *Decoder) ReadMetadata() {
	if d.Metadata != nil {
		return
	}
	d.ReadInfo()
	if d.Err() != nil || d.Metadata != nil {
		return
	}
	var (
		chunk *riff.Chunk
		err   error
	)
	for err == nil {
		chunk, err = d.parser.NextChunk()
		if err != nil {
			break
		}

		switch chunk.ID {
		case CIDList:
			if err = DecodeListChunk(d, chunk); err != nil {
				if err != io.EOF {
					d.err = err
				}
			}
			if d.Metadata != nil && d.Metadata.SamplerInfo != nil {
				// we got everything we were looking for
				break
			}
		case CIDSmpl:
			if err = DecodeSamplerChunk(d, chunk); err != nil {
				if err != io.EOF {
					d.err = err
				}
			}
		case CIDCue:
			if err = DecodeCueChunk(d, chunk); err != nil {
				if err != io.EOF {
					d.err = err
				}
			}
		default:
			// fmt.Println(string(chunk.ID[:]))
			chunk.Drain()
		}
	}

}
549073
func (s *VirtualRouterData) SetMetadata(v *ResourceMetadata) *VirtualRouterData {
	s.Metadata = v
	return s
}
1310065
func (f *Field) loadMeta() error {
	var pb internal.FieldOptions

	// Read data from meta file.
	buf, err := ioutil.ReadFile(filepath.Join(f.path, ".meta"))
	if os.IsNotExist(err) {
		return nil
	} else if err != nil {
		return errors.Wrap(err, "reading meta")
	} else {
		if err := proto.Unmarshal(buf, &pb); err != nil {
			return errors.Wrap(err, "unmarshaling")
		}
	}

	// Copy metadata fields.
	f.options.Type = pb.Type
	f.options.CacheType = pb.CacheType
	f.options.CacheSize = pb.CacheSize
	f.options.Min = pb.Min
	f.options.Max = pb.Max
	f.options.TimeQuantum = TimeQuantum(pb.TimeQuantum)
	f.options.Keys = pb.Keys
	f.options.NoStandardView = pb.NoStandardView

	return nil
}
614562
func (s *PutObjectInput) SetMetadata(v map[string]*string) *PutObjectInput {
	s.Metadata = v
	return s
}
420535
func (s *StartRestoreJobInput) SetMetadata(v map[string]*string) *StartRestoreJobInput {
	s.Metadata = v
	return s
}
419990
func (s *ContextStoreWithDefault) GetMetadata(name string) (store.Metadata, error) {
	if name == DefaultContextName {
		defaultContext, err := s.Resolver()
		if err != nil {
			return store.Metadata{}, err
		}
		return defaultContext.Meta, nil
	}
	return s.Store.GetMetadata(name)
}
546769
func (s *TrustedAdvisorResourceDetail) SetMetadata(v []*string) *TrustedAdvisorResourceDetail {
	s.Metadata = v
	return s
}
1341154
func populateMetadata(testInfo *TestInfo, testTime *TestTime, labels map[string]string) error {
	test := labels["test"]

	// Populate testInfo with the test description.
	testInfo.Info[test] = labels["desc"]

	// Populate testTime with the test end timestamp.
	t, err := strconv.ParseInt(labels["timestamp"], 10, 64)
	if err != nil {
		return fmt.Errorf("failed to convert timestamp %q to an int64: %v", labels["timestamp"], err)
	}
	timestamp := time.Unix(t, 0).UTC().Format(testLogTimeFormat)
	testTime.Add(test, labels["node"], timestamp)

	return nil
}
59865
func LoadSrtmData(client *http.Client) (*SrtmData, error) {
	result := new(SrtmData)

	var err error
	result.Srtm1BaseUrl = SRTM_BASE_URL + SRTM1_URL
	result.Srtm1, err = getLinksFromUrl(client, result.Srtm1BaseUrl, result.Srtm1BaseUrl, 0)
	if err != nil {
		return nil, err
	}

	result.Srtm3BaseUrl = SRTM_BASE_URL + SRTM3_URL
	result.Srtm3, err = getLinksFromUrl(client, result.Srtm3BaseUrl, result.Srtm3BaseUrl, 0)
	if err != nil {
		return nil, err
	}

	return result, nil
}
278433
func (ad *ArchiveData) Metadata() (*Metadata, error) {
	buf := ad.NewBuffer()
	_, metaFile, err := tar.FindFile(buf, ad.MetadataFile)
	if err != nil {
		return nil, errors.Trace(err)
	}

	meta, err := NewMetadataJSONReader(metaFile)
	return meta, errors.Trace(err)
}
106276
func (s *Segment) AddMetadata(key string, value string) {
	s.addMetadata(key, value)
}
1272150
func (r *Namespace) Reload() (*Namespace, error) {
	return r.collection.Get(r.Metadata.Name)
}
598223
func (s *InitiateDocumentVersionUploadOutput) SetUploadMetadata(v *UploadMetadata) *InitiateDocumentVersionUploadOutput {
	s.UploadMetadata = v
	return s
}
1298732
func (c *Files) GetMetadata(in *GetMetadataInput) (out *GetMetadataOutput, err error) {
	body, err := c.call("/files/get_metadata", in)
	if err != nil {
		return
	}
	defer body.Close()

	err = json.NewDecoder(body).Decode(&out)
	return
}
809757
func (s *Application) SetMetadata(v map[string]*string) *Application {
	s.Metadata = v
	return s
}
950683
func (v *BtrfsVolume) ReadMetadata(label, name string) (io.ReadCloser, error) {
	filePath := filepath.Join(v.snapshotPath(label), name)
	return os.Open(filePath)
}