-
Notifications
You must be signed in to change notification settings - Fork 708
introduce modes for required ordered serialization #1757
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
Conversation
cc/ @johnynek |
3339abd
to
d6945f6
Compare
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.
some minor nits. Take or leave them.
|
||
import org.scalatest.{ Matchers, WordSpec } | ||
|
||
class NoOrderdSerJob(args: Args) extends Job(args) { | ||
class NoOrderdSerJob(args: Args, mode: String) extends Job(args) { |
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.
mode is confusing here since it is almost always scalding.Mode
named that. Can we rename?
case RequireOrderedSerializationMode.Fail => | ||
Failure(new RuntimeException(message)) | ||
case RequireOrderedSerializationMode.Log => | ||
LOG.error(message) |
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 this be an error or warning? I kind of feel warning.
d6945f6
to
5109b95
Compare
@johnynek I've just addressed your comments. Thank you for the quick review! |
👍 |
trait RequiredBinaryComparatorsConfig extends Job { | ||
override def config = super.config + (Config.ScaldingRequireOrderedSerialization -> "true") | ||
def requireOrderedSerializationMode: RequireOrderedSerializationMode = RequireOrderedSerializationMode.Fail | ||
override def config = super.config + (Config.ScaldingRequireOrderedSerialization -> requireOrderedSerializationMode.toString) |
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.
What's the .toString
supposed to output here? Aren't we matching on lowercase in getRequireOrderedSerializationMode
above?
Problem
We're planning to roll out
OrderedSerialization
to more jobs. The initial plan was to add theRequiredBinaryComparators
traits to our execution and job classes, but jobs could fail at runtime ifTypedPipe
transformations are done outside the job/execution body since the implicit macro wouldn't be available. For instance, we recommend people to extract transformations in companion objects for testability.Solution
Introduce a mechanism that allows us to add the traits without failing at runtime if a transformation doesn't have the ordered serialization. By overriding
requireOrderedSerializationMode
, we can set the mode toLog
, which will produce an error message at runtime.Notes