|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.gisgraphy.importer.AbstractSimpleImporterProcessor
com.gisgraphy.importer.AbstractAdvancedImporterProcessor
public abstract class AbstractAdvancedImporterProcessor
Import the street from an (pre-processed) openStreet map data file in with all the processor capacity.
| Field Summary | |
|---|---|
protected ImporterException |
exception
|
protected FileSpliter |
fileSpliter
|
protected IIdGenerator |
idGenerator
|
protected static org.slf4j.Logger |
logger
The logger |
protected List<File> |
splitedFiles
|
protected org.springframework.scheduling.backportconcurrent.ThreadPoolTaskExecutor |
threadPoolTaskExecutor
|
protected AtomicInteger |
totalReadLineMultithreaded
|
| Fields inherited from class com.gisgraphy.importer.AbstractSimpleImporterProcessor |
|---|
COMMENT_START, currentFile, importerConfig, in, internationalisationService, readFileLine, status, statusMessage, totalReadLine, transactionManager, txDefinition, txStatus |
| Constructor Summary | |
|---|---|
AbstractAdvancedImporterProcessor()
|
|
| Method Summary | |
|---|---|
abstract Runnable |
createTask(File file)
|
protected void |
flushAndClear()
Should flush and clear all the Daos that are used by the processor. |
String |
getCurrentFileName()
|
protected int |
getNumberOfColumns()
|
long |
getNumberOfLinesToProcess()
|
int |
getNumberOfProcessors()
|
int |
getNumberOfTaskExecutors()
|
long |
getReadFileLine()
The number of read line for the current processed file |
protected abstract List<File> |
getSplitedFiles()
|
protected int |
getSplitLength(int nblines)
|
long |
getTotalReadLine()
The number of read line for all the processed file |
int |
incrementReadedFileLine(int increment)
|
void |
process()
Manage the transaction, flush Daos, and process all files to be processed |
protected void |
processData(String line)
Process a read line of the geonames file, must be implemented by the concrete class |
void |
setIdGenerator(IIdGenerator idGenerator)
|
protected void |
setup()
Template method that can be override. |
protected boolean |
shouldIgnoreComments()
Whether the filter should ignore the comments (i.e. lines starting with #) |
protected boolean |
shouldIgnoreFirstLine()
Template Method : Whether the processor should ignore the first line of the input |
protected void |
splitFiles()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.gisgraphy.importer.IImporterProcessor |
|---|
rollback |
| Field Detail |
|---|
protected IIdGenerator idGenerator
protected AtomicInteger totalReadLineMultithreaded
protected org.springframework.scheduling.backportconcurrent.ThreadPoolTaskExecutor threadPoolTaskExecutor
protected FileSpliter fileSpliter
protected List<File> splitedFiles
protected static final org.slf4j.Logger logger
protected ImporterException exception
| Constructor Detail |
|---|
public AbstractAdvancedImporterProcessor()
| Method Detail |
|---|
protected void setup()
AbstractSimpleImporterProcessor
setup in class AbstractSimpleImporterProcessorprotected abstract List<File> getSplitedFiles()
protected void splitFiles()
protected int getSplitLength(int nblines)
public void process()
AbstractSimpleImporterProcessor
process in interface IImporterProcessorprocess in class AbstractSimpleImporterProcessorpublic abstract Runnable createTask(File file)
public int incrementReadedFileLine(int increment)
incrementReadedFileLine in class AbstractSimpleImporterProcessorincrement -
protected void processData(String line)
throws ImporterException
AbstractSimpleImporterProcessor
processData in class AbstractSimpleImporterProcessorline - the line to process
ImporterExceptionpublic String getCurrentFileName()
getCurrentFileName in interface IImporterProcessorgetCurrentFileName in class AbstractSimpleImporterProcessorpublic long getReadFileLine()
IImporterProcessor
getReadFileLine in interface IImporterProcessorgetReadFileLine in class AbstractSimpleImporterProcessorIImporterProcessor.getTotalReadLine()public long getTotalReadLine()
IImporterProcessor
getTotalReadLine in interface IImporterProcessorgetTotalReadLine in class AbstractSimpleImporterProcessorIImporterProcessor.getReadFileLine()protected boolean shouldIgnoreComments()
AbstractSimpleImporterProcessor
shouldIgnoreComments in class AbstractSimpleImporterProcessorAbstractSimpleImporterProcessor.COMMENT_STARTprotected boolean shouldIgnoreFirstLine()
AbstractSimpleImporterProcessor
shouldIgnoreFirstLine in class AbstractSimpleImporterProcessorprotected int getNumberOfColumns()
getNumberOfColumns in class AbstractSimpleImporterProcessorpublic int getNumberOfProcessors()
public int getNumberOfTaskExecutors()
public void setIdGenerator(IIdGenerator idGenerator)
protected void flushAndClear()
AbstractSimpleImporterProcessor
flushAndClear in class AbstractSimpleImporterProcessorpublic long getNumberOfLinesToProcess()
getNumberOfLinesToProcess in interface IImporterProcessorgetNumberOfLinesToProcess in class AbstractSimpleImporterProcessor
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||