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

Function BufFileCreateShared

src/backend/storage/file/buffile.c:360–381  ·  view source on GitHub ↗

* Create a BufFile that can be discovered and opened read-only by other * backends that are attached to the same SharedFileSet using the same name. * * The naming scheme for shared BufFiles is left up to the calling code. The * name will appear as part of one or more filenames on disk, and might * provide clues to administrators about which subsystem is generating * temporary file data. Si

Source from the content-addressed store, hash-verified

358 * unrelated SharedFileSet objects.
359 */
360BufFile *
361BufFileCreateShared(SharedFileSet *fileset, const char *name, workfile_set *work_set)
362{
363 BufFile *file;
364
365 file = makeBufFileCommon(1);
366 file->fileset = fileset;
367 file->name = pstrdup(name);
368 file->files = (File *) palloc(sizeof(File));
369 file->files[0] = MakeNewSharedSegment(file, 0);
370 file->readOnly = false;
371 /*
372 * Register the file as a "work file", so that the Cloudberry workfile
373 * limits apply to it.
374 */
375 file->work_set = work_set;
376
377 FileSetIsWorkfile(file->files[0]);
378 RegisterFileWithSet(file->files[0], work_set);
379
380 return file;
381}
382
383/*
384 * Open a file that was previously created in another backend (or this one)

Callers 6

tuplestore_make_sharedFunction · 0.85
tuplestore_make_sharedV2Function · 0.85
sts_puttupleFunction · 0.85
LogicalTapeSetCreateFunction · 0.85
subxact_info_writeFunction · 0.85
stream_open_fileFunction · 0.85

Calls 6

makeBufFileCommonFunction · 0.85
MakeNewSharedSegmentFunction · 0.85
FileSetIsWorkfileFunction · 0.85
RegisterFileWithSetFunction · 0.85
pstrdupFunction · 0.50
pallocFunction · 0.50

Tested by

no test coverage detected