Skip to content

Commit

Permalink
more optionality
Browse files Browse the repository at this point in the history
  • Loading branch information
rjernst committed Dec 27, 2024
1 parent 8671329 commit 1706758
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ public class SingleNodeShutdownMetadata implements SimpleDiffable<SingleNodeShut

static {
PARSER.declareString(ConstructingObjectParser.constructorArg(), NODE_ID_FIELD);
PARSER.declareString(ConstructingObjectParser.optionalConstructorArg(), NODE_EPHEMERAL_ID_FIELD);
PARSER.declareField(ConstructingObjectParser.optionalConstructorArg(),
(p, c) -> p.textOrNull(),
NODE_EPHEMERAL_ID_FIELD,
ObjectParser.ValueType.STRING_OR_NULL);
PARSER.declareString(ConstructingObjectParser.constructorArg(), TYPE_FIELD);
PARSER.declareString(ConstructingObjectParser.constructorArg(), REASON_FIELD);
PARSER.declareLong(ConstructingObjectParser.constructorArg(), STARTED_AT_MILLIS_FIELD);
Expand Down Expand Up @@ -116,6 +119,7 @@ public static SingleNodeShutdownMetadata parse(XContentParser parser) {
*/
private SingleNodeShutdownMetadata(
String nodeId,
@Nullable
String nodeEphemeralId,
Type type,
String reason,
Expand Down

0 comments on commit 1706758

Please sign in to comment.