|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.chukwa.datacollection.sender.ChukwaHttpSender
public class ChukwaHttpSender
Encapsulates all of the http setup and connection details needed for chunks to be delivered to a collector. This class should encapsulate the details of the low level data formatting. The Connector is responsible for picking what to send and to whom; retry policy is encoded in the collectors iterator. This class is not thread safe. Synchronization is the caller's responsibility.
On error, tries the list of available collectors, pauses for a minute, and then repeats.
Will wait forever for collectors to come up.
| Nested Class Summary | |
|---|---|
static class |
ChukwaHttpSender.CommitListEntry
|
| Field Summary | |
|---|---|
static String |
COLLECTOR_TIMEOUT_OPT
|
protected Iterator<String> |
collectors
|
| Constructor Summary | |
|---|---|
ChukwaHttpSender(org.apache.hadoop.conf.Configuration c)
|
|
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String COLLECTOR_TIMEOUT_OPT
protected Iterator<String> collectors
| Constructor Detail |
|---|
public ChukwaHttpSender(org.apache.hadoop.conf.Configuration c)
| Method Detail |
|---|
public void setCollectors(Iterator<String> collectors)
Chunks to
setCollectors in interface ChukwaSendercollectors -
public List<ChukwaHttpSender.CommitListEntry> send(List<Chunk> toSend)
throws InterruptedException,
IOException
send in interface ChukwaSendertoSend - a list of chunks to commit
InterruptedException - if interrupted while trying to send
IOException
public List<ChukwaHttpSender.CommitListEntry> postAndParseResponse(org.apache.commons.httpclient.methods.PostMethod method,
List<ChukwaHttpSender.CommitListEntry> expectedCommitResults)
throws IOException,
InterruptedException
method - the data to pushexpectedCommitResults - the list
IOException
InterruptedException
protected List<String> reliablySend(org.apache.commons.httpclient.HttpMethodBase method,
String pathSuffix)
throws InterruptedException,
IOException
method -
InterruptedException
IOException - 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)
IOException
org.apache.commons.httpclient.HttpExceptionpublic void stop()
stop in interface ChukwaSender
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||