Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public enum OzoneManagerVersion implements ComponentVersion {
LIGHTWEIGHT_LIST_KEYS(4, "OzoneManager version that supports lightweight"
+ " listKeys API."),

ATOMIC_REWRITE_KEY(5, "OzoneManager version that supports rewriting key as atomic operation"),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll need to update the specific version number later, as 5 is being added for HDDS-10435.


FUTURE_VERSION(-1, "Used internally in the client when the server side is "
+ " newer and an unknown server version has arrived to the client.");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1416,6 +1416,10 @@ public OzoneOutputStream createKey(
public OzoneOutputStream rewriteKey(String volumeName, String bucketName, String keyName,
long size, long existingKeyGeneration, ReplicationConfig replicationConfig,
Map<String, String> metadata) throws IOException {
if (omVersion.compareTo(OzoneManagerVersion.ATOMIC_REWRITE_KEY) < 0) {
throw new IOException("OzoneManager does not support atomic key rewrite.");
}

createKeyPreChecks(volumeName, bucketName, keyName, replicationConfig);
String ownerName = getRealUserInfo().getShortUserName();

Expand Down