|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.perforce.p4java.impl.mapbased.rpc.func.proto.FlowControl
public class FlowControl
Process and implement the various Perforce flow control commands, in particular the flush1 / flush2 pair.
In general, we keep a count of outstanding bytes and send a flush1 when it gets above the high water mark (hwm); we then wait for a corresponding flush2 before doing much else. The server does the same thing in reverse. This will all be explained in more detail later when the full implementation is much clearer... (HR).
Field Summary | |
---|---|
static long |
DEFAULT_HI_MARK
Default maximum number of bytes allowed to be outstanding before we start worrying that we haven't seen a suitable flush2 response. |
static int |
DEFAULT_LO_MARK
Default maximum number of bytes allowed to be outstanding before we send a flush1 message on duplex commands. |
static int |
FLUSH_CMD_LENGTH
Length in bytes of a flush command when marshaled. |
static String |
TRACE_PREFIX
|
Constructor Summary | |
---|---|
FlowControl(RpcPacketDispatcher mainDispatcher,
Properties props)
|
Method Summary | |
---|---|
void |
decrementCurrentHiMark(int decr)
|
long |
getCurrentHiMark()
|
long |
getCurrentLoMark()
|
long |
getHiMark()
|
long |
getLoMark()
|
void |
incrementCurrentHiMark(int incr)
|
void |
processFlushCommandFromServer(RpcConnection rpcConnection,
RpcFunctionSpec funcSpec,
Map<String,Object> resultsMap)
Given a map passed-in from the main dispatcher that represents a flush command received from the Perforce server, respond appropriately. |
void |
sendFlush1(RpcConnection rpcConnection,
Map<String,Object> resultsMap)
|
void |
sendFlush2(RpcConnection rpcConnection,
Map<String,Object> resultsMap)
|
void |
setCurrentHiMark(long currentHiMark)
|
void |
setCurrentLoMark(long currentLoMark)
|
void |
setHiMark(long hiMark)
|
void |
setLoMark(long loMark)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String TRACE_PREFIX
public static final int FLUSH_CMD_LENGTH
public static final int DEFAULT_LO_MARK
public static final long DEFAULT_HI_MARK
Constructor Detail |
---|
public FlowControl(RpcPacketDispatcher mainDispatcher, Properties props)
Method Detail |
---|
public void processFlushCommandFromServer(RpcConnection rpcConnection, RpcFunctionSpec funcSpec, Map<String,Object> resultsMap) throws ConnectionException
ConnectionException
public void sendFlush1(RpcConnection rpcConnection, Map<String,Object> resultsMap)
public void sendFlush2(RpcConnection rpcConnection, Map<String,Object> resultsMap) throws ConnectionException
ConnectionException
public void incrementCurrentHiMark(int incr)
public void decrementCurrentHiMark(int decr)
public long getLoMark()
public void setLoMark(long loMark)
public long getHiMark()
public void setHiMark(long hiMark)
public long getCurrentLoMark()
public void setCurrentLoMark(long currentLoMark)
public long getCurrentHiMark()
public void setCurrentHiMark(long currentHiMark)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |