public List<Long> generateBuckets() throws FileNotFoundException, UnsupportedEncodingException {
  logger.info("Generating buckets for: " + dataType.toString() + " with prune factor: "+ pruneFactor);
  List<Long> buckets=createBuckets();
  System.gc();
  if (pruneFactor != 0) {
    buckets=pruneBucket(buckets,pruneFactor);
    System.gc();
  }
  if (dataType.equals(FieldDataType.DOUBLE)) {
    logger.info("Special case for double; adding a set of low buckets for high precision on lower numbers.");
    for (int i=0; i < 10000; i++) {
      logger.debug("Adding " + i);
      buckets.add(new Long(i));
    }
    for (int i=10000; i < 100000; i=i + 2) {
      logger.debug("Adding " + i);
      buckets.add(new Long(i));
    }
    for (int i=100000; i < 1000000; i=i + 10) {
      logger.debug("Adding " + i);
      buckets.add(new Long(i));
    }
  }
  if (useNegativeBuckets) {
    buckets=addNegativeBuckets(buckets);
    System.gc();
  }
  Collections.sort(buckets);
  return buckets;
}

public List < Long > generateBuckets ( ) throws FileNotFoundException , UnsupportedEncodingException { logger . info ( "Generating buckets for: " + dataType . toString ( ) + " with prune factor: " + pruneFactor ) ; List < Long > buckets = createBuckets ( ) ; System . gc ( ) ; if ( pruneFactor != 0 ) { buckets = pruneBucket ( buckets , pruneFactor ) ; System . gc ( ) ; } if ( dataType . equals ( FieldDataType . DOUBLE ) ) { logger . info ( "Special case for double; adding a set of low buckets for high precision on lower numbers." ) ; for ( int i = 0 ; i < 10000 ; i ++ ) { logger . debug ( "Adding " + i ) ; buckets . add ( new Long ( i ) ) ; } for ( int i = 10000 ; i < 100000 ; i = i + 2 ) { logger . debug ( "Adding " + i ) ; buckets . add ( new Long ( i ) ) ; } for ( int i = 100000 ; i < 1000000 ; i = i + 10 ) { logger . debug ( "Adding " + i ) ; buckets . add ( new Long ( i ) ) ; } } if ( useNegativeBuckets ) { buckets = addNegativeBuckets ( buckets ) ; System . gc ( ) ; } Collections . sort ( buckets ) ; return buckets ; }
does the actual work .
