Package com.yahoo.vespa.filedistribution
Class FileDownloader
- java.lang.Object
-
- com.yahoo.vespa.filedistribution.FileDownloader
-
- All Implemented Interfaces:
AutoCloseable
public class FileDownloader extends Object implements AutoCloseable
Handles downloads of files (file references only for now)- Author:
- hmusum
-
-
Field Summary
Fields Modifier and Type Field Description static File
defaultDownloadDirectory
-
Constructor Summary
Constructors Constructor Description FileDownloader(com.yahoo.vespa.config.ConnectionPool connectionPool, com.yahoo.jrt.Supervisor supervisor)
FileDownloader(com.yahoo.vespa.config.ConnectionPool connectionPool, com.yahoo.jrt.Supervisor supervisor, File downloadDirectory, Duration timeout)
FileDownloader(com.yahoo.vespa.config.ConnectionPool connectionPool, com.yahoo.jrt.Supervisor supervisor, File downloadDirectory, Duration timeout, Duration sleepBetweenRetries)
FileDownloader(com.yahoo.vespa.config.ConnectionPool connectionPool, com.yahoo.jrt.Supervisor supervisor, Duration timeout)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
com.yahoo.vespa.config.ConnectionPool
connectionPool()
void
downloadIfNeeded(FileReferenceDownload fileReferenceDownload)
Start a download if needed, don't wait for resultDownloads
downloads()
Map<com.yahoo.config.FileReference,Double>
downloadStatus()
static com.yahoo.vespa.config.ConnectionPool
emptyConnectionPool()
Optional<File>
getFile(FileReferenceDownload fileReferenceDownload)
-
-
-
Field Detail
-
defaultDownloadDirectory
public static final File defaultDownloadDirectory
-
-
Constructor Detail
-
FileDownloader
public FileDownloader(com.yahoo.vespa.config.ConnectionPool connectionPool, com.yahoo.jrt.Supervisor supervisor)
-
FileDownloader
public FileDownloader(com.yahoo.vespa.config.ConnectionPool connectionPool, com.yahoo.jrt.Supervisor supervisor, Duration timeout)
-
FileDownloader
public FileDownloader(com.yahoo.vespa.config.ConnectionPool connectionPool, com.yahoo.jrt.Supervisor supervisor, File downloadDirectory, Duration timeout)
-
-
Method Detail
-
getFile
public Optional<File> getFile(FileReferenceDownload fileReferenceDownload)
-
connectionPool
public com.yahoo.vespa.config.ConnectionPool connectionPool()
-
downloads
public Downloads downloads()
-
downloadIfNeeded
public void downloadIfNeeded(FileReferenceDownload fileReferenceDownload)
Start a download if needed, don't wait for result
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
-
emptyConnectionPool
public static com.yahoo.vespa.config.ConnectionPool emptyConnectionPool()
-
-