Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Sadanand Shenoy committed Sep 5, 2024
1 parent efb3516 commit 15170e8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,15 @@ public boolean setSafeMode(SafeModeAction action, boolean isChecked)

@Override
public void setReplication(String key, short replication) throws IOException {
OzoneKeyDetails keyDetails = bucket.getKey(key);
OzoneKeyDetails keyDetails = null;
try {
keyDetails = bucket.getKey(key);
} catch (OMException ome) {
if (ome.getResult() == KEY_NOT_FOUND) {
return;
}
throw ome;
}
ReplicationConfig newReplication = OzoneClientUtils
.resolveClientSideReplicationConfig(replication, null,
null, config);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,16 @@ protected void incrementCounter(Statistic objectsRead, long count) {
public void setReplication(String key, short replication) throws IOException {
OFSPath ofsPath = new OFSPath(key, config);
OzoneBucket bucket = getBucket(ofsPath, false);
OzoneKeyDetails keyDetails = bucket.getKey(ofsPath.getKeyName());
OzoneKeyDetails keyDetails = null;
try {
keyDetails = bucket.getKey(key);
} catch (OMException ome) {
// if key does not exist, do nothing
if (ome.getResult() == KEY_NOT_FOUND) {
return;
}
throw ome;
}
ReplicationConfig newReplication = OzoneClientUtils
.resolveClientSideReplicationConfig(replication, null,
null, config);
Expand Down

0 comments on commit 15170e8

Please sign in to comment.