public final class Feeder extends Object
The feeder maintains several statistics that provide information about the replication rate for each replica. By comparing this information to information about master replication maintained by the FeederTxns class, it is also possible to estimate the lag between replicas and the master.
The statistics facilities do not expect the set of available statistics to change dynamically. To handle recording statistics about the changing set of replicas, the statistics are represented as maps that associated node names with statistics. Each feeder adds individual statistics in these maps at startup, and removes them at shutdown time to make sure that the statistics in the map only reflect up-to-date information.
Some notes about the specific statistics:
| Modifier and Type | Class and Description |
|---|---|
static class |
Feeder.ExitException
A marker exception that wraps the real exception.
|
| Constructor and Description |
|---|
Feeder() |
| Modifier and Type | Method and Description |
|---|---|
String |
dumpState()
For debugging and exception messages.
|
ArbiterFeederSource |
getArbiterFeederSource() |
StreamAuthenticator |
getAuthenticator() |
Channel |
getChannel()
Return the channel associated with this feeder.
|
FeederFilter |
getFeederFilter() |
VLSN |
getFeederVLSN()
Returns the next VLSN that will be sent to the replica.
|
StatGroup |
getProtocolStats(StatsConfig config) |
JEVersion |
getReplicaJEVersion()
Returns the JE version supported by the replica, or
null if the
value is not yet known. |
NameIdPair |
getReplicaNameIdPair() |
RepNodeImpl |
getReplicaNode()
Returns a RepNodeImpl that describes the replica, or
null if the
value is not yet known. |
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() |
TestHook<BinaryProtocol.Message> |
getWriteMessageHook()
Get the test hook to be called before sending a message using the
protocol's write method.
|
void |
initMasterFeederSource(VLSN startVLSN)
Creates the MasterFeederSource, which must be done while all files in
the VLSNIndex range are protected by syncup.
|
boolean |
isShutdown() |
void |
makeSecurityCheckResponse(String err)
Sends a security check response to client and if failure, wait for a
grace period before throwing an exception to caller
|
boolean |
needSecurityChecks() |
void |
setFeederFilter(FeederFilter filter) |
static void |
setInitialWriteMessageHook(TestHook<BinaryProtocol.Message> initialWriteMessageHook)
Set the value of the write message hook that will be used for newly
created feeders.
|
void |
setWriteMessageHook(TestHook<BinaryProtocol.Message> writeMessageHook)
Set a test hook that will be called before sending a message using the
protocol's write method, supplying the hook with the message as an
argument.
|
void |
shutdown(Exception shutdownException)
Shutdown the feeder, closing its channel and releasing its threads.
|
public void initMasterFeederSource(VLSN startVLSN) throws IOException
IOExceptionpublic StatGroup getProtocolStats(StatsConfig config)
public RepNode getRepNode()
public NameIdPair getReplicaNameIdPair()
public void setFeederFilter(FeederFilter filter)
public FeederFilter getFeederFilter()
public VLSN getReplicaTxnEndVLSN()
public VLSN getFeederVLSN()
public Channel getChannel()
public JEVersion getReplicaJEVersion()
null if the
value is not yet known.nullpublic RepNodeImpl getReplicaNode()
null if the
value is not yet known. The value will be non-null if the feeder
handshake has completed successfully.nullpublic void shutdown(Exception shutdownException)
public boolean isShutdown()
public ArbiterFeederSource getArbiterFeederSource()
public StreamAuthenticator getAuthenticator()
public String dumpState()
public void setWriteMessageHook(TestHook<BinaryProtocol.Message> writeMessageHook)
public TestHook<BinaryProtocol.Message> getWriteMessageHook()
public static void setInitialWriteMessageHook(TestHook<BinaryProtocol.Message> initialWriteMessageHook)
public boolean needSecurityChecks()
public void makeSecurityCheckResponse(String err) throws ReplicationSecurityException
err - error message sent to clientReplicationSecurityExceptionCopyright © 2024. All rights reserved.