Optimize restore source JSON serialization
Don't print "restore_source": null if restore source is null, omit entire line instead
This commit is contained in:
parent
9b9ad1a603
commit
d92f573404
|
@ -341,12 +341,10 @@ public class ImmutableShardRouting implements Streamable, Serializable, ShardRou
|
||||||
.field("node", currentNodeId())
|
.field("node", currentNodeId())
|
||||||
.field("relocating_node", relocatingNodeId())
|
.field("relocating_node", relocatingNodeId())
|
||||||
.field("shard", shardId().id())
|
.field("shard", shardId().id())
|
||||||
.field("index", shardId().index().name())
|
.field("index", shardId().index().name());
|
||||||
.field("restore_source");
|
|
||||||
if (restoreSource() != null) {
|
if (restoreSource() != null) {
|
||||||
|
builder.field("restore_source");
|
||||||
restoreSource().toXContent(builder, params);
|
restoreSource().toXContent(builder, params);
|
||||||
} else {
|
|
||||||
builder.nullValue();
|
|
||||||
}
|
}
|
||||||
return builder.endObject();
|
return builder.endObject();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue