org.apache.hadoop.chukwa.datacollection.sender
Class ChukwaHttpSender
java.lang.Object
org.apache.hadoop.chukwa.datacollection.sender.ChukwaHttpSender
- All Implemented Interfaces:
- ChukwaSender
public class ChukwaHttpSender
- extends Object
- implements ChukwaSender
Encapsulates all of the http setup and connection details needed for chunks
to be delivered to a collector.
On error, tries the list of available collectors, pauses for a minute, and
then repeats.
Will wait forever for collectors to come up.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
collectors
protected Iterator<String> collectors
ChukwaHttpSender
public ChukwaHttpSender(org.apache.hadoop.conf.Configuration c)
setCollectors
public void setCollectors(String collector)
- Set up a single connector for this client to send
Chunk
s to
- Parameters:
collector
- the url of the collector
setCollectors
public void setCollectors(Iterator<String> collectors)
- Set up a list of connectors for this client to send
Chunk
s to
- Specified by:
setCollectors
in interface ChukwaSender
- Parameters:
collectors
-
send
public List<ChukwaHttpSender.CommitListEntry> send(List<Chunk> toSend)
throws InterruptedException,
IOException
- grab all of the chunks currently in the chunkQueue, stores a copy of them
locally, calculates their size, sets them up
- Specified by:
send
in interface ChukwaSender
- Parameters:
toSend
- a list of chunks to commit
- Returns:
- array of chunk id's which were ACKed by collector
- Throws:
InterruptedException
- if interrupted while trying to send
IOException
Copyright © ${year} The Apache Software Foundation