Module org.elasticsearch.server
Class RetryingInputStream<V>
java.lang.Object
java.io.InputStream
org.elasticsearch.common.blobstore.RetryingInputStream<V>
- Type Parameters:
V- The type used to represent the version of a blob
- All Implemented Interfaces:
Closeable,AutoCloseable
An
InputStream that resumes downloads from the point at which they failed when a retry-able error occurs.
This class implements some Elasticsearch-specific retry behavior, including:
- Retrying indefinitely for
OperationPurpose.INDICESoperations - Not retrying at all for
OperationPurpose.REPOSITORY_ANALYSISoperations - Extending retries if "meaningful" progress was made on the last attempt
- More detailed logging about the status of operations being retried
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interfaceThis implements all the behavior that is blob-store-specificprotected static final classRepresents anInputStreamfor a single attempt to read a blob.static enum -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected RetryingInputStream.SingleAttemptInputStream<V> static final int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRetryingInputStream(RetryingInputStream.BlobStoreServices<V> blobStoreServices, OperationPurpose purpose) protectedRetryingInputStream(RetryingInputStream.BlobStoreServices<V> blobStoreServices, OperationPurpose purpose, long start, long end) -
Method Summary
Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Field Details
-
MAX_SUPPRESSED_EXCEPTIONS
public static final int MAX_SUPPRESSED_EXCEPTIONS- See Also:
-
currentStream
-
-
Constructor Details
-
RetryingInputStream
protected RetryingInputStream(RetryingInputStream.BlobStoreServices<V> blobStoreServices, OperationPurpose purpose) throws IOException - Throws:
IOException
-
RetryingInputStream
protected RetryingInputStream(RetryingInputStream.BlobStoreServices<V> blobStoreServices, OperationPurpose purpose, long start, long end) throws IOException - Throws:
IOException
-
-
Method Details
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
getRetryDelayInMillis
protected long getRetryDelayInMillis() -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classInputStream- Throws:
IOException
-
reset
public void reset()- Overrides:
resetin classInputStream
-