Search in sources :

Example 6 with NonUniqueIndexSampler

use of org.neo4j.kernel.impl.api.index.sampling.NonUniqueIndexSampler in project neo4j by neo4j.

the class NonUniqueDatabaseIndexPopulatingUpdaterTest method removedNodePropertyIncludedInSample.

@Test
public void removedNodePropertyIncludedInSample() throws Exception {
    NonUniqueIndexSampler sampler = newSampler();
    NonUniqueLuceneIndexPopulatingUpdater updater = newUpdater(sampler);
    updater.process(add(1, SCHEMA_DESCRIPTOR, "foo"));
    updater.process(add(2, SCHEMA_DESCRIPTOR, "bar"));
    updater.process(add(3, SCHEMA_DESCRIPTOR, "baz"));
    updater.process(add(4, SCHEMA_DESCRIPTOR, "qux"));
    updater.process(remove(1, SCHEMA_DESCRIPTOR, "foo"));
    updater.process(remove(2, SCHEMA_DESCRIPTOR, "bar"));
    updater.process(remove(4, SCHEMA_DESCRIPTOR, "qux"));
    verifySamplingResult(sampler, 1, 1, 1);
}
Also used : NonUniqueIndexSampler(org.neo4j.kernel.impl.api.index.sampling.NonUniqueIndexSampler) DefaultNonUniqueIndexSampler(org.neo4j.kernel.impl.api.index.sampling.DefaultNonUniqueIndexSampler) Test(org.junit.Test)

Example 7 with NonUniqueIndexSampler

use of org.neo4j.kernel.impl.api.index.sampling.NonUniqueIndexSampler in project neo4j by neo4j.

the class NonUniqueDatabaseIndexPopulatingUpdaterTest method addedNodeCompositePropertiesIncludedInSample.

@Test
public void addedNodeCompositePropertiesIncludedInSample() throws Exception {
    NonUniqueIndexSampler sampler = newSampler();
    NonUniqueLuceneIndexPopulatingUpdater updater = newUpdater(sampler);
    updater.process(add(1, COMPOSITE_SCHEMA_DESCRIPTOR, "bit", "foo"));
    updater.process(add(2, COMPOSITE_SCHEMA_DESCRIPTOR, "bit", "bar"));
    updater.process(add(3, COMPOSITE_SCHEMA_DESCRIPTOR, "bit", "baz"));
    updater.process(add(4, COMPOSITE_SCHEMA_DESCRIPTOR, "bit", "bar"));
    verifySamplingResult(sampler, 4, 3, 4);
}
Also used : NonUniqueIndexSampler(org.neo4j.kernel.impl.api.index.sampling.NonUniqueIndexSampler) DefaultNonUniqueIndexSampler(org.neo4j.kernel.impl.api.index.sampling.DefaultNonUniqueIndexSampler) Test(org.junit.Test)

Example 8 with NonUniqueIndexSampler

use of org.neo4j.kernel.impl.api.index.sampling.NonUniqueIndexSampler in project neo4j by neo4j.

the class NonUniqueDatabaseIndexPopulatingUpdaterTest method removedNodeCompositePropertyIncludedInSample.

@Test
public void removedNodeCompositePropertyIncludedInSample() throws Exception {
    NonUniqueIndexSampler sampler = newSampler();
    NonUniqueLuceneIndexPopulatingUpdater updater = newUpdater(sampler);
    updater.process(add(1, COMPOSITE_SCHEMA_DESCRIPTOR, "bit", "foo"));
    updater.process(add(2, COMPOSITE_SCHEMA_DESCRIPTOR, "bit", "bar"));
    updater.process(add(3, COMPOSITE_SCHEMA_DESCRIPTOR, "bit", "baz"));
    updater.process(add(4, COMPOSITE_SCHEMA_DESCRIPTOR, "bit", "qux"));
    updater.process(remove(1, COMPOSITE_SCHEMA_DESCRIPTOR, "bit", "foo"));
    updater.process(remove(2, COMPOSITE_SCHEMA_DESCRIPTOR, "bit", "bar"));
    updater.process(remove(4, COMPOSITE_SCHEMA_DESCRIPTOR, "bit", "qux"));
    verifySamplingResult(sampler, 1, 1, 1);
}
Also used : NonUniqueIndexSampler(org.neo4j.kernel.impl.api.index.sampling.NonUniqueIndexSampler) DefaultNonUniqueIndexSampler(org.neo4j.kernel.impl.api.index.sampling.DefaultNonUniqueIndexSampler) Test(org.junit.Test)

Example 9 with NonUniqueIndexSampler

use of org.neo4j.kernel.impl.api.index.sampling.NonUniqueIndexSampler in project neo4j by neo4j.

the class NonUniqueDatabaseIndexPopulatingUpdaterTest method nodePropertyUpdatesIncludedInSample.

@Test
public void nodePropertyUpdatesIncludedInSample() throws Exception {
    NonUniqueIndexSampler sampler = newSampler();
    NonUniqueLuceneIndexPopulatingUpdater updater = newUpdater(sampler);
    updater.process(add(1, SCHEMA_DESCRIPTOR, "foo"));
    updater.process(change(1, SCHEMA_DESCRIPTOR, "foo", "newFoo1"));
    updater.process(add(2, SCHEMA_DESCRIPTOR, "bar"));
    updater.process(remove(2, SCHEMA_DESCRIPTOR, "bar"));
    updater.process(change(1, SCHEMA_DESCRIPTOR, "newFoo1", "newFoo2"));
    updater.process(add(42, SCHEMA_DESCRIPTOR, "qux"));
    updater.process(add(3, SCHEMA_DESCRIPTOR, "bar"));
    updater.process(add(4, SCHEMA_DESCRIPTOR, "baz"));
    updater.process(add(5, SCHEMA_DESCRIPTOR, "bar"));
    updater.process(remove(42, SCHEMA_DESCRIPTOR, "qux"));
    verifySamplingResult(sampler, 4, 3, 4);
}
Also used : NonUniqueIndexSampler(org.neo4j.kernel.impl.api.index.sampling.NonUniqueIndexSampler) DefaultNonUniqueIndexSampler(org.neo4j.kernel.impl.api.index.sampling.DefaultNonUniqueIndexSampler) Test(org.junit.Test)

Aggregations

DefaultNonUniqueIndexSampler (org.neo4j.kernel.impl.api.index.sampling.DefaultNonUniqueIndexSampler)9 NonUniqueIndexSampler (org.neo4j.kernel.impl.api.index.sampling.NonUniqueIndexSampler)9 Test (org.junit.Test)8 IOException (java.io.IOException)1 IndexReader (org.apache.lucene.index.IndexReader)1 LeafReaderContext (org.apache.lucene.index.LeafReaderContext)1 Terms (org.apache.lucene.index.Terms)1 TermsEnum (org.apache.lucene.index.TermsEnum)1 BytesRef (org.apache.lucene.util.BytesRef)1