public interface SmartResourceLocalizer extends ResourceLocalizer
SmartResourceLocalizer
provides additional functionality on
top of ResourceLocalizer
order to handle more fine grained
handling of resource localizing.
These smart functionalities includes of controlling localizing process manually, copy files into file system prior the localization and use staging concept of application files.
Logic of having methods for manually resolving, distributing and
copying resources is to have an early possibility to fail fast
if something goes wrong. Although one need to remember that on
all circumstances calling ResourceLocalizer.getResources()
should always be enough.
ResourceLocalizer
Modifier and Type | Method and Description |
---|---|
boolean |
clean()
Cleans all leftovers what has been created during
the distribute process.
|
void |
copy()
If resource localizer has knowledge to copy files
into file system, calling this method effectively
should do all tasks for that specific functionality.
|
void |
distribute()
If underlying implementation needs to do operations
on file system or any other preparation work,
calling of this method should make implementation
ready to return resources from
ResourceLocalizer.getResources()
command. |
void |
resolve()
Manually resolve resources before distribution process
is initiated.
|
void |
setStagingDirectory(org.apache.hadoop.fs.Path stagingDirectory)
Sets the staging directory.
|
void |
setStagingId(java.lang.String stagingId)
Sets the staging id.
|
getResources
void distribute()
ResourceLocalizer.getResources()
command.
Effectively result of calling this method should be same as calling both copy() and resolve() methods manually.
void resolve()
void copy()
boolean clean()
void setStagingDirectory(org.apache.hadoop.fs.Path stagingDirectory)
stagingDirectory
- the new staging directoryvoid setStagingId(java.lang.String stagingId)
Path
set in setStagingDirectory(Path)
to post fix unique
runtime staging path. If not set simultaneous instances of
same application may override files.stagingId
- the new staging id