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

Method open

gpcontrib/gpcloud/src/s3key_reader.cpp:184–211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182}
183
184void S3KeyReader::open(const S3Params& params) {
185 S3_CHECK_OR_DIE(this->s3Interface != NULL, S3RuntimeError, "s3Interface must not be NULL");
186
187 this->sharedError = false;
188
189 this->numOfChunks = params.getNumOfChunks();
190 S3_CHECK_OR_DIE(this->numOfChunks > 0, S3RuntimeError, "numOfChunks must not be zero");
191
192 this->offsetMgr.setKeySize(params.getKeySize());
193 this->offsetMgr.setChunkSize(params.getChunkSize());
194
195 S3_CHECK_OR_DIE(params.getChunkSize() > 0, S3RuntimeError,
196 "chunk size must be greater than zero");
197
198 this->chunkBuffers.reserve(this->numOfChunks);
199
200 for (uint64_t i = 0; i < this->numOfChunks; i++) {
201 this->chunkBuffers.emplace_back(params.getS3Url(), *this, params.getMemoryContext());
202 }
203
204 for (uint64_t i = 0; i < this->numOfChunks; i++) {
205 this->chunkBuffers[i].setS3InterfaceService(this->s3Interface);
206
207 pthread_t thread;
208 pthread_create(&thread, NULL, DownloadThreadFunc, &this->chunkBuffers[i]);
209 this->threads.push_back(thread);
210 }
211}
212
213uint64_t S3KeyReader::read(char* buf, uint64_t count) {
214 uint64_t fileLen = this->offsetMgr.getKeySize();

Callers

nothing calls this directly

Calls 6

getNumOfChunksMethod · 0.80
setKeySizeMethod · 0.45
getKeySizeMethod · 0.45
setChunkSizeMethod · 0.45
getChunkSizeMethod · 0.45
setS3InterfaceServiceMethod · 0.45

Tested by

no test coverage detected