com.sleepycat.je.rep.impl.node
Class Feeder

java.lang.Object
  extended by com.sleepycat.je.rep.impl.node.Feeder

public final class Feeder
extends Object

There is an instance of a Feeder for each client that needs a replication stream. Either a master, or replica (providing feeder services) may establish a feeder. A feeder is created in response to a request from a Replica, and is shutdown either upon loss of connectivity, or upon a change in mastership. The protocol used to validate and negotiate a connection is synchronous, but once this phase has been completed, the communication between the feeder and replica is asynchronous. To handle the async communications, the feeder has two threads associated with it: 1) An output thread whose sole purpose is to pump log records (and if necessary heart beat requests) down to the replica as fast as the network will allow it 2) An input thread that listens for responses to transaction commits and heart beat responses.


Nested Class Summary
static class Feeder.ExitException
          A marker exception that wraps the real exception.
 
Constructor Summary
Feeder()
           
Feeder(FeederManager feederManager, SocketChannel socketChannel)
           
 
Method Summary
 String dumpState()
          For debugging and exception messages.
 SocketChannel getFeederReplicaChannel()
          Returns the channel between this Feeder and its Replica.
 StatGroup getProtocolStats(StatsConfig config)
           
 NameIdPair getReplicaNameIdPair()
           
 RepNode getRepNode()
           
 boolean isShutdown()
           
(package private)  void resetStats()
           
static void setSprayAfterNMessagesCount(long sANMC)
           
(package private)  void shutdown(Exception shutdownException)
          Shutdown the feeder, closing its channel and releasing its threads.
(package private)  void startFeederThreads()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Feeder

Feeder(FeederManager feederManager,
       SocketChannel socketChannel)
 throws DatabaseException,
        IOException
Throws:
DatabaseException
IOException

Feeder

public Feeder()
Method Detail

startFeederThreads

void startFeederThreads()

getProtocolStats

public StatGroup getProtocolStats(StatsConfig config)

resetStats

void resetStats()

getFeederReplicaChannel

public SocketChannel getFeederReplicaChannel()
Returns the channel between this Feeder and its Replica.

Returns:
the channel

getRepNode

public RepNode getRepNode()

getReplicaNameIdPair

public NameIdPair getReplicaNameIdPair()

shutdown

void shutdown(Exception shutdownException)
Shutdown the feeder, closing its channel and releasing its threads. May be called internally upon noticing a problem, or externally when the RepNode is shutting down.


isShutdown

public boolean isShutdown()

setSprayAfterNMessagesCount

public static void setSprayAfterNMessagesCount(long sANMC)

dumpState

public String dumpState()
For debugging and exception messages.



Copyright (c) 2004-2010 Oracle. All rights reserved.