|
@@ -30,6 +30,7 @@ import org.elasticsearch.common.blobstore.BlobStore;
|
|
|
import org.elasticsearch.common.blobstore.DeleteResult;
|
|
|
import org.elasticsearch.common.blobstore.support.PlainBlobMetadata;
|
|
|
import org.elasticsearch.common.bytes.BytesArray;
|
|
|
+import org.elasticsearch.common.io.Streams;
|
|
|
import org.elasticsearch.common.util.Maps;
|
|
|
import org.elasticsearch.common.xcontent.LoggingDeprecationHandler;
|
|
|
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
|
|
@@ -205,6 +206,15 @@ public class MockEventuallyConsistentRepository extends BlobStoreRepository {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public InputStream readBlob(String blobName, long position, long length) throws IOException {
|
|
|
+ final InputStream stream = readBlob(blobName);
|
|
|
+ if (position > 0) {
|
|
|
+ stream.skip(position);
|
|
|
+ }
|
|
|
+ return Streams.limitStream(stream, length);
|
|
|
+ }
|
|
|
+
|
|
|
private List<BlobStoreAction> relevantActions(String blobPath) {
|
|
|
assert Thread.holdsLock(context.actions);
|
|
|
final List<BlobStoreAction> relevantActions = new ArrayList<>(
|