Lucene.Net.Index.DocumentsWriter.CloseDocStore C# (CSharp) Method

CloseDocStore() private method

Closes the current open doc stores an returns the doc store segment name. This returns null if there are * no buffered documents.
private CloseDocStore ( ) : System.String
return System.String
		internal System.String CloseDocStore()
		{
			lock (this)
			{
				
				System.Diagnostics.Debug.Assert(AllThreadsIdle());
				
				if (infoStream != null)
					Message("closeDocStore: " + openFiles.Count + " files to flush to segment " + docStoreSegment + " numDocs=" + numDocsInStore);
				
				bool success = false;
				
				try
				{
					InitFlushState(true);
					closedFiles.Clear();
					
					consumer.CloseDocStore(flushState);
					System.Diagnostics.Debug.Assert(0 == openFiles.Count);
					
					System.String s = docStoreSegment;
					docStoreSegment = null;
					docStoreOffset = 0;
					numDocsInStore = 0;
					success = true;
					return s;
				}
				finally
				{
					if (!success)
					{
						Abort();
					}
				}
			}
		}