lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhershko <...@git.apache.org>
Subject [GitHub] lucenenet pull request: Adding a MergeScheduler that uses Tasks
Date Sat, 07 May 2016 22:32:08 GMT
Github user synhershko commented on a diff in the pull request:

    https://github.com/apache/lucenenet/pull/171#discussion_r62423601
  
    --- Diff: src/Lucene.Net.Tests/core/Index/TestTransactions.cs ---
    @@ -128,13 +134,21 @@ public IndexerThread(TestTransactions outerInstance, object @lock,
Directory dir
     
                 public override void DoWork()
                 {
    -                IndexWriter writer1 = new IndexWriter(Dir1, ((IndexWriterConfig)NewIndexWriterConfig(TEST_VERSION_CURRENT,
new MockAnalyzer(Random())).SetMaxBufferedDocs(3)).SetMergeScheduler(new ConcurrentMergeScheduler()).SetMergePolicy(NewLogMergePolicy(2)));
    -                ((ConcurrentMergeScheduler)writer1.Config.MergeScheduler).SetSuppressExceptions();
    +                var config = NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random()))
    +                                .SetMaxBufferedDocs(3)
    +                                .SetMergeScheduler(_scheduler1)
    +                                .SetMergePolicy(NewLogMergePolicy(2));
    +                IndexWriter writer1 = new IndexWriter(Dir1, config);
    +                ((IConcurrentMergeScheduler)writer1.Config.MergeScheduler).SetSuppressExceptions();
     
                     // Intentionally use different params so flush/merge
                     // happen @ different times
    -                IndexWriter writer2 = new IndexWriter(Dir2, ((IndexWriterConfig)NewIndexWriterConfig(TEST_VERSION_CURRENT,
new MockAnalyzer(Random())).SetMaxBufferedDocs(2)).SetMergeScheduler(new ConcurrentMergeScheduler()).SetMergePolicy(NewLogMergePolicy(3)));
    -                ((ConcurrentMergeScheduler)writer2.Config.MergeScheduler).SetSuppressExceptions();
    +                var config2 = NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random()))
    +                                .SetMaxBufferedDocs(2)
    +                                .SetMergeScheduler(_scheduler2)
    +                                .SetMergePolicy(NewLogMergePolicy(3));
    +                IndexWriter writer2 = new IndexWriter(Dir2, config2);
    +                ((IConcurrentMergeScheduler)writer2.Config.MergeScheduler).SetSuppressExceptions();
    --- End diff --
    
    why not do a randomized shceduler selection?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message