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
DataSegmentPullergetSegmentFiles in interface DataSegmentPullersegment - 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
SegmentLoadingExceptionpublic InputStream getInputStream(URI uri) throws IOException
URIDataPullergetInputStream in interface URIDataPulleruri - The URI to open an Input Stream toIOExceptionpublic String getVersion(URI uri) throws IOException
URIDataPullergetVersion in interface URIDataPulleruri - The URI to checkIOException - on errorpublic com.google.common.base.Predicate<Throwable> shouldRetryPredicate()
URIDataPullershouldRetryPredicate in interface URIDataPullerCopyright © 2011–2017. All rights reserved.