Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Use a factory to create VirtualSpout instances #71

Merged
merged 5 commits into from
Nov 23, 2017

Conversation

stanlemon
Copy link
Contributor

IMO this is related to #70 as you can tell by some of the naming weirdness.

FactoryManager doesn't have any facilities for passing arguments to a constructor, which is why it was not used to create the VirtualSpoutFactory.

I have mixed feelings about the generics in DelegateSpoutFactory, in the end if this is not done we wind up casting, so I think this is a better option honestly.

Note that right now the FilterChain is part of VirtualSpout and not of DelegateSpout, I think this is worth calling out because it is the primary reason why someone would want to directly type against VirtualSpout today. Perhaps we should reconsider this, I'm open to this - we just need to make a decision that the FilterChain is a first class citizen in the interface and that we expect implementations to utilize this.

@stanlemon stanlemon requested a review from Crim November 22, 2017 16:13
// it's our firehose.
fireHoseIdentifier,
getSpoutConfig(),
topologyContext,
Copy link
Contributor

Choose a reason for hiding this comment

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

I like this approach. Do we need to store a copy of topologyContext anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably not. I don’t think we use it. Should we just drop 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.

It's used to construct ConsumerPeerContext, which should maybe just be moved to a constructor parameter? Not sure. I started stripping topologyContext out, I'll stick it in a branch in case we want to revisit but I don't think we should sweat it right now.

Copy link
Contributor

Choose a reason for hiding this comment

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

oh its just used in open right, i just meant dropping saving the reference in the class beyond the scope of where its used. Not sure it matters much tho

* Handy in things like {@link com.salesforce.storm.spout.dynamic.handler.SpoutHandler} where we want to abstract away particulars, such
* as the things passed down from {@link DynamicSpout} such as the {@link MetricsRecorder} as an example.
*/
public class VirtualSpoutFactory implements DelegateSpoutFactory {
Copy link
Contributor

Choose a reason for hiding this comment

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

No test over this class?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added, thanks for keeping me honest.

@stanlemon stanlemon merged commit 7c0964f into master Nov 23, 2017
@stanlemon stanlemon deleted the lemon/virtual-spout-factory branch November 23, 2017 02:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants