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

STORM-188: Allow user to specifiy full configuration path when running storm command #120

Conversation

clockfly
Copy link
Contributor

We can use system config "storm.conf.file" to specify a custom config file.

Before this patch, we will only try to lookup this file on jvm classpath.

This patch will give us the ability to specify full/relative filesystem path as configuration file path, thus will give us more flexibility, while we still are able to look it up on jvm classpath.

Now we are able to submit storm topology like this:

storm jar job.jar --config /tmp/dynamic-configuration-path.yaml

We don't need to add /tmp into our classpath(also inappropriate).

… system path if we cannot find it on classpath
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.PrintStream;
Copy link

Choose a reason for hiding this comment

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

Unused?

@d2r
Copy link

d2r commented Jul 10, 2014

Changed my comments to the diff instead of the commit. Sorry about that.

@d2r
Copy link

d2r commented Aug 14, 2014

@clockfly Any chance to look at the comments?

@d2r
Copy link

d2r commented Sep 4, 2014

@clockfly Could you upmerge also?

@clockfly
Copy link
Contributor Author

clockfly commented Sep 5, 2014

Sure, I will take care of it.

@d2r
Copy link

d2r commented Sep 30, 2014

Hi @clockfly, any update?

@clockfly
Copy link
Contributor Author

clockfly commented Nov 4, 2014

@d2r , sorry it takes so long.

Now, the patch is synced with upstream.

@clockfly
Copy link
Contributor Author

The original behavior of findAndReadConfigFile() is to locate config file on classpath.

findResources(name) will not be empty when name exists on classpath.

input.close();
in = getConfigFileInputStream(name);
if (null != in) {
Yaml yaml = new Yaml();
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we change this to Yaml yaml = new Yaml(new SafeConstructor());

@revans2
Copy link
Contributor

revans2 commented Nov 18, 2014

I just had one comment, to avoid YAML doing some potentially unsafe things, but it is not that critical, because placing a --config on the command line is going to use a file the user probably supplied.

+ " resources. You're probably bundling the Storm jars with your topology jar. "
+ resources);
} else {
URL resource = resources.iterator().next();
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be nice to log something here, so that the user knows that we are using a config file from the classpath. I just thought about the case where someone creates a ./storm.yaml file and passes it in with --config. They will get the storm.yaml from the classpath without knowing it, because the classpath is searched prior to the absolute path being searched, and this would be really confusing.

@revans2
Copy link
Contributor

revans2 commented Jan 9, 2015

@clockfly any update on this? I just had the one minor comment, and I am happy to do it myself in a follow up JIRA if you want. Just curious if this is still on your radar.

@clockfly
Copy link
Contributor Author

@revans,

Feel free to do what you want, change it, or replace it.:)

knusbaum pushed a commit to knusbaum/incubator-storm that referenced this pull request Feb 11, 2015
@manuzhang
Copy link
Contributor

guys, any updates on this issue ?

@d2r
Copy link

d2r commented Oct 8, 2015

@clockfly , It seems this pull request was superseded by #495, and STORM-188 has been resolved. Would you close this pull request?

@clockfly
Copy link
Contributor Author

clockfly commented Oct 9, 2015

Sure.

@clockfly clockfly closed this Oct 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants