* Returns if a CompleteMPU operation is in progress for this * object, by looking at the `completeInProgress` flag stored in * the overview key * * @param {object} params - params object * @param {string} params.bucketName - bucket name where object should be stored * @
(params, log, cb)
| 669 | * @return {undefined} |
| 670 | */ |
| 671 | isCompleteMPUInProgress(params, log, cb) { |
| 672 | assert.strictEqual(typeof params, 'object'); |
| 673 | assert.strictEqual(typeof params.bucketName, 'string'); |
| 674 | assert.strictEqual(typeof params.objectKey, 'string'); |
| 675 | assert.strictEqual(typeof params.uploadId, 'string'); |
| 676 | assert.strictEqual(typeof params.splitter, 'string'); |
| 677 | |
| 678 | const mpuBucketName = `${constants.mpuBucketPrefix}${params.bucketName}`; |
| 679 | const splitter = params.splitter; |
| 680 | const mpuOverviewKey = |
| 681 | `overview${splitter}${params.objectKey}${splitter}${params.uploadId}`; |
| 682 | return metadata.getObjectMD(mpuBucketName, mpuOverviewKey, {}, log, |
| 683 | (err, res) => { |
| 684 | if (err) { |
| 685 | log.error('error getting the overview object from mpu bucket', { |
| 686 | error: err, |
| 687 | method: 'services.isCompleteMPUInProgress', |
| 688 | params, |
| 689 | }); |
| 690 | return cb(err); |
| 691 | } |
| 692 | return cb(null, Boolean(res.completeInProgress)); |
| 693 | }); |
| 694 | }, |
| 695 | |
| 696 | /** |
| 697 | * Checks whether bucket exists, multipart upload |