MCPcopy Index your code
hub / github.com/scality/cloudserver / getMasterState

Function getMasterState

lib/api/apiUtils/object/versioning.js:298–319  ·  view source on GitHub ↗

* Build the state of the master version from its object metadata * * @param {object} objMD - object metadata parsed from JSON * * @return {object} state of master version, with the following attributes: * - {boolean} exists - true if the object exists (i.e. if `objMD` is truish) * - {string} v

(objMD)

Source from the content-addressed store, hash-verified

296 * - {array} objLocation - array of data locations
297 */
298function getMasterState(objMD) {
299 if (!objMD) {
300 return {};
301 }
302
303 const mst = {
304 exists: true,
305 versionId: objMD.versionId,
306 uploadId: objMD.uploadId,
307 isNull: objMD.isNull,
308 isNull2: objMD.isNull2,
309 nullVersionId: objMD.nullVersionId,
310 nullUploadId: objMD.nullUploadId,
311 };
312
313 if (objMD.location) {
314 mst.objLocation = Array.isArray(objMD.location) ?
315 objMD.location : [objMD.location];
316 }
317
318 return mst;
319}
320/** versioningPreprocessing - return versioning information for S3 to handle
321 * creation of new versions and manage deletion of old data and metadata
322 * @param {string} bucketName - name of bucket

Callers 2

versioningPreprocessingFunction · 0.85
versioning.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected