org.apache.hadoop.chukwa.datacollection.sender
Class AsyncAckSender

java.lang.Object
  extended by org.apache.hadoop.chukwa.datacollection.sender.ChukwaHttpSender
      extended by org.apache.hadoop.chukwa.datacollection.sender.AsyncAckSender
All Implemented Interfaces:
ChukwaSender

public class AsyncAckSender
extends ChukwaHttpSender

An enhancement to ChukwaHttpSender that handles asynchronous acknowledgment. This class will periodically poll the collectors to find out how much data has been committed to HDFS, and will then pass those acks on to the Agent.


Nested Class Summary
static class AsyncAckSender.DelayedCommit
           
 
Nested classes/interfaces inherited from class org.apache.hadoop.chukwa.datacollection.sender.ChukwaHttpSender
ChukwaHttpSender.CommitListEntry
 
Field Summary
 AdaptorResetThread adaptorReset
           
protected static org.apache.log4j.Logger log
           
static String POLLHOSTS_OPT
           
static String POLLPERIOD_OPT
           
 
Fields inherited from class org.apache.hadoop.chukwa.datacollection.sender.ChukwaHttpSender
COLLECTOR_TIMEOUT_OPT, collectors
 
Constructor Summary
AsyncAckSender(org.apache.hadoop.conf.Configuration conf, ChukwaAgent a)
           
 
Method Summary
protected  boolean failedCollector(String downed)
          A hook for taking action when a collector is declared failed.
 List<ChukwaHttpSender.CommitListEntry> postAndParseResponse(org.apache.commons.httpclient.methods.PostMethod method, List<ChukwaHttpSender.CommitListEntry> expectedCommitResults)
           
 void setCollectors(Iterator<String> collectors)
          Set up a list of connectors for this client to send Chunks to
 void stop()
           
 
Methods inherited from class org.apache.hadoop.chukwa.datacollection.sender.ChukwaHttpSender
doRequest, reliablySend, send
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.log4j.Logger log

POLLPERIOD_OPT

public static final String POLLPERIOD_OPT
See Also:
Constant Field Values

POLLHOSTS_OPT

public static final String POLLHOSTS_OPT
See Also:
Constant Field Values

adaptorReset

public AdaptorResetThread adaptorReset
Constructor Detail

AsyncAckSender

public AsyncAckSender(org.apache.hadoop.conf.Configuration conf,
                      ChukwaAgent a)
               throws IOException
Throws:
IOException
Method Detail

setCollectors

public void setCollectors(Iterator<String> collectors)
Description copied from class: ChukwaHttpSender
Set up a list of connectors for this client to send Chunks to

Specified by:
setCollectors in interface ChukwaSender
Overrides:
setCollectors in class ChukwaHttpSender

postAndParseResponse

public List<ChukwaHttpSender.CommitListEntry> postAndParseResponse(org.apache.commons.httpclient.methods.PostMethod method,
                                                                   List<ChukwaHttpSender.CommitListEntry> expectedCommitResults)
                                                            throws IOException,
                                                                   InterruptedException
Overrides:
postAndParseResponse in class ChukwaHttpSender
Parameters:
method - the data to push
expectedCommitResults - the list
Returns:
the list of committed chunks
Throws:
IOException
InterruptedException

failedCollector

protected boolean failedCollector(String downed)
Description copied from class: ChukwaHttpSender
A hook for taking action when a collector is declared failed. Returns whether to retry current post, or junk it

Overrides:
failedCollector in class ChukwaHttpSender

stop

public void stop()
Specified by:
stop in interface ChukwaSender
Overrides:
stop in class ChukwaHttpSender


Copyright © ${year} The Apache Software Foundation