Răsfoiți Sursa

Optimize restore source JSON serialization

Don't print "restore_source":  null if restore source is null, omit entire line instead
Igor Motov 12 ani în urmă
părinte
comite
d92f573404

+ 2 - 4
src/main/java/org/elasticsearch/cluster/routing/ImmutableShardRouting.java

@@ -341,12 +341,10 @@ public class ImmutableShardRouting implements Streamable, Serializable, ShardRou
                 .field("node", currentNodeId())
                 .field("relocating_node", relocatingNodeId())
                 .field("shard", shardId().id())
-                .field("index", shardId().index().name())
-                .field("restore_source");
+                .field("index", shardId().index().name());
         if (restoreSource() != null) {
+            builder.field("restore_source");
             restoreSource().toXContent(builder, params);
-        } else {
-            builder.nullValue();
         }
         return builder.endObject();
     }