Exemplo n.º 1
0
        private static void VerifySamplingResult(NonUniqueIndexSampler sampler, long expectedIndexSize, long expectedUniqueValues, long expectedSampleSize)
        {
            IndexSample sample = sampler.Result();

            assertEquals(expectedIndexSize, sample.IndexSize());
            assertEquals(expectedUniqueValues, sample.UniqueValues());
            assertEquals(expectedSampleSize, sample.SampleSize());
        }
Exemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void addedNodeCompositePropertiesIncludedInSample() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void AddedNodeCompositePropertiesIncludedInSample()
        {
            NonUniqueIndexSampler sampler = NewSampler();
            NonUniqueLuceneIndexPopulatingUpdater updater = NewUpdater(sampler);

            updater.Process(add(1, _compositeSchemaDescriptor, "bit", "foo"));
            updater.Process(add(2, _compositeSchemaDescriptor, "bit", "bar"));
            updater.Process(add(3, _compositeSchemaDescriptor, "bit", "baz"));
            updater.Process(add(4, _compositeSchemaDescriptor, "bit", "bar"));

            VerifySamplingResult(sampler, 4, 3, 4);
        }
Exemplo n.º 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void changedNodePropertiesIncludedInSample() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void ChangedNodePropertiesIncludedInSample()
        {
            NonUniqueIndexSampler sampler = NewSampler();
            NonUniqueLuceneIndexPopulatingUpdater updater = NewUpdater(sampler);

            updater.Process(add(1, _schemaDescriptor, "initial1"));
            updater.Process(add(2, _schemaDescriptor, "initial2"));
            updater.Process(add(3, _schemaDescriptor, "new2"));

            updater.Process(change(1, _schemaDescriptor, "initial1", "new1"));
            updater.Process(change(1, _schemaDescriptor, "initial2", "new2"));

            VerifySamplingResult(sampler, 3, 2, 3);
        }
Exemplo n.º 4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void removedNodePropertyIncludedInSample() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void RemovedNodePropertyIncludedInSample()
        {
            NonUniqueIndexSampler sampler = NewSampler();
            NonUniqueLuceneIndexPopulatingUpdater updater = NewUpdater(sampler);

            updater.Process(add(1, _schemaDescriptor, "foo"));
            updater.Process(add(2, _schemaDescriptor, "bar"));
            updater.Process(add(3, _schemaDescriptor, "baz"));
            updater.Process(add(4, _schemaDescriptor, "qux"));

            updater.Process(remove(1, _schemaDescriptor, "foo"));
            updater.Process(remove(2, _schemaDescriptor, "bar"));
            updater.Process(remove(4, _schemaDescriptor, "qux"));

            VerifySamplingResult(sampler, 1, 1, 1);
        }
Exemplo n.º 5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void nodeCompositePropertyUpdatesIncludedInSample() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void NodeCompositePropertyUpdatesIncludedInSample()
        {
            NonUniqueIndexSampler sampler = NewSampler();
            NonUniqueLuceneIndexPopulatingUpdater updater = NewUpdater(sampler);

            updater.Process(add(1, _compositeSchemaDescriptor, "bit", "foo"));
            updater.Process(change(1, _compositeSchemaDescriptor, new object[] { "bit", "foo" }, new object[] { "bit", "newFoo1" }));

            updater.Process(add(2, _compositeSchemaDescriptor, "bit", "bar"));
            updater.Process(remove(2, _compositeSchemaDescriptor, "bit", "bar"));

            updater.Process(change(1, _compositeSchemaDescriptor, new object[] { "bit", "newFoo1" }, new object[] { "bit", "newFoo2" }));

            updater.Process(add(42, _compositeSchemaDescriptor, "bit", "qux"));
            updater.Process(add(3, _compositeSchemaDescriptor, "bit", "bar"));
            updater.Process(add(4, _compositeSchemaDescriptor, "bit", "baz"));
            updater.Process(add(5, _compositeSchemaDescriptor, "bit", "bar"));
            updater.Process(remove(42, _compositeSchemaDescriptor, "bit", "qux"));

            VerifySamplingResult(sampler, 4, 3, 4);
        }
Exemplo n.º 6
0
 private static NonUniqueLuceneIndexPopulatingUpdater NewUpdater(LuceneIndexWriter writer, NonUniqueIndexSampler sampler)
 {
     return(new NonUniqueLuceneIndexPopulatingUpdater(writer, sampler));
 }
Exemplo n.º 7
0
 private static NonUniqueLuceneIndexPopulatingUpdater NewUpdater(NonUniqueIndexSampler sampler)
 {
     return(NewUpdater(mock(typeof(LuceneIndexWriter)), sampler));
 }
Exemplo n.º 8
0
 public NonUniqueLuceneIndexPopulator(SchemaIndex luceneIndex, IndexSamplingConfig samplingConfig) : base(luceneIndex)
 {
     this._samplingConfig = samplingConfig;
     this._sampler        = CreateDefaultSampler();
 }
Exemplo n.º 9
0
 public NonUniqueLuceneIndexPopulatingUpdater(LuceneIndexWriter writer, NonUniqueIndexSampler sampler) : base(writer)
 {
     this._sampler = sampler;
 }