public class GoogleDataSegmentPuller extends Object implements DataSegmentPuller, URIDataPuller
Constructor and Description |
---|
GoogleDataSegmentPuller(GoogleStorage storage) |
Modifier and Type | Method and Description |
---|---|
InputStream |
getInputStream(URI uri)
Create a new InputStream based on the URI
|
void |
getSegmentFiles(DataSegment segment,
File outDir)
Pull down segment files for the given DataSegment and put them in the given directory.
|
FileUtils.FileCopyResult |
getSegmentFiles(String bucket,
String path,
File outDir) |
String |
getVersion(URI uri)
Returns an abstract "version" for the URI.
|
void |
prepareOutDir(File outDir) |
com.google.common.base.Predicate<Throwable> |
shouldRetryPredicate()
Evaluates a Throwable to see if it is recoverable.
|
@Inject public GoogleDataSegmentPuller(GoogleStorage storage)
public void getSegmentFiles(DataSegment segment, File outDir) throws SegmentLoadingException
DataSegmentPuller
getSegmentFiles
in interface DataSegmentPuller
segment
- The segment to pull down files foroutDir
- The directory to store the files inSegmentLoadingException
- if there are any errorspublic FileUtils.FileCopyResult getSegmentFiles(String bucket, String path, File outDir) 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) throws IOException
URIDataPuller
getVersion
in interface URIDataPuller
uri
- The URI to checkIOException
- on errorpublic com.google.common.base.Predicate<Throwable> shouldRetryPredicate()
URIDataPuller
shouldRetryPredicate
in interface URIDataPuller
Copyright © 2011–2017. All rights reserved.