diff src/goodjava/lucene/logging/LoggingIndexWriter.java @ 1551:9cc4cee39b8b

add LuanOpDoer
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 04 Oct 2020 16:29:54 -0600
parents 41c32da4cbd1
children 52241b69c339
line wrap: on
line diff
--- a/src/goodjava/lucene/logging/LoggingIndexWriter.java	Sat Oct 03 23:08:36 2020 -0600
+++ b/src/goodjava/lucene/logging/LoggingIndexWriter.java	Sun Oct 04 16:29:54 2020 -0600
@@ -223,7 +223,7 @@
 			throw new RuntimeException();
 		Directory dir = FSDirectory.open(dirFile);
 		LuceneIndexWriter mergeWriter = new LuceneIndexWriter( dir, indexWriter.goodConfig );
-		OpDoer opDoer = new OpDoer(mergeWriter);
+		OpDoer opDoer = new BasicOpDoer(mergeWriter);
 		playLog( first.input(), opDoer );
 		playLog( second.input(), opDoer );
 		mergeWriter.commit();
@@ -300,7 +300,7 @@
 			IoUtils.deleteRecursively(dirFile);
 			Directory dir = FSDirectory.open(dirFile);
 			LuceneIndexWriter checkWriter = new LuceneIndexWriter( dir, indexWriter.goodConfig );
-			playLogs(logReaders,new OpDoer(checkWriter));
+			playLogs(logReaders,new BasicOpDoer(checkWriter));
 			//logger.info("check lucene");
 			IndexReader checkReader = checkWriter.openReader();
 			int nCheck = checkReader.numDocs();
@@ -448,10 +448,9 @@
 		log.writeByte(op);
 	}
 
-	// return whether stopped at tag
 	public synchronized void playLogs(OpDoer opDoer) throws IOException {
 		if( opDoer == null )
-			opDoer = new OpDoer(indexWriter);
+			opDoer = new BasicOpDoer(indexWriter);
 		playLogs( logReaders(logs), opDoer );
 	}
 
@@ -466,7 +465,7 @@
 	private static void playLogs(LogInputStream[] logReaders,OpDoer opDoer)
 		throws IOException
 	{
-		if( numDocs(opDoer.writer) != 0 )
+		if( numDocs(opDoer.writer()) != 0 )
 			throw new RuntimeException ("not empty");
 		for( LogInputStream reader : logReaders ) {
 			playLog(reader,opDoer);