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

Method getUploadId

gpcontrib/gpcloud/src/s3interface.cpp:428–459  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

426}
427
428string S3InterfaceService::getUploadId(const S3Url &s3Url) {
429 HTTPHeaders headers;
430
431 headers.Add(HOST, s3Url.getHostForCurl());
432 headers.Disable(CONTENTTYPE);
433 headers.Disable(CONTENTLENGTH);
434 headers.Add(X_AMZ_CONTENT_SHA256,
435 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"); // sha256hex
436 // of empty
437 // string
438 if (params.getSSEType() == SSE_S3) {
439 headers.Add(X_AMZ_SERVER_SIDE_ENCRYPTION, "AES256");
440 }
441
442 SignRequestV4("POST", &headers, s3Url.getRegion(), s3Url.getPathForCurl(),
443 "uploads=", this->params.getCred());
444
445 stringstream urlWithQuery;
446 urlWithQuery << s3Url.getFullUrlForCurl() << "?uploads";
447
448 Response resp = this->postResponseWithRetries(urlWithQuery.str(), headers, vector<uint8_t>());
449 S3MessageParser s3msg(resp);
450
451 if (resp.getStatus() == RESPONSE_OK) {
452 return s3msg.parseS3Tag("UploadId");
453 } else if (resp.getStatus() == RESPONSE_ERROR) {
454 S3MessageParser s3msg(resp);
455 S3_DIE(S3LogicError, s3msg.getCode(), s3msg.getMessage());
456 } else {
457 S3_DIE(S3RuntimeError, "unexpected response status");
458 }
459}
460
461string S3InterfaceService::uploadPartOfData(S3VectorUInt8 &data, const S3Url &s3Url,
462 uint64_t partNumber, const string &uploadId) {

Callers 2

TEST_FFunction · 0.80
openMethod · 0.80

Calls 12

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

Tested by 1

TEST_FFunction · 0.64