Mercurial Hosting > luan
comparison src/goodjava/lucene/backup/Backup.java @ 1500:f01abd6d5858
minor
| author | Franklin Schmidt <fschmidt@gmail.com> | 
|---|---|
| date | Sun, 10 May 2020 13:06:11 -0600 | 
| parents | 22e15cf73040 | 
| children | e66e3d50b289 | 
   comparison
  equal
  deleted
  inserted
  replaced
| 1499:22e15cf73040 | 1500:f01abd6d5858 | 
|---|---|
| 19 | 19 | 
| 20 class Backup { | 20 class Backup { | 
| 21 private static final Logger logger = LoggerFactory.getLogger(Backup.class); | 21 private static final Logger logger = LoggerFactory.getLogger(Backup.class); | 
| 22 | 22 | 
| 23 private final File dir; | 23 private final File dir; | 
| 24 private final File index; | |
| 24 | 25 | 
| 25 Backup(File dir) { | 26 Backup(File dir) { | 
| 26 this.dir = dir; | 27 this.dir = dir; | 
| 28 this.index = new File(dir,"index"); | |
| 27 } | 29 } | 
| 28 | 30 | 
| 29 synchronized void handle(RpcServer rpc,RpcCall call) { | 31 synchronized void handle(RpcServer rpc,RpcCall call) { | 
| 30 try { | 32 try { | 
| 31 handle2(rpc,call); | 33 handle2(rpc,call); | 
| 89 break; | 91 break; | 
| 90 } | 92 } | 
| 91 logs.add( new LogFile(f) ); | 93 logs.add( new LogFile(f) ); | 
| 92 } | 94 } | 
| 93 if( complete ) { | 95 if( complete ) { | 
| 94 File index = new File(dir,"index"); | |
| 95 LoggingIndexWriter.writeIndex(logs,index); | 96 LoggingIndexWriter.writeIndex(logs,index); | 
| 96 logger.info("write index"); | 97 logger.info("write index"); | 
| 97 } | 98 } | 
| 98 } | 99 } | 
| 99 rpc.write(result); | 100 rpc.write(result); | 
