Search in sources :

Example 1 with TestOperation

use of org.apache.hyracks.storage.am.common.TestOperationSelector.TestOperation in project asterixdb by apache.

the class AbstractIndexTestWorker method run.

@Override
public void run() {
    try {
        for (int i = 0; i < numBatches; i++) {
            TupleBatch batch = dataGen.getBatch();
            for (int j = 0; j < batch.size(); j++) {
                TestOperation op = opSelector.getOp(rnd.nextInt());
                ITupleReference tuple = batch.get(j);
                performOp(tuple, op);
            }
            dataGen.releaseBatch(batch);
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : TestOperation(org.apache.hyracks.storage.am.common.TestOperationSelector.TestOperation) ITupleReference(org.apache.hyracks.dataflow.common.data.accessors.ITupleReference) HyracksDataException(org.apache.hyracks.api.exceptions.HyracksDataException) TupleBatch(org.apache.hyracks.storage.am.common.datagen.TupleBatch)

Example 2 with TestOperation

use of org.apache.hyracks.storage.am.common.TestOperationSelector.TestOperation in project asterixdb by apache.

the class LSMRTreeWithAntiMatterTuplesMultiThreadTest method getTestWorkloadConf.

@Override
protected ArrayList<TestWorkloadConf> getTestWorkloadConf() {
    ArrayList<TestWorkloadConf> workloadConfs = new ArrayList<>();
    // Insert only workload.
    TestOperation[] insertOnlyOps = new TestOperation[] { TestOperation.INSERT };
    workloadConfs.add(new TestWorkloadConf(insertOnlyOps, ProbabilityHelper.getUniformProbDist(insertOnlyOps.length)));
    // Insert and merge workload.
    TestOperation[] insertMergeOps = new TestOperation[] { TestOperation.INSERT, TestOperation.MERGE };
    workloadConfs.add(new TestWorkloadConf(insertMergeOps, ProbabilityHelper.getUniformProbDist(insertMergeOps.length)));
    // Inserts mixed with scans.
    TestOperation[] insertSearchOnlyOps = new TestOperation[] { TestOperation.INSERT, TestOperation.SCAN };
    workloadConfs.add(new TestWorkloadConf(insertSearchOnlyOps, ProbabilityHelper.getUniformProbDist(insertSearchOnlyOps.length)));
    // Inserts and deletes.
    TestOperation[] insertDeleteOps = new TestOperation[] { TestOperation.INSERT, TestOperation.DELETE };
    workloadConfs.add(new TestWorkloadConf(insertDeleteOps, ProbabilityHelper.getUniformProbDist(insertDeleteOps.length)));
    // Inserts, deletes and merges.
    TestOperation[] insertDeleteMergeOps = new TestOperation[] { TestOperation.INSERT, TestOperation.DELETE, TestOperation.MERGE };
    workloadConfs.add(new TestWorkloadConf(insertDeleteMergeOps, ProbabilityHelper.getUniformProbDist(insertDeleteMergeOps.length)));
    // All operations except merge.
    TestOperation[] allNoMergeOps = new TestOperation[] { TestOperation.INSERT, TestOperation.DELETE, TestOperation.SCAN };
    workloadConfs.add(new TestWorkloadConf(allNoMergeOps, ProbabilityHelper.getUniformProbDist(allNoMergeOps.length)));
    // All operations.
    TestOperation[] allOps = new TestOperation[] { TestOperation.INSERT, TestOperation.DELETE, TestOperation.SCAN, TestOperation.MERGE };
    workloadConfs.add(new TestWorkloadConf(allOps, ProbabilityHelper.getUniformProbDist(allOps.length)));
    return workloadConfs;
}
Also used : TestOperation(org.apache.hyracks.storage.am.common.TestOperationSelector.TestOperation) TestWorkloadConf(org.apache.hyracks.storage.am.common.TestWorkloadConf) ArrayList(java.util.ArrayList)

Example 3 with TestOperation

use of org.apache.hyracks.storage.am.common.TestOperationSelector.TestOperation in project asterixdb by apache.

the class LSMInvertedIndexMultiThreadTest method getTestWorkloadConf.

protected ArrayList<TestWorkloadConf> getTestWorkloadConf() {
    ArrayList<TestWorkloadConf> workloadConfs = new ArrayList<>();
    // Insert only workload.
    TestOperation[] insertOnlyOps = new TestOperation[] { TestOperation.INSERT };
    workloadConfs.add(new TestWorkloadConf(insertOnlyOps, ProbabilityHelper.getUniformProbDist(insertOnlyOps.length)));
    // Insert and merge workload.
    TestOperation[] insertMergeOps = new TestOperation[] { TestOperation.INSERT, TestOperation.MERGE };
    workloadConfs.add(new TestWorkloadConf(insertMergeOps, ProbabilityHelper.getUniformProbDist(insertMergeOps.length)));
    // Inserts mixed with point searches and scans.
    TestOperation[] insertSearchOnlyOps = new TestOperation[] { TestOperation.INSERT, TestOperation.POINT_SEARCH, TestOperation.SCAN };
    workloadConfs.add(new TestWorkloadConf(insertSearchOnlyOps, ProbabilityHelper.getUniformProbDist(insertSearchOnlyOps.length)));
    // Inserts, and deletes.
    TestOperation[] insertDeleteUpdateOps = new TestOperation[] { TestOperation.INSERT, TestOperation.DELETE };
    workloadConfs.add(new TestWorkloadConf(insertDeleteUpdateOps, ProbabilityHelper.getUniformProbDist(insertDeleteUpdateOps.length)));
    // Inserts, deletes and merges.
    TestOperation[] insertDeleteUpdateMergeOps = new TestOperation[] { TestOperation.INSERT, TestOperation.DELETE, TestOperation.MERGE };
    workloadConfs.add(new TestWorkloadConf(insertDeleteUpdateMergeOps, ProbabilityHelper.getUniformProbDist(insertDeleteUpdateMergeOps.length)));
    // All operations except merge.
    TestOperation[] allNoMergeOps = new TestOperation[] { TestOperation.INSERT, TestOperation.DELETE, TestOperation.POINT_SEARCH, TestOperation.SCAN };
    workloadConfs.add(new TestWorkloadConf(allNoMergeOps, ProbabilityHelper.getUniformProbDist(allNoMergeOps.length)));
    // All operations.
    TestOperation[] allOps = new TestOperation[] { TestOperation.INSERT, TestOperation.DELETE, TestOperation.POINT_SEARCH, TestOperation.SCAN, TestOperation.MERGE };
    workloadConfs.add(new TestWorkloadConf(allOps, ProbabilityHelper.getUniformProbDist(allOps.length)));
    return workloadConfs;
}
Also used : TestOperation(org.apache.hyracks.storage.am.common.TestOperationSelector.TestOperation) TestWorkloadConf(org.apache.hyracks.storage.am.common.TestWorkloadConf) ArrayList(java.util.ArrayList)

Example 4 with TestOperation

use of org.apache.hyracks.storage.am.common.TestOperationSelector.TestOperation in project asterixdb by apache.

the class LSMRTreeMultiThreadTest method getTestWorkloadConf.

@Override
protected ArrayList<TestWorkloadConf> getTestWorkloadConf() {
    ArrayList<TestWorkloadConf> workloadConfs = new ArrayList<>();
    // Insert only workload.
    TestOperation[] insertOnlyOps = new TestOperation[] { TestOperation.INSERT };
    workloadConfs.add(new TestWorkloadConf(insertOnlyOps, ProbabilityHelper.getUniformProbDist(insertOnlyOps.length)));
    // Insert and merge workload.
    TestOperation[] insertMergeOps = new TestOperation[] { TestOperation.INSERT, TestOperation.MERGE };
    workloadConfs.add(new TestWorkloadConf(insertMergeOps, ProbabilityHelper.getUniformProbDist(insertMergeOps.length)));
    // Inserts mixed with scans.
    TestOperation[] insertSearchOnlyOps = new TestOperation[] { TestOperation.INSERT, TestOperation.SCAN };
    workloadConfs.add(new TestWorkloadConf(insertSearchOnlyOps, ProbabilityHelper.getUniformProbDist(insertSearchOnlyOps.length)));
    // Inserts and deletes.
    TestOperation[] insertDeleteOps = new TestOperation[] { TestOperation.INSERT, TestOperation.DELETE };
    workloadConfs.add(new TestWorkloadConf(insertDeleteOps, ProbabilityHelper.getUniformProbDist(insertDeleteOps.length)));
    // Inserts, deletes and merges.
    TestOperation[] insertDeleteMergeOps = new TestOperation[] { TestOperation.INSERT, TestOperation.DELETE, TestOperation.MERGE };
    workloadConfs.add(new TestWorkloadConf(insertDeleteMergeOps, ProbabilityHelper.getUniformProbDist(insertDeleteMergeOps.length)));
    // All operations except merge.
    TestOperation[] allNoMergeOps = new TestOperation[] { TestOperation.INSERT, TestOperation.DELETE, TestOperation.SCAN };
    workloadConfs.add(new TestWorkloadConf(allNoMergeOps, ProbabilityHelper.getUniformProbDist(allNoMergeOps.length)));
    // All operations.
    TestOperation[] allOps = new TestOperation[] { TestOperation.INSERT, TestOperation.DELETE, TestOperation.SCAN, TestOperation.MERGE };
    workloadConfs.add(new TestWorkloadConf(allOps, ProbabilityHelper.getUniformProbDist(allOps.length)));
    return workloadConfs;
}
Also used : TestOperation(org.apache.hyracks.storage.am.common.TestOperationSelector.TestOperation) TestWorkloadConf(org.apache.hyracks.storage.am.common.TestWorkloadConf) ArrayList(java.util.ArrayList)

Example 5 with TestOperation

use of org.apache.hyracks.storage.am.common.TestOperationSelector.TestOperation in project asterixdb by apache.

the class RTreeMultiThreadTest method getTestWorkloadConf.

@Override
protected ArrayList<TestWorkloadConf> getTestWorkloadConf() {
    ArrayList<TestWorkloadConf> workloadConfs = new ArrayList<>();
    // Insert only workload.
    TestOperation[] insertOnlyOps = new TestOperation[] { TestOperation.INSERT };
    workloadConfs.add(new TestWorkloadConf(insertOnlyOps, ProbabilityHelper.getUniformProbDist(insertOnlyOps.length)));
    // Inserts mixed with scans.
    TestOperation[] insertSearchOnlyOps = new TestOperation[] { TestOperation.INSERT, TestOperation.SCAN, TestOperation.DISKORDER_SCAN };
    workloadConfs.add(new TestWorkloadConf(insertSearchOnlyOps, ProbabilityHelper.getUniformProbDist(insertSearchOnlyOps.length)));
    // Inserts and deletes.
    TestOperation[] insertDeleteOps = new TestOperation[] { TestOperation.INSERT, TestOperation.DELETE };
    workloadConfs.add(new TestWorkloadConf(insertDeleteOps, ProbabilityHelper.getUniformProbDist(insertDeleteOps.length)));
    // All operations mixed.
    TestOperation[] allOps = new TestOperation[] { TestOperation.INSERT, TestOperation.DELETE, TestOperation.SCAN, TestOperation.DISKORDER_SCAN };
    workloadConfs.add(new TestWorkloadConf(allOps, ProbabilityHelper.getUniformProbDist(allOps.length)));
    return workloadConfs;
}
Also used : TestOperation(org.apache.hyracks.storage.am.common.TestOperationSelector.TestOperation) TestWorkloadConf(org.apache.hyracks.storage.am.common.TestWorkloadConf) ArrayList(java.util.ArrayList)

Aggregations

TestOperation (org.apache.hyracks.storage.am.common.TestOperationSelector.TestOperation)8 ArrayList (java.util.ArrayList)6 TestWorkloadConf (org.apache.hyracks.storage.am.common.TestWorkloadConf)6 HyracksDataException (org.apache.hyracks.api.exceptions.HyracksDataException)1 ITupleReference (org.apache.hyracks.dataflow.common.data.accessors.ITupleReference)1 TupleBatch (org.apache.hyracks.storage.am.common.datagen.TupleBatch)1