Package org.jgroups.protocols
Class RATE_LIMITER2
java.lang.Object
org.jgroups.stack.Protocol
org.jgroups.protocols.RATE_LIMITER2
- All Implemented Interfaces:
Lifecycle
Rate limiter based credits (max_bytes). Senders send until max_bytes is exceeded; a replenisher task replenishes
periodically.
See https://issues.redhat.com/browse/JGRP-2779 for details
- Since:
- 5.3.5
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AverageMinMaxprotected longprotected Conditionprotected booleanprotected Future<?> protected longprotected Lockprotected intprotected final LongAdderprotected final LongAdderprotected intprotected booleanprotected final Runnableprotected TimeSchedulerFields inherited from class org.jgroups.stack.Protocol
after_creation_hook, down_prot, ergonomics, id, local_addr, log, policies, stack, stats, up_prot -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidchangeInterval(long new_interval) A message is sent down the stack.booleandropDontBlockMessages(boolean p) voidinit()Called after a protocol has been created and before the protocol is started.longinterval()interval(long i) intmaxBytes()maxBytes(int m) voidvoidvoidstart()This method is called on aJChannel.connect(String); starts work.voidstop()Called on aJChannel.disconnect(); stops work (e.g.Methods inherited from class org.jgroups.stack.Protocol
accept, addPolicy, addr, addr, afterCreationHook, destroy, down, down, enableStats, getAddress, getComponents, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getLog, getName, getPolicies, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, isErgonomics, level, parse, policies, providedDownServices, providedUpServices, removePolicy, requiredDownServices, requiredUpServices, resetStatistics, setAddress, setDownProtocol, setErgonomics, setId, setLevel, setPolicies, setProtocolStack, setSocketFactory, setUpProtocol, setValue, statsEnabled, toString, up, up, up
-
Field Details
-
max_bytes
protected int max_bytes -
interval
protected long interval -
drop_dont_block_msgs
protected boolean drop_dont_block_msgs -
bytes_left
protected long bytes_left -
num_replenishments
protected int num_replenishments -
num_dropped_msgs
-
num_blockings
-
avg_block_time
-
lock
-
cond
-
running
protected boolean running -
timer
-
f
-
task
-
-
Constructor Details
-
RATE_LIMITER2
public RATE_LIMITER2()
-
-
Method Details
-
maxBytes
public int maxBytes() -
maxBytes
-
interval
public long interval() -
interval
-
dropDontBlockMessages
public boolean dropDontBlockMessages() -
dropDontBlockMessages
-
init
Description copied from class:ProtocolCalled after a protocol has been created and before the protocol is started. Attributes are already set. Other protocols are not yet connected and events cannot yet be sent. -
start
Description copied from class:ProtocolThis method is called on aJChannel.connect(String); starts work. Protocols are connected ready to receive events. Will be called from bottom to top. -
stop
public void stop()Description copied from class:ProtocolCalled on aJChannel.disconnect(); stops work (e.g. by closing multicast socket). Will be called from top to bottom. -
resetStats
public void resetStats()- Overrides:
resetStatsin classProtocol
-
replenish
public void replenish() -
changeInterval
public void changeInterval(long new_interval) -
down
Description copied from class:ProtocolA message is sent down the stack. Protocols may examine the message and do something (e.g. add a header) with it, before passing it down.
-