public class FileCache extends Object
<system-tmp-dir>/tmp_<jobID>/
".Modifier and Type | Method and Description |
---|---|
static void |
copy(Path sourcePath,
Path targetPath,
boolean executable) |
Future<Path> |
createTmpFile(String name,
DistributedCache.DistributedCacheEntry entry,
JobID jobID)
If the file doesn't exists locally, it will copy the file to the temp directory.
|
void |
deleteTmpFile(String name,
JobID jobID)
Deletes the local file after a 5 second delay.
|
void |
shutdown()
Shuts down the file cache by cancelling all.
|
public FileCache(String[] tempDirectories) throws IOException
IOException
public void shutdown()
public Future<Path> createTmpFile(String name, DistributedCache.DistributedCacheEntry entry, JobID jobID)
name
- The name under which the file is registered.entry
- The cache entry descriptor (path, executable flag)jobID
- The ID of the job for which the file is copied.public void deleteTmpFile(String name, JobID jobID)
name
- The name under which the file is registered.jobID
- The ID of the job for which the file is copied.public static void copy(Path sourcePath, Path targetPath, boolean executable) throws IOException
IOException
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.