stijn192 commented on a change in pull request #4430:
URL: https://github.com/apache/nifi/pull/4430#discussion_r463237030
##########
File path:
nifi-nar-bundles/nifi-azure-bundle/nifi-azure-processors/src/main/java/org/apache/nifi/processors/azure/storage/DeleteAzureBlobStorage.java
##########
@@ -48,20 +48,17 @@
@InputRequirement(Requirement.INPUT_REQUIRED)
public class DeleteAzureBlobStorage extends AbstractAzureBlobProcessor {
- private static final AllowableValue DELETE_SNAPSHOTS_NONE = new
AllowableValue(DeleteSnapshotsOption.NONE.name(), "None", "Delete the blob
only.");
-
- private static final AllowableValue DELETE_SNAPSHOTS_ALSO = new
AllowableValue(DeleteSnapshotsOption.INCLUDE_SNAPSHOTS.name(), "Include
Snapshots", "Delete the blob and its snapshots.");
+ private static final AllowableValue DELETE_SNAPSHOTS_ALSO = new
AllowableValue(DeleteSnapshotsOptionType.INCLUDE.name(), "Include Snapshots",
"Delete the blob and its snapshots.");
- private static final AllowableValue DELETE_SNAPSHOTS_ONLY = new
AllowableValue(DeleteSnapshotsOption.DELETE_SNAPSHOTS_ONLY.name(), "Delete
Snapshots Only", "Delete only the blob's snapshots.");
+ private static final AllowableValue DELETE_SNAPSHOTS_ONLY = new
AllowableValue(DeleteSnapshotsOptionType.ONLY.name(), "Delete Snapshots Only",
"Delete only the blob's snapshots.");
Review comment:
@turcsanyip Thank you for this remark! Maybe also due to my inexperience
with the NiFi codebase, but my go to solution would be to implement a solution
such as this:
```
// translation enum for backwards compatability from
DeleteSnapshotsOption (v8 api) -> DeleteSnapshotsOptionType (v12 api)
public enum DeleteSnapshotsOption {
// don't delete snapshots
NONE(null),
// include snapshots on blob deletion
INCLUDE_SNAPSHOTS(DeleteSnapshotsOptionType.INCLUDE),
// only delete snapshots of blob and don't delete blob itself
DELETE_SNAPSHOTS_ONLY(DeleteSnapshotsOptionType.ONLY);
private final DeleteSnapshotsOptionType deleteSnapshotsOptionType;
DeleteSnapshotsOption(DeleteSnapshotsOptionType type) {
this.deleteSnapshotsOptionType = type;
}
public DeleteSnapshotsOptionType getValue() {
return this.deleteSnapshotsOptionType;
}
}
```
would this suffice to achieve backwards compatability?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]