Class PerDestinationBundler

java.lang.Object
org.jgroups.protocols.PerDestinationBundler
All Implemented Interfaces:
Bundler

public class PerDestinationBundler extends Object implements Bundler
Queues messages per destination ('null' is a special destination), sending when the last sender thread to the same destination returns or max_size has been reached. This uses 1 thread per destination, so it won't scale to many cluster members (unless virtual threads are used).

See https://issues.redhat.com/browse/JGRP-2639 for details.

Since:
5.2.7
  • Field Details

    • max_size

      protected int max_size
      Maximum number of bytes for messages to be queued until they are sent. This value needs to be smaller than the largest datagram packet size in case of UDP
    • total_msgs_sent

      protected final LongAdder total_msgs_sent
    • num_single_msgs_sent

      protected final LongAdder num_single_msgs_sent
    • num_batches_sent

      protected final LongAdder num_batches_sent
    • num_send_due_to_no_msgs

      protected final LongAdder num_send_due_to_no_msgs
    • num_sends_due_to_max_size

      protected final LongAdder num_sends_due_to_max_size
    • transport

      protected TP transport
    • log

      protected Log log
    • local_addr

      protected Address local_addr
    • dests

    • NULL

      protected static final Address NULL
    • THREAD_NAME

      protected static final String THREAD_NAME
      See Also:
    • p_send_msg_list

      final Profiler p_send_msg_list
    • p_send_single_msg

      final Profiler p_send_single_msg
    • p_send_msgs

      final Profiler p_send_msgs
  • Constructor Details

    • PerDestinationBundler

      public PerDestinationBundler()
  • Method Details

    • size

      public int size()
      Description copied from interface: Bundler
      The number of unsent messages in the bundler
      Specified by:
      size in interface Bundler
    • getQueueSize

      public int getQueueSize()
      Description copied from interface: Bundler
      If the bundler has a queue and it should be managed by a queuing discipline (like Random Early Detection), then return the number of elements in the queue, else -1. In the latter case, the queue won't be managed.

      This method needs to be fast as it might get called on every message to be sent.

      Specified by:
      getQueueSize in interface Bundler
    • getMaxSize

      public int getMaxSize()
      Description copied from interface: Bundler
      Maximum number of bytes for messages to be queued until they are sent
      Specified by:
      getMaxSize in interface Bundler
    • setMaxSize

      public Bundler setMaxSize(int s)
      Specified by:
      setMaxSize in interface Bundler
    • avgBatchSize

      public double avgBatchSize()
    • resetStats

      public void resetStats()
      Specified by:
      resetStats in interface Bundler
    • init

      public void init(TP transport)
      Description copied from interface: Bundler
      Called after creation of the bundler
      Specified by:
      init in interface Bundler
      Parameters:
      transport - the transport, for further reference
    • start

      public void start()
      Description copied from interface: Bundler
      Called after Bundler.init(TP)
      Specified by:
      start in interface Bundler
    • stop

      public void stop()
      Specified by:
      stop in interface Bundler
    • send

      public void send(Message msg) throws Exception
      Specified by:
      send in interface Bundler
      Throws:
      Exception
    • viewChange

      public void viewChange(View view)
      Specified by:
      viewChange in interface Bundler