/** * {@inheritDoc} */ public boolean equals(final Object obj) { return obj instanceof Entry && this == obj || obj != null && id.equals(((HealthMessage.Entry)obj).id); }
/** * Since MasterNode reports on other peers that they are DEAD or INDOUBT, be sure not to compare sequence ids between * a peer and a MasterNode health message report on that peer. * * @param other the entry of other peer * @return true if this HM.entry and other are from same member. */ public boolean isFromSameMember(HealthMessage.Entry other) { return (other != null && id.equals(other.id)); }
/** * Since MasterNode reports on other peers that they are DEAD or INDOUBT, be sure not to compare sequence ids between * a peer and a MasterNode health message report on that peer. * * @param other the entry of other peer * @return true if this HM.entry and other are from same member. */ public boolean isFromSameMember(HealthMessage.Entry other) { return (other != null && id.equals(other.id)); }
/** * {@inheritDoc} */ public boolean equals(final Object obj) { return obj instanceof Entry && this == obj || obj != null && id.equals(((HealthMessage.Entry)obj).id); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ProcessedMasterViewId that = (ProcessedMasterViewId) o; if (masterViewIdSeq != that.masterViewIdSeq) return false; if (master != null ? !master.equals(that.master) : that.master != null) return false; return true; } }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ProcessedMasterViewId that = (ProcessedMasterViewId) o; if (masterViewIdSeq != that.masterViewIdSeq) return false; if (master != null ? !master.equals(that.master) : that.master != null) return false; return true; } }
/** * Determines whether this node is at the top of the list * * @return true if this node is a the top of the list, false otherwise */ public boolean isFirst() { final PeerID id = view.firstKey(); return advertisement.getID().equals(id); }
/** * Determines whether this node is at the top of the list * * @param advertisement the advertisement to test * @return true if this node is a the top of the list, false otherwise */ public boolean isFirst(SystemAdvertisement advertisement) { final PeerID id = view.firstKey(); return advertisement.getID().equals(id); }
/** * Determines whether this node is at the top of the list * * @param advertisement the advertisement to test * @return true if this node is a the top of the list, false otherwise */ public boolean isFirst(SystemAdvertisement advertisement) { final PeerID id = view.firstKey(); return advertisement.getID().equals(id); }
private boolean canProcessInDoubt(final HealthMessage.Entry entry) { boolean canProcessIndoubt = false; //dont suspect self if (!entry.id.equals(localPeerID)) { if (masterNode.getMasterNodeID().equals(entry.id)) { canProcessIndoubt = true; } else if (masterNode.isMaster()) { canProcessIndoubt = true; } } return canProcessIndoubt; }
private boolean canProcessInDoubt(final HealthMessage.Entry entry) { boolean canProcessIndoubt = false; //dont suspect self if (!entry.id.equals(localPeerID)) { if (masterNode.getMasterNodeID().equals(entry.id)) { canProcessIndoubt = true; } else if (masterNode.isMaster()) { canProcessIndoubt = true; } } return canProcessIndoubt; }
/** * Determines whether this node is at the top of the list * * @return true if this node is a the top of the list, false otherwise */ public boolean isFirst() { final PeerID id = view.firstKey(); return advertisement.getID().equals(id); }
/** * Detect when one hm is from a failed member and the new hm is from the restart of that member. * @param other the entry of other peer * @return true if same instantiation of member sent this health message. */ public boolean isFromSameMemberStartup(HealthMessage.Entry other) { return (other != null && id.equals(other.id) && getSrcStartTime() == other.getSrcStartTime()); }
/** * Determines whether this node is the Master * * @return true if this node is the master node */ public boolean isMaster() { return masterAdvertisement != null && masterAdvertisement.getID().equals(advertisement.getID()); }
/** * Detect when one hm is from a failed member and the new hm is from the restart of that member. * @param other the entry of other peer * @return true if same instantiation of member sent this health message. */ public boolean isFromSameMemberStartup(HealthMessage.Entry other) { return (other != null && id.equals(other.id) && getSrcStartTime() == other.getSrcStartTime()); }
/** * Determines whether this node is the Master * * @return true if this node is the master node */ public boolean isMaster() { return masterAdvertisement != null && masterAdvertisement.getID().equals(advertisement.getID()); }
private SystemAdvertisement getNodeAdvertisement(Message msg) { SystemAdvertisement adv = null; Object value = msg.getMessageElement( NODEADV ); if( value instanceof SystemAdvertisement ) { adv = (SystemAdvertisement)value; if( !adv.getID().equals( localPeerID ) ) { if( LOG.isLoggable( Level.FINER ) ) { LOG.log( Level.FINER, "Received a System advertisement Name :" + adv.getName() ); } } } return adv; }
private SystemAdvertisement getNodeAdvertisement(Message msg) { SystemAdvertisement adv = null; Object value = msg.getMessageElement( NODEADV ); if( value instanceof SystemAdvertisement ) { adv = (SystemAdvertisement)value; if( !adv.getID().equals( localPeerID ) ) { if( LOG.isLoggable( Level.FINER ) ) { LOG.log( Level.FINER, "Received a System advertisement Name :" + adv.getName() ); } } } return adv; }
public MemberStates getMemberState(String member, long threshold, long timeout) { MemberStates result = MemberStates.UNKNOWN; if (clusterManager != null) { PeerID id = clusterManager.getID(member); if (! id.equals(PeerID.NULL_PEER_ID)) { String state = clusterManager.getNodeState(id, threshold, timeout).toUpperCase(); result = MemberStates.valueOf(state); } } return result; }
public MemberStates getMemberState(String member, long threshold, long timeout) { MemberStates result = MemberStates.UNKNOWN; if (clusterManager != null) { PeerID id = clusterManager.getID(member); if (! id.equals(PeerID.NULL_PEER_ID)) { String state = clusterManager.getNodeState(id, threshold, timeout).toUpperCase(); result = MemberStates.valueOf(state); } } return result; }