19 using System.Collections.Generic;
22 namespace Lucene.Net.Index
75 internal bool mergeDocStores;
76 internal bool optimize;
77 internal bool registerDone;
78 internal long mergeGen;
79 internal bool isExternal;
80 internal int maxNumSegmentsOptimize;
84 internal bool useCompoundFile;
85 internal bool aborted;
86 internal System.Exception error;
90 if (0 == segments.Count)
91 throw new ArgumentException(
"segments must include at least one segment",
"segments");
92 this.segments = segments;
93 this.useCompoundFile = useCompoundFile;
99 internal virtual void SetException(System.Exception error)
110 internal virtual System.Exception GetException()
122 internal virtual void Abort()
131 internal virtual bool IsAborted()
139 internal virtual void CheckAborted(
Directory dir)
148 internal virtual String SegString(
Directory dir)
150 var b =
new System.Text.StringBuilder();
151 int numSegments = segments.Count;
152 for (
int i = 0; i < numSegments; i++)
156 b.Append(segments.Info(i).SegString(dir));
159 b.Append(
" into ").Append(info.name);
161 b.Append(
" [optimize]");
164 b.Append(
" [mergeDocStores]");
169 public SegmentInfos segments_ForNUnit
171 get {
return segments; }
185 public IList<OneMerge> merges =
new List<OneMerge>();
194 var b =
new System.Text.StringBuilder();
195 b.Append(
"MergeSpec:\n");
196 int count = merges.Count;
197 for (
int i = 0; i < count; i++)
198 b.Append(
" ").Append(1 + i).Append(
": ").Append(merges[i].SegString(dir));
245 this.writer = writer;
256 public abstract MergeSpecification FindMerges(
SegmentInfos segmentInfos);
273 public abstract MergeSpecification FindMergesForOptimize(
SegmentInfos segmentInfos,
int maxSegmentCount,
274 ISet<SegmentInfo> segmentsToOptimize);
282 public abstract MergeSpecification FindMergesToExpungeDeletes(
SegmentInfos segmentInfos);
285 [Obsolete(
"Use Dispose() instead")]
292 public void Dispose()
297 protected abstract void Dispose(
bool disposing);
307 public abstract bool UseCompoundDocStore(
SegmentInfos segments);