Skip to content

Commit ea83e18

Browse files
committed
ILP v4 -> QWP v1
1 parent 80e65fb commit ea83e18

11 files changed

Lines changed: 29 additions & 29 deletions

core/src/main/java/io/questdb/client/Sender.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ enum Transport {
474474
/**
475475
* Use WebSocket transport to communicate with a QuestDB server.
476476
* <p>
477-
* WebSocket transport uses the ILP v4 binary protocol for efficient data ingestion.
477+
* WebSocket transport uses the QWP v1 binary protocol for efficient data ingestion.
478478
* It supports both synchronous and asynchronous modes with flow control.
479479
*/
480480
WEBSOCKET
@@ -1391,6 +1391,17 @@ private static RuntimeException rethrow(Throwable t) {
13911391
throw new LineSenderException(t);
13921392
}
13931393

1394+
private String buildWebSocketAuthHeader() {
1395+
if (username != null && password != null) {
1396+
String credentials = username + ":" + password;
1397+
return "Basic " + Base64.getEncoder().encodeToString(credentials.getBytes(StandardCharsets.UTF_8));
1398+
}
1399+
if (httpToken != null) {
1400+
return "Bearer " + httpToken;
1401+
}
1402+
return null;
1403+
}
1404+
13941405
private void configureDefaults() {
13951406
if (protocol == PARAMETER_NOT_SET_EXPLICITLY) {
13961407
protocol = PROTOCOL_TCP;
@@ -1797,17 +1808,6 @@ private void validateParameters() {
17971808
}
17981809
}
17991810

1800-
private String buildWebSocketAuthHeader() {
1801-
if (username != null && password != null) {
1802-
String credentials = username + ":" + password;
1803-
return "Basic " + Base64.getEncoder().encodeToString(credentials.getBytes(StandardCharsets.UTF_8));
1804-
}
1805-
if (httpToken != null) {
1806-
return "Bearer " + httpToken;
1807-
}
1808-
return null;
1809-
}
1810-
18111811
private void websocket() {
18121812
if (protocol != PARAMETER_NOT_SET_EXPLICITLY) {
18131813
throw new LineSenderException("protocol was already configured ")

core/src/main/java/io/questdb/client/cutlass/qwp/client/NativeBufferWriter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import io.questdb.client.std.Unsafe;
3030

3131
/**
32-
* A simple native memory buffer writer for encoding ILP v4 messages.
32+
* A simple native memory buffer writer for encoding QWP v1 messages.
3333
* <p>
3434
* This class provides write methods similar to HttpClient.Request but writes
3535
* to a native memory buffer that can be sent over WebSocket.

core/src/main/java/io/questdb/client/cutlass/qwp/client/QwpBufferWriter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
import io.questdb.client.cutlass.line.array.ArrayBufferAppender;
2828

2929
/**
30-
* Buffer writer interface for ILP v4 message encoding.
30+
* Buffer writer interface for QWP v1 message encoding.
3131
* <p>
3232
* This interface extends {@link ArrayBufferAppender} with additional methods
33-
* required for encoding ILP v4 messages, including varint encoding, string
33+
* required for encoding QWP v1 messages, including varint encoding, string
3434
* handling, and buffer manipulation.
3535
* <p>
3636
* Implementations include:

core/src/main/java/io/questdb/client/cutlass/qwp/client/QwpWebSocketEncoder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import static io.questdb.client.cutlass.qwp.protocol.QwpConstants.*;
3535

3636
/**
37-
* Encodes ILP v4 messages for WebSocket transport.
37+
* Encodes QWP v1 messages for WebSocket transport.
3838
* <p>
3939
* This encoder reads column data from off-heap {@link io.questdb.client.cutlass.qwp.protocol.OffHeapAppendMemory}
4040
* buffers in {@link QwpTableBuffer.ColumnBuffer} and uses bulk {@code putBlockOfBytes} for fixed-width

core/src/main/java/io/questdb/client/cutlass/qwp/client/QwpWebSocketSender.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353

5454

5555
/**
56-
* ILP v4 WebSocket client sender for streaming data to QuestDB.
56+
* QWP v1 WebSocket client sender for streaming data to QuestDB.
5757
* <p>
5858
* This sender uses a double-buffering scheme with asynchronous I/O for high throughput:
5959
* <ul>
@@ -123,7 +123,7 @@ public class QwpWebSocketSender implements Sender {
123123
// Auto-flush configuration
124124
private final int autoFlushRows;
125125
private final Decimal256 currentDecimal256 = new Decimal256();
126-
// Encoder for ILP v4 messages
126+
// Encoder for QWP v1 messages
127127
private final QwpWebSocketEncoder encoder;
128128
// Global symbol dictionary for delta encoding
129129
private final GlobalSymbolDictionary globalSymbolDictionary;
@@ -1088,7 +1088,7 @@ private void failExpectedIfNeeded(long expectedSequence, LineSenderException err
10881088

10891089
/**
10901090
* Flushes pending rows by encoding and sending them.
1091-
* Each table's rows are encoded into a separate ILP v4 message and sent as one WebSocket frame.
1091+
* Each table's rows are encoded into a separate QWP v1 message and sent as one WebSocket frame.
10921092
*/
10931093
private void flushPendingRows() {
10941094
if (pendingRowCount <= 0) {
@@ -1139,7 +1139,7 @@ private void flushPendingRows() {
11391139
QwpBufferWriter buffer = encoder.getBuffer();
11401140

11411141
// Copy to microbatch buffer and seal immediately
1142-
// Each ILP v4 message must be in its own WebSocket frame
1142+
// Each QWP v1 message must be in its own WebSocket frame
11431143
activeBuffer.ensureCapacity(messageSize);
11441144
activeBuffer.write(buffer.getBufferPtr(), messageSize);
11451145
activeBuffer.incrementRowCount();

core/src/main/java/io/questdb/client/cutlass/qwp/client/WebSocketResponse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import java.nio.charset.StandardCharsets;
3030

3131
/**
32-
* Binary response format for WebSocket ILP v4 protocol.
32+
* Binary response format for WebSocket QWP v1 protocol.
3333
* <p>
3434
* Response format (little-endian):
3535
* <pre>

core/src/main/java/io/questdb/client/cutlass/qwp/protocol/QwpBitWriter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import io.questdb.client.std.Unsafe;
2929

3030
/**
31-
* Bit-level writer for ILP v4 protocol.
31+
* Bit-level writer for QWP v1 protocol.
3232
* <p>
3333
* This class writes bits to a buffer in LSB-first order within each byte.
3434
* Bits are packed sequentially, spanning byte boundaries as needed.

core/src/main/java/io/questdb/client/cutlass/qwp/protocol/QwpColumnDef.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import static io.questdb.client.cutlass.qwp.protocol.QwpConstants.TYPE_CHAR;
2929

3030
/**
31-
* Represents a column definition in an ILP v4 schema.
31+
* Represents a column definition in an QWP v1 schema.
3232
* <p>
3333
* This class is immutable and safe for caching.
3434
*/
@@ -41,7 +41,7 @@ public final class QwpColumnDef {
4141
* Creates a column definition.
4242
*
4343
* @param name the column name (UTF-8)
44-
* @param typeCode the ILP v4 type code (0x01-0x0F, optionally OR'd with 0x80 for nullable)
44+
* @param typeCode the QWP v1 type code (0x01-0x0F, optionally OR'd with 0x80 for nullable)
4545
*/
4646
public QwpColumnDef(String name, byte typeCode) {
4747
this.name = name;

core/src/main/java/io/questdb/client/cutlass/qwp/protocol/QwpConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
package io.questdb.client.cutlass.qwp.protocol;
2626

2727
/**
28-
* Constants for the ILP v4 binary protocol.
28+
* Constants for the QWP v1 binary protocol.
2929
*/
3030
public final class QwpConstants {
3131

core/src/main/java/io/questdb/client/cutlass/qwp/protocol/QwpGorillaEncoder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import io.questdb.client.std.Unsafe;
2929

3030
/**
31-
* Gorilla delta-of-delta encoder for timestamps in ILP v4 format.
31+
* Gorilla delta-of-delta encoder for timestamps in QWP v1 format.
3232
* <p>
3333
* This encoder is used by the WebSocket encoder to compress timestamp columns.
3434
* It uses delta-of-delta compression where:

0 commit comments

Comments
 (0)