feat(qwp): add QwpQueryClient for QWP egress over WebSocket#11
Open
bluestreak01 wants to merge 7 commits intomainfrom
Open
feat(qwp): add QwpQueryClient for QWP egress over WebSocket#11bluestreak01 wants to merge 7 commits intomainfrom
bluestreak01 wants to merge 7 commits intomainfrom
Conversation
Collaborator
|
Contributor
[PR Coverage check]😞 fail : 203 / 754 (26.92%) file detail
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
QwpQueryClient, the client-side counterpart of the QWP egress endpoint that QuestDB's HTTP server now exposes at/read/v1. Sends a SQL query, receives result batches as binary WebSocket frames, decodes them into a column-majorQwpColumnBatchview.QwpQueryClient.fromConfig(\"ws::addr=localhost:9000;...\")mirrors theSender.fromConfigshape used by the existing ingestion API.DirectUtf8Sequenceview into the underlying WebSocket payload buffer.examples/com/example/query/.API shape
QwpColumnBatchexposes both schema-agnostic accessors (getLong,getDouble,getString,isNull) and per-type raw-address APIs (valuesAddr,nonNullIndex,getLongValue,getIntValue) for callers writing the tightest possible inner loops.Threading model
QwpQueryClient, spawned onconnect(), marked daemon.WebSocketClient, theQwpResultBatchDecoder, and a small pool ofQwpBatchBufferinstances (default 4, configurable viawithBufferPoolSize).execute(), invokes the handler, releases the buffer back to the pool.freeBuffers.take(), the WS recv buffer fills, and TCP flow control closes the server's send window.close()sendsThread.interrupt()to the I/O thread, joins for up to 5 s, then frees the pool. If join times out, the daemon thread is left running and the buffer pool + WebSocket socket are leaked for the JVM lifetime rather than freed under an active reader;wasLastCloseTimedOut()surfaces the condition for callers.Performance characteristics
DirectUtf8Stringviews replace per-cellStringandbyte[]allocation.getLongstill has a wire-type switch; callers in tight scan loops can use the type-specialisedgetLongValue/getIntValueaccessors to skip it.Limitations
QwpEgressRequestDecoderaccepts binds for every scalar wire type, butQwpQueryClient.executeonly takes a SQL string today.wss::) connect-string is reserved but not implemented.QwpResultCursorrow-iterator wrapper around the column-batch consumer API is on the Phase 2 backlog.Test plan
🤖 Generated with Claude Code