public class HdfsDataSegmentPuller extends Object implements DataSegmentPuller, URIDataPuller
| Modifier and Type | Class and Description | 
|---|---|
static class  | 
HdfsDataSegmentPuller.HdfsIOException
FileObject.getLastModified and FileObject.delete don't throw IOException. 
 | 
| Modifier and Type | Field and Description | 
|---|---|
protected org.apache.hadoop.conf.Configuration | 
config  | 
static int | 
DEFAULT_RETRY_COUNT  | 
| Constructor and Description | 
|---|
HdfsDataSegmentPuller(org.apache.hadoop.conf.Configuration config)  | 
| Modifier and Type | Method and Description | 
|---|---|
static FileObject | 
buildFileObject(URI uri,
               org.apache.hadoop.conf.Configuration config)  | 
static FileObject | 
buildFileObject(URI uri,
               org.apache.hadoop.conf.Configuration config,
               Boolean overwrite)  | 
InputStream | 
getInputStream(org.apache.hadoop.fs.Path path)  | 
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(org.apache.hadoop.fs.Path path,
               File outDir)  | 
FileUtils.FileCopyResult | 
getSegmentFiles(URI uri,
               File outDir)  | 
String | 
getVersion(URI uri)
Return 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
protected final org.apache.hadoop.conf.Configuration config
@Inject public HdfsDataSegmentPuller(org.apache.hadoop.conf.Configuration config)
public static FileObject buildFileObject(URI uri, org.apache.hadoop.conf.Configuration config)
public static FileObject buildFileObject(URI uri, org.apache.hadoop.conf.Configuration config, Boolean overwrite)
public void getSegmentFiles(DataSegment segment, File dir) throws SegmentLoadingException
DataSegmentPullergetSegmentFiles in interface DataSegmentPullersegment - The segment to pull down files fordir - The directory to store the files inSegmentLoadingException - if there are any errorspublic FileUtils.FileCopyResult getSegmentFiles(org.apache.hadoop.fs.Path path, File outDir) throws SegmentLoadingException
SegmentLoadingExceptionpublic FileUtils.FileCopyResult getSegmentFiles(URI uri, File outDir) throws SegmentLoadingException
SegmentLoadingExceptionpublic InputStream getInputStream(org.apache.hadoop.fs.Path path) throws IOException
IOExceptionpublic InputStream getInputStream(URI uri) throws IOException
URIDataPullergetInputStream in interface URIDataPulleruri - The URI to open an Input Stream toIOExceptionpublic String getVersion(URI uri) throws IOException
getVersion in interface URIDataPulleruri - The URI of interestIOExceptionpublic com.google.common.base.Predicate<Throwable> shouldRetryPredicate()
URIDataPullershouldRetryPredicate in interface URIDataPullerCopyright © 2011–2018. All rights reserved.