com.sleepycat.je.rep.impl.networkRestore
Class FeederManager
java.lang.Object
java.lang.Thread
com.sleepycat.je.utilint.StoppableThread
com.sleepycat.je.rep.impl.networkRestore.FeederManager
- All Implemented Interfaces:
- ExceptionListenerUser, Runnable
public class FeederManager
- extends StoppableThread
Manages the multiple log file feeders that may be servicing requests from
multiple clients requesting log files.
Nested Class Summary |
(package private) class |
FeederManager.Lease
Provides the lease mechanism used to maintain a handle to the DbBackup
object across Server client disconnects. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
feeders
final Map<Integer,LogFileFeeder> feeders
leases
final Map<Integer,FeederManager.Lease> leases
statResponses
final Map<String,Protocol.FileInfoResp> statResponses
leaseTimer
final Timer leaseTimer
nameIdPair
final NameIdPair nameIdPair
leaseRenewalCount
public int leaseRenewalCount
leaseDuration
long leaseDuration
serviceDispatcher
final ServiceDispatcher serviceDispatcher
shutdown
final AtomicBoolean shutdown
logger
final Logger logger
FEEDER_SERVICE
public static final String FEEDER_SERVICE
- See Also:
- Constant Field Values
FeederManager
public FeederManager(ServiceDispatcher serviceDispatcher,
EnvironmentImpl envImpl,
NameIdPair nameIdPair)
- Creates a FeederManager but does not start it.
- Parameters:
serviceDispatcher
- The service dispatcher with which the
FeederManager must register itself. It's null only in a test
environment.nameIdPair
- The node name and id associated with the feederenvImpl
- the environment that will provide the log files
getEnvImpl
EnvironmentImpl getEnvImpl()
getLeaseRenewalCount
public int getLeaseRenewalCount()
- Returns the number of times the lease was actually renewed.
getLeaseCount
public int getLeaseCount()
- Returns the number of leases that are currently outstanding.
getActiveFeederCount
public int getActiveFeederCount()
- Returns the number of feeders that are currently active with this node.
Note that active leases are included in this count, since it's expected
that the clients will try to reconnect.
getLeaseDuration
public long getLeaseDuration()
setLeaseDuration
public void setLeaseDuration(long leaseDuration)
run
public void run()
- The dispatcher method that starts up new log file feeders.
- Specified by:
run
in interface Runnable
- Overrides:
run
in class Thread
shutdown
public void shutdown()
initiateSoftShutdown
protected int initiateSoftShutdown()
- Description copied from class:
StoppableThread
- Threads that use shutdownThread() must define this method. It's invoked
by shutdownThread as an attempt at a soft shutdown.
This method makes provisions for this thread to exit on its own. The
technique used to make the thread exit can vary based upon the nature of
the service being provided by the thread. For example, the thread may be
known to poll some shutdown flag on a periodic basis, or it may detect
that a channel that it waits on has been closed by this method.
- Overrides:
initiateSoftShutdown
in class StoppableThread
- Returns:
- the amount of time in ms that the shutdownThread method will
wait for the thread to exit. A -ve value means that the method will not
wait. A zero value means it will wait indefinitely.
getLogger
protected Logger getLogger()
- Specified by:
getLogger
in class StoppableThread
- Returns:
- a logger to use when logging uncaught exceptions.
- See Also:
StoppableThread.getLogger()
Copyright (c) 2004-2010 Oracle. All rights reserved.