Exemple #1
0
 /// <summary>This ctor used only by test code.
 ///
 /// </summary>
 /// <param name="dir">The Directory to merge the other segments into
 /// </param>
 /// <param name="name">The name of the new segment
 /// </param>
 public /*internal*/ SegmentMerger(Directory dir, System.String name)
 {
     InitBlock();
     directory  = dir;
     segment    = name;
     checkAbort = new AnonymousClassCheckAbort(this, null, null);
 }
Exemple #2
0
 /// <summary>
 /// Sole constructor. </summary>
 internal MergeState(IList <AtomicReader> readers, SegmentInfo segmentInfo, InfoStream infoStream, CheckAbort checkAbort_)
 {
     this.Readers     = readers;
     this.SegmentInfo = segmentInfo;
     this.InfoStream  = infoStream;
     this.checkAbort  = checkAbort_;
 }
Exemple #3
0
 /// <summary>This ctor used only by test code.
 ///
 /// </summary>
 /// <param name="dir">The Directory to merge the other segments into
 /// </param>
 /// <param name="name">The name of the new segment
 /// </param>
 public /*internal*/ SegmentMerger(Directory dir, System.String name)
 {
     InitBlock();
     directory  = dir;
     segment    = name;
     checkAbort = new CheckAbort(null, null, (d) => { /*Do nothing*/ });
 }
Exemple #4
0
 internal SegmentMerger(IndexWriter writer, System.String name, MergePolicy.OneMerge merge)
 {
     InitBlock();
     directory = writer.GetDirectory();
     segment   = name;
     if (merge != null)
     {
         checkAbort = new CheckAbort(merge, directory);
     }
     termIndexInterval = writer.GetTermIndexInterval();
 }
Exemple #5
0
 internal SegmentMerger(IndexWriter writer, System.String name, MergePolicy.OneMerge merge)
 {
     InitBlock();
     directory = writer.Directory;
     segment   = name;
     if (merge != null)
     {
         checkAbort = new CheckAbort(merge, directory);
     }
     else
     {
         checkAbort = new AnonymousClassCheckAbort1(this, null, null);
     }
     termIndexInterval = writer.TermIndexInterval;
 }
Exemple #6
0
 // note, just like in codec apis Directory 'dir' is NOT the same as segmentInfo.dir!!
 internal SegmentMerger(IList <AtomicReader> readers, SegmentInfo segmentInfo, InfoStream infoStream, Directory dir, int termIndexInterval, CheckAbort checkAbort, FieldInfos.FieldNumbers fieldNumbers, IOContext context, bool validate)
 {
     // validate incoming readers
     if (validate)
     {
         foreach (AtomicReader reader in readers)
         {
             reader.CheckIntegrity();
         }
     }
     mergeState                      = new MergeState(readers, segmentInfo, infoStream, checkAbort);
     directory                       = dir;
     this.termIndexInterval          = termIndexInterval;
     this.codec                      = segmentInfo.Codec;
     this.context                    = context;
     this.fieldInfosBuilder          = new FieldInfos.Builder(fieldNumbers);
     mergeState.SegmentInfo.DocCount = SetDocMaps();
 }