private byte [ ] replicas ( ) { byte [ ] r = _replicas ; if ( r != null ) return r ; byte [ ] nr = new byte [ H2O . CLOUD . size ( ) + 1 /*1-based numbering*/ + 10 /*limit of 10 clients*/ ] ; if ( REPLICAS_UPDATER . compareAndSet ( this , null , nr ) ) return nr ; r = _replicas /*read again, since CAS failed must be set now*/ ; assert r != null ; return r ; }
Fills in the _replicas field atomically on first set of a replica .