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

Function reader_cleanup

gpcontrib/gpcloud/src/gpreader.cpp:152–174  ·  view source on GitHub ↗

invoked by s3_import(), need to be exception safe

Source from the content-addressed store, hash-verified

150
151// invoked by s3_import(), need to be exception safe
152bool reader_cleanup(GPReader** reader) {
153 bool result = true;
154 try {
155 if (*reader) {
156 (*reader)->close();
157 delete *reader;
158 *reader = NULL;
159 } else {
160 result = false;
161 }
162 } catch (S3Exception& e) {
163 s3extErrorMessage =
164 "reader_cleanup caught a " + e.getType() + " exception: " + e.getFullMessage();
165 S3ERROR("reader_cleanup caught %s: %s", e.getType().c_str(), s3extErrorMessage.c_str());
166 result = false;
167 } catch (...) {
168 S3ERROR("Caught an unexpected exception.");
169 s3extErrorMessage = "Caught an unexpected exception.";
170 result = false;
171 }
172
173 return result;
174}

Callers 3

destroyGpcloudResHandleFunction · 0.85
checkConfigFunction · 0.85
downloadS3Function · 0.85

Calls 3

getFullMessageMethod · 0.80
closeMethod · 0.45
getTypeMethod · 0.45

Tested by

no test coverage detected