public abstract class TriggerBase extends Object implements AutoScaling.Trigger
AutoScaling.Trigger implementations.
It handles state snapshot / restore in ZK.| Modifier and Type | Field and Description |
|---|---|
protected Map<String,Object> |
lastState |
protected SolrZkClient |
zkClient |
| Modifier | Constructor and Description |
|---|---|
protected |
TriggerBase(SolrZkClient zkClient) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract Map<String,Object> |
getState()
Prepare and return internal state of this trigger in a format suitable for persisting in ZK.
|
void |
restoreState()
Restore internal state of this trigger from ZooKeeper.
|
void |
saveState()
Save internal state of this trigger in ZooKeeper.
|
protected abstract void |
setState(Map<String,Object> state)
Restore internal state of this trigger from properties retrieved from ZK.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetActions, getEventType, getName, getProcessor, getProperties, getWaitForSecond, init, isClosed, isEnabled, restoreState, setProcessorprotected SolrZkClient zkClient
protected TriggerBase(SolrZkClient zkClient)
protected abstract Map<String,Object> getState()
Utils.toJSON(Object).protected abstract void setState(Map<String,Object> state)
state - never null but may be empty.public void saveState()
AutoScaling.TriggersaveState in interface AutoScaling.Triggerpublic void restoreState()
AutoScaling.TriggerrestoreState in interface AutoScaling.TriggerCopyright © 2000-2017 Apache Software Foundation. All Rights Reserved.