PostgreSQL Source Code
git master
|
#include "storage/fileset.h"
Go to the source code of this file.
Typedefs | |
typedef struct BufFile | BufFile |
Functions | |
BufFile * | BufFileCreateTemp (bool interXact) |
void | BufFileClose (BufFile *file) |
size_t | BufFileRead (BufFile *file, void *ptr, size_t size) |
void | BufFileWrite (BufFile *file, void *ptr, size_t size) |
int | BufFileSeek (BufFile *file, int fileno, off_t offset, int whence) |
void | BufFileTell (BufFile *file, int *fileno, off_t *offset) |
int | BufFileSeekBlock (BufFile *file, long blknum) |
int64 | BufFileSize (BufFile *file) |
long | BufFileAppend (BufFile *target, BufFile *source) |
BufFile * | BufFileCreateFileSet (FileSet *fileset, const char *name) |
void | BufFileExportFileSet (BufFile *file) |
BufFile * | BufFileOpenFileSet (FileSet *fileset, const char *name, int mode, bool missing_ok) |
void | BufFileDeleteFileSet (FileSet *fileset, const char *name, bool missing_ok) |
void | BufFileTruncateFileSet (BufFile *file, int fileno, off_t offset) |
Definition at line 872 of file buffile.c.
References Assert(), BUFFILE_SEG_SIZE, elog, ERROR, BufFile::files, BufFile::fileset, i, BufFile::numFiles, repalloc(), BufFile::resowner, and source.
Referenced by LogicalTapeImport().
void BufFileClose | ( | BufFile * | file | ) |
Definition at line 407 of file buffile.c.
References BufFileFlush(), FileClose(), BufFile::files, i, BufFile::numFiles, and pfree().
Referenced by apply_handle_stream_abort(), apply_spooled_messages(), ExecHashJoinNewBatch(), ExecHashTableDestroy(), gistFreeBuildBuffers(), LogicalTapeSetClose(), SendBackupManifest(), stream_close_file(), sts_end_parallel_scan(), sts_end_write(), sts_parallel_scan_next(), subxact_info_read(), subxact_info_write(), tuplestore_clear(), and tuplestore_end().
Definition at line 262 of file buffile.c.
References BufFile::files, BufFile::fileset, makeBufFileCommon(), MakeNewFileSetSegment(), BufFile::name, name, palloc(), pstrdup(), and BufFile::readOnly.
Referenced by LogicalTapeSetCreate(), stream_open_file(), sts_puttuple(), and subxact_info_write().
Definition at line 188 of file buffile.c.
References Assert(), BufFile::isInterXact, makeBufFile(), OpenTemporaryFile(), and PrepareTempTablespaces().
Referenced by ExecHashJoinSaveTuple(), gistInitBuildBuffers(), InitializeBackupManifest(), LogicalTapeSetCreate(), and tuplestore_puttuple_common().
Definition at line 359 of file buffile.c.
References CHECK_FOR_INTERRUPTS, elog, ERROR, FileSetDelete(), FileSetSegmentName(), MAXPGPATH, and name.
Referenced by stream_cleanup_files(), and subxact_info_write().
void BufFileExportFileSet | ( | BufFile * | file | ) |
Definition at line 389 of file buffile.c.
References Assert(), BufFileFlush(), BufFile::fileset, and BufFile::readOnly.
Referenced by LogicalTapeFreeze().
Definition at line 286 of file buffile.c.
References CHECK_FOR_INTERRUPTS, ereport, errcode_for_file_access(), errmsg(), ERROR, BufFile::files, BufFile::fileset, FileSetOpen(), FileSetSegmentName(), makeBufFileCommon(), MAXPGPATH, mode, BufFile::name, name, palloc(), pfree(), pstrdup(), BufFile::readOnly, and repalloc().
Referenced by apply_handle_stream_abort(), apply_spooled_messages(), LogicalTapeImport(), stream_open_file(), sts_parallel_scan_next(), subxact_info_read(), and subxact_info_write().
size_t BufFileRead | ( | BufFile * | file, |
void * | ptr, | ||
size_t | size | ||
) |
Definition at line 582 of file buffile.c.
References Assert(), BufFile::buffer, BufFileFlush(), BufFileLoadBuffer(), BufFile::curOffset, PGAlignedBlock::data, BufFile::nbytes, and BufFile::pos.
Referenced by apply_spooled_messages(), ExecHashJoinGetSavedTuple(), getlen(), ltsReadBlock(), ReadTempFileBlock(), readtup_heap(), SendBackupManifest(), sts_parallel_scan_next(), sts_read_tuple(), and subxact_info_read().
int BufFileSeek | ( | BufFile * | file, |
int | fileno, | ||
off_t | offset, | ||
int | whence | ||
) |
Definition at line 689 of file buffile.c.
References BufFileFlush(), BufFile::curFile, BufFile::curOffset, elog, ereport, errcode_for_file_access(), errmsg(), ERROR, FilePathName(), BufFile::files, FileSize(), MAX_PHYSICAL_FILESIZE, BufFile::name, BufFile::nbytes, BufFile::numFiles, and BufFile::pos.
Referenced by BufFileSeekBlock(), ExecHashJoinNewBatch(), SendBackupManifest(), stream_open_file(), tuplestore_copy_read_pointer(), tuplestore_gettuple(), tuplestore_puttuple_common(), tuplestore_rescan(), and tuplestore_select_read_pointer().
int BufFileSeekBlock | ( | BufFile * | file, |
long | blknum | ||
) |
Definition at line 800 of file buffile.c.
References BUFFILE_SEG_SIZE, and BufFileSeek().
Referenced by ltsReadBlock(), ltsWriteBlock(), ReadTempFileBlock(), sts_parallel_scan_next(), and WriteTempFileBlock().
int64 BufFileSize | ( | BufFile * | file | ) |
Definition at line 833 of file buffile.c.
References Assert(), ereport, errcode_for_file_access(), errmsg(), ERROR, FilePathName(), BufFile::files, BufFile::fileset, FileSize(), MAX_PHYSICAL_FILESIZE, BufFile::name, and BufFile::numFiles.
Referenced by LogicalTapeImport().
void BufFileTell | ( | BufFile * | file, |
int * | fileno, | ||
off_t * | offset | ||
) |
Definition at line 782 of file buffile.c.
References BufFile::curFile, BufFile::curOffset, and BufFile::pos.
Referenced by dumptuples(), subxact_info_add(), tuplestore_copy_read_pointer(), tuplestore_gettuple(), tuplestore_puttuple_common(), and tuplestore_select_read_pointer().
void BufFileTruncateFileSet | ( | BufFile * | file, |
int | fileno, | ||
off_t | offset | ||
) |
Definition at line 900 of file buffile.c.
References BufFile::curFile, BufFile::curOffset, ereport, errcode_for_file_access(), errmsg(), ERROR, FileClose(), FilePathName(), BufFile::files, BufFile::fileset, FileSetDelete(), FileSetSegmentName(), FileTruncate(), i, MAX_PHYSICAL_FILESIZE, MAXPGPATH, BufFile::name, BufFile::nbytes, BufFile::numFiles, BufFile::pos, and WAIT_EVENT_BUFFILE_TRUNCATE.
Referenced by apply_handle_stream_abort().
void BufFileWrite | ( | BufFile * | file, |
void * | ptr, | ||
size_t | size | ||
) |
Definition at line 625 of file buffile.c.
References Assert(), BufFile::buffer, BufFileDumpBuffer(), BufFile::curOffset, PGAlignedBlock::data, BufFile::dirty, BufFile::nbytes, BufFile::pos, and BufFile::readOnly.
Referenced by AppendStringToManifest(), ExecHashJoinSaveTuple(), ltsWriteBlock(), stream_write_change(), sts_flush_chunk(), subxact_info_write(), WriteTempFileBlock(), and writetup_heap().