public class ChukwaHttpSender extends Object implements ChukwaSender
On error, tries the list of available collectors, pauses for a minute, and then repeats.
Will wait forever for collectors to come up.
| Modifier and Type | Class and Description | 
|---|---|
| static class  | ChukwaHttpSender.CommitListEntry | 
| Modifier and Type | Field and Description | 
|---|---|
| static String | COLLECTOR_TIMEOUT_OPT | 
| protected Iterator<String> | collectors | 
| Constructor and Description | 
|---|
| ChukwaHttpSender(org.apache.hadoop.conf.Configuration c) | 
| Modifier and Type | Method and Description | 
|---|---|
| protected List<String> | doRequest(org.apache.commons.httpclient.HttpMethodBase method,
         String dest)Responsible for performing a single operation to a specified collector URL. | 
| protected boolean | failedCollector(String downCollector)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) | 
| protected List<String> | reliablySend(org.apache.commons.httpclient.HttpMethodBase method,
            String pathSuffix)Responsible for executing the supplied method on at least one collector | 
| List<ChukwaHttpSender.CommitListEntry> | send(List<Chunk> toSend)grab all of the chunks currently in the chunkQueue, stores a copy of them
 locally, calculates their size, sets them up | 
| void | setCollectors(Iterator<String> collectors)Set up a list of connectors for this client to send  Chunks to | 
| void | stop() | 
public static final String COLLECTOR_TIMEOUT_OPT
public void setCollectors(Iterator<String> collectors)
Chunks tosetCollectors in interface ChukwaSendercollectors - public List<ChukwaHttpSender.CommitListEntry> send(List<Chunk> toSend) throws InterruptedException, IOException
send in interface ChukwaSendertoSend - a list of chunks to commitInterruptedException - if interrupted while trying to sendIOExceptionpublic List<ChukwaHttpSender.CommitListEntry> postAndParseResponse(org.apache.commons.httpclient.methods.PostMethod method, List<ChukwaHttpSender.CommitListEntry> expectedCommitResults) throws IOException, InterruptedException
method - the data to pushexpectedCommitResults - the listIOExceptionInterruptedExceptionprotected List<String> reliablySend(org.apache.commons.httpclient.HttpMethodBase method, String pathSuffix) throws InterruptedException, IOException
method - InterruptedExceptionIOException - if no collector responds with an OKprotected boolean failedCollector(String downCollector)
downCollector - protected List<String> doRequest(org.apache.commons.httpclient.HttpMethodBase method, String dest) throws IOException, org.apache.commons.httpclient.HttpException
dest - the URL being requested. (Including hostname)IOExceptionorg.apache.commons.httpclient.HttpExceptionpublic void stop()
stop in interface ChukwaSenderCopyright © 2014 Apache Software Foundation. All Rights Reserved.