backtype.storm.messaging
Interface IContext

All Known Implementing Classes:
Context

public interface IContext

This interface needs to be implemented for messaging plugin. Messaging plugin is specified via Storm config parameter, storm.messaging.transport. A messaging plugin should have a default constructor and implements IContext interface. Upon construction, we will invoke IContext::prepare(storm_conf) to enable context to be configured according to storm configuration.


Method Summary
 IConnection bind(String storm_id, int port)
          This method establishes a server side connection
 IConnection connect(String storm_id, String host, int port)
          This method establish a client side connection to a remote server
 void prepare(Map storm_conf)
          This method is invoked at the startup of messaging plugin
 void term()
          This method is invoked when a worker is unload a messaging plugin
 

Method Detail

prepare

void prepare(Map storm_conf)
This method is invoked at the startup of messaging plugin

Parameters:
storm_conf - storm configuration

term

void term()
This method is invoked when a worker is unload a messaging plugin


bind

IConnection bind(String storm_id,
                 int port)
This method establishes a server side connection

Parameters:
storm_id - topology ID
port - port #
Returns:
server side connection

connect

IConnection connect(String storm_id,
                    String host,
                    int port)
This method establish a client side connection to a remote server

Parameters:
storm_id - topology ID
host - remote host
port - remote port
Returns:
client side connection


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