Skip to content

Commit

Permalink
Convert NodeMetadata to record
Browse files Browse the repository at this point in the history
  • Loading branch information
williamrandolph committed Feb 8, 2024
1 parent 6628814 commit e1821e4
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions server/src/main/java/org/elasticsearch/env/NodeMetadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,18 @@
* and version of the oldest index it stores.
* The metadata is persisted in the data folder of this node and is reused across restarts.
*/
public final class NodeMetadata {
public record NodeMetadata(
String nodeId,
IndexVersion indexVersionCheckpoint,
IndexVersion previousIndexVersionCheckpoint,
IndexVersion oldestIndexVersion
) {

static final String NODE_ID_KEY = "node_id";
static final String NODE_VERSION_KEY = "node_version";
static final String OLDEST_INDEX_VERSION_KEY = "oldest_index_version";

private final String nodeId;

private final IndexVersion indexVersionCheckpoint;

private final IndexVersion previousIndexVersionCheckpoint;

private final IndexVersion oldestIndexVersion;

private NodeMetadata(
public NodeMetadata(
final String nodeId,
final IndexVersion indexVersionCheckpoint,
final IndexVersion previousIndexVersionCheckpoint,
Expand Down

0 comments on commit e1821e4

Please sign in to comment.