org.apache.tinkerpop.gremlin.process.computer

## Interface MessageCombiner<M>

- All Superinterfaces:
    Serializable
  All Known Implementing Classes:
    PageRankMessageCombiner, TraversalVertexProgramMessageCombiner

      public interface MessageCombiner<M>
      extends Serializable

  A MessageCombiner allows two messages in route to the same vertex to be aggregated into a single message. Message combining can reduce the number of messages sent between vertices and thus, reduce network traffic. Not all messages can be combined and thus, this is an optional feature of a `VertexProgram`.
  Author:
    Marko A. Rodriguez (http://markorodriguez.com)

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `M` | `combine(M messageA, M messageB)` Combine two messages and return a message containing the combination.

- - ### Method Detail

    - #### combine

          M combine(M messageA,
                    M messageB)

      Combine two messages and return a message containing the combination. In many instances, it is possible to simply merge the data in the second message into the first message. Such an optimization can limit the amount of object creation.
      Parameters:
        `messageA` - the first message
        `messageB` - the second message
      Returns:
        the combination of the two messages

Copyright © 2013–2022 Apache Software Foundation. All rights reserved.