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 @@ -20,6 +20,7 @@
import java.io.IOException;
import java.util.Objects;

import org.apache.commons.lang3.StringUtils;
import org.apache.hadoop.hdds.client.ECReplicationConfig;
import org.apache.hadoop.hdds.client.ReplicationConfig;
import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.BasicKeyInfo;
Expand Down Expand Up @@ -51,7 +52,7 @@ private BasicOmKeyInfo(Builder b) {
this.modificationTime = b.modificationTime;
this.replicationConfig = b.replicationConfig;
this.isFile = b.isFile;
this.eTag = b.eTag;
this.eTag = StringUtils.isNotEmpty(b.eTag) ? b.eTag : null;
}

private BasicOmKeyInfo(OmKeyInfo b) {
Expand Down Expand Up @@ -179,7 +180,7 @@ public BasicKeyInfo getProtobuf() {
} else {
builder.setFactor(ReplicationConfig.getLegacyFactor(replicationConfig));
}
if (eTag != null) {
if (StringUtils.isNotEmpty(eTag)) {
builder.setETag(eTag);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ Test key handling
Should Not Contain ${result} NOTICE.txt.1 exists
${result} = Execute ozone sh key info ${protocol}${server}/${volume}/bb1/key1 | jq -r '. | select(.name=="key1")'
Should contain ${result} creationTime
Should not contain ${result} ETag
${result} = Execute ozone sh key list ${protocol}${server}/${volume}/bb1 | jq -r '.[] | select(.name=="key1") | .name'
Should Be Equal ${result} key1
Execute ozone sh key rename ${protocol}${server}/${volume}/bb1 key1 key2
Expand Down