Skip to content

Commit cdd00e6

Browse files
committed
Merge remote-tracking branch 'origin/jh_experiment_new_ilp' into jh_experiment_new_ilp_udp
2 parents 9f888b9 + ea83e18 commit cdd00e6

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
@@ -486,7 +486,7 @@ enum Transport {
486486
/**
487487
* Use WebSocket transport to communicate with a QuestDB server.
488488
* <p>
489-
* WebSocket transport uses the ILP v4 binary protocol for efficient data ingestion.
489+
* WebSocket transport uses the QWP v1 binary protocol for efficient data ingestion.
490490
* It supports both synchronous and asynchronous modes with flow control.
491491
*/
492492
WEBSOCKET
@@ -1490,6 +1490,17 @@ private static RuntimeException rethrow(Throwable t) {
14901490
throw new LineSenderException(t);
14911491
}
14921492

1493+
private String buildWebSocketAuthHeader() {
1494+
if (username != null && password != null) {
1495+
String credentials = username + ":" + password;
1496+
return "Basic " + Base64.getEncoder().encodeToString(credentials.getBytes(StandardCharsets.UTF_8));
1497+
}
1498+
if (httpToken != null) {
1499+
return "Bearer " + httpToken;
1500+
}
1501+
return null;
1502+
}
1503+
14931504
private void configureDefaults() {
14941505
if (protocol == PARAMETER_NOT_SET_EXPLICITLY) {
14951506
protocol = PROTOCOL_TCP;
@@ -1974,17 +1985,6 @@ private void validateParameters() {
19741985
}
19751986
}
19761987

1977-
private String buildWebSocketAuthHeader() {
1978-
if (username != null && password != null) {
1979-
String credentials = username + ":" + password;
1980-
return "Basic " + Base64.getEncoder().encodeToString(credentials.getBytes(StandardCharsets.UTF_8));
1981-
}
1982-
if (httpToken != null) {
1983-
return "Bearer " + httpToken;
1984-
}
1985-
return null;
1986-
}
1987-
19881988
private void udp() {
19891989
if (protocol != PARAMETER_NOT_SET_EXPLICITLY) {
19901990
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
@@ -30,7 +30,7 @@
3030
import static io.questdb.client.cutlass.qwp.protocol.QwpConstants.*;
3131

3232
/**
33-
* Encodes ILP v4 messages for WebSocket transport.
33+
* Encodes QWP v1 messages for WebSocket transport.
3434
* <p>
3535
* This encoder delegates column encoding to {@link QwpColumnWriter} and wraps
3636
* the encoded payload with a 12-byte ILP4 header.

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)