org.apache.hadoop.chukwa.datacollection.adaptor
Class UDPAdaptor

java.lang.Object
  extended by org.apache.hadoop.chukwa.datacollection.adaptor.AbstractAdaptor
      extended by org.apache.hadoop.chukwa.datacollection.adaptor.UDPAdaptor
All Implemented Interfaces:
Adaptor
Direct Known Subclasses:
SyslogAdaptor

public class UDPAdaptor
extends AbstractAdaptor


Field Summary
 
Fields inherited from class org.apache.hadoop.chukwa.datacollection.adaptor.AbstractAdaptor
adaptorID, control, dest, type
 
Constructor Summary
UDPAdaptor()
           
 
Method Summary
 String getCurrentStatus()
          Return the adaptor's state Should not include class name or byte offset, which are written by caller.
 String parseArgs(String s)
           
 void send(byte[] buf, DatagramPacket dp)
           
 long shutdown(AdaptorShutdownPolicy shutdownPolicy)
          Signals this adaptor to come to an orderly stop.
 void start(long offset)
           
 
Methods inherited from class org.apache.hadoop.chukwa.datacollection.adaptor.AbstractAdaptor
deregisterAndStop, getType, hardStop, parseArgs, shutdown, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UDPAdaptor

public UDPAdaptor()
Method Detail

send

public void send(byte[] buf,
                 DatagramPacket dp)
          throws InterruptedException,
                 IOException
Throws:
InterruptedException
IOException

parseArgs

public String parseArgs(String s)
Specified by:
parseArgs in class AbstractAdaptor

start

public void start(long offset)
           throws AdaptorException
Specified by:
start in class AbstractAdaptor
Throws:
AdaptorException

getCurrentStatus

public String getCurrentStatus()
Description copied from interface: Adaptor
Return the adaptor's state Should not include class name or byte offset, which are written by caller. The datatype should, however, be written by this method.

Returns:
the adaptor state as a string

shutdown

public long shutdown(AdaptorShutdownPolicy shutdownPolicy)
              throws AdaptorException
Description copied from interface: Adaptor
Signals this adaptor to come to an orderly stop. The adaptor ought to push out all the data it can before exiting depending of the shutdown policy

Returns:
the logical offset at which the adaptor was when the method return
Throws:
AdaptorException


Copyright © 2011 Apache Software Foundation. All Rights Reserved.