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(org.apache.hadoop.conf.Configuration configuration,
java.util.Collection<LocalResourcesFactoryBean.TransferEntry> transferEntries,
java.util.Collection<LocalResourcesFactoryBean.CopyEntry> copyEntries)
Instantiates a new default resource localizer.
|
DefaultResourceLocalizer(org.apache.hadoop.conf.Configuration configuration,
java.util.Collection<LocalResourcesFactoryBean.TransferEntry> transferEntries,
java.util.Collection<LocalResourcesFactoryBean.CopyEntry> copyEntries,
org.apache.hadoop.fs.Path stagingDirectory)
Instantiates a new default resource localizer.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
AddRawContent(java.lang.String key,
byte[] value)
Adds a content into a to be written entries.
|
protected void |
doFileCopy(org.apache.hadoop.fs.FileSystem fs)
Do file copy.
|
protected java.util.Map<java.lang.String,org.apache.hadoop.yarn.api.records.LocalResource> |
doFileTransfer(org.apache.hadoop.fs.FileSystem fs)
Do file transfer.
|
void |
setRawFileContents(java.util.Map<java.lang.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(org.apache.hadoop.conf.Configuration configuration,
java.util.Collection<LocalResourcesFactoryBean.TransferEntry> transferEntries,
java.util.Collection<LocalResourcesFactoryBean.CopyEntry> copyEntries)
configuration - the configurationtransferEntries - the transfer entriescopyEntries - the copy entriespublic DefaultResourceLocalizer(org.apache.hadoop.conf.Configuration configuration,
java.util.Collection<LocalResourcesFactoryBean.TransferEntry> transferEntries,
java.util.Collection<LocalResourcesFactoryBean.CopyEntry> copyEntries,
org.apache.hadoop.fs.Path stagingDirectory)
configuration - the configurationtransferEntries - the transfer entriescopyEntries - the copy entriesstagingDirectory - the staging directorypublic boolean AddRawContent(java.lang.String key,
byte[] value)
key - the key considered as a file namevalue - the content of a file to be writtenpublic void setRawFileContents(java.util.Map<java.lang.String,byte[]> rawFileContents)
rawFileContents - the raw file contentsprotected void doFileCopy(org.apache.hadoop.fs.FileSystem fs)
throws java.lang.Exception
AbstractResourceLocalizerdoFileCopy in class AbstractResourceLocalizerfs - the fsjava.lang.Exception - the exceptionprotected java.util.Map<java.lang.String,org.apache.hadoop.yarn.api.records.LocalResource> doFileTransfer(org.apache.hadoop.fs.FileSystem fs)
throws java.lang.Exception
AbstractResourceLocalizerdoFileTransfer in class AbstractResourceLocalizerfs - the fsjava.lang.Exception - the exception