public class DefaultResourceLocalizer extends AbstractResourceLocalizer implements SmartResourceLocalizer
ResourceLocalizer which
is only capable of re-using files already in HDFS and preparing
correct parameters for created LocalResource entries.| Constructor and Description |
|---|
DefaultResourceLocalizer(Configuration configuration,
Collection<LocalResourcesFactoryBean.TransferEntry> transferEntries,
Collection<LocalResourcesFactoryBean.CopyEntry> copyEntries)
Instantiates a new default resource localizer.
|
DefaultResourceLocalizer(Configuration configuration,
Collection<LocalResourcesFactoryBean.TransferEntry> transferEntries,
Collection<LocalResourcesFactoryBean.CopyEntry> copyEntries,
Path stagingDirectory)
Instantiates a new default resource localizer.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
AddRawContent(String key,
byte[] value)
Adds a content into a to be written entries.
|
protected void |
doFileCopy(FileSystem fs)
Do file copy.
|
protected Map<String,LocalResource> |
doFileTransfer(FileSystem fs)
Do file transfer.
|
void |
setRawFileContents(Map<String,byte[]> rawFileContents)
Sets the raw file contents.
|
clean, copy, deleteStagingEntries, distribute, getConfiguration, getLock, getResources, isCopied, isDistributed, resolve, resolveStagingDirectory, setCopied, setDistributed, setStagingDirectory, setStagingIdclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclean, copy, distribute, resolve, setStagingDirectory, setStagingIdgetResourcespublic DefaultResourceLocalizer(Configuration configuration, Collection<LocalResourcesFactoryBean.TransferEntry> transferEntries, Collection<LocalResourcesFactoryBean.CopyEntry> copyEntries)
configuration - the configurationtransferEntries - the transfer entriescopyEntries - the copy entriespublic DefaultResourceLocalizer(Configuration configuration, Collection<LocalResourcesFactoryBean.TransferEntry> transferEntries, Collection<LocalResourcesFactoryBean.CopyEntry> copyEntries, Path stagingDirectory)
configuration - the configurationtransferEntries - the transfer entriescopyEntries - the copy entriesstagingDirectory - the staging directorypublic boolean AddRawContent(String key, byte[] value)
key - the key considered as a file namevalue - the content of a file to be writtenpublic void setRawFileContents(Map<String,byte[]> rawFileContents)
rawFileContents - the raw file contentsprotected void doFileCopy(FileSystem fs) throws Exception
AbstractResourceLocalizerdoFileCopy in class AbstractResourceLocalizerfs - the fsException - the exceptionprotected Map<String,LocalResource> doFileTransfer(FileSystem fs) throws Exception
AbstractResourceLocalizerdoFileTransfer in class AbstractResourceLocalizerfs - the fsException - the exception