static Storage initializeGroup ( Collection < Storage > group ) { List < Storage > sorted = Ordering . natural ( ) . immutableSortedCopy ( group ) ; Storage primary = sorted . get ( 0 ) ; // After sorting, the first storage in each group is the primary. if ( ! primary . isConsistent ( ) ) { // Dropping the primary drops the entire group (primary+mirrors), so 'primary' must be a mirror that // should have been dropped but was missed due to error conditions related to eventual consistency. return null ; } for ( Storage storage : sorted ) { storage . _group = sorted ; } return primary ; }
Post - construction initialization links all non - dropped members of group together . Returns the primary member of the group other members are mirrors .