77 * License v3.0 only", or the "Server Side Public License, v 1".
88 */
99
10- package org .elasticsearch .benchmark .compute . operator ;
10+ package org .elasticsearch .benchmark ._nightly . esql ;
1111
1212import org .apache .lucene .document .FieldType ;
1313import org .apache .lucene .document .NumericDocValuesField ;
8585@ State (Scope .Thread )
8686@ Fork (1 )
8787public class ValuesSourceReaderBenchmark {
88+ private static final String [] SUPPORTED_LAYOUTS = new String [] { "in_order" , "shuffled" , "shuffled_singles" };
89+ private static final String [] SUPPORTED_NAMES = new String [] {
90+ "long" ,
91+ "int" ,
92+ "double" ,
93+ "keyword" ,
94+ "stored_keyword" ,
95+ "3_stored_keywords" };
96+
8897 private static final int BLOCK_LENGTH = 16 * 1024 ;
8998 private static final int INDEX_SIZE = 10 * BLOCK_LENGTH ;
9099 private static final int COMMIT_INTERVAL = 500 ;
91- private static final BigArrays BIG_ARRAYS = BigArrays .NON_RECYCLING_INSTANCE ;
92100 private static final BlockFactory blockFactory = BlockFactory .getInstance (
93101 new NoopCircuitBreaker ("noop" ),
94102 BigArrays .NON_RECYCLING_INSTANCE
@@ -104,8 +112,8 @@ static void selfTest() {
104112 ValuesSourceReaderBenchmark benchmark = new ValuesSourceReaderBenchmark ();
105113 benchmark .setupIndex ();
106114 try {
107- for (String layout : ValuesSourceReaderBenchmark .class . getField ( "layout" ). getAnnotationsByType ( Param . class )[ 0 ]. value () ) {
108- for (String name : ValuesSourceReaderBenchmark .class . getField ( "name" ). getAnnotationsByType ( Param . class )[ 0 ]. value () ) {
115+ for (String layout : ValuesSourceReaderBenchmark .SUPPORTED_LAYOUTS ) {
116+ for (String name : ValuesSourceReaderBenchmark .SUPPORTED_NAMES ) {
109117 benchmark .layout = layout ;
110118 benchmark .name = name ;
111119 try {
@@ -119,7 +127,7 @@ static void selfTest() {
119127 } finally {
120128 benchmark .teardownIndex ();
121129 }
122- } catch (IOException | NoSuchFieldException e ) {
130+ } catch (IOException e ) {
123131 throw new AssertionError (e );
124132 }
125133 }
@@ -321,10 +329,10 @@ public FieldNamesFieldMapper.FieldNamesFieldType fieldNames() {
321329 * each page has a single document rather than {@code BLOCK_SIZE} docs.</li>
322330 * </ul>
323331 */
324- @ Param ({ "in_order" , "shuffled" , "shuffled_singles" })
332+ @ Param ({ "in_order" , "shuffled" })
325333 public String layout ;
326334
327- @ Param ({ "long" , "int" , "double" , " keyword" , "stored_keyword" , "3_stored_keywords " })
335+ @ Param ({ "long" , "keyword" , "stored_keyword" })
328336 public String name ;
329337
330338 private Directory directory ;
0 commit comments