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 @@ -110,7 +110,6 @@ public final class OmKeyInfo extends WithParentObjectId
// This allows a key to be created an committed atomically if the original has not
// been modified.
private Long expectedDataGeneration = null;
private String expectedETag;

private OmKeyInfo(Builder b) {
super(b);
Expand All @@ -130,7 +129,6 @@ private OmKeyInfo(Builder b) {
this.ownerName = b.ownerName;
this.tags = b.tags.build();
this.expectedDataGeneration = b.expectedDataGeneration;
this.expectedETag = b.expectedETag;
}

private static Codec<OmKeyInfo> newCodec(boolean ignorePipeline) {
Expand Down Expand Up @@ -191,14 +189,6 @@ public Long getExpectedDataGeneration() {
return expectedDataGeneration;
}

public void setExpectedETag(String eTag) {
this.expectedETag = eTag;
}

public String getExpectedETag() {
return expectedETag;
}

public String getOwnerName() {
return ownerName;
}
Expand Down Expand Up @@ -502,7 +492,6 @@ public static class Builder extends WithParentObjectId.Builder<OmKeyInfo> {
private boolean isFile;
private final MapBuilder<String, String> tags;
private Long expectedDataGeneration = null;
private String expectedETag;

public Builder() {
this.acls = AclListBuilder.empty();
Expand All @@ -525,7 +514,6 @@ public Builder(OmKeyInfo obj) {
this.fileChecksum = obj.fileChecksum;
this.isFile = obj.isFile;
this.expectedDataGeneration = obj.expectedDataGeneration;
this.expectedETag = obj.expectedETag;
this.tags = MapBuilder.of(obj.tags);
obj.keyLocationVersions.forEach(keyLocationVersion ->
this.omKeyLocationInfoGroups.add(
Expand Down Expand Up @@ -697,11 +685,6 @@ public Builder setExpectedDataGeneration(Long existingGeneration) {
return this;
}

public Builder setExpectedETag(String eTag) {
this.expectedETag = eTag;
return this;
}

@Override
protected void validate() {
super.validate();
Expand Down Expand Up @@ -821,9 +804,6 @@ private KeyInfo getProtobuf(boolean ignorePipeline, String fullKeyName,
if (expectedDataGeneration != null) {
kb.setExpectedDataGeneration(expectedDataGeneration);
}
if (expectedETag != null) {
kb.setExpectedETag(expectedETag);
}
if (ownerName != null) {
kb.setOwnerName(ownerName);
}
Expand Down Expand Up @@ -877,9 +857,6 @@ public static Builder builderFromProtobuf(KeyInfo keyInfo) {
if (keyInfo.hasExpectedDataGeneration()) {
builder.setExpectedDataGeneration(keyInfo.getExpectedDataGeneration());
}
if (keyInfo.hasExpectedETag()) {
builder.setExpectedETag(keyInfo.getExpectedETag());
}

if (keyInfo.hasOwnerName()) {
builder.setOwnerName(keyInfo.getOwnerName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1192,11 +1192,6 @@ message KeyInfo {
// This allows a key to be created an committed atomically if the original has not
// been modified.
optional uint64 expectedDataGeneration = 22;

// expectedETag, when set, indicates that the existing key must have
// the given ETag for the operation to succeed. This is used for
// S3 conditional writes with the If-Match header.
optional string expectedETag = 23;
}

// KeyInfoProtoLight is a lightweight subset of KeyInfo message containing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager, Execut
// Set the UpdateID to current transactionLogIndex
omKeyInfo = omKeyInfo.toBuilder()
.setExpectedDataGeneration(null)
.setExpectedETag(null)
.addAllMetadata(KeyValueUtil.getFromProtobuf(
commitKeyArgs.getMetadataList()))
.setUpdateID(trxnLogIndex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager, Execut
// Optimistic locking validation has passed. Now set the rewrite fields to null so they are
// not persisted in the key table.
omKeyInfo.setExpectedDataGeneration(null);
omKeyInfo.setExpectedETag(null);

long correctedSpace = omKeyInfo.getReplicatedSize();
// if keyToDelete isn't null, usedNamespace shouldn't check and increase.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -993,9 +993,6 @@ protected OmKeyInfo prepareFileInfo(
if (keyArgs.hasExpectedDataGeneration()) {
builder.setExpectedDataGeneration(keyArgs.getExpectedDataGeneration());
}
if (keyArgs.hasExpectedETag()) {
builder.setExpectedETag(keyArgs.getExpectedETag());
}

return builder.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ public void testCreateKeyExpectedGenCreateIfNotExistsKeyMissing(
assertNotNull(openKeyInfo);
assertEquals(OzoneConsts.EXPECTED_GEN_CREATE_IF_NOT_EXISTS,
openKeyInfo.getExpectedDataGeneration());
assertNull(openKeyInfo.getExpectedETag());
}

@ParameterizedTest
Expand Down Expand Up @@ -353,7 +352,6 @@ public void testCreateWithExpectedETagSuccess(
assertNotNull(openKeyInfo);
assertEquals(existingKeyInfo.getUpdateID(),
openKeyInfo.getExpectedDataGeneration());
assertNull(openKeyInfo.getExpectedETag());
// Creation time should remain the same on rewrite
assertEquals(existingKeyInfo.getCreationTime(),
openKeyInfo.getCreationTime());
Expand Down