public class MesosArtifactServer extends Object implements MesosArtifactResolver
More information: http://mesos.apache.org/documentation/latest/fetcher/ http://mesos.apache.org/documentation/latest/fetcher-cache-internals/
Modifier and Type | Class and Description |
---|---|
static class |
MesosArtifactServer.UnknownFileHandler
Handle a request for a non-existent file.
|
static class |
MesosArtifactServer.VirtualFileServerHandler
Handle HEAD and GET requests for a specific file.
|
Constructor and Description |
---|
MesosArtifactServer(String prefix,
String serverHostname,
int configuredPort,
Configuration config) |
Modifier and Type | Method and Description |
---|---|
URL |
addFile(File localFile,
String remoteFile)
Adds a file to the artifact server.
|
URL |
addPath(Path path,
Path remoteFile)
Adds a path to the artifact server.
|
URL |
baseURL() |
int |
getServerPort()
Get the server port on which the artifact server is listening.
|
void |
removePath(Path remoteFile) |
scala.Option<URL> |
resolve(Path remoteFile) |
void |
stop()
Stops the artifact server.
|
public MesosArtifactServer(String prefix, String serverHostname, int configuredPort, Configuration config) throws Exception
Exception
public URL baseURL()
public int getServerPort()
public URL addFile(File localFile, String remoteFile) throws IOException, MalformedURLException
localFile
- the local file to serve.remoteFile
- the remote path with which to locate the file.MalformedURLException
- if the remote path is invalid.IOException
public URL addPath(Path path, Path remoteFile) throws IOException, MalformedURLException
path
- the qualified FS path to serve (local, hdfs, etc).remoteFile
- the remote path with which to locate the file.MalformedURLException
- if the remote path is invalid.IOException
public void removePath(Path remoteFile)
public scala.Option<URL> resolve(Path remoteFile)
resolve
in interface MesosArtifactResolver
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.