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

Method open

gpcontrib/gpcloud/src/s3common_reader.cpp:3–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include "s3common_reader.h"
2
3void S3CommonReader::open(const S3Params &params) {
4 this->keyReader.setS3InterfaceService(s3InterfaceService);
5
6 S3CompressionType compressionType = s3InterfaceService->checkCompressionType(params.getS3Url());
7
8 switch (compressionType) {
9 case S3_COMPRESSION_DEFLATE:
10 case S3_COMPRESSION_GZIP:
11 this->upstreamReader = &this->decompressReader;
12 this->decompressReader.setReader(&this->keyReader);
13 break;
14 case S3_COMPRESSION_PLAIN:
15 this->upstreamReader = &this->keyReader;
16 break;
17 default:
18 S3_CHECK_OR_DIE(false, S3RuntimeError, "unknown file type");
19 };
20
21 this->upstreamReader->open(params);
22}
23
24// read() attempts to read up to count bytes into the buffer.
25// Return 0 if EOF. Throw exception if encounters errors.

Callers

nothing calls this directly

Calls 3

checkCompressionTypeMethod · 0.80
setReaderMethod · 0.80
setS3InterfaceServiceMethod · 0.45

Tested by

no test coverage detected