-
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
static to non-static conversion for methods in Index[Merger/Maker/IO] #1804
Conversation
6f6d465
to
3b20e2d
Compare
@himanshug nice! I've been waiting so long for that day. @cheddar you owe @himanshug a beer :) |
@@ -84,6 +87,9 @@ | |||
public static final Splitter tabSplitter = Splitter.on("\t"); | |||
public static final Joiner tabJoiner = Joiner.on("\t"); | |||
public static final ObjectMapper jsonMapper; |
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.
should we also update those constants above to uppercase to be consistent while we're at it?
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.
sure, will do that
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.
done
This is cool. Will probably want to callout in release notes because this might break extensions (it will break some extensions I'm tinkering with). |
@drcrallen sure, we can call this out in release notes. I am putting a note on PR description too. |
28837df
to
2189b2b
Compare
@xvrl @drcrallen all comments have been taken care of, pls see as this PR is required to unblock #1728 |
@@ -107,8 +113,11 @@ public void configure(Binder binder) | |||
new IndexingHadoopModule() | |||
) | |||
); | |||
jsonMapper = injector.getInstance(ObjectMapper.class); | |||
JSON_MAPPER = injector.getInstance(ObjectMapper.class); | |||
properties = injector.getInstance(Properties.class); |
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 think properties
can be removed- it was only used for the "hack to get druid.processing.bitmap property passed down" which you've now got rid of
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.
removed
this PR looks good to me after figuring out what we want to do with |
2189b2b
to
02ca44e
Compare
@gian support for |
@himanshug ok sounds fair |
👍 looks good to me |
👍 |
@JsonProperty("context") Map<String, Object> context | ||
@JsonProperty("context") Map<String, Object> context, | ||
@JacksonInject IndexMerger indexMerger, | ||
@JacksonInject IndexIO indexIO |
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.
Injecting IndexIO and IndexMerger might be a problem for external libraries relying on those classes purely for serialization and de-serialization, such as tranquility. I wonder if it would be possible to separate the parts necessary for serde from the parts needed to run the task.
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.
Could put them in the TaskToolbox instead.
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.
the same concern also applies to all the other tasks and classes that, until now, did not rely on jackson injection.
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.
we should also add some ser-de tests for tasks, I don't think we have any.
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.
there's a lot in the TaskSerdeTest class
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.
Fwiw I think tranquility will probably be able to handle these, as long as its injector has the ability to make these classes (which if it doesn't, could be added). Putting them in the TaskToolbox is cool too if we want to go that way.
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.
@gianm my bad, missed the task serde test. In general I think it would be nice to move away from jackson injecting if we ever want to make those classes available in a proper API or client library.
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.
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.
@himanshug the toolbox shouldn't need to be injected just for serialization, as it's only needed if you're calling run
. That wouldn't happen if the *Task class is just being used by something that wants to generate a request to submit to the overlord (like tranquility does). Right?
I am ok with doing it either way though. Tranquility already has to set up an ObjectMapper with a bunch of Druid modules (for stuff like AggregatorFactories and Firehoses) and so needing this other stuff too wouldn't be much worse.
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.
@himanshug I had marked default bitmap config deprecated mainly because it is possible to specify it in the index spec ever since we added compression, whereas before that property was the only way to specify it. It might still be nice to be able to specify a default, but I'm also not wedded to it if you think it's too cumbersome to maintain. A more general way to specify indexing default might be nice in the future though. |
other than my concerns about jackson injection, the rest looks fine to me. |
02ca44e
to
84f7d8d
Compare
appropriate ObjectMapper injected instead of creating one statically
@xvrl all comments addressed |
changes looks good, 👍 |
👍 |
static to non-static conversion for methods in Index[Merger/Maker/IO]
so that appropriate dependencies can be injected specially ObjectMapper that can handle extensions as well without each having their own static Injector creation.
Release Notes update:
this PR removes the support for deprecated property
druid.processing.bitmap
and makes Concise be default.