@Test (expectedExceptions = IllegalArgumentException.class) public void createOperationChooserNullProperties() { CoreWorkload.createOperationGenerator(null); }
protected static DiscreteGenerator createOperationGenerator(final Properties p) { if (p == null) { throw new IllegalArgumentException("Properties object cannot be null"); } final double readproportion = Double.parseDouble( p.getProperty(READ_PROPORTION_PROPERTY, READ_PROPORTION_PROPERTY_DEFAULT)); final double updateproportion = Double.parseDouble( p.getProperty(UPDATE_PROPORTION_PROPERTY, UPDATE_PROPORTION_PROPERTY_DEFAULT)); final double insertproportion = Double.parseDouble( p.getProperty(INSERT_PROPORTION_PROPERTY, INSERT_PROPORTION_PROPERTY_DEFAULT)); final double scanproportion = Double.parseDouble( p.getProperty(SCAN_PROPORTION_PROPERTY, SCAN_PROPORTION_PROPERTY_DEFAULT)); final double readmodifywriteproportion = Double.parseDouble(p.getProperty( READMODIFYWRITE_PROPORTION_PROPERTY, READMODIFYWRITE_PROPORTION_PROPERTY_DEFAULT)); final DiscreteGenerator operationchooser = new DiscreteGenerator(); if (readproportion > 0) { operationchooser.addValue(readproportion, "READ"); } if (updateproportion > 0) { operationchooser.addValue(updateproportion, "UPDATE"); } if (insertproportion > 0) { operationchooser.addValue(insertproportion, "INSERT"); } if (scanproportion > 0) { operationchooser.addValue(scanproportion, "SCAN"); } if (readmodifywriteproportion > 0) { operationchooser.addValue(readmodifywriteproportion, "READMODIFYWRITE"); } return operationchooser; }
CoreWorkload extends Workload { protected static DiscreteGenerator createOperationGenerator(final Properties p) { if (p == null) { throw new IllegalArgumentException("Properties object cannot be null"); } final double readproportion = Double.parseDouble( p.getProperty(READ_PROPORTION_PROPERTY, READ_PROPORTION_PROPERTY_DEFAULT)); final double updateproportion = Double.parseDouble( p.getProperty(UPDATE_PROPORTION_PROPERTY, UPDATE_PROPORTION_PROPERTY_DEFAULT)); final double insertproportion = Double.parseDouble( p.getProperty(INSERT_PROPORTION_PROPERTY, INSERT_PROPORTION_PROPERTY_DEFAULT)); final double scanproportion = Double.parseDouble( p.getProperty(SCAN_PROPORTION_PROPERTY, SCAN_PROPORTION_PROPERTY_DEFAULT)); final double readmodifywriteproportion = Double.parseDouble(p.getProperty( READMODIFYWRITE_PROPORTION_PROPERTY, READMODIFYWRITE_PROPORTION_PROPERTY_DEFAULT)); final DiscreteGenerator operationchooser = new DiscreteGenerator(); if (readproportion > 0) { operationchooser.addValue(readproportion, "READ"); } if (updateproportion > 0) { operationchooser.addValue(updateproportion, "UPDATE"); } if (insertproportion > 0) { operationchooser.addValue(insertproportion, "INSERT"); } if (scanproportion > 0) { operationchooser.addValue(scanproportion, "SCAN"); } if (readmodifywriteproportion > 0) { operationchooser.addValue(readmodifywriteproportion, "READMODIFYWRITE"); } return operationchooser; } }
CoreWorkload extends Workload { protected static DiscreteGenerator createOperationGenerator(final Properties p) { if (p == null) { throw new IllegalArgumentException("Properties object cannot be null"); } final double readproportion = Double.parseDouble( p.getProperty(READ_PROPORTION_PROPERTY, READ_PROPORTION_PROPERTY_DEFAULT)); final double updateproportion = Double.parseDouble( p.getProperty(UPDATE_PROPORTION_PROPERTY, UPDATE_PROPORTION_PROPERTY_DEFAULT)); final double insertproportion = Double.parseDouble( p.getProperty(INSERT_PROPORTION_PROPERTY, INSERT_PROPORTION_PROPERTY_DEFAULT)); final double scanproportion = Double.parseDouble( p.getProperty(SCAN_PROPORTION_PROPERTY, SCAN_PROPORTION_PROPERTY_DEFAULT)); final double readmodifywriteproportion = Double.parseDouble(p.getProperty( READMODIFYWRITE_PROPORTION_PROPERTY, READMODIFYWRITE_PROPORTION_PROPERTY_DEFAULT)); final DiscreteGenerator operationchooser = new DiscreteGenerator(); if (readproportion > 0) { operationchooser.addValue(readproportion, "READ"); } if (updateproportion > 0) { operationchooser.addValue(updateproportion, "UPDATE"); } if (insertproportion > 0) { operationchooser.addValue(insertproportion, "INSERT"); } if (scanproportion > 0) { operationchooser.addValue(scanproportion, "SCAN"); } if (readmodifywriteproportion > 0) { operationchooser.addValue(readmodifywriteproportion, "READMODIFYWRITE"); } return operationchooser; }  }
CoreWorkload extends Workload { protected static DiscreteGenerator createOperationGenerator(final Properties p) { if (p == null) { throw new IllegalArgumentException("Properties object cannot be null"); } final double readproportion = Double.parseDouble( p.getProperty(READ_PROPORTION_PROPERTY, READ_PROPORTION_PROPERTY_DEFAULT)); final double updateproportion = Double.parseDouble( p.getProperty(UPDATE_PROPORTION_PROPERTY, UPDATE_PROPORTION_PROPERTY_DEFAULT)); final double insertproportion = Double.parseDouble( p.getProperty(INSERT_PROPORTION_PROPERTY, INSERT_PROPORTION_PROPERTY_DEFAULT)); final double scanproportion = Double.parseDouble( p.getProperty(SCAN_PROPORTION_PROPERTY, SCAN_PROPORTION_PROPERTY_DEFAULT)); final double readmodifywriteproportion = Double.parseDouble(p.getProperty( READMODIFYWRITE_PROPORTION_PROPERTY, READMODIFYWRITE_PROPORTION_PROPERTY_DEFAULT)); final DiscreteGenerator operationchooser = new DiscreteGenerator(); if (readproportion > 0) { operationchooser.addValue(readproportion, "READ"); } if (updateproportion > 0) { operationchooser.addValue(updateproportion, "UPDATE"); } if (insertproportion > 0) { operationchooser.addValue(insertproportion, "INSERT"); } if (scanproportion > 0) { operationchooser.addValue(scanproportion, "SCAN"); } if (readmodifywriteproportion > 0) { operationchooser.addValue(readmodifywriteproportion, "READMODIFYWRITE"); } return operationchooser; }  @Override void init(Properties p); @Override boolean doInsert(DB db, Object threadstate); @Override boolean doTransaction(DB db, Object threadstate); void doTransactionRead(DB db); void doTransactionReadModifyWrite(DB db); void doTransactionScan(DB db); void doTransactionUpdate(DB db); void doTransactionInsert(DB db); }
CoreWorkload extends Workload { protected static DiscreteGenerator createOperationGenerator(final Properties p) { if (p == null) { throw new IllegalArgumentException("Properties object cannot be null"); } final double readproportion = Double.parseDouble( p.getProperty(READ_PROPORTION_PROPERTY, READ_PROPORTION_PROPERTY_DEFAULT)); final double updateproportion = Double.parseDouble( p.getProperty(UPDATE_PROPORTION_PROPERTY, UPDATE_PROPORTION_PROPERTY_DEFAULT)); final double insertproportion = Double.parseDouble( p.getProperty(INSERT_PROPORTION_PROPERTY, INSERT_PROPORTION_PROPERTY_DEFAULT)); final double scanproportion = Double.parseDouble( p.getProperty(SCAN_PROPORTION_PROPERTY, SCAN_PROPORTION_PROPERTY_DEFAULT)); final double readmodifywriteproportion = Double.parseDouble(p.getProperty( READMODIFYWRITE_PROPORTION_PROPERTY, READMODIFYWRITE_PROPORTION_PROPERTY_DEFAULT)); final DiscreteGenerator operationchooser = new DiscreteGenerator(); if (readproportion > 0) { operationchooser.addValue(readproportion, "READ"); } if (updateproportion > 0) { operationchooser.addValue(updateproportion, "UPDATE"); } if (insertproportion > 0) { operationchooser.addValue(insertproportion, "INSERT"); } if (scanproportion > 0) { operationchooser.addValue(scanproportion, "SCAN"); } if (readmodifywriteproportion > 0) { operationchooser.addValue(readmodifywriteproportion, "READMODIFYWRITE"); } return operationchooser; }  @Override void init(Properties p); @Override boolean doInsert(DB db, Object threadstate); @Override boolean doTransaction(DB db, Object threadstate); void doTransactionRead(DB db); void doTransactionReadModifyWrite(DB db); void doTransactionScan(DB db); void doTransactionUpdate(DB db); void doTransactionInsert(DB db); static final String TABLENAME_PROPERTY; static final String TABLENAME_PROPERTY_DEFAULT; static final String FIELD_COUNT_PROPERTY; static final String FIELD_COUNT_PROPERTY_DEFAULT; static final String FIELD_LENGTH_DISTRIBUTION_PROPERTY; static final String FIELD_LENGTH_DISTRIBUTION_PROPERTY_DEFAULT; static final String FIELD_LENGTH_PROPERTY; static final String FIELD_LENGTH_PROPERTY_DEFAULT; static final String MIN_FIELD_LENGTH_PROPERTY; static final String MIN_FIELD_LENGTH_PROPERTY_DEFAULT; static final String FIELD_LENGTH_HISTOGRAM_FILE_PROPERTY; static final String FIELD_LENGTH_HISTOGRAM_FILE_PROPERTY_DEFAULT; static final String READ_ALL_FIELDS_PROPERTY; static final String READ_ALL_FIELDS_PROPERTY_DEFAULT; static final String WRITE_ALL_FIELDS_PROPERTY; static final String WRITE_ALL_FIELDS_PROPERTY_DEFAULT; static final String DATA_INTEGRITY_PROPERTY; static final String DATA_INTEGRITY_PROPERTY_DEFAULT; static final String READ_PROPORTION_PROPERTY; static final String READ_PROPORTION_PROPERTY_DEFAULT; static final String UPDATE_PROPORTION_PROPERTY; static final String UPDATE_PROPORTION_PROPERTY_DEFAULT; static final String INSERT_PROPORTION_PROPERTY; static final String INSERT_PROPORTION_PROPERTY_DEFAULT; static final String SCAN_PROPORTION_PROPERTY; static final String SCAN_PROPORTION_PROPERTY_DEFAULT; static final String READMODIFYWRITE_PROPORTION_PROPERTY; static final String READMODIFYWRITE_PROPORTION_PROPERTY_DEFAULT; static final String REQUEST_DISTRIBUTION_PROPERTY; static final String REQUEST_DISTRIBUTION_PROPERTY_DEFAULT; static final String ZERO_PADDING_PROPERTY; static final String ZERO_PADDING_PROPERTY_DEFAULT; static final String MIN_SCAN_LENGTH_PROPERTY; static final String MIN_SCAN_LENGTH_PROPERTY_DEFAULT; static final String MAX_SCAN_LENGTH_PROPERTY; static final String MAX_SCAN_LENGTH_PROPERTY_DEFAULT; static final String SCAN_LENGTH_DISTRIBUTION_PROPERTY; static final String SCAN_LENGTH_DISTRIBUTION_PROPERTY_DEFAULT; static final String INSERT_ORDER_PROPERTY; static final String INSERT_ORDER_PROPERTY_DEFAULT; static final String HOTSPOT_DATA_FRACTION; static final String HOTSPOT_DATA_FRACTION_DEFAULT; static final String HOTSPOT_OPN_FRACTION; static final String HOTSPOT_OPN_FRACTION_DEFAULT; static final String INSERTION_RETRY_LIMIT; static final String INSERTION_RETRY_LIMIT_DEFAULT; static final String INSERTION_RETRY_INTERVAL; static final String INSERTION_RETRY_INTERVAL_DEFAULT; static final String FIELD_NAME_PREFIX; static final String FIELD_NAME_PREFIX_DEFAULT; }