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

Add withConfig api to allow running an execution with a transformed config #1489

Merged
merged 6 commits into from
Feb 9, 2016

Conversation

ianoc
Copy link
Collaborator

@ianoc ianoc commented Feb 1, 2016

Adds the the ability to transform Config's (and hence args) for sub-sections of Execution flows. This can be useful to override hadoop or source level options in subsections. This lets the user have more control over things like split sizes, memory used in mappers/reducers, combining small files, etc..

@johnynek
Copy link
Collaborator

johnynek commented Feb 2, 2016

I think the cache key needs to include the config if we do this.

Also, if we go this route, I would say we change Execution from a Reader[(Config Mode), T] to State[(Config, Mode), T] and even allow mode changes in the flow.

@richwhitjr
Copy link
Contributor

I like this idea, will help in many cases where we have to go wide on a source using splits map side but want to write larger files to hdfs at the end of a job. Currently there is not much choice aside from using .shard

@@ -209,6 +209,9 @@ object Execution {
override def join[T, U](t: Execution[T], u: Execution[U]): Execution[(T, U)] = t.zip(u)
}

def withConfig[T](ex: => Execution[T])(c: Config => Config): Execution[T] =
Copy link
Collaborator

Choose a reason for hiding this comment

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

if this is lazy, the arg in the constructor needs to be, otherwise this should not be lazy.

@johnynek
Copy link
Collaborator

johnynek commented Feb 8, 2016

Looks great! (1 minor issue)

@ianoc
Copy link
Collaborator Author

ianoc commented Feb 8, 2016

Killed the lazy, not useful I don't think here

@ianoc
Copy link
Collaborator Author

ianoc commented Feb 9, 2016

Good to go now @johnynek ?

@ianoc ianoc changed the title Add a flatMapWithConfigTransform helper Add withConfig api to allow running an execution with a transformed config Feb 9, 2016
johnynek added a commit that referenced this pull request Feb 9, 2016
Add withConfig api to allow running an execution with a transformed config
@johnynek johnynek merged commit 8009a5f into develop Feb 9, 2016
@johnynek johnynek deleted the ianoc/flatMapWithConfig branch February 9, 2016 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants