@ Override public boolean tryAssignPayload ( Payload payload ) { Preconditions . checkNotNull ( payload ) ; // check that we can actually run in this slot if ( isCanceled ( ) ) { return false ; } // atomically assign the vertex if ( ! PAYLOAD_UPDATER . compareAndSet ( this , null , payload ) ) { return false ; } // we need to do a double check that we were not cancelled in the meantime if ( isCanceled ( ) ) { this . payload = null ; return false ; } return true ; }
Atomically sets the executed vertex if no vertex has been assigned to this slot so far .