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

java.lang.Object
  extended by 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.


Nested Class Summary
static class ChukwaHttpSender.CommitListEntry
           
 
Field Summary
protected  Iterator<String> collectors
           
 
Constructor Summary
ChukwaHttpSender(org.apache.hadoop.conf.Configuration c)
           
 
Method Summary
 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 setCollectors(String collector)
          Set up a single connector for this client to send Chunks to
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

collectors

protected Iterator<String> collectors
Constructor Detail

ChukwaHttpSender

public ChukwaHttpSender(org.apache.hadoop.conf.Configuration c)
Method Detail

setCollectors

public void setCollectors(String collector)
Set up a single connector for this client to send Chunks 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 Chunks 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