Adds digest metadata to the StorageObjectMetadata object
428515
@Override
  public void addDigestMetadata(StorageObjectMetadata meta, String digest)
  {
    if (!SnowflakeUtil.isBlank(digest))
    {
      // Azure doesn't allow hyphens in the name of a metadata field.
      meta.addUserMetadata("sfcdigest", digest);
    }
  }
945539
private static ITag injectMetaData(IMetaData<?, ?> meta, ITag tag) {
        IoBuffer bb = IoBuffer.allocate(1000);
        bb.setAutoExpand(true);
        Output out = new Output(bb);
        Serializer.serialize(out, "onMetaData");
        Serializer.serialize(out, meta);
        IoBuffer tmpBody = out.buf().flip();
        int tmpBodySize = out.buf().limit();
        int tmpPreviousTagSize = tag.getPreviousTagSize();
        return new Tag(IoConstants.TYPE_METADATA, 0, tmpBodySize, tmpBody, tmpPreviousTagSize);
    }
714667
private JSONObject createResponseMeta(Map<String,String> metaInfo, Set<String> reqMetaInfo, Long ownerId, long requestTime)
            throws EventHandlerException, JSONException, ServiceException {
        JSONObject meta = new JsonObject();
        JSONObject headers = new JsonObject();

        for (String key : metaInfo.keySet()) {
            if (!Listener.AUTHENTICATED_USER_HEADER.equals(key)
                    && !Listener.METAINFO_HTTP_STATUS_CODE.equals(key)
                    && !Listener.METAINFO_ACCEPT.equals(key)
                    && !Listener.METAINFO_DOWNLOAD_FORMAT.equals(key)
                    && !Listener.METAINFO_MDW_REQUEST_ID.equals(key)
                    && !reqMetaInfo.contains(key)) {
                headers.put(key, metaInfo.get(key));
            }
        }

        // these always get populated if present
        if (metaInfo.get(Listener.METAINFO_REQUEST_ID) != null)
            headers.put(Listener.METAINFO_REQUEST_ID, metaInfo.get(Listener.METAINFO_REQUEST_ID));
        if (metaInfo.get(Listener.METAINFO_MDW_REQUEST_ID) != null && !metaInfo.get(Listener.METAINFO_MDW_REQUEST_ID).equals("0"))
            headers.put(Listener.METAINFO_MDW_REQUEST_ID, metaInfo.get(Listener.METAINFO_MDW_REQUEST_ID));
        if (metaInfo.get(Listener.METAINFO_CORRELATION_ID) != null)
            headers.put(Listener.METAINFO_CORRELATION_ID, metaInfo.get(Listener.METAINFO_CORRELATION_ID));
        if (metaInfo.get(Listener.METAINFO_CONTENT_TYPE) != null)
            headers.put(Listener.METAINFO_CONTENT_TYPE, metaInfo.get(Listener.METAINFO_CONTENT_TYPE));

        if (!headers.has(Listener.METAINFO_CONTENT_TYPE))
            headers.put(Listener.METAINFO_CONTENT_TYPE, "application/json");

        meta.put("headers", headers);

        createDocument(JSONObject.class.getName(), meta, OwnerType.LISTENER_RESPONSE_META, ownerId);


        ServiceLocator.getRequestServices().setElapsedTime(OwnerType.LISTENER_RESPONSE, ownerId,
                System.currentTimeMillis() - requestTime);

        return meta;
    }
843382
function updateMetadata(metadata, form) {
  metadata.files[form.id] = {
    name: form.name,
    path: path.join(ZIP_SUBFOLDER_NAME, form.id + '.json')
  };
}
440173
def _load_metadata(self):
        """"""
        if self._synchronizer is None:
            self._load_metadata_nosync()
        else:
            mkey = self._key_prefix + array_meta_key
            with self._synchronizer[mkey]:
                self._load_metadata_nosync()
