public ProfileShardResult(StreamInput in) throws IOException { int profileSize = in.readVInt(); List<QueryProfileShardResult> queryProfileResults = new ArrayList<>(profileSize); for (int i = 0; i < profileSize; i++) { QueryProfileShardResult result = new QueryProfileShardResult(in); queryProfileResults.add(result); } this.queryProfileResults = Collections.unmodifiableList(queryProfileResults); this.aggProfileShardResult = new AggregationProfileShardResult(in); }
public static AggregationProfileShardResult fromXContent(XContentParser parser) throws IOException { XContentParser.Token token = parser.currentToken(); ensureExpectedToken(XContentParser.Token.START_ARRAY, token, parser::getTokenLocation); List<ProfileResult> aggProfileResults = new ArrayList<>(); while((token = parser.nextToken()) != XContentParser.Token.END_ARRAY) { aggProfileResults.add(ProfileResult.fromXContent(parser)); } return new AggregationProfileShardResult(aggProfileResults); } }
/** * Helper method to convert Profiler into InternalProfileShardResults, which * can be serialized to other nodes, emitted as JSON, etc. * * @param profilers * The {@link Profilers} to convert into results * @return A {@link ProfileShardResult} representing the results for this * shard */ public static ProfileShardResult buildShardResults(Profilers profilers) { List<QueryProfiler> queryProfilers = profilers.getQueryProfilers(); AggregationProfiler aggProfiler = profilers.getAggregationProfiler(); List<QueryProfileShardResult> queryResults = new ArrayList<>(queryProfilers.size()); for (QueryProfiler queryProfiler : queryProfilers) { QueryProfileShardResult result = new QueryProfileShardResult(queryProfiler.getTree(), queryProfiler.getRewriteTime(), queryProfiler.getCollector()); queryResults.add(result); } AggregationProfileShardResult aggResults = new AggregationProfileShardResult(aggProfiler.getTree()); return new ProfileShardResult(queryResults, aggResults); } }
public ProfileShardResult(StreamInput in) throws IOException { int profileSize = in.readVInt(); List<QueryProfileShardResult> queryProfileResults = new ArrayList<>(profileSize); for (int i = 0; i < profileSize; i++) { QueryProfileShardResult result = new QueryProfileShardResult(in); queryProfileResults.add(result); } this.queryProfileResults = Collections.unmodifiableList(queryProfileResults); this.aggProfileShardResult = new AggregationProfileShardResult(in); }
public ProfileShardResult(StreamInput in) throws IOException { int profileSize = in.readVInt(); List<QueryProfileShardResult> queryProfileResults = new ArrayList<>(profileSize); for (int i = 0; i < profileSize; i++) { QueryProfileShardResult result = new QueryProfileShardResult(in); queryProfileResults.add(result); } this.queryProfileResults = Collections.unmodifiableList(queryProfileResults); this.aggProfileShardResult = new AggregationProfileShardResult(in); }
public ProfileShardResult(StreamInput in) throws IOException { int profileSize = in.readVInt(); List<QueryProfileShardResult> queryProfileResults = new ArrayList<>(profileSize); for (int i = 0; i < profileSize; i++) { QueryProfileShardResult result = new QueryProfileShardResult(in); queryProfileResults.add(result); } this.queryProfileResults = Collections.unmodifiableList(queryProfileResults); this.aggProfileShardResult = new AggregationProfileShardResult(in); }
public static AggregationProfileShardResult fromXContent(XContentParser parser) throws IOException { XContentParser.Token token = parser.currentToken(); ensureExpectedToken(XContentParser.Token.START_ARRAY, token, parser::getTokenLocation); List<ProfileResult> aggProfileResults = new ArrayList<>(); while((token = parser.nextToken()) != XContentParser.Token.END_ARRAY) { aggProfileResults.add(ProfileResult.fromXContent(parser)); } return new AggregationProfileShardResult(aggProfileResults); } }
public static AggregationProfileShardResult fromXContent(XContentParser parser) throws IOException { XContentParser.Token token = parser.currentToken(); ensureExpectedToken(XContentParser.Token.START_ARRAY, token, parser::getTokenLocation); List<ProfileResult> aggProfileResults = new ArrayList<>(); while((token = parser.nextToken()) != XContentParser.Token.END_ARRAY) { aggProfileResults.add(ProfileResult.fromXContent(parser)); } return new AggregationProfileShardResult(aggProfileResults); } }
public static AggregationProfileShardResult fromXContent(XContentParser parser) throws IOException { XContentParser.Token token = parser.currentToken(); ensureExpectedToken(XContentParser.Token.START_ARRAY, token, parser::getTokenLocation); List<ProfileResult> aggProfileResults = new ArrayList<>(); while((token = parser.nextToken()) != XContentParser.Token.END_ARRAY) { aggProfileResults.add(ProfileResult.fromXContent(parser)); } return new AggregationProfileShardResult(aggProfileResults); } }
/** * Helper method to convert Profiler into InternalProfileShardResults, which * can be serialized to other nodes, emitted as JSON, etc. * * @param profilers * The {@link Profilers} to convert into results * @return A {@link ProfileShardResult} representing the results for this * shard */ public static ProfileShardResult buildShardResults(Profilers profilers) { List<QueryProfiler> queryProfilers = profilers.getQueryProfilers(); AggregationProfiler aggProfiler = profilers.getAggregationProfiler(); List<QueryProfileShardResult> queryResults = new ArrayList<>(queryProfilers.size()); for (QueryProfiler queryProfiler : queryProfilers) { QueryProfileShardResult result = new QueryProfileShardResult(queryProfiler.getTree(), queryProfiler.getRewriteTime(), queryProfiler.getCollector()); queryResults.add(result); } AggregationProfileShardResult aggResults = new AggregationProfileShardResult(aggProfiler.getTree()); return new ProfileShardResult(queryResults, aggResults); } }
/** * Helper method to convert Profiler into InternalProfileShardResults, which * can be serialized to other nodes, emitted as JSON, etc. * * @param profilers * The {@link Profilers} to convert into results * @return A {@link ProfileShardResult} representing the results for this * shard */ public static ProfileShardResult buildShardResults(Profilers profilers) { List<QueryProfiler> queryProfilers = profilers.getQueryProfilers(); AggregationProfiler aggProfiler = profilers.getAggregationProfiler(); List<QueryProfileShardResult> queryResults = new ArrayList<>(queryProfilers.size()); for (QueryProfiler queryProfiler : queryProfilers) { QueryProfileShardResult result = new QueryProfileShardResult(queryProfiler.getTree(), queryProfiler.getRewriteTime(), queryProfiler.getCollector()); queryResults.add(result); } AggregationProfileShardResult aggResults = new AggregationProfileShardResult(aggProfiler.getTree()); return new ProfileShardResult(queryResults, aggResults); } }
/** * Helper method to convert Profiler into InternalProfileShardResults, which * can be serialized to other nodes, emitted as JSON, etc. * * @param profilers * The {@link Profilers} to convert into results * @return A {@link ProfileShardResult} representing the results for this * shard */ public static ProfileShardResult buildShardResults(Profilers profilers) { List<QueryProfiler> queryProfilers = profilers.getQueryProfilers(); AggregationProfiler aggProfiler = profilers.getAggregationProfiler(); List<QueryProfileShardResult> queryResults = new ArrayList<>(queryProfilers.size()); for (QueryProfiler queryProfiler : queryProfilers) { QueryProfileShardResult result = new QueryProfileShardResult(queryProfiler.getTree(), queryProfiler.getRewriteTime(), queryProfiler.getCollector()); queryResults.add(result); } AggregationProfileShardResult aggResults = new AggregationProfileShardResult(aggProfiler.getTree()); return new ProfileShardResult(queryResults, aggResults); } }