// note, requires a wrapping object @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { if (docs != null) { docs.toXContent(builder, params); } if (store != null) { store.toXContent(builder, params); } if (indexing != null) { indexing.toXContent(builder, params); } if (get != null) { get.toXContent(builder, params); } if (search != null) { search.toXContent(builder, params); } if (merge != null) { merge.toXContent(builder, params); } if (refresh != null) { refresh.toXContent(builder, params); } if (flush != null) { flush.toXContent(builder, params); } if (warmer != null) { warmer.toXContent(builder, params); } return builder; }
@Override public void readFrom(StreamInput in) throws IOException { if (in.readBoolean()) { docs = DocsStats.readDocStats(in); } if (in.readBoolean()) { store = StoreStats.readStoreStats(in); } if (in.readBoolean()) { indexing = IndexingStats.readIndexingStats(in); } if (in.readBoolean()) { get = GetStats.readGetStats(in); } if (in.readBoolean()) { search = SearchStats.readSearchStats(in); } if (in.readBoolean()) { merge = MergeStats.readMergeStats(in); } if (in.readBoolean()) { refresh = RefreshStats.readRefreshStats(in); } if (in.readBoolean()) { flush = FlushStats.readFlushStats(in); } if (in.readBoolean()) { warmer = WarmerStats.readWarmerStats(in); } }
@Override public void writeTo(StreamOutput out) throws IOException { if (docs == null) { out.writeBoolean(false); } else { out.writeBoolean(true); docs.writeTo(out); } if (store == null) { out.writeBoolean(false); } else { out.writeBoolean(true); store.writeTo(out); } if (indexing == null) { out.writeBoolean(false); } else { out.writeBoolean(true); indexing.writeTo(out); } if (get == null) { out.writeBoolean(false); } else { out.writeBoolean(true); get.writeTo(out); } if (search == null) { out.writeBoolean(false); } else { out.writeBoolean(true); search.writeTo(out); } if (merge == null) { out.writeBoolean(false); } else { out.writeBoolean(true); merge.writeTo(out); } if (refresh == null) { out.writeBoolean(false); } else { out.writeBoolean(true); refresh.writeTo(out); } if (flush == null) { out.writeBoolean(false); } else { out.writeBoolean(true); flush.writeTo(out); } if (warmer == null) { out.writeBoolean(false); } else { out.writeBoolean(true); warmer.writeTo(out); } }
public void add(CommonStats stats) { if (docs == null) { if (stats.docs() != null) { docs = new DocsStats(); docs.add(stats.docs()); } } else { docs.add(stats.docs()); } if (store == null) { if (stats.store() != null) { store = new StoreStats(); store.add(stats.store()); } } else { store.add(stats.store()); } if (indexing == null) { if (stats.indexing() != null) { indexing = new IndexingStats(); indexing.add(stats.indexing()); } } else { indexing.add(stats.indexing()); } if (get == null) { if (stats.get() != null) { get = new GetStats(); get.add(stats.get()); } } else { get.add(stats.get()); } if (search == null) { if (stats.search() != null) { search = new SearchStats(); search.add(stats.search()); } } else { search.add(stats.search()); } if (merge == null) { if (stats.merge() != null) { merge = new MergeStats(); merge.add(stats.merge()); } } else { merge.add(stats.merge()); } if (refresh == null) { if (stats.refresh() != null) { refresh = new RefreshStats(); refresh.add(stats.refresh()); } } else { refresh.add(stats.refresh()); } if (flush == null) { if (stats.flush() != null) { flush = new FlushStats(); flush.add(stats.flush()); } } else { flush.add(stats.flush()); } if (warmer == null) { if (stats.warmer() != null) { warmer = new WarmerStats(); warmer.add(stats.warmer()); } } else { warmer.add(stats.warmer()); } }