public Map < String , byte [ ] > getCurrentMembers ( ) { ImmutableMap . Builder < String , byte [ ] > builder = ImmutableMap . builder ( ) ; boolean thisIdAdded = false ; for ( ChildData data : cache . getCurrentData ( ) ) { String id = idFromPath ( data . getPath ( ) ) ; thisIdAdded = thisIdAdded || id . equals ( thisId ) ; builder . put ( id , data . getData ( ) ) ; } if ( ! thisIdAdded ) { builder . put ( thisId , pen . getData ( ) ) ; // this instance is always a member } return builder . build ( ) ; }
Return the current view of membership . The keys are the IDs of the members . The values are each member s payload