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

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

public class RetryListOfCollectors
extends Object
implements Iterator<String>

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.


Constructor Summary
RetryListOfCollectors(File collectorFile, int maxRetryRateMs)
           
RetryListOfCollectors(List<String> collectors, int maxRetryRateMs)
           
 
Method Summary
 void add(URL collector)
           
 String getRandomCollector()
           
 boolean hasNext()
           
 String next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RetryListOfCollectors

public RetryListOfCollectors(File collectorFile,
                             int maxRetryRateMs)
                      throws IOException
Throws:
IOException

RetryListOfCollectors

public RetryListOfCollectors(List<String> collectors,
                             int maxRetryRateMs)
Method Detail

hasNext

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

next

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

getRandomCollector

public String getRandomCollector()

add

public void add(URL collector)

remove

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


Copyright © ${year} The Apache Software Foundation