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

Method open

gpcontrib/gpcloud/src/s3key_writer.cpp:3–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include "s3key_writer.h"
2
3void S3KeyWriter::open(const S3Params& params) {
4 this->params = params;
5
6 S3_CHECK_OR_DIE(this->s3Interface != NULL, S3RuntimeError, "s3Interface must not be NULL");
7 S3_CHECK_OR_DIE(this->params.getChunkSize() > 0, S3RuntimeError, "chunkSize must not be zero");
8
9 buffer.reserve(this->params.getChunkSize());
10
11 this->uploadId = this->s3Interface->getUploadId(this->params.getS3Url());
12 S3_CHECK_OR_DIE(!this->uploadId.empty(), S3RuntimeError, "Failed to get upload id");
13
14 S3DEBUG("key: %s, upload id: %s", this->params.getS3Url().getFullUrlForCurl().c_str(),
15 this->uploadId.c_str());
16}
17
18// write() first fills up the data buffer before flush it out
19uint64_t S3KeyWriter::write(const char* buf, uint64_t count) {

Callers

nothing calls this directly

Calls 3

getUploadIdMethod · 0.80
getFullUrlForCurlMethod · 0.80
getChunkSizeMethod · 0.45

Tested by

no test coverage detected