Package com.yahoo.ycsb.generator

Examples of com.yahoo.ycsb.generator.ZipfianGenerator


    if(fieldlengthdistribution.compareTo("constant") == 0) {
      fieldlengthgenerator = new ConstantIntegerGenerator(fieldlength);
    } else if(fieldlengthdistribution.compareTo("uniform") == 0) {
      fieldlengthgenerator = new UniformIntegerGenerator(1, fieldlength);
    } else if(fieldlengthdistribution.compareTo("zipfian") == 0) {
      fieldlengthgenerator = new ZipfianGenerator(1, fieldlength);
    } else if(fieldlengthdistribution.compareTo("histogram") == 0) {
      try {
        fieldlengthgenerator = new HistogramGenerator(fieldlengthhistogram);
      } catch(IOException e) {
        throw new WorkloadException("Couldn't read field length histogram file: "+fieldlengthhistogram, e);
View Full Code Here


    {
      scanlength=new UniformIntegerGenerator(1,maxscanlength);
    }
    else if (scanlengthdistrib.compareTo("zipfian")==0)
    {
      scanlength=new ZipfianGenerator(1,maxscanlength);
    }
    else
    {
      throw new WorkloadException("Distribution \""+scanlengthdistrib+"\" not allowed for scan length");
    }
View Full Code Here

        System.out.println("persisted");
    }

    private HashMap<String, ByteIterator> buildValues()
    {
        IntegerGenerator fieldlengthgenerator = new ZipfianGenerator(1, 4);
        HashMap<String, ByteIterator> values = new HashMap<String, ByteIterator>();

        for (int i = 0; i < 4; i++)
        {
            String fieldkey = "field" + i;
            ByteIterator data = new RandomByteIterator(fieldlengthgenerator.nextInt());
            values.put(fieldkey, data);
        }
        return values;
    }
View Full Code Here

    fieldchooser = new UniformIntegerGenerator(0, Config.getConfig().field_count - 1);

    if (Config.getConfig().scan_length_distribution.compareTo("uniform") == 0) {
      scanlength = new UniformIntegerGenerator(1, Config.getConfig().max_scan_length);
    } else if (Config.getConfig().scan_length_distribution.compareTo("zipfian") == 0) {
      scanlength = new ZipfianGenerator(1, Config.getConfig().max_scan_length);
    } else {
      throw new WorkloadException("Distribution \"" + Config.getConfig().scan_length_distribution
          + "\" not allowed for scan length");
    }
  }
View Full Code Here

    fieldchooser = new UniformIntegerGenerator(0, Config.getConfig().field_count - 1);

    if (Config.getConfig().scan_length_distribution.compareTo("uniform") == 0) {
      scanlength = new UniformIntegerGenerator(1, Config.getConfig().max_scan_length);
    } else if (Config.getConfig().scan_length_distribution.compareTo("zipfian") == 0) {
      scanlength = new ZipfianGenerator(1, Config.getConfig().max_scan_length);
    } else {
      throw new WorkloadException("Distribution \"" + Config.getConfig().scan_length_distribution + "\" not allowed for scan length");
    }
  }
View Full Code Here

TOP

Related Classes of com.yahoo.ycsb.generator.ZipfianGenerator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.