backtype.storm.messaging.netty
Class Client

java.lang.Object
  extended by backtype.storm.messaging.netty.Client
All Implemented Interfaces:
IConnection

public class Client
extends Object
implements IConnection


Method Summary
 void close()
          gracefully close this client.
 String name()
           
 Iterator<TaskMessage> recv(int flags, int clientId)
          receive a batch message iterator (consists taskId and payload)
 void send(int taskId, byte[] payload)
          send a message with taskId and payload
 void send(Iterator<TaskMessage> msgs)
          Enqueue task messages to be sent to server
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

send

public void send(Iterator<TaskMessage> msgs)
Enqueue task messages to be sent to server

Specified by:
send in interface IConnection

name

public String name()

close

public void close()
gracefully close this client. We will send all existing requests, and then invoke close_n_release() method

Specified by:
close in interface IConnection

recv

public Iterator<TaskMessage> recv(int flags,
                                  int clientId)
Description copied from interface: IConnection
receive a batch message iterator (consists taskId and payload)

Specified by:
recv in interface IConnection
Parameters:
flags - 0: block, 1: non-block
Returns:

send

public void send(int taskId,
                 byte[] payload)
Description copied from interface: IConnection
send a message with taskId and payload

Specified by:
send in interface IConnection
Parameters:
taskId - task ID


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