[Ml Data Frame] Size the GET stats search by number of Ids requested (#43206)

Set the size of the search request to the number of ids limited by 10,000
This commit is contained in:
David Kyle 2019-06-26 16:35:14 +01:00
parent 5035454613
commit e1f761dfc7
2 changed files with 2 additions and 1 deletions

View File

@ -341,6 +341,7 @@ public class DataFrameTransformsConfigManager {
SearchRequest searchRequest = client.prepareSearch(DataFrameInternalIndex.INDEX_NAME)
.addSort(DataFrameField.ID.getPreferredName(), SortOrder.ASC)
.setQuery(builder)
.setSize(Math.min(transformIds.size(), 10_000))
.request();
executeAsyncWithOrigin(client.threadPool().getThreadContext(), DATA_FRAME_ORIGIN, searchRequest,

View File

@ -261,7 +261,7 @@ public class DataFrameTransformsConfigManagerTests extends DataFrameSingleNodeTe
}
public void testGetStateAndStatsMultiple() throws InterruptedException {
int numStats = randomInt(5);
int numStats = randomIntBetween(10, 15);
List<DataFrameTransformStateAndStats> expectedStats = new ArrayList<>();
for (int i=0; i<numStats; i++) {
DataFrameTransformStateAndStats stat =