PickUpOutcomeMixin

public interface PickUpOutcomeMixin

A mixin of the PickUpOutcome that provides convenient methods for accessing the result.

Functions

Link copied to clipboard
public Optional<ShardAlreadyPickedUp> alreadyPicked()
Returns ShardAlreadyPickedUp if this outcome indicates that shard could not be picked up as it's already picked up by another worker, or empty Optional otherwise.
public static PickUpOutcome alreadyPicked(WorkerId worker, Timestamp whenPicked)
Creates a new PickUpOutcome indicating that the shard is already picked up by the given worker in pickedUp message.
Link copied to clipboard
public static PickUpOutcome pickedUp(ShardSessionRecord session)
Creates a new PickUpOutcome of successfully picked up shard with the given ShardSessionRecord.
Link copied to clipboard
public Optional<ShardSessionRecord> session()
Returns ShardProcessingSession if this outcome indicates that shard is successfully picked up, or empty Optional otherwise.