comparison src/goodjava/lucene/backup/Backup.java @ 1548:736ec76bbf42

lucene log work
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 27 Sep 2020 22:07:18 -0600
parents 31b543826ca9
children 8dd8c556c449
comparison
equal deleted inserted replaced
1547:f24a9ba7551e 1548:736ec76bbf42
103 } 103 }
104 } 104 }
105 } 105 }
106 if( call.cmd.equals("add") ) { 106 if( call.cmd.equals("add") ) {
107 boolean complete = true; 107 boolean complete = true;
108 List<LogFile> logs = new ArrayList<LogFile>(); 108 final LogFile[] logs = new LogFile[logInfo.size()];
109 for( Object obj : logInfo ) { 109 for( int i=0; i<logs.length; i++ ) {
110 Map fileInfo = (Map)obj; 110 Map fileInfo = (Map)logInfo.get(i);
111 String name = (String)fileInfo.get("name"); 111 String name = (String)fileInfo.get("name");
112 File f = new File(dir,name); 112 File f = new File(dir,name);
113 if( !f.exists() ) { 113 if( !f.exists() ) {
114 complete = false; 114 complete = false;
115 break; 115 break;
116 } 116 }
117 logs.add( new LogFile(f) ); 117 logs[i] = new LogFile(f);
118 } 118 }
119 if( complete ) { 119 if( complete ) {
120 LoggingIndexWriter.writeIndex(logs,index); 120 LoggingIndexWriter.writeIndex(logs,index);
121 //logger.info("write index"); 121 //logger.info("write index");
122 } 122 }