You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Vert.x 4.4.5 all methods which exposes Netty classes directly are deprecated. NeonBee is using such methods at two places:
ImmutableBuffer [1], where the ByteBuf class is used
EventLoopHealthCheck [2], where EventExecutor is used.
Desired Solution
ImmutableBuffer: Could the approach below work?
// CurrentImmutableBuffer(Bufferbuffer) {
this(requireNonNull(buffer), buffer.getByteBuf());
}
/** * Small optimization, as calling {@link Buffer#getByteBuf} will duplicate the underlying buffer. * * @param buffer the buffer to wrap * @param byteBuffer the associated Netty byte-buffer */privateImmutableBuffer(Bufferbuffer, ByteBufbyteBuffer) {
// if the underlying byte buffer is read-only already, there is no need to make it any more immutablethis.buffer = byteBuffer.isReadOnly() ? buffer : Buffer.buffer(byteBuffer.asReadOnly());
}
// newImmutableBuffer(Bufferbuffer) {
this.buffer = bufferinstanceOfImmutableBuffer ? buffer : Buffer.buffer(buffer);
}
EventLoopHealthCheck: I'd suggest to use SuppressWarnings here because:
The long term solution is, that the metric "pending tasks" will be part of Vert.x Metrics. I talked already with Julien.
In Vert.x 5 we can use VertxInternal to access the EventExecutor. Of course this is an internal API, but the unofficial agreement is that we won't touch this API until the pending tasks metric is part of Vert.x Metrics.
The second is easy, thanks that you talked to Julien, I think adding this to the Vert.x metrics is a very good addition and suppressing warnings on our side until then is fine for me 👍
In regards to the ImmutableBuffer, if there is no more possibility to get access to the underlying byte buffer in Vert.x 4.4.5, copying the Buffer either via Buffer.buffer(buffer) or calling Buffer.copy() would work, yes. However if in 4.4.5 getByteBuf only gets deprecated, we have to carry on the deprecation until the method is removed in a future minor or major release, as otherwise one could violate the immutability by simply calling the (now deprecated) getByteBuf method and accessing the underlying (mutable) ByteBuf directly. So I would suggest we keep the method for the time being until we can remove it after the getByteBuf method is gone?
Is there an existing issue for this?
The Problem
In Vert.x 4.4.5 all methods which exposes Netty classes directly are deprecated. NeonBee is using such methods at two places:
Desired Solution
ImmutableBuffer: Could the approach below work?
EventLoopHealthCheck: I'd suggest to use SuppressWarnings here because:
[1]
neonbee/src/main/java/io/neonbee/internal/buffer/ImmutableBuffer.java
Line 95 in 92030a7
[2]
neonbee/src/main/java/io/neonbee/health/EventLoopHealthCheck.java
Line 66 in 92030a7
Alternative Solutions
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: