-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate Stream-related API #1195
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of things:
Though JEP 211 indicates that it should be otherwise, and my testing directly with javac confirms the expected behavior, when building the driver I'm getting warnings about imports of classes/interfaces that have been deprecated. I'm not sure why, or what to do about it. Options:
- Fully qualify all references to deprecated types so that the imports can be removed
- Disable linting for deprecation
- Live with the warnings until it's time to remove the deprecated types for 5.0
Scala test The_scala_package_should_mirror_parts_of_com.mongodb.connection_in_org.mongdb.scala.connection
is passing by adding exceptions for the two new classes. Not sure whether to add Scala wrappers for them instead.
*/ | ||
@Sealed | ||
@Immutable | ||
public abstract class TransportSettings { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still like this name... at least better than IoSettings
. Note that Netty refers to its implementation as "Transport Services".
An alternative that keeps the same spirit would be something like TransportImplementationSettings
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going once...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am good with the name.
Adds: * TransportSettings abstract class * NettyTransportSettings subclass of TransportSettings * A new method on MongoClientSettings to configure TransportSettings Deprecates: * MongoClientSettings#streamFactoryFactory * NettyStreamFactoryFactory * NettyStreamFactory * AsynchronousSocketChannelStreamFactory * AsynchronousSocketChannelStreamFactoryFactory * BufferProvider * SocketStreamFactory * Stream * StreamFactory * StreamFactoryFactory * TlsChannelStreamFactoryFactory JAVA-5051
driver-core/src/main/com/mongodb/connection/TransportSettings.java
Outdated
Show resolved
Hide resolved
driver-core/src/main/com/mongodb/connection/netty/NettyStreamFactoryFactory.java
Outdated
Show resolved
Hide resolved
driver-core/src/main/com/mongodb/connection/AsynchronousSocketChannelStreamFactoryFactory.java
Outdated
Show resolved
Hide resolved
driver-core/src/main/com/mongodb/connection/NettyTransportSettings.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Valentin Kovalenko <valentin.male.kovalenko@gmail.com>
When I run
|
Yes, I mentioned that here, and gave several options for how to proceed. |
Sorry, I thought the added |
I went with option 2 and disabled linting for deprecation |
A few more suppressions are needed, as there are still some warnings (or, rather notes). Here is an example:
|
No, I was wrong. |
I'm mystified by the behavior of the compiler in this regard. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - So whats next after this PR?
As internally we continue to use StreamFactoryFactory
is there a ticket for the replacements? I'm interested in what the alternative will look like.
Similar to what we did with the Operation layer in 3.x. We'll remove the two deprecated methods on MongoClientSettings, and then move all thee deprecated types to The point of deprecation/removal here is not that this is not a useful abstraction for the driver. It's that it doesn't need to be part of the driver API, as afaik no-one has ever needed to create their own implementation of |
Adds:
Deprecates:
JAVA-5051