Package com.alibaba.druid.pool.ha.node
Class PoolUpdater
- java.lang.Object
-
- com.alibaba.druid.pool.ha.node.PoolUpdater
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_INTERVAL
-
Constructor Summary
Constructors Constructor Description PoolUpdater(HighAvailableDataSource highAvailableDataSource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddNode(NodeEvent event)protected voiddeleteNode(NodeEvent event)voiddestroy()HighAvailableDataSourcegetHighAvailableDataSource()intgetIntervalSeconds()Set<String>getNodesToDel()voidinit()Create a ScheduledExecutorService to remove unused DataSources.booleanisAllowEmptyPool()booleanisInited()voidremoveDataSources()Remove unused DataSources.voidsetAllowEmptyPool(boolean allowEmptyPool)voidsetHighAvailableDataSource(HighAvailableDataSource highAvailableDataSource)voidsetIntervalSeconds(int intervalSeconds)voidupdate(Observable o, Object arg)Process the given NodeEvent[].
-
-
-
Field Detail
-
DEFAULT_INTERVAL
public static final int DEFAULT_INTERVAL
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PoolUpdater
public PoolUpdater(HighAvailableDataSource highAvailableDataSource)
-
-
Method Detail
-
isInited
public boolean isInited()
-
init
public void init()
Create a ScheduledExecutorService to remove unused DataSources.
-
destroy
public void destroy()
-
update
public void update(Observable o, Object arg)
Process the given NodeEvent[]. Maybe add / delete some nodes.
-
removeDataSources
public void removeDataSources()
Remove unused DataSources.
-
addNode
protected void addNode(NodeEvent event)
-
deleteNode
protected void deleteNode(NodeEvent event)
-
getHighAvailableDataSource
public HighAvailableDataSource getHighAvailableDataSource()
-
setHighAvailableDataSource
public void setHighAvailableDataSource(HighAvailableDataSource highAvailableDataSource)
-
getIntervalSeconds
public int getIntervalSeconds()
-
setIntervalSeconds
public void setIntervalSeconds(int intervalSeconds)
-
isAllowEmptyPool
public boolean isAllowEmptyPool()
-
setAllowEmptyPool
public void setAllowEmptyPool(boolean allowEmptyPool)
-
-