public class S3DataSegmentPuller extends Object implements DataSegmentPuller, URIDataPuller
| Modifier and Type | Class and Description |
|---|---|
protected static class |
S3DataSegmentPuller.S3Coords |
| Modifier and Type | Field and Description |
|---|---|
protected static String |
BUCKET |
static int |
DEFAULT_RETRY_COUNT |
protected static String |
KEY |
protected org.jets3t.service.impl.rest.httpclient.RestS3Service |
s3Client |
static String |
scheme |
| Constructor and Description |
|---|
S3DataSegmentPuller(org.jets3t.service.impl.rest.httpclient.RestS3Service s3Client) |
| Modifier and Type | Method and Description |
|---|---|
static FileObject |
buildFileObject(URI uri,
org.jets3t.service.impl.rest.httpclient.RestS3Service s3Client) |
static URI |
checkURI(URI uri) |
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(S3DataSegmentPuller.S3Coords s3Coords,
File outDir) |
String |
getVersion(URI uri)
Returns the "version" (aka last modified timestamp) of the URI
|
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 final String scheme
protected static final String BUCKET
protected static final String KEY
protected final org.jets3t.service.impl.rest.httpclient.RestS3Service s3Client
@Inject public S3DataSegmentPuller(org.jets3t.service.impl.rest.httpclient.RestS3Service s3Client)
public static FileObject buildFileObject(URI uri, org.jets3t.service.impl.rest.httpclient.RestS3Service s3Client) throws org.jets3t.service.ServiceException
org.jets3t.service.ServiceExceptionpublic 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(S3DataSegmentPuller.S3Coords s3Coords, File outDir) throws SegmentLoadingException
SegmentLoadingExceptionpublic InputStream getInputStream(URI uri) throws IOException
URIDataPullergetInputStream in interface URIDataPulleruri - The URI to open an Input Stream toIOExceptionpublic com.google.common.base.Predicate<Throwable> shouldRetryPredicate()
URIDataPullershouldRetryPredicate in interface URIDataPullerpublic String getVersion(URI uri) throws IOException
getVersion in interface URIDataPulleruri - The URI to check the last timestampIOExceptionCopyright © 2011–2017. All rights reserved.