Skip to content

Commit

Permalink
Remove version field from CachedBlob
Browse files Browse the repository at this point in the history
  • Loading branch information
javanna committed Dec 19, 2024
1 parent 9cc362b commit 7f0cb0e
Showing 1 changed file with 0 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@

package org.elasticsearch.xpack.searchablesnapshots.cache.blob;

import org.elasticsearch.Version;
import org.elasticsearch.common.bytes.BytesArray;
import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.core.UpdateForV9;
import org.elasticsearch.xcontent.ToXContent;
import org.elasticsearch.xcontent.XContentBuilder;

Expand Down Expand Up @@ -60,14 +58,10 @@ private CachedBlob(Instant creationTime, String repository, String name, String

@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
@UpdateForV9(owner = UpdateForV9.Owner.SEARCH_FOUNDATIONS)
// we can remove the version field when we no longer need to keep compatibility with <8.12
final int version = Version.CURRENT.id;
builder.startObject();
{
builder.field("type", TYPE);
builder.field(CREATION_TIME_FIELD, creationTime.toEpochMilli());
builder.field("version", version);
builder.field("repository", repository);
builder.startObject("blob");
{
Expand Down

0 comments on commit 7f0cb0e

Please sign in to comment.