net.sf.sparql.benchmarking.runners.mix
Class SamplingOperationMixRunner

java.lang.Object
  extended by net.sf.sparql.benchmarking.runners.mix.AbstractOperationMixRunner
      extended by net.sf.sparql.benchmarking.runners.mix.SamplingOperationMixRunner
All Implemented Interfaces:
OperationMixRunner

public class SamplingOperationMixRunner
extends AbstractOperationMixRunner

An operation mix runner that runs a sample of the operations in the mix respecting whether random order has been selected.

The sample is configurable and may be larger/smaller than the size of the mixes to be run, optionally the sample may include repeats of operations.

In the case where random order is disabled and the sample size is smaller than the mix size only the first N operations (where N is the sample size) will be run and the remaining operations will never be run.

In the case where the desired sample size is larger than the mix size but repeats are not allowed then the actual sample size will be the same as the mix size and every operation will be run precisely once.

Author:
rvesse

Constructor Summary
SamplingOperationMixRunner(boolean allowRepeats)
          Creates a runner which optionally allows repeats, the sample size will always be the mix size
SamplingOperationMixRunner(int sampleSize)
          Creates a runner with the given sample size
SamplingOperationMixRunner(int sampleSize, boolean allowRepeats)
          Creates a runner with the given sample size that optionally allows repeats
 
Method Summary
protected  List<Integer> getInOrderSample(OperationMix mix)
           
protected
<T extends Options>
List<Integer>
getOperationOrder(T options, OperationMix mix)
          Gets the order in which the runner should run the operations
protected  List<Integer> getRandomSample(OperationMix mix)
           
 
Methods inherited from class net.sf.sparql.benchmarking.runners.mix.AbstractOperationMixRunner
reportOperationOrder, run, runOp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SamplingOperationMixRunner

public SamplingOperationMixRunner(int sampleSize)
Creates a runner with the given sample size

Parameters:
sampleSize - Sample size, if <= 0 then sample size will always be the mix size

SamplingOperationMixRunner

public SamplingOperationMixRunner(boolean allowRepeats)
Creates a runner which optionally allows repeats, the sample size will always be the mix size

Parameters:
allowRepeats - Whether to allow repeats

SamplingOperationMixRunner

public SamplingOperationMixRunner(int sampleSize,
                                  boolean allowRepeats)
Creates a runner with the given sample size that optionally allows repeats

Parameters:
sampleSize - Sample size, if <= 0 then sample size will always be the mix size
allowRepeats - WHether to allow repeats
Method Detail

getOperationOrder

protected <T extends Options> List<Integer> getOperationOrder(T options,
                                                              OperationMix mix)
Description copied from class: AbstractOperationMixRunner
Gets the order in which the runner should run the operations

Specified by:
getOperationOrder in class AbstractOperationMixRunner
Parameters:
options - Options
mix - Mix containing the operations to be run
Returns:
Operation order expressed as a list of IDs

getRandomSample

protected List<Integer> getRandomSample(OperationMix mix)

getInOrderSample

protected List<Integer> getInOrderSample(OperationMix mix)


Copyright © 2014. All Rights Reserved.