WindowParametersHelper { public static int getMaxRows( int windowMaxRowLimit, long windowLimit, boolean timeBased ) { return windowLimit > 0 && timeBased ? (int) Math.min( windowLimit, windowMaxRowLimit ) : windowMaxRowLimit; }  static String getCacheKey( String query, IDataServiceClientService.StreamingMode windowMode, long windowSize, long windowEvery,
                                    int windowMaxRowLimit, long windowMaxTimeLimit, long windowLimit, int serviceExecutorCacheKeyHash ); static long getWindowEvery( long windowEvery, boolean timeBased, int maxRows, long maxTime ); static long getWindowSize( long windowSize, boolean timeBased, int maxRows, long maxTime ); static long getMaxTime( long windowMaxTimeLimit, long windowLimit, boolean rowBased ); static int getMaxRows( int windowMaxRowLimit, long windowLimit, boolean timeBased );  }
@Test public void testGetMaxRowsRowMode() { assertEquals( 1000, WindowParametersHelper.getMaxRows( 1000, 0, false ) ); assertEquals( 1000, WindowParametersHelper.getMaxRows( 1000, 10, false ) ); assertEquals( 1000, WindowParametersHelper.getMaxRows( 1000, 10000, false ) ); }
@Test public void testGetMaxRowsTimeMode() { assertEquals( 1000, WindowParametersHelper.getMaxRows( 1000, 0, true ) ); assertEquals( 10, WindowParametersHelper.getMaxRows( 1000, 10, true ) ); assertEquals( 1000, WindowParametersHelper.getMaxRows( 1000, 10000, true ) ); }