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

java.lang.Object
  extended by org.apache.hadoop.chukwa.datacollection.sender.RetryListOfCollectors
All Implemented Interfaces:
Cloneable, Iterator<String>

public class RetryListOfCollectors
extends Object
implements Iterator<String>, Cloneable

An iterator returning a list of Collectors to try. This class is nondeterministic, since it puts collectors back on the list after some period. No node will be polled more than once per maxRetryRateMs milliseconds. hasNext() will continue return true if you have not called it recently.


Field Summary
static String RETRY_RATE_OPT
           
 
Constructor Summary
RetryListOfCollectors(org.apache.hadoop.conf.Configuration conf)
           
RetryListOfCollectors(File collectorFile, org.apache.hadoop.conf.Configuration conf)
           
RetryListOfCollectors(List<String> collectors, org.apache.hadoop.conf.Configuration conf)
          This is only used for debugging.
 
Method Summary
 void add(String collector)
           
 RetryListOfCollectors clone()
           
 boolean hasNext()
           
 String next()
           
 void remove()
           
 void shuffleList()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RETRY_RATE_OPT

public static final String RETRY_RATE_OPT
See Also:
Constant Field Values
Constructor Detail

RetryListOfCollectors

public RetryListOfCollectors(File collectorFile,
                             org.apache.hadoop.conf.Configuration conf)
                      throws IOException
Throws:
IOException

RetryListOfCollectors

public RetryListOfCollectors(List<String> collectors,
                             org.apache.hadoop.conf.Configuration conf)
This is only used for debugging. Possibly it should sanitize urls the same way the other constructor does.

Parameters:
collectors -
maxRetryRateMs -

RetryListOfCollectors

public RetryListOfCollectors(org.apache.hadoop.conf.Configuration conf)
Method Detail

shuffleList

public void shuffleList()

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<String>

next

public String next()
Specified by:
next in interface Iterator<String>

add

public void add(String collector)

remove

public void remove()
Specified by:
remove in interface Iterator<String>

clone

public RetryListOfCollectors clone()
Overrides:
clone in class Object


Copyright © ${year} The Apache Software Foundation