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

Function SharedFileSetCreate

src/backend/storage/file/sharedfileset.c:153–176  ·  view source on GitHub ↗

* Create a new file in the given set. */

Source from the content-addressed store, hash-verified

151 * Create a new file in the given set.
152 */
153File
154SharedFileSetCreate(SharedFileSet *fileset, const char *name)
155{
156 char path[MAXPGPATH];
157 File file;
158
159 SharedFilePath(path, fileset, name);
160 file = PathNameCreateTemporaryFile(path, false);
161
162 /* If we failed, see if we need to create the directory on demand. */
163 if (file <= 0)
164 {
165 char tempdirpath[MAXPGPATH];
166 char filesetpath[MAXPGPATH];
167 Oid tablespace = ChooseTablespace(fileset, name);
168
169 TempTablespacePath(tempdirpath, tablespace);
170 SharedFileSetPath(filesetpath, fileset, tablespace);
171 PathNameCreateTemporaryDir(tempdirpath, filesetpath);
172 file = PathNameCreateTemporaryFile(path, true);
173 }
174
175 return file;
176}
177
178/*
179 * Open a file that was created with SharedFileSetCreate(), possibly in

Callers 1

MakeNewSharedSegmentFunction · 0.85

Calls 6

SharedFilePathFunction · 0.85
ChooseTablespaceFunction · 0.85
TempTablespacePathFunction · 0.85
SharedFileSetPathFunction · 0.85

Tested by

no test coverage detected