741691
def _set_blob_metadata(self, sd, metadata):
        # type: (SyncCopy, blobxfer.models.synccopy.Descriptor, dict) -> None
        
        blobxfer.operations.azure.blob.set_blob_metadata(
            sd.dst_entity, metadata)
        if blobxfer.util.is_not_empty(sd.dst_entity.replica_targets):
            for ase in sd.dst_entity.replica_targets:
                blobxfer.operations.azure.blob.set_blob_metadata(ase, metadata)
1056270
def add_item_metadata(self, handle, key, value):
        
        if not os.path.isdir(self._metadata_fragments_abspath):
            os.mkdir(self._metadata_fragments_abspath)

        prefix = self._handle_to_fragment_absprefixpath(handle)
        fpath = prefix + '.{}.json'.format(key)

        with open(fpath, 'w') as fh:
            json.dump(value, fh)
435617
def add_item_metadata(self, handle, key, value):
        
        _mkdir_if_missing(self._metadata_fragments_abspath)

        prefix = self._handle_to_fragment_absprefixpath(handle)
        fpath = prefix + '.{}.json'.format(key)

        _put_obj(fpath, value)
660271
@Override
  public void addUserMetadata(String key, String value)
  {
    userDefinedMetadata.put(key, value);
  }
598715
private function loadCacheMetaData()
    {
        if (isset($this->metaData)) {
            return;
        }

        $metaFile = $this->cacheDirectory . '/cache.meta';
        $this->metaData = array();

        if (file_exists($metaFile)) {
            $this->metaData = unserialize(file_get_contents($metaFile));
        }
    }
1299587
public void setMetadata(String key, Object value) {
        if (value != null) {
            getMetadata().put(key, value);
        }
    }
71374
@Override
    public MetaData<?, ?> readMetaData(IoBuffer buffer) {
        MetaData<?, ?> retMeta = new MetaData<String, Object>();
        Input input = new Input(buffer);
        String metaType = Deserializer.deserialize(input, String.class);
        log.debug("Metadata type: {}", metaType);
        Map<String, ?> m = Deserializer.deserialize(input, Map.class);
        retMeta.putAll(m);
        return retMeta;
    }
1207261
function getMetadata (dir) {
  var json = path.join(dir, 'meta.json')
  var js = path.join(dir, 'meta.js')
  var opts = {}

  if (exists(json)) {
    opts = metadata.sync(json)
  } else if (exists(js)) {
    var req = require(path.resolve(js))
    if (req !== Object(req)) {
      throw new Error('meta.js needs to expose an object')
    }
    opts = req
  }

  return opts
}
908351
@Override
    public void endMetaData(MetaData metadata)
    {
        this.builder.addBlock(new MetaDataBlock(this.builder.endBlockList(), metadata));
    }
1084813
def generatemetadata(self, parameters, parentfile, relevantinputfiles, provenancedata = None):
        """"""
        assert isinstance(provenancedata,CLAMProvenanceData) or provenancedata is None

        data = {}

        if self.copymetadata:
            #Copy parent metadata
            for key, value in parentfile.metadata.items():
                data[key] = value

        for metafield in self.metafields:
            if isinstance(metafield, ParameterCondition):
                metafield = metafield.evaluate(parameters)
                if not metafield:
                    continue
            assert isinstance(metafield, AbstractMetaField)
            metafield.resolve(data, parameters, parentfile, relevantinputfiles)

        if provenancedata:
            data['provenance'] = provenancedata

        return self.formatclass(None, **data)
418547
def _load_metadata(self):
        """"""
        if self._schema is None:
            self._schema = self._get_schema()
            self.datashape = self._schema.datashape
            self.dtype = self._schema.dtype
            self.shape = self._schema.shape
            self.npartitions = self._schema.npartitions
            self.metadata.update(self._schema.extra_metadata)
523285
function storeMetaData(metaData, file) {
	var json
		, stream;

	try {
		json = JSON.stringify(metaData);
		stream = fs.createWriteStream(file);

		stream.write(json);
		stream.end();
	} catch(e) {
		console.error('Could not save meta data for ' + file);
	}
}