Class RED
java.lang.Object
org.jgroups.stack.Protocol
org.jgroups.protocols.RED
- All Implemented Interfaces:
Lifecycle
Deprecated, for removal: This API element is subject to removal in a future version.
Functionality replaced by PerDestinationBundler, see https://redhat.atlassian.net/browse/JGRP-3027
Implementation of Random Early Drop: messages are discarded when the bundler's queue in the transport nears exhaustion.
See Floyd and Van Jacobsen's paper for details.
- Since:
- 5.0.0, 4.2.2
- Author:
- Bela Ban
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected doubleDeprecated, for removal: This API element is subject to removal in a future version.protected BundlerDeprecated, for removal: This API element is subject to removal in a future version.protected final LongAdderDeprecated, for removal: This API element is subject to removal in a future version.protected booleanDeprecated, for removal: This API element is subject to removal in a future version.protected final LockDeprecated, for removal: This API element is subject to removal in a future version.protected longDeprecated, for removal: This API element is subject to removal in a future version.protected doubleDeprecated, for removal: This API element is subject to removal in a future version.protected longDeprecated, for removal: This API element is subject to removal in a future version.protected doubleDeprecated, for removal: This API element is subject to removal in a future version.protected intDeprecated, for removal: This API element is subject to removal in a future version.protected longDeprecated, for removal: This API element is subject to removal in a future version.protected final LongAdderDeprecated, for removal: This API element is subject to removal in a future version.protected doubleDeprecated, for removal: This API element is subject to removal in a future version.protected doubleDeprecated, for removal: This API element is subject to removal in a future version.Fields inherited from class Protocol
after_creation_hook, down_prot, ergonomics, id, local_addr, log, policies, preview_warning, stack, stats, up_prot -
Constructor Summary
ConstructorsConstructorDescriptionRED()Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionprotected static doublecheckRange(double val, double min, double max, String name) Deprecated, for removal: This API element is subject to removal in a future version.protected doublecomputeAverage(double old_avg, int new_queue_size) Deprecated, for removal: This API element is subject to removal in a future version.protected doublecomputeDropProbability(double avg) Deprecated, for removal: This API element is subject to removal in a future version.Computes a probability P with which the message should get dropped.Deprecated, for removal: This API element is subject to removal in a future version.A message is sent down the stack.protected booleandrop(double avg) Deprecated, for removal: This API element is subject to removal in a future version.longDeprecated.doubleDeprecated, for removal: This API element is subject to removal in a future version.doubleDeprecated, for removal: This API element is subject to removal in a future version.longDeprecated.booleanDeprecated, for removal: This API element is subject to removal in a future version.voidDeprecated, for removal: This API element is subject to removal in a future version.setEnabled(boolean e) Deprecated, for removal: This API element is subject to removal in a future version.voidstart()Deprecated, for removal: This API element is subject to removal in a future version.This method is called on aJChannel.connect(String); starts work.toString()Deprecated, for removal: This API element is subject to removal in a future version.voidup(MessageBatch batch) Deprecated, for removal: This API element is subject to removal in a future version.Sends up a multiple messages in aMessageBatch.Methods inherited from class 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, init, isErgonomics, level, parse, policies, previewWarning, previewWarning, providedDownServices, providedUpServices, removePolicy, requiredDownServices, requiredUpServices, resetStatistics, setAddress, setDownProtocol, setErgonomics, setId, setLevel, setPolicies, setProtocolStack, setSocketFactory, setUpProtocol, setValue, statsEnabled, stop, up, up
-
Field Details
-
enabled
protected boolean enabledDeprecated, for removal: This API element is subject to removal in a future version. -
queue_capacity
protected int queue_capacityDeprecated, for removal: This API element is subject to removal in a future version. -
min_threshold
protected double min_thresholdDeprecated, for removal: This API element is subject to removal in a future version. -
min
protected long minDeprecated, for removal: This API element is subject to removal in a future version. -
max_threshold
protected double max_thresholdDeprecated, for removal: This API element is subject to removal in a future version. -
max
protected long maxDeprecated, for removal: This API element is subject to removal in a future version. -
avg_queue_size
protected double avg_queue_sizeDeprecated, for removal: This API element is subject to removal in a future version. -
weight_factor
protected double weight_factorDeprecated, for removal: This API element is subject to removal in a future version. -
dropped_msgs
Deprecated, for removal: This API element is subject to removal in a future version. -
total_msgs
Deprecated, for removal: This API element is subject to removal in a future version. -
bundler
Deprecated, for removal: This API element is subject to removal in a future version. -
lock
Deprecated, for removal: This API element is subject to removal in a future version. -
span
protected long spanDeprecated, for removal: This API element is subject to removal in a future version. -
weight
protected double weightDeprecated, for removal: This API element is subject to removal in a future version.
-
-
Constructor Details
-
RED
public RED()Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
isEnabled
public boolean isEnabled()Deprecated, for removal: This API element is subject to removal in a future version. -
setEnabled
Deprecated, for removal: This API element is subject to removal in a future version. -
getMinThreshold
public double getMinThreshold()Deprecated, for removal: This API element is subject to removal in a future version. -
getDroppedMessages
Deprecated.Don't remove! https://issues.redhat.com/browse/JGRP-2814 -
getTotalMessages
Deprecated.Don't remove! https://issues.redhat.com/browse/JGRP-2814 -
getDropRate
public double getDropRate()Deprecated, for removal: This API element is subject to removal in a future version. -
start
Deprecated, for removal: This API element is subject to removal in a future version.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. -
resetStats
public void resetStats()Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
resetStatsin classProtocol
-
down
Deprecated, for removal: This API element is subject to removal in a future version.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. -
up
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:ProtocolSends up a multiple messages in aMessageBatch. The sender of the batch is always the same, and so is the destination (null == multicast messages). Messages in a batch can be OOB messages, regular messages, or mixed messages, although the transport itself will create initial MessageBatches that contain only either OOB or regular messages.The default processing below sends messages up the stack individually, based on a matching criteria (calling
Protocol.accept(Message)), and - if true - callsProtocol.up(org.jgroups.Event)for that message and removes the message. If the batch is not empty, it is passed up, or else it is dropped.Subclasses should check if there are any messages destined for them (e.g. using
MessageBatch.iterator(Predicate)), then possibly remove and process them and finally pass the batch up to the next protocol. Protocols can also modify messages in place, e.g. ENCRYPT could decrypt all encrypted messages in the batch, not remove them, and pass the batch up when done. -
toString
-
computeAverage
protected double computeAverage(double old_avg, int new_queue_size) Deprecated, for removal: This API element is subject to removal in a future version. -
computeDropProbability
protected double computeDropProbability(double avg) Deprecated, for removal: This API element is subject to removal in a future version.Computes a probability P with which the message should get dropped. min_threshold less than avg less than max_threshold. Probability increases linearly with min moving toward max -
drop
protected boolean drop(double avg) Deprecated, for removal: This API element is subject to removal in a future version. -
checkRange
Deprecated, for removal: This API element is subject to removal in a future version.
-