/** * Removes all elements less than or equal to seqno from the table. Does this by nulling entire rows in the matrix * and nulling all elements < index(seqno) of the first row that cannot be removed * @param seqno */ public void purge(long seqno) { purge(seqno, false); }
/** Add the ACK to hashtable.sender.sent_msgs */ protected void handleAckReceived(Address sender, long seqno, short conn_id, int timestamp) { if(is_trace) log.trace("%s <-- ACK(%s: #%d, conn-id=%d, ts=%d)", local_addr, sender, seqno, conn_id, timestamp); SenderEntry entry=send_table.get(sender); if(entry != null && entry.connId() != conn_id) { log.trace("%s: my conn_id (%d) != received conn_id (%d); discarding ACK", local_addr, entry.connId(), conn_id); return; } Table<Message> win=entry != null? entry.msgs : null; if(win != null && entry.updateLastTimestamp(timestamp)) { win.purge(seqno, true); // removes all messages <= seqno (forced purge) num_acks_received++; } }
entry.update(); if(dont_loopback_set) entry.msgs.purge(entry.msgs.getHighestDeliverable()); break;
buf.purge(hd);
/** * Removes all elements less than or equal to seqno from the table. Does this by nulling entire rows in the matrix * and nulling all elements < index(seqno) of the first row that cannot be removed * @param seqno */ public void purge(long seqno) { purge(seqno, false); }
/** Add the ACK to hashtable.sender.sent_msgs */ protected void handleAckReceived(Address sender, long seqno, short conn_id, int timestamp) { if(is_trace) log.trace("%s <-- ACK(%s: #%d, conn-id=%d, ts=%d)", local_addr, sender, seqno, conn_id, timestamp); SenderEntry entry=send_table.get(sender); if(entry != null && entry.connId() != conn_id) { log.trace("%s: my conn_id (%d) != received conn_id (%d); discarding ACK", local_addr, entry.connId(), conn_id); return; } Table<Message> win=entry != null? entry.msgs : null; if(win != null && entry.updateLastTimestamp(timestamp)) { win.purge(seqno, true); // removes all messages <= seqno (forced purge) num_acks_received++; } }
entry.update(); if(dont_loopback_set) entry.msgs.purge(entry.msgs.getHighestDeliverable()); break;