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

Function reader_transfer_data

gpcontrib/gpcloud/src/gpreader.cpp:126–149  ·  view source on GitHub ↗

invoked by s3_import(), need to be exception safe

Source from the content-addressed store, hash-verified

124
125// invoked by s3_import(), need to be exception safe
126bool reader_transfer_data(GPReader* reader, char* data_buf, int& data_len) {
127 try {
128 if (!reader || !data_buf || (data_len <= 0)) {
129 return false;
130 }
131
132 uint64_t read_len = reader->read(data_buf, data_len);
133
134 // sure read_len <= data_len here, hence truncation will never happen
135 data_len = (int)read_len;
136 } catch (S3Exception& e) {
137 s3extErrorMessage =
138 "reader_transfer_data caught a " + e.getType() + " exception: " + e.getFullMessage();
139 S3ERROR("reader_transfer_data caught %s: %s", e.getType().c_str(),
140 s3extErrorMessage.c_str());
141 return false;
142 } catch (...) {
143 S3ERROR("Caught an unexpected exception.");
144 s3extErrorMessage = "Caught an unexpected exception.";
145 return false;
146 }
147
148 return true;
149}
150
151// invoked by s3_import(), need to be exception safe
152bool reader_cleanup(GPReader** reader) {

Callers 2

s3_importFunction · 0.85
downloadS3Function · 0.85

Calls 3

getFullMessageMethod · 0.80
readMethod · 0.45
getTypeMethod · 0.45

Tested by

no test coverage detected