public class DefaultMultiResourceLocalizer extends java.lang.Object implements MultiResourceLocalizer
MultiResourceLocalizer
.Constructor and Description |
---|
DefaultMultiResourceLocalizer(ResourceLocalizer localizer,
java.util.Map<java.lang.String,ResourceLocalizer> localizers)
Instantiates a new default multi resource localizer.
|
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,org.apache.hadoop.yarn.api.records.LocalResource> |
getResources()
Gets a map of
LocalResource instances. |
java.util.Map<java.lang.String,org.apache.hadoop.yarn.api.records.LocalResource> |
getResources(java.lang.String id)
Gets a map of
LocalResource instances identified by
an arbitrary id. |
public DefaultMultiResourceLocalizer(ResourceLocalizer localizer, java.util.Map<java.lang.String,ResourceLocalizer> localizers)
localizer
- the default localizerlocalizers
- the custom localizerspublic java.util.Map<java.lang.String,org.apache.hadoop.yarn.api.records.LocalResource> getResources()
ResourceLocalizer
LocalResource
instances. Underlying
instances of LocalResource
s needs to be fully
initialised including resource size and timestamp.
Calling this method should do all needed preparation work
needed to return LocalResource
s.
getResources
in interface ResourceLocalizer
LocalResource
instancespublic java.util.Map<java.lang.String,org.apache.hadoop.yarn.api.records.LocalResource> getResources(java.lang.String id)
MultiResourceLocalizer
LocalResource
instances identified by
an arbitrary id. Passing null
or unknown id
will fall back to base method ResourceLocalizer.getResources()
.getResources
in interface MultiResourceLocalizer
id
- identifier for local resourcesLocalResource
instancesResourceLocalizer.getResources()