Permalink
Browse files

UNICAST2.sendStableMessages() doesn't need to purge its own messages;…

… this is already done
  • Loading branch information...
1 parent 572f4ac commit ac462710c905a74c2b37847fd6967bc5c6d57647 Bela Ban committed Jan 27, 2012
Showing with 1 addition and 41 deletions.
  1. +1 −6 src/org/jgroups/protocols/UNICAST2.java
  2. +0 −35 src/org/jgroups/util/Table.java
@@ -618,11 +618,6 @@ protected void sendStableMessage(Address dest, short conn_id, long hd, long hr)
log.trace(sb.toString());
}
down_prot.down(new Event(Event.MSG, stable_msg));
-
- ReceiverEntry entry=recv_table.get(dest);
- Table<Message> win=entry != null? entry.received_msgs : null;
- if(win != null)
- win.purge(win.getHighestDelivered(),true);
}
@@ -786,7 +781,7 @@ protected void handleDataReceived(Address sender, long seqno, short conn_id, boo
if(added) {
int len=msg.getLength();
- if(len > 0 && entry.incrementStable(msg.getLength()))
+ if(len > 0 && entry.incrementStable(len))
sendStableMessage(sender, entry.recv_conn_id, win.getHighestDelivered(), win.getHighestReceived());
}
@@ -315,41 +315,6 @@ public T remove(boolean nullify) {
*/
public void purge(long seqno) {
purge(seqno, false);
- /*lock.lock();
- try {
- if(seqno > hd) // we cannot be higher than the highest removed seqno
- seqno=hd;
- int start_row=computeRow(low), end_row=computeRow(seqno);
- if(start_row < 0) start_row=0;
- if(end_row < 0)
- return;
- for(int i=start_row; i < end_row; i++) // Null all rows which can be fully removed
- matrix[i]=null;
-
- if(matrix[end_row] != null) {
- int index=computeIndex(seqno);
- for(int i=0; i <= index; i++) // null all elements up to and including seqno in the given row
- matrix[end_row][i]=null;
- }
- if(seqno > low)
- low=seqno;
- num_purges++;
- if(max_compaction_time <= 0) // see if compaction should be triggered
- return;
-
- long current_time=System.currentTimeMillis();
- if(last_compaction_timestamp > 0) {
- if(current_time - last_compaction_timestamp >= max_compaction_time) {
- _compact();
- last_compaction_timestamp=current_time;
- }
- }
- else
- last_compaction_timestamp=current_time;
- }
- finally {
- lock.unlock();
- }*/
}
/**

0 comments on commit ac46271

Please sign in to comment.