public class LocalDataSegmentPuller extends Object implements DataSegmentPuller, URIDataPuller
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_RETRY_COUNT |
Constructor and Description |
---|
LocalDataSegmentPuller() |
Modifier and Type | Method and Description |
---|---|
static FileObject |
buildFileObject(URI uri) |
InputStream |
getInputStream(URI uri)
Create a new InputStream based on the URI
|
void |
getSegmentFiles(DataSegment segment,
File dir)
Pull down segment files for the given DataSegment and put them in the given directory.
|
FileUtils.FileCopyResult |
getSegmentFiles(File sourceFile,
File dir) |
String |
getVersion(URI uri)
Returns the "version" (aka last modified timestamp) of the URI of interest
|
com.google.common.base.Predicate<Throwable> |
shouldRetryPredicate()
Evaluates a Throwable to see if it is recoverable.
|
public static final int DEFAULT_RETRY_COUNT
public static FileObject buildFileObject(URI uri)
public void getSegmentFiles(DataSegment segment, File dir) throws SegmentLoadingException
DataSegmentPuller
getSegmentFiles
in interface DataSegmentPuller
segment
- The segment to pull down files fordir
- The directory to store the files inSegmentLoadingException
- if there are any errorspublic FileUtils.FileCopyResult getSegmentFiles(File sourceFile, File dir) throws SegmentLoadingException
SegmentLoadingException
public InputStream getInputStream(URI uri) throws IOException
URIDataPuller
getInputStream
in interface URIDataPuller
uri
- The URI to open an Input Stream toIOException
public String getVersion(URI uri)
getVersion
in interface URIDataPuller
uri
- The URI to check the last modified timestamppublic com.google.common.base.Predicate<Throwable> shouldRetryPredicate()
URIDataPuller
shouldRetryPredicate
in interface URIDataPuller
Copyright © 2011–2017. All rights reserved.