Package org.apache.cassandra.net
Class ForwardingInfo
- java.lang.Object
-
- org.apache.cassandra.net.ForwardingInfo
-
- All Implemented Interfaces:
java.io.Serializable
public final class ForwardingInfo extends java.lang.Object implements java.io.Serializable
A container used to store a node -> message_id map for inter-DC write forwarding. We pick one node in each external DC to forward the message to its local peers. TODO: in the next protocol version only serialize peers, message id will become redundant once 3.0 is out of the picture- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ForwardingInfo(java.util.List<InetAddressAndPort> targets, long[] messageIds)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
forEach(java.util.function.BiConsumer<java.lang.Long,InetAddressAndPort> biConsumer)
Apply the provided consumer to all (host, message_id) pairs.boolean
useSameMessageID(long id)
-
-
-
Constructor Detail
-
ForwardingInfo
public ForwardingInfo(java.util.List<InetAddressAndPort> targets, long[] messageIds)
-
-
Method Detail
-
useSameMessageID
public boolean useSameMessageID(long id)
- Returns:
true
if all host are to use the same message id,false
otherwise. Starting with 4.0 and above, we should be reusing the same id, always, but it won't always be true until 3.0/3.11 are phased out.
-
forEach
public void forEach(java.util.function.BiConsumer<java.lang.Long,InetAddressAndPort> biConsumer)
Apply the provided consumer to all (host, message_id) pairs.
-
-