backtype.storm
Class StormSubmitter

java.lang.Object
  extended by backtype.storm.StormSubmitter

public class StormSubmitter
extends Object

Use this class to submit topologies to run on the Storm cluster. You should run your program with the "storm jar" command from the command-line, and then use this class to submit your topologies.


Nested Class Summary
static interface StormSubmitter.ProgressListener
          Interface use to track progress of file upload
 
Field Summary
static org.slf4j.Logger LOG
           
 
Constructor Summary
StormSubmitter()
           
 
Method Summary
static void setLocalNimbus(Nimbus.Iface localNimbusHandler)
           
static String submitJar(Map conf, String localJar)
          Submit jar file
static String submitJar(Map conf, String localJar, StormSubmitter.ProgressListener listener)
          Submit jar file
static void submitTopology(String name, Map stormConf, StormTopology topology)
          Submits a topology to run on the cluster.
static void submitTopology(String name, Map stormConf, StormTopology topology, SubmitOptions opts, StormSubmitter.ProgressListener progressListener)
          Submits a topology to run on the cluster.
static void submitTopologyWithProgressBar(String name, Map stormConf, StormTopology topology)
          Submits a topology to run on the cluster with a progress bar.
static void submitTopologyWithProgressBar(String name, Map stormConf, StormTopology topology, SubmitOptions opts)
          Submits a topology to run on the cluster with a progress bar.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static org.slf4j.Logger LOG
Constructor Detail

StormSubmitter

public StormSubmitter()
Method Detail

setLocalNimbus

public static void setLocalNimbus(Nimbus.Iface localNimbusHandler)

submitTopology

public static void submitTopology(String name,
                                  Map stormConf,
                                  StormTopology topology)
                           throws AlreadyAliveException,
                                  InvalidTopologyException
Submits a topology to run on the cluster. A topology runs forever or until explicitly killed.

Parameters:
name - the name of the storm.
stormConf - the topology-specific configuration. See Config.
topology - the processing to execute.
Throws:
AlreadyAliveException - if a topology with this name is already running
InvalidTopologyException - if an invalid topology was submitted

submitTopology

public static void submitTopology(String name,
                                  Map stormConf,
                                  StormTopology topology,
                                  SubmitOptions opts,
                                  StormSubmitter.ProgressListener progressListener)
                           throws AlreadyAliveException,
                                  InvalidTopologyException
Submits a topology to run on the cluster. A topology runs forever or until explicitly killed.

Parameters:
name - the name of the storm.
stormConf - the topology-specific configuration. See Config.
topology - the processing to execute.
opts - to manipulate the starting of the topology
progressListener - to track the progress of the jar upload process
Throws:
AlreadyAliveException - if a topology with this name is already running
InvalidTopologyException - if an invalid topology was submitted

submitTopologyWithProgressBar

public static void submitTopologyWithProgressBar(String name,
                                                 Map stormConf,
                                                 StormTopology topology)
                                          throws AlreadyAliveException,
                                                 InvalidTopologyException
Submits a topology to run on the cluster with a progress bar. A topology runs forever or until explicitly killed.

Parameters:
name - the name of the storm.
stormConf - the topology-specific configuration. See Config.
topology - the processing to execute.
Throws:
AlreadyAliveException - if a topology with this name is already running
InvalidTopologyException - if an invalid topology was submitted

submitTopologyWithProgressBar

public static void submitTopologyWithProgressBar(String name,
                                                 Map stormConf,
                                                 StormTopology topology,
                                                 SubmitOptions opts)
                                          throws AlreadyAliveException,
                                                 InvalidTopologyException
Submits a topology to run on the cluster with a progress bar. A topology runs forever or until explicitly killed.

Parameters:
name - the name of the storm.
stormConf - the topology-specific configuration. See Config.
topology - the processing to execute.
opts - to manipulate the starting of the topology
Throws:
AlreadyAliveException - if a topology with this name is already running
InvalidTopologyException - if an invalid topology was submitted

submitJar

public static String submitJar(Map conf,
                               String localJar)
Submit jar file

Parameters:
conf - the topology-specific configuration. See Config.
localJar - file path of the jar file to submit
Returns:
the remote location of the submitted jar

submitJar

public static String submitJar(Map conf,
                               String localJar,
                               StormSubmitter.ProgressListener listener)
Submit jar file

Parameters:
conf - the topology-specific configuration. See Config.
localJar - file path of the jar file to submit
listener - progress listener to track the jar file upload
Returns:
the remote location of the submitted jar


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.