@@ -30,38 +30,30 @@ public class PlanConcurrencyCalculatorTests extends ESTestCase {
3030
3131 public void testSimpleLimit () {
3232 assertConcurrency ("""
33- FROM x
34- | LIMIT 123
35- """ ,
36- 123
37- );
33+ FROM x
34+ | LIMIT 123
35+ """ , 123 );
3836 }
3937
4038 public void testImplicitLimit () {
4139 assertConcurrency ("""
4240 FROM x
43- """ ,
44- 1000
45- );
41+ """ , 1000 );
4642 }
4743
4844 public void testStats () {
4945 assertConcurrency ("""
5046 FROM x
5147 | STATS COUNT(salary)
52- """ ,
53- null
54- );
48+ """ , null );
5549 }
5650
5751 public void testStatsWithLimit () {
5852 assertConcurrency ("""
5953 FROM x
6054 | LIMIT 123
6155 | STATS COUNT(salary)
62- """ ,
63- 123
64- );
56+ """ , 123 );
6557 }
6658
6759 public void testStatsWithSortBeforeLimit () {
@@ -70,9 +62,7 @@ public void testStatsWithSortBeforeLimit() {
7062 | SORT salary
7163 | LIMIT 123
7264 | STATS COUNT(salary)
73- """ ,
74- null
75- );
65+ """ , null );
7666 }
7767
7868 public void testStatsWithSortAfterLimit () {
@@ -81,57 +71,34 @@ public void testStatsWithSortAfterLimit() {
8171 | SORT salary
8272 | LIMIT 123
8373 | STATS COUNT(salary)
84- """ ,
85- null
86- );
74+ """ , null );
8775 }
8876
8977 public void testSort () {
9078 assertConcurrency ("""
9179 FROM x
9280 | SORT salary
93- """ ,
94- null
95- );
81+ """ , null );
9682 }
9783
98- private void assertConcurrency (
99- String query ,
100- Integer expectedConcurrency
101- ) {
84+ private void assertConcurrency (String query , Integer expectedConcurrency ) {
10285 assertConcurrency (query , null , expectedConcurrency );
10386 }
10487
105- private void assertConcurrency (
106- String query ,
107- Integer concurrencyPragmaValue ,
108- Integer expectedConcurrency
109- ) {
88+ private void assertConcurrency (String query , Integer concurrencyPragmaValue , Integer expectedConcurrency ) {
11089 Configuration configuration = concurrencyPragmaValue == null
11190 ? configuration (query )
11291 : configuration (
113- new QueryPragmas (
114- Settings .builder ()
115- .put ("max_concurrent_nodes_per_cluster" , concurrencyPragmaValue )
116- .build ()
117- ),
92+ new QueryPragmas (Settings .builder ().put ("max_concurrent_nodes_per_cluster" , concurrencyPragmaValue ).build ()),
11893 query
11994 );
120- Analyzer analyzer = analyzer (
121- loadMapping ("mapping-basic.json" , "test" ), TEST_VERIFIER , configuration
122- );
95+ Analyzer analyzer = analyzer (loadMapping ("mapping-basic.json" , "test" ), TEST_VERIFIER , configuration );
12396 LogicalPlan logicalPlan = AnalyzerTestUtils .analyze (query , analyzer );
12497 PhysicalPlan physicalPlan = new Mapper ().map (logicalPlan );
12598
126- PhysicalPlan dataNodePlan = PlannerUtils .breakPlanBetweenCoordinatorAndDataNode (
127- physicalPlan ,
128- configuration
129- ).v2 ();
99+ PhysicalPlan dataNodePlan = PlannerUtils .breakPlanBetweenCoordinatorAndDataNode (physicalPlan , configuration ).v2 ();
130100
131- Integer actualConcurrency = PlanConcurrencyCalculator .INSTANCE .calculateNodesConcurrency (
132- dataNodePlan ,
133- configuration
134- );
101+ Integer actualConcurrency = PlanConcurrencyCalculator .INSTANCE .calculateNodesConcurrency (dataNodePlan , configuration );
135102
136103 assertThat (actualConcurrency , equalTo (expectedConcurrency ));
137104 }
0 commit comments