Spring for Apache Hadoop

org.springframework.data.hadoop.store.strategy.rollover
Class ChainedRolloverStrategy

java.lang.Object
  extended by org.springframework.data.hadoop.store.strategy.rollover.ChainedRolloverStrategy
All Implemented Interfaces:
RolloverStrategy

public class ChainedRolloverStrategy
extends java.lang.Object
implements RolloverStrategy

RolloverStrategy which is simply chaining other strategies.

Author:
Janne Valkealahti

Constructor Summary
ChainedRolloverStrategy()
          Instantiates a new chained rollover strategy.
ChainedRolloverStrategy(java.util.List<? extends RolloverStrategy> strategies)
          Instantiates a new chained rollover strategy.
 
Method Summary
 java.util.List<? extends RolloverStrategy> getStrategies()
          Gets the strategies.
 boolean hasRolled()
          Checks if strategy wants to rollover.
 void register(RolloverStrategy strategy)
          Register a new strategy.
 void reset()
          Reset the strategy state.
 void setStrategies(java.util.List<? extends RolloverStrategy> strategies)
          Sets the list of strategies.
 void setWritePosition(long position)
          Sets the write position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChainedRolloverStrategy

public ChainedRolloverStrategy()
Instantiates a new chained rollover strategy.


ChainedRolloverStrategy

public ChainedRolloverStrategy(java.util.List<? extends RolloverStrategy> strategies)
Instantiates a new chained rollover strategy.

Parameters:
strategies - the strategies
Method Detail

hasRolled

public boolean hasRolled()
Description copied from interface: RolloverStrategy
Checks if strategy wants to rollover.

Specified by:
hasRolled in interface RolloverStrategy
Returns:
true, if rollover should happen

reset

public void reset()
Description copied from interface: RolloverStrategy
Reset the strategy state.

Specified by:
reset in interface RolloverStrategy

setWritePosition

public void setWritePosition(long position)
Description copied from interface: RolloverStrategy
Sets the write position.

Specified by:
setWritePosition in interface RolloverStrategy
Parameters:
position - the new write position

setStrategies

public void setStrategies(java.util.List<? extends RolloverStrategy> strategies)
Sets the list of strategies. This clears all existing strategies.

Parameters:
strategies - the new strategies

register

public void register(RolloverStrategy strategy)
Register a new strategy.

Parameters:
strategy - the strategy

getStrategies

public java.util.List<? extends RolloverStrategy> getStrategies()
Gets the strategies.

Returns:
the strategies

Spring for Apache Hadoop