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

Function BufFilePledgeSequential

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

* BufFilePledgeSequential * * Promise that the caller will only do sequential I/O on the given file. * This allows the BufFile to be compressed, if 'gp_workfile_compression=on'. * * A sequential file is used in two stages: * * 0. Create file with BufFileCreateTemp(). * 1. Write all data, using BufFileWrite() * 2. Rewind to beginning, with BufFileSeek(file, 0, 0, SEEK_SET). * 3. Read as m

Source from the content-addressed store, hash-verified

1258 * that use buffiles across processes pledge sequential access, though.)
1259 */
1260void
1261BufFilePledgeSequential(BufFile *buffile)
1262{
1263 if (BufFileSize(buffile) != 0)
1264 elog(ERROR, "cannot pledge sequential access to a temporary file after writing it");
1265
1266 if (gp_workfile_compression)
1267 BufFileStartCompression(buffile);
1268}
1269
1270/*
1271 * The rest of the code is only needed when compression support is compiled in.

Callers 1

ExecHashJoinSaveTupleFunction · 0.85

Calls 2

BufFileSizeFunction · 0.85
BufFileStartCompressionFunction · 0.85

Tested by

no test coverage detected