org.jgroups.protocols

Class FC

public class FC extends Protocol

Simple flow control protocol based on a credit system. Each sender has a number of credits (bytes to send). When the credits have been exhausted, the sender blocks. Each receiver also keeps track of how many credits it has received from a sender. When credits for a sender fall below a threshold, the receiver sends more credits to the sender. Works for both unicast and multicast messages.

Note that this protocol must be located towards the top of the stack, or all down_threads from JChannel to this protocol must be set to false ! This is in order to block JChannel.send()/JChannel.down().
This is the second simplified implementation of the same model. The algorithm is sketched out in doc/FlowControl.txt

Version: $Revision: 1.50 $

Author: Bela Ban

Nested Class Summary
static classFC.FcHeader
Method Summary
voiddown(Event evt)
MapdumpStats()
doublegetAverageTimeBlocked()
longgetMaxBlockTime()
longgetMaxCredits()
longgetMinCredits()
doublegetMinThreshold()
StringgetName()
intgetNumberOfBlockings()
intgetNumberOfCreditRequestsReceived()
intgetNumberOfCreditRequestsSent()
intgetNumberOfCreditResponsesReceived()
intgetNumberOfCreditResponsesSent()
longgetTotalTimeBlocked()
booleanisBlocked()
StringprintCredits()
StringprintReceiverCredits()
StringprintSenderCredits()
protected voidreceiveDownEvent(Event evt)
We need to receive view changes concurrent to messages on the down events: a message might blocks, e.g. because we don't have enough credits to send to member P.
voidresetStats()
voidsetMaxBlockTime(long t)
voidsetMaxCredits(long max_credits)
voidsetMinCredits(long min_credits)
voidsetMinThreshold(double min_threshold)
booleansetProperties(Properties props)
StringshowLastBlockingTimes()
voidstart()
voidstop()
voidunblock()
Allows to unblock a blocked sender from an external program, e.g.
voidup(Event evt)

Method Detail

down

public void down(Event evt)

dumpStats

public Map dumpStats()

getAverageTimeBlocked

public double getAverageTimeBlocked()

getMaxBlockTime

public long getMaxBlockTime()

getMaxCredits

public long getMaxCredits()

getMinCredits

public long getMinCredits()

getMinThreshold

public double getMinThreshold()

getName

public final String getName()

getNumberOfBlockings

public int getNumberOfBlockings()

getNumberOfCreditRequestsReceived

public int getNumberOfCreditRequestsReceived()

getNumberOfCreditRequestsSent

public int getNumberOfCreditRequestsSent()

getNumberOfCreditResponsesReceived

public int getNumberOfCreditResponsesReceived()

getNumberOfCreditResponsesSent

public int getNumberOfCreditResponsesSent()

getTotalTimeBlocked

public long getTotalTimeBlocked()

isBlocked

public boolean isBlocked()

printCredits

public String printCredits()

printReceiverCredits

public String printReceiverCredits()

printSenderCredits

public String printSenderCredits()

receiveDownEvent

protected void receiveDownEvent(Event evt)
We need to receive view changes concurrent to messages on the down events: a message might blocks, e.g. because we don't have enough credits to send to member P. However, if member P crashed, we need to unblock !

Parameters: evt

resetStats

public void resetStats()

setMaxBlockTime

public void setMaxBlockTime(long t)

setMaxCredits

public void setMaxCredits(long max_credits)

setMinCredits

public void setMinCredits(long min_credits)

setMinThreshold

public void setMinThreshold(double min_threshold)

setProperties

public boolean setProperties(Properties props)

showLastBlockingTimes

public String showLastBlockingTimes()

start

public void start()

stop

public void stop()

unblock

public void unblock()
Allows to unblock a blocked sender from an external program, e.g. JMX

up

public void up(Event evt)
Copyright ? 1998-2005 Bela Ban. All Rights Reserved.