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

Function writer_cleanup

gpcontrib/gpcloud/src/gpwriter.cpp:132–154  ·  view source on GitHub ↗

invoked by s3_export(), need to be exception safe

Source from the content-addressed store, hash-verified

130
131// invoked by s3_export(), need to be exception safe
132bool writer_cleanup(GPWriter** writer) {
133 bool result = true;
134 try {
135 if (*writer) {
136 (*writer)->close();
137 delete *writer;
138 *writer = NULL;
139 } else {
140 result = false;
141 }
142 } catch (S3Exception& e) {
143 s3extErrorMessage =
144 "writer_cleanup caught a " + e.getType() + " exception: " + e.getFullMessage();
145 S3ERROR("writer_cleanup caught %s: %s", e.getType().c_str(), s3extErrorMessage.c_str());
146 result = false;
147 } catch (...) {
148 S3ERROR("Caught an unexpected exception.");
149 s3extErrorMessage = "Caught an unexpected exception.";
150 result = false;
151 }
152
153 return result;
154}

Callers 2

destroyGpcloudResHandleFunction · 0.85
uploadS3Function · 0.85

Calls 3

getFullMessageMethod · 0.80
closeMethod · 0.45
getTypeMethod · 0.45

Tested by

no test coverage detected