public class PacketSendBuffer extends Object implements FCPublisher
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEBUG_LAT |
static String |
KEEP_SUBS_NODEID |
long |
lastMsgFlush |
static int |
RETRANS_MEM |
static boolean |
RETRANSDEBUG |
| Constructor and Description |
|---|
PacketSendBuffer(PhysicalTransport trans,
String nodeId,
Topic entry) |
| Modifier and Type | Method and Description |
|---|---|
FCPublisher |
batchOnLimit(boolean doBatch)
decides wether to start batching once rate limit is reached.
|
void |
flush() |
void |
free() |
int |
getPacketRateLimit() |
Topic |
getTopicEntry() |
int |
getTopicId() |
protected void |
initDropMsgPacket(String nodeId) |
boolean |
isBatchOnLimit(boolean doBatch) |
boolean |
isUnordered() |
boolean |
offer(String receiverNodeId,
byte[] b,
int start,
int len,
boolean doFlush)
send a byte[] message
|
boolean |
offer(String subscriberNodeId,
org.nustaq.offheap.bytez.ByteSource msg,
boolean doFlush)
send a byte[] message
|
boolean |
offer(String receiverNodeId,
org.nustaq.offheap.bytez.ByteSource msg,
long start,
int len,
boolean doFlush)
send a byte[] message
|
protected boolean |
offerNoLock(String receiverNodeId,
org.nustaq.offheap.bytez.ByteSource msg,
long start,
int len,
boolean doFlush) |
void |
setPacketRateLimit(int limit) |
void |
setUnordered(boolean unordered) |
public static boolean RETRANSDEBUG
public static final String KEEP_SUBS_NODEID
public static boolean DEBUG_LAT
public static int RETRANS_MEM
public volatile long lastMsgFlush
public PacketSendBuffer(PhysicalTransport trans, String nodeId, Topic entry)
protected void initDropMsgPacket(String nodeId)
public void free()
public Topic getTopicEntry()
public boolean isUnordered()
public void setUnordered(boolean unordered)
protected boolean offerNoLock(String receiverNodeId, org.nustaq.offheap.bytez.ByteSource msg, long start, int len, boolean doFlush)
public boolean offer(String receiverNodeId, byte[] b, int start, int len, boolean doFlush)
FCPublisheroffer in interface FCPublisherreceiverNodeId - - null to send to all subscribers, aNodeId to target a specific nodeb - - bytes to sendstart - - start offsetlen - - number of bytes to senddoFlush - - if true, the currently written packet is sent immediately EXCEPT your send rate is > pps limit (packets per second)
only set to true if you care mostly about latency instead of throughput. fast cast automatically flushes after one ms. So a
value of true only makes sense if you care about micros.public boolean offer(String receiverNodeId, org.nustaq.offheap.bytez.ByteSource msg, long start, int len, boolean doFlush)
FCPublisheroffer in interface FCPublisherreceiverNodeId - - null to send to all subscribers, aNodeId to target a specific nodemsg - - byte source containing the message bytesstart - - start offsetlen - - number of bytes to senddoFlush - - if true, the currently written packet is sent immediately EXCEPT your send rate is > pps limit (packets per second)
only set to true if you care mostly about latency instead of throughput. fast cast automatically flushes after one ms. So a
value of true only makes sense if you care about micros.public boolean offer(String subscriberNodeId, org.nustaq.offheap.bytez.ByteSource msg, boolean doFlush)
FCPublisheroffer in interface FCPublishersubscriberNodeId - - null to send to all subscribers, aNodeId to target a specific nodemsg - - byte source containing the message bytes.doFlush - - if true, the currently written packet is sent immediately EXCEPT your send rate is > pps limit (packets per second)
only set to true if you care mostly about latency instead of throughput. fast cast automatically flushes after one ms. So a
value of true only makes sense if you care about micros.public int getTopicId()
getTopicId in interface FCPublisherpublic void setPacketRateLimit(int limit)
setPacketRateLimit in interface FCPublisherpublic int getPacketRateLimit()
getPacketRateLimit in interface FCPublisherpublic FCPublisher batchOnLimit(boolean doBatch)
FCPublisherbatchOnLimit in interface FCPublisherpublic boolean isBatchOnLimit(boolean doBatch)
isBatchOnLimit in interface FCPublisherpublic void flush()
flush in interface FCPublisherCopyright © 2015. All rights reserved.