-
Notifications
You must be signed in to change notification settings - Fork 266
Pass the semigroup to create Mergeable online #687
Conversation
new CombinedServiceStoreFactory[K, V] { | ||
def mergeableStore = () => onlineStore | ||
def mergeableStore = _ => online |
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.
Inconsistency between _
and ()
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 do you mean? They mean different things. _: Semigroup[V]
is being ignored here.
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.
Ah, of course
Looks good. I suppose we'll need a version bump for the |
@jnievelt yes, this will be a minor version break. |
} | ||
|
||
trait MergeableStoreFactory[-K, V] extends java.io.Serializable { | ||
def mergeableStore: () => Mergeable[K, V] | ||
def mergeableStore: Semigroup[V] => Mergeable[K, V] |
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.
At this point it seems like this method should be named like a function and not a property. Earlier it was in the spirit of lazily created mergeable store so the name was ok. Should we call it createMergeableStore?
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.
Well, I'm a little nervous about that because it lead to a lot of serialization problems before (which is why we did this). Calling a method is still lazy, so def mergeableStore = store
would have been lazy, but still we got burned enough to add this extra layer).
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 didn't mean to suggest we change the structure, just the name. MergeableStoreFactory.mergeableStore reads like a property which would provide a mergeable store but it is a function that takes an input to provide a mergeable store.
e.g. when I read factory.mergeableStore I would think that this is a mergeable store object, finding out that it is a function that needs a semigroup as input to produce a mergeable store would be a surprise.
Looks good overall, one minor comment. |
@johnynek Could you cut a release before merging this? This will for sure require changes in our internal repository since there are custom implementations of MergeableStoreFactory that will need to change. |
@pankajroark I want to push back on cutting a release. The reason is this:
To turn it around: should Twitter employees publish new jars on each incompatible change for other users to see what the change will be like before a merge? I think that is too much work. |
Actually I think there's just one place where we call |
Yeah, this should be ok. Overriding Mergeable is common, MergeableStoreFactory seems to be created mostly with the help of factory function. By bad in confusing the two. On cutting a release on breaking changes, it was just an effort on my part to make my life easier. I'm planning to do a summingbird release soon and was hoping to do least amount of code changes in our repo, the last release turned out to be very complicated due to the MemoryPlatform changes. But it's not a big deal. In general I agree I wouldn't expect a release of summingbird on every breaking change. |
I have a +1 on this now, @pankajroark @jnievelt ? |
closes #677
The issue is that it is easy to have the semigroup get out of sync between the
implicit
semigroup in theProducer
graph, and the captured value for storm. This is not totally fixed, since when using a single store as a service and a store, we still need to capture the semigroup, butleftJoin
does not have access to that. We could fix that walking the graph and finding the semigroup at the location of thesumByKey
. We can do that in a later PR.