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

Function destroyGpcloudResHandle

gpcontrib/gpcloud/src/gpcloud.cpp:208–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206}
207
208static void destroyGpcloudResHandle(gpcloudResHandle *resHandle) {
209 if (resHandle == NULL) return;
210
211 /* unlink from linked list first */
212 if (resHandle->prev)
213 resHandle->prev->next = resHandle->next;
214 else
215 openedResHandles = resHandle->next;
216
217 if (resHandle->next) {
218 resHandle->next->prev = resHandle->prev;
219 }
220
221 if (resHandle->gpreader != NULL) {
222 if (!reader_cleanup(&resHandle->gpreader)) {
223 elog(WARNING, "Failed to cleanup gpcloud extension: %s", s3extErrorMessage.c_str());
224 }
225 }
226
227 if (resHandle->gpwriter != NULL) {
228 if (!writer_cleanup(&resHandle->gpwriter)) {
229 elog(WARNING, "Failed to cleanup gpcloud extension: %s", s3extErrorMessage.c_str());
230 }
231 }
232
233 thread_cleanup();
234 pfree(resHandle);
235}
236
237/*
238 * Close any open handles on abort.

Callers 3

gpcloudAbortCallbackFunction · 0.85
s3_importFunction · 0.85
s3_exportFunction · 0.85

Calls 4

reader_cleanupFunction · 0.85
writer_cleanupFunction · 0.85
thread_cleanupFunction · 0.85
pfreeFunction · 0.50

Tested by

no test coverage detected