Skip to content
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

Merged
merged 2 commits into from
Nov 3, 2015

Conversation

himanshug
Copy link
Contributor

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.

@himanshug himanshug added this to the 0.9.0 milestone Oct 5, 2015
@xvrl
Copy link
Member

xvrl commented Oct 5, 2015

@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;
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, will do that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@drcrallen
Copy link
Contributor

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).

@himanshug
Copy link
Contributor Author

@drcrallen sure, we can call this out in release notes. I am putting a note on PR description too.

@himanshug himanshug force-pushed the objectify_index_creators branch 3 times, most recently from 28837df to 2189b2b Compare October 21, 2015 20:04
@himanshug
Copy link
Contributor Author

@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);
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

@gianm
Copy link
Contributor

gianm commented Oct 31, 2015

this PR looks good to me after figuring out what we want to do with druid.processing.bitmap.type - either remove it from the docs, or add support back in but mark it deprecated in the docs.

@himanshug
Copy link
Contributor Author

@gian support for druid.processing.bitmap.type becomes complicated inside IndexSpec no arg constructor once we lose static properties object inside IndexIO also it needs hacks to support it inside hadoop indexing as well . Code said it was deprecated (dint look at the doc at the time) and hence removed it to keep things simple. Since this is going inside a new major release, I believe it is OK.

@gianm
Copy link
Contributor

gianm commented Nov 1, 2015

@himanshug ok sounds fair

@gianm
Copy link
Contributor

gianm commented Nov 1, 2015

👍 looks good to me

@drcrallen
Copy link
Contributor

👍

@JsonProperty("context") Map<String, Object> context
@JsonProperty("context") Map<String, Object> context,
@JacksonInject IndexMerger indexMerger,
@JacksonInject IndexIO indexIO
Copy link
Member

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.

Copy link
Contributor

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.

Copy link
Member

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.

Copy link
Member

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.

Copy link
Contributor

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

Copy link
Contributor

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.

Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xvrl @gian if we put it inside TaskToolbox then TaskToolbox needs to be injected , I don't think we can avoid injection.
libraries will probably need to setup dummy objects for injection for all these.

Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xvrl @gianm ok removed them from individual task constructors, added to TaskToolbox instead and using from same.
hopefully this will reduce some burden on tranquility side.

@xvrl
Copy link
Member

xvrl commented Nov 2, 2015

@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.

@xvrl
Copy link
Member

xvrl commented Nov 2, 2015

other than my concerns about jackson injection, the rest looks fine to me.

@himanshug
Copy link
Contributor Author

@xvrl all comments addressed

@gianm
Copy link
Contributor

gianm commented Nov 3, 2015

changes looks good, 👍

@gianm gianm closed this Nov 3, 2015
@gianm gianm reopened this Nov 3, 2015
@xvrl
Copy link
Member

xvrl commented Nov 3, 2015

👍

fjy added a commit that referenced this pull request Nov 3, 2015
static to non-static conversion for methods in Index[Merger/Maker/IO]
@fjy fjy merged commit cec09a9 into apache:master Nov 3, 2015
@himanshug himanshug deleted the objectify_index_creators branch December 5, 2015 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants