use of org.voltcore.messaging.Mailbox in project voltdb by VoltDB.
the class MockMailbox method send.
@Override
public void send(long HSId, VoltMessage message) {
outgoingMessages.add(new Message(HSId, message));
Mailbox dest = postoffice.get(HSId);
if (dest != null) {
message.m_sourceHSId = m_hsId;
dest.deliver(message);
}
}
use of org.voltcore.messaging.Mailbox in project voltdb by VoltDB.
the class ExportDataSource method forwardAckToOtherReplicas.
private void forwardAckToOtherReplicas(long uso) {
if (m_runEveryWhere && m_replicaRunning) {
//we dont forward if we are running as replica in replicated export
return;
}
Pair<Mailbox, ImmutableList<Long>> p = m_ackMailboxRefs.get();
Mailbox mbx = p.getFirst();
if (mbx != null && p.getSecond().size() > 0) {
// partition:int(4) + length:int(4) +
// signaturesBytes.length + ackUSO:long(8) + 2 bytes for runEverywhere or not.
final int msgLen = 4 + 4 + m_signatureBytes.length + 8 + 2;
ByteBuffer buf = ByteBuffer.allocate(msgLen);
buf.putInt(m_partitionId);
buf.putInt(m_signatureBytes.length);
buf.put(m_signatureBytes);
buf.putLong(uso);
buf.putShort((m_runEveryWhere ? (short) 1 : (short) 0));
BinaryPayloadMessage bpm = new BinaryPayloadMessage(new byte[0], buf.array());
for (Long siteId : p.getSecond()) {
mbx.send(siteId, bpm);
}
}
}
Aggregations