public String toString(final Address[] order, boolean print_highest_received) { StringBuilder sb=new StringBuilder(); boolean first=true; if(capacity() == 0) return "[]"; int count=0, capacity=capacity(); for(Address key: order) { long[] tmp_seqnos=key != null? get(key) : null; if(key == null || tmp_seqnos == null) continue; if(!first) sb.append(", "); else first=false; sb.append(key).append(": ").append('[').append(tmp_seqnos[0]); if(print_highest_received) sb.append(" (").append(tmp_seqnos[1]).append(")"); sb.append("]"); if(Util.MAX_LIST_PRINT_SIZE > 0 && ++count >= Util.MAX_LIST_PRINT_SIZE) { if(capacity > count) sb.append(", ..."); break; } } return sb.toString(); }
/** * Returns true if all senders of the current digest have their seqnos >= the ones from other * @param other * @return */ public boolean isGreaterThanOrEqual(Digest other) { if(other == null) return true; Map<Address,Entry> our_map=getSenders(); Address sender; Entry my_entry, their_entry; long my_highest, their_highest; for(Map.Entry<Address,Entry> entry: our_map.entrySet()) { sender=entry.getKey(); my_entry=entry.getValue(); their_entry=other.get(sender); if(their_entry == null) continue; my_highest=my_entry.getHighest(); their_highest=their_entry.getHighest(); if(my_highest < their_highest) return false; } return true; }
/** * Returns true if all senders of the current digest have their seqnos >= the ones from other */ protected static boolean isGreaterThanOrEqual(Digest first, Digest other) { if(other == null) return true; for(Digest.Entry entry: first) { Address sender=entry.getMember(); long[] their_entry=other.get(sender); if(their_entry == null) continue; long my_highest=entry.getHighest(); long their_highest=Math.max(their_entry[0],their_entry[1]); if(my_highest < their_highest) return false; } return true; }
sender=entry.getKey(); their_entry=entry.getValue(); my_entry=my_digest.get(sender); if(my_entry == null) continue;
long[] my_entry=my_digest.get(member); if(my_entry == null) continue;
public String toString(final Address[] order, boolean print_highest_received) { StringBuilder sb=new StringBuilder(); boolean first=true; if(capacity() == 0) return "[]"; int count=0, capacity=capacity(); for(Address key: order) { long[] tmp_seqnos=key != null? get(key) : null; if(key == null || tmp_seqnos == null) continue; if(!first) sb.append(", "); else first=false; sb.append(key).append(": ").append('[').append(tmp_seqnos[0]); if(print_highest_received) sb.append(" (").append(tmp_seqnos[1]).append(")"); sb.append("]"); if(Util.MAX_LIST_PRINT_SIZE > 0 && ++count >= Util.MAX_LIST_PRINT_SIZE) { if(capacity > count) sb.append(", ..."); break; } } return sb.toString(); }
/** * wait for the mcast state from the given member to reach the given seqno */ protected void waitForMessageState(NAKACK2 nakack, InternalDistributedMember sender, Long seqno) throws InterruptedException { JGAddress jgSender = new JGAddress(sender); Digest digest = nakack.getDigest(jgSender); if (digest != null) { for (;;) { long[] senderSeqnos = digest.get(jgSender); if (senderSeqnos == null || senderSeqnos[0] >= seqno.longValue()) { break; } Thread.sleep(50); } } }
/** * Returns true if all senders of the current digest have their seqnos >= the ones from other */ protected static boolean isGreaterThanOrEqual(Digest first, Digest other) { if(other == null) return true; for(Digest.Entry entry: first) { Address sender=entry.getMember(); long[] their_entry=other.get(sender); if(their_entry == null) continue; long my_highest=entry.getHighest(); long their_highest=Math.max(their_entry[0],their_entry[1]); if(my_highest < their_highest) return false; } return true; }
Entry e1=this.get(address); Entry e2=other.get(address); thisMinusInteresection.removeAll(intersection); for(Address address : thisMinusInteresection) { resultMap.put(address, new Entry(this.get(address))); otherMinusInteresection.removeAll(intersection); for(Address address : otherMinusInteresection) { resultMap.put(address, new Entry(other.get(address)));
Entry e1=this.get(address); Entry e2=other.get(address); if(e1.getHighestDeliveredSeqno() != e2.getHighestDeliveredSeqno()) { long low=Math.min(e1.highest_delivered_seqno, e2.highest_delivered_seqno); thisMinusInteresection.removeAll(intersection); for(Address address : thisMinusInteresection) { resultMap.put(address, new Entry(this.get(address))); otherMinusInteresection.removeAll(intersection); for(Address address : otherMinusInteresection) { resultMap.put(address, new Entry(other.get(address)));
long[] my_entry=my_digest.get(member); if(my_entry == null) continue;