public class FileCache extends Object
Files and zipped directories are retrieved from the PermanentBlobService
. The
life-cycle of these files is managed by the blob-service.
Retrieved directories will be expanded in "<system-tmp-dir>/tmp_<jobID>/
" and deleted
when the task is unregistered after a 5 second delay, unless a new task requests the file in the
meantime.
Constructor and Description |
---|
FileCache(String[] tempDirectories,
PermanentBlobService blobService) |
Modifier and Type | Method and Description |
---|---|
Future<Path> |
createTmpFile(String name,
DistributedCache.DistributedCacheEntry entry,
JobID jobID,
ExecutionAttemptID executionId)
If the file doesn't exists locally, retrieve the file from the blob-service.
|
void |
releaseJob(JobID jobId,
ExecutionAttemptID executionId) |
void |
shutdown()
Shuts down the file cache by cancelling all.
|
public FileCache(String[] tempDirectories, PermanentBlobService blobService) throws IOException
IOException
public void shutdown()
public Future<Path> createTmpFile(String name, DistributedCache.DistributedCacheEntry entry, JobID jobID, ExecutionAttemptID executionId) throws Exception
entry
- The cache entry descriptor (path, executable flag)jobID
- The ID of the job for which the file is copied.Exception
public void releaseJob(JobID jobId, ExecutionAttemptID executionId)
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.