mirror of https://github.com/citusdata/citus.git
Rename RemoveDirectory -> CitusRemoveDirectory
parent
06f756b0a1
commit
aa2ab023a2
|
@ -145,7 +145,7 @@ void
|
||||||
RemoveJobDirectory(uint64 jobId)
|
RemoveJobDirectory(uint64 jobId)
|
||||||
{
|
{
|
||||||
StringInfo jobDirectoryName = MasterJobDirectoryName(jobId);
|
StringInfo jobDirectoryName = MasterJobDirectoryName(jobId);
|
||||||
RemoveDirectory(jobDirectoryName);
|
CitusRemoveDirectory(jobDirectoryName);
|
||||||
|
|
||||||
ResourceOwnerForgetJobDirectory(CurrentResourceOwner, jobId);
|
ResourceOwnerForgetJobDirectory(CurrentResourceOwner, jobId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -340,7 +340,7 @@ TrackerCleanupJobDirectories(void)
|
||||||
StringInfo jobCacheDirectory = makeStringInfo();
|
StringInfo jobCacheDirectory = makeStringInfo();
|
||||||
appendStringInfo(jobCacheDirectory, "base/%s", PG_JOB_CACHE_DIR);
|
appendStringInfo(jobCacheDirectory, "base/%s", PG_JOB_CACHE_DIR);
|
||||||
|
|
||||||
RemoveDirectory(jobCacheDirectory);
|
CitusRemoveDirectory(jobCacheDirectory);
|
||||||
CreateDirectory(jobCacheDirectory);
|
CreateDirectory(jobCacheDirectory);
|
||||||
|
|
||||||
FreeStringInfo(jobCacheDirectory);
|
FreeStringInfo(jobCacheDirectory);
|
||||||
|
|
|
@ -211,7 +211,7 @@ task_tracker_cleanup_job(PG_FUNCTION_ARGS)
|
||||||
* writing to a table within the schema.
|
* writing to a table within the schema.
|
||||||
*/
|
*/
|
||||||
jobDirectoryName = JobDirectoryName(jobId);
|
jobDirectoryName = JobDirectoryName(jobId);
|
||||||
RemoveDirectory(jobDirectoryName);
|
CitusRemoveDirectory(jobDirectoryName);
|
||||||
|
|
||||||
LockJobResource(jobId, AccessExclusiveLock);
|
LockJobResource(jobId, AccessExclusiveLock);
|
||||||
jobSchemaName = JobSchemaName(jobId);
|
jobSchemaName = JobSchemaName(jobId);
|
||||||
|
|
|
@ -152,7 +152,7 @@ worker_range_partition_table(PG_FUNCTION_ARGS)
|
||||||
|
|
||||||
/* close partition files and atomically rename (commit) them */
|
/* close partition files and atomically rename (commit) them */
|
||||||
ClosePartitionFiles(partitionFileArray, fileCount);
|
ClosePartitionFiles(partitionFileArray, fileCount);
|
||||||
RemoveDirectory(taskDirectory);
|
CitusRemoveDirectory(taskDirectory);
|
||||||
RenameDirectory(taskAttemptDirectory, taskDirectory);
|
RenameDirectory(taskAttemptDirectory, taskDirectory);
|
||||||
|
|
||||||
PG_RETURN_VOID();
|
PG_RETURN_VOID();
|
||||||
|
@ -213,7 +213,7 @@ worker_hash_partition_table(PG_FUNCTION_ARGS)
|
||||||
|
|
||||||
/* close partition files and atomically rename (commit) them */
|
/* close partition files and atomically rename (commit) them */
|
||||||
ClosePartitionFiles(partitionFileArray, fileCount);
|
ClosePartitionFiles(partitionFileArray, fileCount);
|
||||||
RemoveDirectory(taskDirectory);
|
CitusRemoveDirectory(taskDirectory);
|
||||||
RenameDirectory(taskAttemptDirectory, taskDirectory);
|
RenameDirectory(taskAttemptDirectory, taskDirectory);
|
||||||
|
|
||||||
PG_RETURN_VOID();
|
PG_RETURN_VOID();
|
||||||
|
@ -615,13 +615,13 @@ CreateDirectory(StringInfo directoryName)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* RemoveDirectory first checks if the given directory exists. If it does, the
|
* CitusRemoveDirectory first checks if the given directory exists. If it does, the
|
||||||
* function recursively deletes the contents of the given directory, and then
|
* function recursively deletes the contents of the given directory, and then
|
||||||
* deletes the directory itself. This function is modeled on the Boost file
|
* deletes the directory itself. This function is modeled on the Boost file
|
||||||
* system library's remove_all() method.
|
* system library's remove_all() method.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
RemoveDirectory(StringInfo filename)
|
CitusRemoveDirectory(StringInfo filename)
|
||||||
{
|
{
|
||||||
struct stat fileStat;
|
struct stat fileStat;
|
||||||
int removed = 0;
|
int removed = 0;
|
||||||
|
@ -674,7 +674,7 @@ RemoveDirectory(StringInfo filename)
|
||||||
fullFilename = makeStringInfo();
|
fullFilename = makeStringInfo();
|
||||||
appendStringInfo(fullFilename, "%s/%s", directoryName, baseFilename);
|
appendStringInfo(fullFilename, "%s/%s", directoryName, baseFilename);
|
||||||
|
|
||||||
RemoveDirectory(fullFilename);
|
CitusRemoveDirectory(fullFilename);
|
||||||
|
|
||||||
FreeStringInfo(fullFilename);
|
FreeStringInfo(fullFilename);
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,7 +115,7 @@ extern bool CacheDirectoryElement(const char *filename);
|
||||||
extern bool JobDirectoryElement(const char *filename);
|
extern bool JobDirectoryElement(const char *filename);
|
||||||
extern bool DirectoryExists(StringInfo directoryName);
|
extern bool DirectoryExists(StringInfo directoryName);
|
||||||
extern void CreateDirectory(StringInfo directoryName);
|
extern void CreateDirectory(StringInfo directoryName);
|
||||||
extern void RemoveDirectory(StringInfo filename);
|
extern void CitusRemoveDirectory(StringInfo filename);
|
||||||
extern StringInfo InitTaskDirectory(uint64 jobId, uint32 taskId);
|
extern StringInfo InitTaskDirectory(uint64 jobId, uint32 taskId);
|
||||||
extern void RemoveJobSchema(StringInfo schemaName);
|
extern void RemoveJobSchema(StringInfo schemaName);
|
||||||
extern Datum * DeconstructArrayObject(ArrayType *arrayObject);
|
extern Datum * DeconstructArrayObject(ArrayType *arrayObject);
|
||||||
|
|
Loading…
Reference in New Issue