public void addCondition(String cond) { executions.add(new Date() + ": " + cond); }
public void addCondition(String cond) { executions.add(new Date() + ": " + cond); }
public void addCondition(String cond) { executions.add(new Date() + ": " + cond); }
public boolean addIfAbsent(T obj) { return obj != null && !contains(obj) && add(obj); }
public boolean addIfAbsent(T obj) { return obj != null && !contains(obj) && add(obj); }
public boolean addIfAbsent(T obj) { return obj != null && !contains(obj) && add(obj); }
/** Called by ping task; will result in all members of host getting suspected */ protected void suspect(InetAddress host) { List<Address> suspects; suspect_history.add(new Tuple<>(host, System.currentTimeMillis())); // we need wall clock time here synchronized(hosts) { List<Address> tmp=hosts.get(host); suspects=tmp != null? new ArrayList<>(tmp) : null; } if(suspects != null) { log.debug("%s: suspecting host %s; suspected members: %s", local_addr, host, Util.printListWithDelimiter(suspects, ",")); suspect(suspects); } }
/** Called by ping task; will result in all members of host getting suspected */ protected void suspect(InetAddress host) { List<Address> suspects; suspect_history.add(new Tuple<>(host, System.currentTimeMillis())); // we need wall clock time here synchronized(hosts) { List<Address> tmp=hosts.get(host); suspects=tmp != null? new ArrayList<>(tmp) : null; } if(suspects != null) { log.debug("%s: suspecting host %s; suspected members: %s", local_addr, host, Util.printListWithDelimiter(suspects, ",")); suspect(suspects); } }
protected void suspect(Set<Address> suspects) { if(suspects == null) return; suspects.remove(local_addr); final List<Address> eligible_mbrs=new ArrayList<>(); for(Address suspect: suspects) suspect_history.add(String.format("%s: %s", new Date(), suspect)); suspected_mbrs.addAll(suspects); eligible_mbrs.addAll(this.members); eligible_mbrs.removeAll(suspected_mbrs); // Check if we're coord, then send up the stack if(local_addr != null && !eligible_mbrs.isEmpty()) { Address first=eligible_mbrs.get(0); if(local_addr.equals(first)) { log.debug("%s: suspecting %s", local_addr, suspected_mbrs); for(Address suspect: suspected_mbrs) { up_prot.up(new Event(Event.SUSPECT, suspect)); down_prot.down(new Event(Event.SUSPECT, suspect)); } } } }
protected void suspect(Set<Address> suspects) { if(suspects == null) return; suspects.remove(local_addr); final List<Address> eligible_mbrs=new ArrayList<>(); for(Address suspect: suspects) suspect_history.add(String.format("%s: %s", new Date(), suspect)); suspected_mbrs.addAll(suspects); eligible_mbrs.addAll(this.members); eligible_mbrs.removeAll(suspected_mbrs); // Check if we're coord, then send up the stack if(local_addr != null && !eligible_mbrs.isEmpty()) { Address first=eligible_mbrs.get(0); if(local_addr.equals(first)) { log.debug("%s: suspecting %s", local_addr, suspected_mbrs); for(Address suspect: suspected_mbrs) { up_prot.up(new Event(Event.SUSPECT, suspect)); down_prot.down(new Event(Event.SUSPECT, suspect)); } } } }
/** Called by ping task; will result in all members of host getting suspected */ protected void suspect(InetAddress host) { List<Address> suspects; suspect_history.add(new Tuple<>(host, System.currentTimeMillis())); // we need wall clock time here synchronized(hosts) { List<Address> tmp=hosts.get(host); suspects=tmp != null? new ArrayList<>(tmp) : null; } if(suspects != null) { log.debug("%s: suspecting host %s; suspected members: %s", local_addr, host, Util.printListWithDelimiter(suspects, ",")); suspect(suspects); } }
protected void queueMessage(Message msg, long seqno) { if(become_server_queue != null) { become_server_queue.add(msg); log.trace("%s: message %s::%d was added to queue (not yet server)", local_addr, msg.getSrc(), seqno); } else log.trace("%s: message %s::%d was discarded (not yet server)", local_addr, msg.getSrc(), seqno); }
protected void queueMessage(Message msg, long seqno) { if(become_server_queue != null) { become_server_queue.add(msg); log.trace("%s: message %s::%d was added to queue (not yet server)", local_addr, msg.getSrc(), seqno); } else log.trace("%s: message %s::%d was discarded (not yet server)", local_addr, msg.getSrc(), seqno); }
protected void queueMessage(Message msg, long seqno) { if(become_server_queue != null) { become_server_queue.add(msg); log.trace("%s: message %s::%d was added to queue (not yet server)", local_addr, msg.getSrc(), seqno); } else log.trace("%s: message %s::%d was discarded (not yet server)", local_addr, msg.getSrc(), seqno); }
synchronized void add(Request req) { if(suspended) { log.trace("%s: queue is suspended; request %s is discarded",local_addr,req); return; } start(); try { queue.add(req); history.add(new Date() + ": " + req.toString()); } catch(QueueClosedException e) { log.trace("%s: queue is closed; request %s is discarded", local_addr, req); } }
synchronized void add(Request req) { if(suspended) { log.trace("%s: queue is suspended; request %s is discarded",local_addr,req); return; } start(); try { queue.add(req); history.add(new Date() + ": " + req.toString()); } catch(QueueClosedException e) { log.trace("%s: queue is closed; request %s is discarded", local_addr, req); } }
synchronized void add(Request req) { if(suspended) { log.trace("%s: queue is suspended; request %s is discarded",local_addr,req); return; } start(); try { queue.add(req); history.add(new Date() + ": " + req.toString()); } catch(QueueClosedException e) { log.trace("%s: queue is closed; request %s is discarded", local_addr, req); } }
public synchronized boolean setMergeId(MergeId expected, MergeId new_value) { boolean match=Util.match(this.merge_id, expected); if(match) { if(new_value != null && merge_id_history.contains(new_value)) return false; else merge_id_history.add(new_value); this.merge_id=new_value; if(this.merge_id != null) { // Clears the view handler queue and discards all JOIN/LEAVE/MERGE requests until after the MERGE gms.getViewHandler().suspend(); gms.getDownProtocol().down(new Event(Event.SUSPEND_STABLE, 20000)); startMergeKiller(); } } return match; }
public synchronized boolean setMergeId(MergeId expected, MergeId new_value) { boolean match=Util.match(this.merge_id, expected); if(match) { if(new_value != null && merge_id_history.contains(new_value)) return false; else merge_id_history.add(new_value); this.merge_id=new_value; if(this.merge_id != null) { // Clears the view handler queue and discards all JOIN/LEAVE/MERGE requests until after the MERGE gms.getViewHandler().suspend(); gms.getDownProtocol().down(new Event(Event.SUSPEND_STABLE, 20000)); startMergeKiller(); } } return match; }
public synchronized boolean setMergeId(MergeId expected, MergeId new_value) { boolean match=Util.match(this.merge_id, expected); if(match) { if(new_value != null && merge_id_history.contains(new_value)) return false; else merge_id_history.add(new_value); this.merge_id=new_value; if(this.merge_id != null) { // Clears the view handler queue and discards all JOIN/LEAVE/MERGE requests until after the MERGE gms.getViewHandler().suspend(); gms.getDownProtocol().down(new Event(Event.SUSPEND_STABLE, 20000)); startMergeKiller(); } } return match; }