Fix MesosSupervisor.getMetadata #121
Merged
+16
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is intended to fix issue #119.
With the introduction of the
TaskAssignments
refactor for creating uniquetask IDs (#106), I introduced a couple of bugs in the implementation of
MesosSupervisor.getMetadata
:getMetadata
was always a single element vector, due to using aSet
instead of a java array previously. This was causing thePersistentVector.create(Object ... object)
method to be matched,which just puts the passed objects into a vector without iterating
over their constituent elements. Since we are passing a single
Set
object, we are getting a single element in the resultant vector.So the fix is to just create a
List
and pass that toPersistentVector.create()
.Object
must be serializable. Depending on thebuild and runtime environment, the serialization done by the storm
supervisor during initialization will fail, crashing the supervisor.
That was happening because we were passing back the
ConcurrentHashMap$KeySetView
object, which is not serializable.Here too, the fix is to just create a List and pass that to
PersistentVector.create()
.NOTE: I haven't been able to reproduce problem 2. unfortunately.