Skip to content

Commit 2f40561

Browse files
nikagradkropachev
authored andcommitted
[scylladb#597] Switching native-protocol dependency.
1 parent b8d57f0 commit 2f40561

9 files changed

Lines changed: 15 additions & 14 deletions

File tree

bom/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@
8181
<version>4.19.0.2-SNAPSHOT</version>
8282
</dependency>
8383
<dependency>
84-
<groupId>com.datastax.oss</groupId>
84+
<groupId>com.scylladb</groupId>
8585
<artifactId>native-protocol</artifactId>
86-
<version>1.5.2</version>
86+
<version>1.5.2.0</version>
8787
</dependency>
8888
</dependencies>
8989
</dependencyManagement>

core-shaded/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
option of the shade plugin because it promotes all dependencies, even nested ones, to top level).
5959
-->
6060
<dependency>
61-
<groupId>com.datastax.oss</groupId>
61+
<groupId>com.scylladb</groupId>
6262
<artifactId>native-protocol</artifactId>
6363
</dependency>
6464
<dependency>

core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
</dependencyManagement>
4747
<dependencies>
4848
<dependency>
49-
<groupId>com.datastax.oss</groupId>
49+
<groupId>com.scylladb</groupId>
5050
<artifactId>native-protocol</artifactId>
5151
</dependency>
5252
<dependency>

core/src/main/java/com/datastax/oss/driver/internal/core/channel/ChannelFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,10 +423,10 @@ protected void initChannel(Channel channel) {
423423
pipeline
424424
.addLast(
425425
FRAME_TO_BYTES_ENCODER_NAME,
426-
new FrameEncoder(context.getFrameCodec(), new ProtocolFeatures(), maxFrameLength))
426+
new FrameEncoder(context.getFrameCodec(), ProtocolFeatures.EMPTY, maxFrameLength))
427427
.addLast(
428428
BYTES_TO_FRAME_DECODER_NAME,
429-
new FrameDecoder(context.getFrameCodec(), new ProtocolFeatures(), maxFrameLength))
429+
new FrameDecoder(context.getFrameCodec(), ProtocolFeatures.EMPTY, maxFrameLength))
430430
// Note: HeartbeatHandler is inserted here once init completes
431431
.addLast(INFLIGHT_HANDLER_NAME, inFlightHandler)
432432
.addLast(INIT_HANDLER_NAME, initHandler);

core/src/main/java/com/datastax/oss/driver/internal/core/channel/ProtocolInitHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,8 @@ private void maybeSwitchToModernFraming() {
437437

438438
private void maybeUpdatePipelineWithProtocolOptions(boolean metadataIdEnabled) {
439439
if (metadataIdEnabled) {
440-
ProtocolFeatures protocolFeatures = new ProtocolFeatures();
441-
protocolFeatures.addFeature(ProtocolFeatures.Feature.SCYLLA_USE_METADATA_ID);
440+
ProtocolFeatures protocolFeatures =
441+
new ProtocolFeatures.Builder().setScyllaUseMetadataId().build();
442442
int maxFrameLength =
443443
(int)
444444
context

core/src/main/java/com/datastax/oss/driver/internal/core/protocol/SegmentToFrameDecoder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ private void decodeSelfContained(Segment<ByteBuf> segment, List<Object> out) {
7474
int frameCount = 0;
7575
try {
7676
do {
77-
Frame frame = frameCodec.decode(payload, new ProtocolFeatures());
77+
Frame frame = frameCodec.decode(payload, ProtocolFeatures.EMPTY);
7878
LOG.trace(
7979
"[{}] Decoded response frame {} from self-contained segment",
8080
logPrefix,
@@ -111,7 +111,7 @@ private void decodeSlice(Segment<ByteBuf> segment, ByteBufAllocator allocator, L
111111
encodedFrame.addComponents(true, accumulatedSlices);
112112
Frame frame;
113113
try {
114-
frame = frameCodec.decode(encodedFrame, new ProtocolFeatures());
114+
frame = frameCodec.decode(encodedFrame, ProtocolFeatures.EMPTY);
115115
} finally {
116116
encodedFrame.release();
117117
// Reset our state

core/src/test/java/com/datastax/oss/driver/internal/core/protocol/FrameDecoderTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public void setup() {
6464
@Test
6565
public void should_decode_valid_payload() {
6666
// Given
67-
FrameDecoder decoder = new FrameDecoder(frameCodec, new ProtocolFeatures(), 1024);
67+
FrameDecoder decoder = new FrameDecoder(frameCodec, ProtocolFeatures.EMPTY, 1024);
6868
channel.pipeline().addLast(decoder);
6969

7070
// When
@@ -85,7 +85,7 @@ public void should_decode_valid_payload() {
8585
public void should_fail_to_decode_if_payload_is_valid_but_too_long() {
8686
// Given
8787
FrameDecoder decoder =
88-
new FrameDecoder(frameCodec, new ProtocolFeatures(), VALID_PAYLOAD.readableBytes() - 1);
88+
new FrameDecoder(frameCodec, ProtocolFeatures.EMPTY, VALID_PAYLOAD.readableBytes() - 1);
8989
channel.pipeline().addLast(decoder);
9090

9191
// When
@@ -104,7 +104,7 @@ public void should_fail_to_decode_if_payload_is_valid_but_too_long() {
104104
@Test
105105
public void should_fail_to_decode_if_payload_cannot_be_decoded() {
106106
// Given
107-
FrameDecoder decoder = new FrameDecoder(frameCodec, new ProtocolFeatures(), 1024);
107+
FrameDecoder decoder = new FrameDecoder(frameCodec, ProtocolFeatures.EMPTY, 1024);
108108
channel.pipeline().addLast(decoder);
109109

110110
// When

core/src/test/java/com/datastax/oss/driver/internal/core/protocol/SegmentToFrameDecoderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,6 @@ private static ByteBuf encodeFrame(Message message) {
9494
Collections.emptyMap(),
9595
Collections.emptyList(),
9696
message);
97-
return FRAME_CODEC.encode(frame, new ProtocolFeatures());
97+
return FRAME_CODEC.encode(frame, ProtocolFeatures.EMPTY);
9898
}
9999
}

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
<skipTests>false</skipTests>
100100
<skipUnitTests>${skipTests}</skipUnitTests>
101101
<pushChanges>false</pushChanges>
102+
<mockitoopens.argline/>
102103
</properties>
103104
<dependencyManagement>
104105
<dependencies>

0 commit comments

Comments
 (0)