MCPcopy Create free account
hub / github.com/apache/cloudberry / abortUpload

Method abortUpload

gpcontrib/gpcloud/src/s3interface.cpp:563–594  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

561}
562
563bool S3InterfaceService::abortUpload(const S3Url &s3Url, const string &uploadId) {
564 HTTPHeaders headers;
565 stringstream queryString;
566
567 headers.Add(HOST, s3Url.getHostForCurl());
568 headers.Disable(CONTENTTYPE);
569 headers.Disable(CONTENTLENGTH);
570 headers.Add(X_AMZ_CONTENT_SHA256,
571 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"); // sha256hex
572 // of empty
573 // string
574
575 queryString << "uploadId=" << uploadId;
576
577 // DELETE /ObjectName?uploadId=UploadId HTTP/1.1
578 SignRequestV4("DELETE", &headers, s3Url.getRegion(), s3Url.getPathForCurl(), queryString.str(),
579 this->params.getCred());
580
581 stringstream urlWithQuery;
582 urlWithQuery << s3Url.getFullUrlForCurl() << "?uploadId=" << uploadId;
583
584 Response resp = this->deleteRequestWithRetries(urlWithQuery.str(), headers);
585
586 if (resp.getStatus() == RESPONSE_OK) {
587 return true;
588 } else if (resp.getStatus() == RESPONSE_ERROR) {
589 S3MessageParser s3msg(resp);
590 S3_DIE(S3LogicError, s3msg.getCode(), s3msg.getMessage());
591 } else {
592 S3_DIE(S3RuntimeError, "unexpected response status");
593 }
594}

Callers 2

TEST_FFunction · 0.80

Calls 11

SignRequestV4Function · 0.85
getHostForCurlMethod · 0.80
DisableMethod · 0.80
getPathForCurlMethod · 0.80
getFullUrlForCurlMethod · 0.80
getStatusMethod · 0.80
AddMethod · 0.45
strMethod · 0.45
getCodeMethod · 0.45
getMessageMethod · 0.45

Tested by 1

TEST_FFunction · 0.64