mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
some small refactors
This commit is contained in:
@@ -49,16 +49,9 @@ public class PoolUpdater implements Observer {
|
||||
private Lock lock = new ReentrantLock();
|
||||
private ScheduledExecutorService executor;
|
||||
private int intervalSeconds = DEFAULT_INTERVAL;
|
||||
private boolean inited = false;
|
||||
private volatile boolean inited = false;
|
||||
|
||||
public PoolUpdater() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see #PoolUpdater()
|
||||
*/
|
||||
public PoolUpdater(HighAvailableDataSource highAvailableDataSource) {
|
||||
this();
|
||||
setHighAvailableDataSource(highAvailableDataSource);
|
||||
}
|
||||
|
||||
@@ -73,6 +66,10 @@ public class PoolUpdater implements Observer {
|
||||
if (inited) {
|
||||
return;
|
||||
}
|
||||
if (intervalSeconds < 10) {
|
||||
LOG.warn("CAUTION: Purge interval has been set to " + intervalSeconds
|
||||
+ ". This value should NOT be too small.");
|
||||
}
|
||||
if (intervalSeconds <= 0) {
|
||||
intervalSeconds = DEFAULT_INTERVAL;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
/**
|
||||
* A NodeListner that watches a Zookeeper Path.
|
||||
* A NodeListener that watches a Zookeeper Path.
|
||||
* e.g.
|
||||
* Path to watch:
|
||||
* <pre>
|
||||
|
||||
Reference in New Issue
Block a user