Package org.apache.druid.data.input.impl
Class HttpEntity
- java.lang.Object
-
- org.apache.druid.data.input.RetryingInputEntity
-
- org.apache.druid.data.input.impl.HttpEntity
-
- All Implemented Interfaces:
InputEntity
public class HttpEntity extends RetryingInputEntity
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.druid.data.input.InputEntity
InputEntity.CleanableFile
-
-
Field Summary
-
Fields inherited from interface org.apache.druid.data.input.InputEntity
DEFAULT_FETCH_BUFFER_SIZE, DEFAULT_MAX_NUM_FETCH_TRIES
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
getPath()
Get path name for this entity, used by the default implementation ofRetryingInputEntity.open()
to determine if the underlying stream needs decompressed, based on file extension of the pathcom.google.common.base.Predicate<Throwable>
getRetryCondition()
Returns a retry condition that the caller should retry on.URI
getUri()
Returns an URI to identify the input entity.static InputStream
openInputStream(URI object, String userName, PasswordProvider passwordProvider, long offset)
protected InputStream
readFrom(long offset)
Directly opens anInputStream
starting at the given offset on the input entity.-
Methods inherited from class org.apache.druid.data.input.RetryingInputEntity
getMaxRetries, open, readFromStart
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.druid.data.input.InputEntity
fetch
-
-
-
-
Method Detail
-
getUri
public URI getUri()
Description copied from interface:InputEntity
Returns an URI to identify the input entity. Implementations can return null if they don't have an unique URI.
-
readFrom
protected InputStream readFrom(long offset) throws IOException
Description copied from class:RetryingInputEntity
Directly opens anInputStream
starting at the given offset on the input entity. Decompression should be handled externally, and is handled by the default implementation ofRetryingInputEntity.open()
,this should return the raw stream for the object.- Specified by:
readFrom
in classRetryingInputEntity
- Parameters:
offset
- an offset to start reading from. A non-negative integer counting the number of bytes from the beginning of the entity- Throws:
IOException
-
getPath
protected String getPath()
Description copied from class:RetryingInputEntity
Get path name for this entity, used by the default implementation ofRetryingInputEntity.open()
to determine if the underlying stream needs decompressed, based on file extension of the path- Specified by:
getPath
in classRetryingInputEntity
-
getRetryCondition
public com.google.common.base.Predicate<Throwable> getRetryCondition()
Description copied from interface:InputEntity
Returns a retry condition that the caller should retry on. The returned condition should be used when reading data from this InputEntity such as inInputEntity.fetch(java.io.File, byte[])
orRetryingInputEntity
.
-
openInputStream
public static InputStream openInputStream(URI object, String userName, PasswordProvider passwordProvider, long offset) throws IOException
- Throws:
IOException
-
-