public abstract class AbstractSingleProducerEnforcer extends AbstractHollowProducerListener implements SingleProducerEnforcer
HollowProducerListener.ProducerStatus, HollowProducerListener.PublishStatus, HollowProducerListener.RestoreStatus, HollowProducerListener.Status
CycleListener.CycleSkipReason
Constructor and Description |
---|
AbstractSingleProducerEnforcer() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
_disable() |
protected abstract void |
_enable() |
protected void |
_force() |
protected abstract boolean |
_isPrimary() |
void |
disable()
Relinquish the primary producer status.
|
void |
enable()
Mark producer to enable processing cycles.
|
void |
force()
Force marking producer to enable processing cycles.
|
protected boolean |
getWasPrimary() |
boolean |
isPrimary()
runCycle() is executed only if isPrimary() is true
|
void |
onCycleComplete(HollowProducerListener.ProducerStatus status,
long elapsed,
java.util.concurrent.TimeUnit unit)
Called after
HollowProducer has completed a cycle normally or abnormally. |
void |
onCycleStart(long version)
Called when the
HollowProducer has begun a new cycle. |
onAnnouncementComplete, onAnnouncementStart, onArtifactPublish, onCycleSkip, onIntegrityCheckComplete, onIntegrityCheckStart, onNewDeltaChain, onNoDeltaAvailable, onPopulateComplete, onPopulateStart, onProducerInit, onProducerRestoreComplete, onProducerRestoreStart, onPublishComplete, onPublishStart, onValidationComplete, onValidationStart
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onAnnouncementComplete, onBlobPublish, onCycleComplete, onIntegrityCheckComplete, onPopulateComplete, onProducerInit, onProducerRestoreComplete, onPublishComplete
onBlobPublishAsync, onBlobStage
protected abstract void _enable()
protected abstract void _disable()
protected abstract boolean _isPrimary()
protected void _force()
public void enable()
SingleProducerEnforcer
enable
in interface SingleProducerEnforcer
public void disable()
SingleProducerEnforcer
disable
in interface SingleProducerEnforcer
public boolean isPrimary()
SingleProducerEnforcer
isPrimary
in interface SingleProducerEnforcer
public void force()
SingleProducerEnforcer
force
in interface SingleProducerEnforcer
public void onCycleStart(long version)
HollowProducerListener
HollowProducer
has begun a new cycle.onCycleStart
in interface HollowProducerListener
onCycleStart
in interface CycleListener
onCycleStart
in class AbstractHollowProducerListener
version
- Version produced by the HollowProducer
for new cycle about to start.public void onCycleComplete(HollowProducerListener.ProducerStatus status, long elapsed, java.util.concurrent.TimeUnit unit)
HollowProducerListener
HollowProducer
has completed a cycle normally or abnormally. A SUCCESS
status indicates that the
entire cycle was successful and the producer is available to begin another cycle.onCycleComplete
in interface HollowProducerListener
onCycleComplete
in class AbstractHollowProducerListener
status
- ProducerStatus of this cycle. HollowProducerListener.ProducerStatus.getStatus()
will return SUCCESS
when the a new data state has been announced to consumers or when there were no changes to the data; it will return @{code FAIL}
when any stage failed or any other failure occured during the cycle.elapsed
- duration of the cycle in unit
unitsunit
- units of the elapsed
durationprotected boolean getWasPrimary()