Mercurial Hosting > luan
comparison src/goodjava/lucene/logging/LoggingIndexWriter.java @ 1488:af55cfad6e12
start lucene.backup
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sat, 02 May 2020 15:38:48 -0600 |
parents | 044a360c2300 |
children | 22e15cf73040 |
comparison
equal
deleted
inserted
replaced
1487:044a360c2300 | 1488:af55cfad6e12 |
---|---|
33 import goodjava.lucene.api.LuceneUtils; | 33 import goodjava.lucene.api.LuceneUtils; |
34 import goodjava.logging.Logger; | 34 import goodjava.logging.Logger; |
35 import goodjava.logging.LoggerFactory; | 35 import goodjava.logging.LoggerFactory; |
36 | 36 |
37 | 37 |
38 public final class LoggingIndexWriter implements GoodIndexWriter { | 38 public class LoggingIndexWriter implements GoodIndexWriter { |
39 private static final Logger logger = LoggerFactory.getLogger(LoggingIndexWriter.class); | 39 private static final Logger logger = LoggerFactory.getLogger(LoggingIndexWriter.class); |
40 private static final int version = 1; | 40 private static final int version = 1; |
41 private static final int OP_DELETE_ALL = 1; | 41 private static final int OP_DELETE_ALL = 1; |
42 private static final int OP_DELETE_DOCUMENTS = 2; | 42 private static final int OP_DELETE_DOCUMENTS = 2; |
43 private static final int OP_ADD_DOCUMENT = 3; | 43 private static final int OP_ADD_DOCUMENT = 3; |
44 private static final int OP_UPDATE_DOCUMENT = 4; | 44 private static final int OP_UPDATE_DOCUMENT = 4; |
45 private static final Random rnd = new Random(); | 45 private static final Random rnd = new Random(); |
46 | 46 |
47 public final LuceneIndexWriter indexWriter; | 47 public final LuceneIndexWriter indexWriter; |
48 private final File logDir; | 48 private final File logDir; |
49 private final List<LogFile> logs = new ArrayList<LogFile>(); | 49 protected final List<LogFile> logs = new ArrayList<LogFile>(); |
50 private LogOutputStream log; | 50 private LogOutputStream log; |
51 private final File index; | 51 private final File index; |
52 private boolean isMerging = false; | 52 private boolean isMerging = false; |
53 | 53 |
54 public LoggingIndexWriter(LuceneIndexWriter indexWriter,File logDir) throws IOException { | 54 public LoggingIndexWriter(LuceneIndexWriter indexWriter,File logDir) throws IOException { |