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
(package private)  void adviseMasterTransferProgress()
           
 String dumpState()
          For debugging and exception messages.
 StatGroup getProtocolStats(StatsConfig config)
           
 NameIdPair getReplicaNameIdPair()
           
 VLSN getReplicaTxnEndVLSN()
          Returns the latest commit VLSN that was acked by the replica, or NULL_VLSN if no commit was acked since the time the feeder was established.
 RepNode getRepNode()
           
 boolean isShutdown()
           
(package private)  void resetStats()
           
(package private)  void setMasterTransfer(MasterTransfer mt)
           
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()

setMasterTransfer

void setMasterTransfer(MasterTransfer mt)

adviseMasterTransferProgress

void adviseMasterTransferProgress()

getRepNode

public RepNode getRepNode()

getReplicaNameIdPair

public NameIdPair getReplicaNameIdPair()

getReplicaTxnEndVLSN

public VLSN getReplicaTxnEndVLSN()
Returns the latest commit VLSN that was acked by the replica, or NULL_VLSN if no commit was acked since the time the feeder was established.


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-2012 Oracle. All rights reserved.