Пример #1
0
/*
 * Creates a new numbered workfile in a given set
 *
 *  The given file_no is used to generate the file name
 */
ExecWorkFile *
workfile_mgr_create_fileno(workfile_set *work_set, uint32 file_no)
{
	Assert(NULL != work_set);

	char file_name[MAXPGPATH];
	retrieve_file_no(work_set, file_no, file_name, sizeof(file_name));
	bool del_on_close = !work_set->can_be_reused;

	ExecWorkFile *ewfile = ExecWorkFile_Create(file_name,
			work_set->metadata.type,
			del_on_close,
			work_set->metadata.bfz_compress_type);

	ExecWorkfile_SetWorkset(ewfile, work_set);

	return ewfile;
}
Пример #2
0
/*
 * Creates a new numbered workfile in a given set
 *
 *  The given file_no is used to generate the file name
 */
ExecWorkFile *
workfile_mgr_create_fileno(workfile_set *work_set, uint32 file_no)
{
	Assert(NULL != work_set);

	char file_name[MAXPGPATH];
	retrieve_file_no(work_set, file_no, file_name, sizeof(file_name));

	ExecWorkFile *ewfile = ExecWorkFile_Create(file_name,
			work_set->metadata.type,
			true /* del_on_close */,
			work_set->metadata.bfz_compress_type);

	SIMPLE_FAULT_INJECTOR(WorkfileCreationFail);

	ExecWorkfile_SetWorkset(ewfile, work_set);

	return ewfile;
}