-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Turn ImmutableDruidDataSource into a data container #7858
Comments
@leventov What should be the detail message to be passed to the constructor args of UnsupportedOperationException ? To check my understanding, ImmutableDruidDataSource's equals() and hashCode() methods have to throw UnsupportedOperationException. Is there anything else that needs to be done. |
What can also be done is adding static analysis checks to catching calling The error message can say e. g. |
The side effect of adding a static analysis check catching ImmutableDruidDataSource.equals() is that assert statements in tests like Assert.assertEquals(dataSource, objectMapper.readValue(json, ImmutableDruidDataSource.class)); are flagged as errors. |
…dDataSource's equals() and hashCode() methods.
ImmutableDruidDataSourceTest.testSerde() is failing because of this. How can this be rewritten to test serde ? Raised #7933.
|
You can move the former |
How to handle this ? |
|
Earlier,
Collecting the stream as a list instead of a set.
Let me know if this is right. |
It's OK |
* #7858 Throwing UnsupportedOperationException from ImmutableDruidDataSource's equals() and hashCode() methods. * 1. Turning ImmutableDruidDataSource into a data container. 2. Adding a Util method to be used in tests for checking equality of ImmutableDruidDataSource objects. * Removing unused method * Fixing assert equals * Fixing assert equals in TestUtils.java * Adding java doc comments, Using ExpectedException in tests * Fixing test cases * Fixed expected exception message in tests * fixed line width * line width fix * code style fixes * code indentation fixes * fixing method name
ImmutableDruidDataSource
'sequals()
andhashCode()
should throwUnsupportedOperationException
as well asDruidDataSource
's methods do.ImmutableDruidDataSource
should be considered a container, not a data class.The idea is the same as behind prohibiting/limiting
equals()
(and therefore usage asHashSet
/HashMap
keys) ofDataSegment
: see #6358. When somebody wants to deduplicateImmutableDruidDataSource
objects, they would need to put them into aMap<String, ImmutableDruidDataSource>
and resolve conflicts by name manually.The text was updated successfully, but these errors were encountered: