Search in sources :

Example 6 with TupleGenerator

use of org.apache.hyracks.storage.am.common.datagen.TupleGenerator in project asterixdb by apache.

the class LSMInvertedIndexTestUtils method createStringDocumentTupleGen.

public static TupleGenerator createStringDocumentTupleGen(Random rnd) throws IOException {
    IFieldValueGenerator[] fieldGens = new IFieldValueGenerator[2];
    fieldGens[0] = new DocumentStringFieldValueGenerator(2, 10, 10000, rnd);
    fieldGens[1] = new SortedIntegerFieldValueGenerator(0);
    ISerializerDeserializer[] fieldSerdes = new ISerializerDeserializer[] { new UTF8StringSerializerDeserializer(), IntegerSerializerDeserializer.INSTANCE };
    TupleGenerator tupleGen = new TupleGenerator(fieldGens, fieldSerdes, 0);
    return tupleGen;
}
Also used : SortedIntegerFieldValueGenerator(org.apache.hyracks.storage.am.common.datagen.SortedIntegerFieldValueGenerator) IFieldValueGenerator(org.apache.hyracks.storage.am.common.datagen.IFieldValueGenerator) TupleGenerator(org.apache.hyracks.storage.am.common.datagen.TupleGenerator) UTF8StringSerializerDeserializer(org.apache.hyracks.dataflow.common.data.marshalling.UTF8StringSerializerDeserializer) DocumentStringFieldValueGenerator(org.apache.hyracks.storage.am.common.datagen.DocumentStringFieldValueGenerator) ISerializerDeserializer(org.apache.hyracks.api.dataflow.value.ISerializerDeserializer)

Example 7 with TupleGenerator

use of org.apache.hyracks.storage.am.common.datagen.TupleGenerator in project asterixdb by apache.

the class LSMInvertedIndexTestUtils method createPersonNamesTupleGen.

public static TupleGenerator createPersonNamesTupleGen(Random rnd) throws IOException {
    IFieldValueGenerator[] fieldGens = new IFieldValueGenerator[2];
    fieldGens[0] = new PersonNameFieldValueGenerator(rnd, 0.5f);
    fieldGens[1] = new SortedIntegerFieldValueGenerator(0);
    ISerializerDeserializer[] fieldSerdes = new ISerializerDeserializer[] { new UTF8StringSerializerDeserializer(), IntegerSerializerDeserializer.INSTANCE };
    TupleGenerator tupleGen = new TupleGenerator(fieldGens, fieldSerdes, 0);
    return tupleGen;
}
Also used : SortedIntegerFieldValueGenerator(org.apache.hyracks.storage.am.common.datagen.SortedIntegerFieldValueGenerator) PersonNameFieldValueGenerator(org.apache.hyracks.storage.am.common.datagen.PersonNameFieldValueGenerator) IFieldValueGenerator(org.apache.hyracks.storage.am.common.datagen.IFieldValueGenerator) TupleGenerator(org.apache.hyracks.storage.am.common.datagen.TupleGenerator) UTF8StringSerializerDeserializer(org.apache.hyracks.dataflow.common.data.marshalling.UTF8StringSerializerDeserializer) ISerializerDeserializer(org.apache.hyracks.api.dataflow.value.ISerializerDeserializer)

Example 8 with TupleGenerator

use of org.apache.hyracks.storage.am.common.datagen.TupleGenerator in project asterixdb by apache.

the class LSMInvertedIndexMultiThreadTest method wordTokensInvIndexTest.

@Test
public void wordTokensInvIndexTest() throws IOException, InterruptedException {
    String dataMsg = "Documents";
    int[] numThreads = new int[] { REGULAR_NUM_THREADS, EXCESSIVE_NUM_THREADS };
    for (int i = 0; i < numThreads.length; i++) {
        for (TestWorkloadConf conf : workloadConfs) {
            setUp();
            LSMInvertedIndexTestContext testCtx = LSMInvertedIndexTestUtils.createWordInvIndexTestContext(harness, getIndexType());
            TupleGenerator tupleGen = LSMInvertedIndexTestUtils.createStringDocumentTupleGen(harness.getRandom());
            runTest(testCtx, tupleGen, numThreads[i], conf, dataMsg);
            tearDown();
        }
    }
}
Also used : TestWorkloadConf(org.apache.hyracks.storage.am.common.TestWorkloadConf) LSMInvertedIndexTestContext(org.apache.hyracks.storage.am.lsm.invertedindex.util.LSMInvertedIndexTestContext) TupleGenerator(org.apache.hyracks.storage.am.common.datagen.TupleGenerator) Test(org.junit.Test)

