public void add ( long reportingHsid , SiteFailureMessage sfm ) { // skip if the reporting site did not belong to the pre // failure mesh, or the reporting site is reporting itself // dead, or none of the sites in the safe transaction map // are among the known hsids if ( ! m_hsids . contains ( reportingHsid ) || ! sfm . m_survivors . contains ( reportingHsid ) ) return ; Set < Long > survivors = sfm . m_survivors ; if ( Sets . filter ( sfm . getObservedFailedSites ( ) , in ( m_hsids ) ) . isEmpty ( ) ) { survivors = m_hsids ; } // dead = pre failure mesh - survivors Set < Long > dead = Sets . difference ( m_hsids , survivors ) ; removeValue ( m_dead , reportingHsid ) ; // add dead graph nodes for ( long w : dead ) { if ( ! m_hsids . contains ( w ) ) continue ; m_dead . put ( w , reportingHsid ) ; } // Remove all what the reporting site thought // was alive before this invocation removeValue ( m_alive , reportingHsid ) ; // add alive graph nodes for ( long s : survivors ) { if ( ! m_hsids . contains ( s ) ) continue ; m_alive . put ( s , reportingHsid ) ; } for ( long s : sfm . getFailedSites ( ) ) { if ( ! m_hsids . contains ( s ) ) continue ; m_reported . put ( s , reportingHsid ) ; } }
Adds alive and dead graph information from a reporting site survivor set