public static RunStats delegateGetBucketForLong(int buckets) throws Exception {
  Long startTime=System.currentTimeMillis();
  PrimaryIndexBucketGeneratorImpl ibg=new PrimaryIndexBucketGeneratorImpl(FieldDataType.LONG,buckets);
  PrimaryIndexBucketLocatorImpl locator=new PrimaryIndexBucketLocatorImpl(null,null,null,null,null,null,null,ibg.generateBuckets(),null);
  logger.debug("test to getBucket for the bucket distribution on Long values");
  HashMap<Long,List<Object>> hm=new HashMap<>();
  SummaryStatistics stats=new SummaryStatistics();
  Random r=new Random();
  for (int i=-200000; i < 200000; i++) {
    Long randomLong=Long.MIN_VALUE + r.nextLong() * Long.MAX_VALUE;
    Long bucketId=locator.getBucket(randomLong,FieldDataType.LONG);
    TestUtils.calculate(hm,stats,bucketId,randomLong);
  }
  Long runTime=System.currentTimeMillis() - startTime;
  RunStats runStats=new RunStats("BucketForLong",FieldDataType.LONG,runTime,stats,hm);
  logger.debug(runStats.toString());
  return runStats;
}

public static RunStats delegateGetBucketForLong ( int buckets ) throws Exception { Long startTime = System . currentTimeMillis ( ) ; PrimaryIndexBucketGeneratorImpl ibg = new PrimaryIndexBucketGeneratorImpl ( FieldDataType . LONG , buckets ) ; PrimaryIndexBucketLocatorImpl locator = new PrimaryIndexBucketLocatorImpl ( null , null , null , null , null , null , null , ibg . generateBuckets ( ) , null ) ; logger . debug ( "test to getBucket for the bucket distribution on Long values" ) ; HashMap < Long , List < Object > > hm = new HashMap < > ( ) ; SummaryStatistics stats = new SummaryStatistics ( ) ; Random r = new Random ( ) ; for ( int i = - 200000 ; i < 200000 ; i ++ ) { Long randomLong = Long . MIN_VALUE + r . nextLong ( ) * Long . MAX_VALUE ; Long bucketId = locator . getBucket ( randomLong , FieldDataType . LONG ) ; TestUtils . calculate ( hm , stats , bucketId , randomLong ) ; } Long runTime = System . currentTimeMillis ( ) - startTime ; RunStats runStats = new RunStats ( "BucketForLong" , FieldDataType . LONG , runTime , stats , hm ) ; logger . debug ( runStats . toString ( ) ) ; return runStats ; }
test to check the bucket distribution for the long values
