|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.flume.util.OrderSelector<T>
T
- - The class on which ordering is to be donepublic abstract class OrderSelector<T>
A basic implementation of an order selector that implements a simple exponential backoff algorithm. Subclasses can use the same algorithm for backoff by simply overriding createIterator method to order the list of active sinks returned by getIndexList method. Classes instantiating subclasses of this class are expected to call informFailure method when an object passed to this class should be marked as failed and backed off. When implementing a different backoff algorithm, a subclass should minimally override informFailure and getIndexList methods.
Constructor Summary | |
---|---|
protected |
OrderSelector(boolean shouldBackOff)
|
Method Summary | |
---|---|
abstract Iterator<T> |
createIterator()
|
protected List<Integer> |
getIndexList()
|
long |
getMaxTimeOut()
|
List<T> |
getObjects()
Get the list of objects to be ordered. |
void |
informFailure(T failedObject)
Inform this class of the failure of an object so it can be backed off. |
boolean |
isShouldBackOff()
|
void |
setMaxTimeOut(long timeout)
|
void |
setObjects(List<T> objects)
Set the list of objects which this class should return in order. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected OrderSelector(boolean shouldBackOff)
Method Detail |
---|
public void setObjects(List<T> objects)
objects
- public List<T> getObjects()
public abstract Iterator<T> createIterator()
public void informFailure(T failedObject)
failedObject
- protected List<Integer> getIndexList()
public boolean isShouldBackOff()
public void setMaxTimeOut(long timeout)
public long getMaxTimeOut()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |