Skip to content

Commit

Permalink
Add Missing Nullable Assertions in SnapshotsService (#49465)
Browse files Browse the repository at this point in the history
Just realized we were missing some annotations here which was somewhat
confusing since other methods/parameters have the `Nullable` annotation
wherever a `null` can be passed.
  • Loading branch information
original-brownbear authored Nov 22, 2019
1 parent f35c972 commit a59b452
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1061,20 +1061,21 @@ public void onFailure(final Exception e) {
* Removes record of running snapshot from cluster state
* @param snapshot snapshot
* @param snapshotInfo snapshot info if snapshot was successful
* @param e exception if snapshot failed
* @param e exception if snapshot failed, {@code null} otherwise
*/
private void removeSnapshotFromClusterState(final Snapshot snapshot, final SnapshotInfo snapshotInfo, final Exception e) {
private void removeSnapshotFromClusterState(final Snapshot snapshot, final SnapshotInfo snapshotInfo, @Nullable Exception e) {
removeSnapshotFromClusterState(snapshot, snapshotInfo, e, null);
}

/**
* Removes record of running snapshot from cluster state and notifies the listener when this action is complete
* @param snapshot snapshot
* @param failure exception if snapshot failed
* @param failure exception if snapshot failed, {@code null} otherwise
* @param listener listener to notify when snapshot information is removed from the cluster state
*/
private void removeSnapshotFromClusterState(final Snapshot snapshot, @Nullable SnapshotInfo snapshotInfo, final Exception failure,
private void removeSnapshotFromClusterState(final Snapshot snapshot, @Nullable SnapshotInfo snapshotInfo, @Nullable Exception failure,
@Nullable CleanupAfterErrorListener listener) {
assert snapshotInfo != null || failure != null : "Either snapshotInfo or failure must be supplied";
clusterService.submitStateUpdateTask("remove snapshot metadata", new ClusterStateUpdateTask() {

@Override
Expand Down

0 comments on commit a59b452

Please sign in to comment.