Example 9 with TupleGenerator

use of org.apache.hyracks.storage.am.common.datagen.TupleGenerator in project asterixdb by apache.

the class LSMInvertedIndexMultiThreadTest method hashedNGramTokensInvIndexTest.

@Test
public void hashedNGramTokensInvIndexTest() throws IOException, InterruptedException {
    String dataMsg = "Person Names";
    int[] numThreads = new int[] { REGULAR_NUM_THREADS, EXCESSIVE_NUM_THREADS };
    for (int i = 0; i < numThreads.length; i++) {
        for (TestWorkloadConf conf : workloadConfs) {
            setUp();
            LSMInvertedIndexTestContext testCtx = LSMInvertedIndexTestUtils.createHashedNGramInvIndexTestContext(harness, getIndexType());
            TupleGenerator tupleGen = LSMInvertedIndexTestUtils.createPersonNamesTupleGen(harness.getRandom());
            runTest(testCtx, tupleGen, numThreads[i], conf, dataMsg);
            tearDown();
        }
    }
}
Also used : TestWorkloadConf(org.apache.hyracks.storage.am.common.TestWorkloadConf) LSMInvertedIndexTestContext(org.apache.hyracks.storage.am.lsm.invertedindex.util.LSMInvertedIndexTestContext) TupleGenerator(org.apache.hyracks.storage.am.common.datagen.TupleGenerator) Test(org.junit.Test)

Example 10 with TupleGenerator

use of org.apache.hyracks.storage.am.common.datagen.TupleGenerator in project asterixdb by apache.

the class AbstractInvertedIndexDeleteTest method hashedNGramTokensInvIndexTest.

@Test
public void hashedNGramTokensInvIndexTest() throws IOException {
    LSMInvertedIndexTestContext testCtx = LSMInvertedIndexTestUtils.createHashedNGramInvIndexTestContext(harness, invIndexType);
    TupleGenerator tupleGen = LSMInvertedIndexTestUtils.createPersonNamesTupleGen(harness.getRandom());
    runTest(testCtx, tupleGen);
}
Also used : LSMInvertedIndexTestContext(org.apache.hyracks.storage.am.lsm.invertedindex.util.LSMInvertedIndexTestContext) TupleGenerator(org.apache.hyracks.storage.am.common.datagen.TupleGenerator) Test(org.junit.Test)

Aggregations

TupleGenerator (org.apache.hyracks.storage.am.common.datagen.TupleGenerator)14 LSMInvertedIndexTestContext (org.apache.hyracks.storage.am.lsm.invertedindex.util.LSMInvertedIndexTestContext)10 Test (org.junit.Test)10 ArrayList (java.util.ArrayList)2 ISerializerDeserializer (org.apache.hyracks.api.dataflow.value.ISerializerDeserializer)2 UTF8StringSerializerDeserializer (org.apache.hyracks.dataflow.common.data.marshalling.UTF8StringSerializerDeserializer)2 TestWorkloadConf (org.apache.hyracks.storage.am.common.TestWorkloadConf)2 IFieldValueGenerator (org.apache.hyracks.storage.am.common.datagen.IFieldValueGenerator)2 SortedIntegerFieldValueGenerator (org.apache.hyracks.storage.am.common.datagen.SortedIntegerFieldValueGenerator)2 IInvertedIndexSearchModifier (org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedIndexSearchModifier)2 ConjunctiveSearchModifier (org.apache.hyracks.storage.am.lsm.invertedindex.search.ConjunctiveSearchModifier)2 JaccardSearchModifier (org.apache.hyracks.storage.am.lsm.invertedindex.search.JaccardSearchModifier)2 DocumentStringFieldValueGenerator (org.apache.hyracks.storage.am.common.datagen.DocumentStringFieldValueGenerator)1 PersonNameFieldValueGenerator (org.apache.hyracks.storage.am.common.datagen.PersonNameFieldValueGenerator)1 EditDistanceSearchModifier (org.apache.hyracks.storage.am.lsm.invertedindex.search.EditDistanceSearchModifier)1