@Public
@Stable
public abstract class LocalResource
extends java.lang.Object
LocalResource represents a local resource required to
run a container.
The NodeManager is responsible for localizing the resource
prior to launching the container.
Applications can specify LocalResourceType and
LocalResourceVisibility.
| Constructor | Description |
|---|---|
LocalResource() |
| Modifier and Type | Method | Description |
|---|---|---|
abstract java.lang.String |
getPattern() |
Get the pattern that should be used to extract entries from the
archive (only used when type is
PATTERN). |
abstract URL |
getResource() |
Get the location of the resource to be localized.
|
abstract boolean |
getShouldBeUploadedToSharedCache() |
NM uses it to decide whether if it is necessary to upload the resource to
the shared cache
|
abstract long |
getSize() |
Get the size of the resource to be localized.
|
abstract long |
getTimestamp() |
Get the original timestamp of the resource to be localized, used
for verification.
|
abstract LocalResourceType |
getType() |
Get the
LocalResourceType of the resource to be localized. |
abstract LocalResourceVisibility |
getVisibility() |
Get the
LocalResourceVisibility of the resource to be
localized. |
static LocalResource |
newInstance(URL url,
LocalResourceType type,
LocalResourceVisibility visibility,
long size,
long timestamp) |
|
static LocalResource |
newInstance(URL url,
LocalResourceType type,
LocalResourceVisibility visibility,
long size,
long timestamp,
boolean shouldBeUploadedToSharedCache) |
|
static LocalResource |
newInstance(URL url,
LocalResourceType type,
LocalResourceVisibility visibility,
long size,
long timestamp,
java.lang.String pattern) |
|
static LocalResource |
newInstance(URL url,
LocalResourceType type,
LocalResourceVisibility visibility,
long size,
long timestamp,
java.lang.String pattern,
boolean shouldBeUploadedToSharedCache) |
|
abstract void |
setPattern(java.lang.String pattern) |
Set the pattern that should be used to extract entries from the
archive (only used when type is
PATTERN). |
abstract void |
setResource(URL resource) |
Set location of the resource to be localized.
|
abstract void |
setShouldBeUploadedToSharedCache(boolean shouldBeUploadedToSharedCache) |
Inform NM whether upload to SCM is needed.
|
abstract void |
setSize(long size) |
Set the size of the resource to be localized.
|
abstract void |
setTimestamp(long timestamp) |
Set the timestamp of the resource to be localized, used
for verification.
|
abstract void |
setType(LocalResourceType type) |
Set the
LocalResourceType of the resource to be localized. |
abstract void |
setVisibility(LocalResourceVisibility visibility) |
Set the
LocalResourceVisibility of the resource to be
localized. |
@Public @Stable public static LocalResource newInstance(URL url, LocalResourceType type, LocalResourceVisibility visibility, long size, long timestamp, java.lang.String pattern)
@Public @Unstable public static LocalResource newInstance(URL url, LocalResourceType type, LocalResourceVisibility visibility, long size, long timestamp, java.lang.String pattern, boolean shouldBeUploadedToSharedCache)
@Public @Stable public static LocalResource newInstance(URL url, LocalResourceType type, LocalResourceVisibility visibility, long size, long timestamp)
@Public @Unstable public static LocalResource newInstance(URL url, LocalResourceType type, LocalResourceVisibility visibility, long size, long timestamp, boolean shouldBeUploadedToSharedCache)
@Public @Stable public abstract URL getResource()
@Public @Stable public abstract void setResource(URL resource)
resource - location of the resource to be localized@Public @Stable public abstract long getSize()
@Public @Stable public abstract void setSize(long size)
size - size of the resource to be localized@Public @Stable public abstract long getTimestamp()
@Public @Stable public abstract void setTimestamp(long timestamp)
timestamp - timestamp of the resource to be localized@Public @Stable public abstract LocalResourceType getType()
LocalResourceType of the resource to be localized.LocalResourceType of the resource to be localized@Public @Stable public abstract void setType(LocalResourceType type)
LocalResourceType of the resource to be localized.type - LocalResourceType of the resource to be localized@Public @Stable public abstract LocalResourceVisibility getVisibility()
LocalResourceVisibility of the resource to be
localized.LocalResourceVisibility of the resource to be
localized@Public @Stable public abstract void setVisibility(LocalResourceVisibility visibility)
LocalResourceVisibility of the resource to be
localized.visibility - LocalResourceVisibility of the resource to be
localized@Public @Stable public abstract java.lang.String getPattern()
PATTERN).@Public @Stable public abstract void setPattern(java.lang.String pattern)
PATTERN).pattern - pattern that should be used to extract entries
from the archive.@Public @Unstable public abstract boolean getShouldBeUploadedToSharedCache()
@Public @Unstable public abstract void setShouldBeUploadedToSharedCache(boolean shouldBeUploadedToSharedCache)
shouldBeUploadedToSharedCache - shouldBeUploadedToSharedCache
of this requestCopyright © 2008–2025 Apache Software Foundation. All rights reserved.