storm-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kyle Nusbaum <>
Subject Re: classpath of worker
Date Tue, 06 Sep 2016 20:54:29 GMT
This is intentional. We don't want user code to preempt any of storm's libraries. Storm shades
most of the libraries it uses, so you should be able to bundle the libraries you want in with
your topology jar.
For guava specifically, storm-core does not include it. You may just package it in your jar
and use it.
 -- Kyle 

    On Friday, September 2, 2016 2:53 AM, jinhong lu <> wrote:

 Hi, I found this about storm worker class path:

protected String getWorkerClassPath(String stormJar, Map stormConf) {
    List<String> topoClasspath = new ArrayList<>();
    Object object = stormConf.get(Config.TOPOLOGY_CLASSPATH);

    if (object instanceof List) {
        topoClasspath.addAll((List<String>) object);
    } else if (object instanceof String) {
        topoClasspath.add((String) object);
    LOG.debug("topology specific classpath is {}", object);

    String classPath = Utils.workerClasspath();
    String classAddPath = Utils.addToClasspath(classPath, Arrays.asList(stormJar));
    return Utils.addToClasspath(classAddPath, topoClasspath);

According to this:
    String classAddPath = Utils.addToClasspath(classPath, Arrays.asList(stormJar));
user’s code will be load behind storm/lib, and storm/extlib.

Is it right?
and if I want another version of jar(for example, guava.jar), how can I do that?


View raw message