Class BaseBundler

    • Field Detail

      • msgs

        protected final java.util.Map<Address,​java.util.List<Message>> msgs
        Keys are destinations, values are lists of Messages
      • transport

        protected TP transport
      • lock

        protected final java.util.concurrent.locks.ReentrantLock lock
      • count

        protected long count
      • log

        protected Log log
    • Constructor Detail

      • BaseBundler

        public BaseBundler()
    • Method Detail

      • 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
      • stop

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

        public void send​(Message msg)
                  throws java.lang.Exception
        Specified by:
        send in interface Bundler
        Throws:
        java.lang.Exception
      • size

        public int size()
        Returns the total number of messages in the hashmap
        Specified by:
        size in interface Bundler
      • sendBundledMessages

        protected void sendBundledMessages()
        Sends all messages in the map. Messages for the same destination are bundled into a message list. The map will be cleared when done.
      • clearMessages

        protected void clearMessages()
      • sendSingleMessage

        protected void sendSingleMessage​(Message msg)
      • sendMessageList

        protected void sendMessageList​(Address dest,
                                       Address src,
                                       java.util.List<Message> list)
      • addMessage

        protected void addMessage​(Message msg,
                                  long size)