Revision 79276af0
Added by Andreas Müller over 4 years ago
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/out/PesiDescriptionExport.java | ||
---|---|---|
75 | 75 |
* <li>Phase 2: Export of TaxonName extensions <code>taxComment</code>, <code>fauComment</code> and <code>fauExtraCodes</code> as Notes.</ul> |
76 | 76 |
* @author e.-m.lee |
77 | 77 |
* @since 23.02.2010 |
78 |
* @author a.mueller |
|
78 | 79 |
*/ |
79 | 80 |
@Component |
80 | 81 |
public class PesiDescriptionExport extends PesiExportBase { |
... | ... | |
90 | 91 |
private static final String dbVernacularTableName = "CommonName"; |
91 | 92 |
private static final String dbImageTableName = "Image"; |
92 | 93 |
private static final String dbAdditionalSourceTableName = "AdditionalTaxonSource"; |
93 |
private static final String pluralString = "attached infos";
|
|
94 |
private static final String pluralString = "descriptions";
|
|
94 | 95 |
private static final String parentPluralString = "Taxa"; |
95 | 96 |
|
96 | 97 |
//decide where to handle them best (configurator, transformer, single method, ...) |
... | ... | |
190 | 191 |
TransactionStatus txStatus = startTransaction(true); |
191 | 192 |
|
192 | 193 |
if (logger.isDebugEnabled()){ |
193 |
logger.info("Started new transaction. Fetching some " + pluralString + " (max: " + limit + ") ..."); |
|
194 |
logger.info("Started new transaction. Fetching some " + parentPluralString + " (max: " + limit + ") ...");
|
|
194 | 195 |
logger.debug("Start snapshot, before starting loop"); |
195 | 196 |
ProfilerController.memorySnapshot(); |
196 | 197 |
} |
... | ... | |
200 | 201 |
while ((taxonList = getNextTaxonPartition(Taxon.class, limit, partitionCount++, propPath )) != null ) { |
201 | 202 |
|
202 | 203 |
if (logger.isDebugEnabled()) { |
203 |
logger.info("Fetched " + taxonList.size() + " " + pluralString + ". Exporting..."); |
|
204 |
logger.info("Fetched " + taxonList.size() + " " + parentPluralString + ". Exporting...");
|
|
204 | 205 |
} |
205 | 206 |
|
206 | 207 |
for (Taxon taxon : taxonList) { |
207 | 208 |
countTaxa++; |
208 |
doCount(count++, modCount, pluralString); |
|
209 |
doCount(count++, modCount, parentPluralString);
|
|
209 | 210 |
state.setCurrentTaxon(taxon); |
210 | 211 |
if (!taxon.getDescriptions().isEmpty()){ |
211 | 212 |
success &= handleSingleTaxon(taxon, state, notesMapping, occurrenceMapping, addSourceSourceMapping, |
... | ... | |
217 | 218 |
|
218 | 219 |
// Commit transaction |
219 | 220 |
commitTransaction(txStatus); |
220 |
logger.info("Exported " + (count - pastCount) + " " + pluralString + ". Total: " + count + " (Phase 01)"); |
|
221 |
logger.info("Exported " + (count - pastCount) + " " + parentPluralString + ". Total: " + count + " (Phase 01)");
|
|
221 | 222 |
pastCount = count; |
222 | 223 |
ProfilerController.memorySnapshot(); |
223 | 224 |
// Start transaction |
224 | 225 |
txStatus = startTransaction(true); |
225 | 226 |
if(logger.isDebugEnabled()) { |
226 |
logger.info("Started new transaction. Fetching some " + pluralString + " (max: " + limit + ") for description import ..."); |
|
227 |
logger.info("Started new transaction. Fetching some " + parentPluralString + " (max: " + limit + ") for description import ...");
|
|
227 | 228 |
} |
228 | 229 |
} |
229 | 230 |
|
230 |
logger.info("No " + pluralString + " left to fetch."); |
|
231 |
logger.info("No " + parentPluralString + " left to fetch.");
|
|
231 | 232 |
logger.info("Partition: " + partitionCount); |
232 | 233 |
logger.info("Taxa: " + countTaxa); |
233 | 234 |
logger.info("Desc: " + countDescriptions); |
... | ... | |
304 | 305 |
logger.info("Started new transaction. Fetching some name descriptions (max: " + limit + ") for description import ..."); |
305 | 306 |
} |
306 | 307 |
|
307 |
logger.info("No " + pluralString + " left to fetch."); |
|
308 |
logger.info("No " + parentPluralString + " left to fetch.");
|
|
308 | 309 |
logger.info("Partition: " + partitionCount); |
309 | 310 |
logger.info("Taxa: " + countTaxa); |
310 | 311 |
logger.info("Desc: " + countDescriptions); |
... | ... | |
551 | 552 |
} |
552 | 553 |
} |
553 | 554 |
|
554 |
doCount(count++, modCount, pluralString); |
|
555 |
doCount(count++, modCount, parentPluralString);
|
|
555 | 556 |
} |
556 | 557 |
|
557 | 558 |
// Commit transaction |
Also available in: Unified diff
cleanup