Package com.yahoo.ycsb.generator

Examples of com.yahoo.ycsb.generator.IntegerGenerator


    if(p.getProperty(Client.RECORD_COUNT_PROPERTY) != null ||
       p.getProperty(Client.INSERT_COUNT_PROPERTY) != null ||
       p.getProperty(Client.OPERATION_COUNT_PROPERTY) != null) {
      System.err.println("Warning: record, insert or operation count was set prior to initting ConstantOccupancyWorkload.  Overriding old values.");
    }
    IntegerGenerator g = CoreWorkload.getFieldLengthGenerator(p);
    double fieldsize = g.mean();
    int fieldcount = Integer.parseInt(p.getProperty(FIELD_COUNT_PROPERTY, FIELD_COUNT_PROPERTY_DEFAULT));

    object_count = (long)(occupancy * ((double)disksize / (fieldsize * (double)fieldcount)));
                if(object_count == 0) {
                    throw new IllegalStateException("Object count was zero.  Perhaps disksize is too low?");
View Full Code Here


  boolean orderedinserts;

  int recordcount;
 
  protected static IntegerGenerator getFieldLengthGenerator(Properties p) throws WorkloadException{
    IntegerGenerator fieldlengthgenerator;
    String fieldlengthdistribution = p.getProperty(FIELD_LENGTH_DISTRIBUTION_PROPERTY, FIELD_LENGTH_DISTRIBUTION_PROPERTY_DEFAULT);
    int fieldlength=Integer.parseInt(p.getProperty(FIELD_LENGTH_PROPERTY,FIELD_LENGTH_PROPERTY_DEFAULT));
    String fieldlengthhistogram = p.getProperty(FIELD_LENGTH_HISTOGRAM_FILE_PROPERTY, FIELD_LENGTH_HISTOGRAM_FILE_PROPERTY_DEFAULT);
    if(fieldlengthdistribution.compareTo("constant") == 0) {
      fieldlengthgenerator = new ConstantIntegerGenerator(fieldlength);
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

TOP

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

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.