Class HttpStorageObject
java.lang.Object
org.elasticsearch.xpack.esql.datasource.http.HttpStorageObject
- All Implemented Interfaces:
StorageObject
StorageObject implementation using HTTP Range requests for efficient partial reads.
Uses standard Java HttpClient and InputStream - no custom stream classes needed.
Supports:
- Full object reads via GET
- Range reads via HTTP Range header for columnar formats
- Metadata retrieval via HEAD requests
-
Field Summary
Fields inherited from interface org.elasticsearch.xpack.esql.datasources.spi.StorageObject
TRANSFER_BUFFER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionHttpStorageObject(HttpClient client, StoragePath path, HttpConfiguration config) Creates an HttpStorageObject without pre-known metadata.HttpStorageObject(HttpClient client, StoragePath path, HttpConfiguration config, long length) Creates an HttpStorageObject with pre-known length.HttpStorageObject(HttpClient client, StoragePath path, HttpConfiguration config, long length, Instant lastModified) Creates an HttpStorageObject with pre-known length and last modified time. -
Method Summary
Modifier and TypeMethodDescriptionbooleanexists()longlength()newStream(long position, long length) path()voidreadBytesAsync(long position, long length, Executor executor, ActionListener<ByteBuffer> listener) Async byte read using HttpClient.sendAsync() for native non-blocking I/O.booleanReturns true - HttpStorageObject has native async support via HttpClient.sendAsync().Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.xpack.esql.datasources.spi.StorageObject
readBytes, readBytesAsync
-
Constructor Details
-
HttpStorageObject
Creates an HttpStorageObject without pre-known metadata. -
HttpStorageObject
public HttpStorageObject(HttpClient client, StoragePath path, HttpConfiguration config, long length) Creates an HttpStorageObject with pre-known length. -
HttpStorageObject
public HttpStorageObject(HttpClient client, StoragePath path, HttpConfiguration config, long length, Instant lastModified) Creates an HttpStorageObject with pre-known length and last modified time.
-
-
Method Details
-
newStream
- Specified by:
newStreamin interfaceStorageObject- Throws:
IOException
-
newStream
- Specified by:
newStreamin interfaceStorageObject- Throws:
IOException
-
length
- Specified by:
lengthin interfaceStorageObject- Throws:
IOException
-
lastModified
- Specified by:
lastModifiedin interfaceStorageObject- Throws:
IOException
-
exists
- Specified by:
existsin interfaceStorageObject- Throws:
IOException
-
path
- Specified by:
pathin interfaceStorageObject
-
readBytesAsync
public void readBytesAsync(long position, long length, Executor executor, ActionListener<ByteBuffer> listener) Async byte read using HttpClient.sendAsync() for native non-blocking I/O.This implementation uses Java's built-in async HTTP client to avoid blocking threads during I/O. The executor parameter is ignored since HttpClient manages its own thread pool for async operations (configured at client creation time).
- Specified by:
readBytesAsyncin interfaceStorageObject- Parameters:
position- the starting byte positionlength- the number of bytes to readexecutor- executor (unused - HttpClient uses executor configured at creation)listener- callback for the result or failure
-
supportsNativeAsync
public boolean supportsNativeAsync()Returns true - HttpStorageObject has native async support via HttpClient.sendAsync().- Specified by:
supportsNativeAsyncin interfaceStorageObject
-