|
||||||||||
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 AbstractSimpleImporterProcessor
protected abstract List<File> getSplitedFiles()
protected void splitFiles()
protected int getSplitLength(int nblines)
public void process()
AbstractSimpleImporterProcessor
process
in interface IImporterProcessor
process
in class AbstractSimpleImporterProcessor
public abstract Runnable createTask(File file)
public int incrementReadedFileLine(int increment)
incrementReadedFileLine
in class AbstractSimpleImporterProcessor
increment
-
protected void processData(String line) throws ImporterException
AbstractSimpleImporterProcessor
processData
in class AbstractSimpleImporterProcessor
line
- the line to process
ImporterException
public String getCurrentFileName()
getCurrentFileName
in interface IImporterProcessor
getCurrentFileName
in class AbstractSimpleImporterProcessor
public long getReadFileLine()
IImporterProcessor
getReadFileLine
in interface IImporterProcessor
getReadFileLine
in class AbstractSimpleImporterProcessor
IImporterProcessor.getTotalReadLine()
public long getTotalReadLine()
IImporterProcessor
getTotalReadLine
in interface IImporterProcessor
getTotalReadLine
in class AbstractSimpleImporterProcessor
IImporterProcessor.getReadFileLine()
protected boolean shouldIgnoreComments()
AbstractSimpleImporterProcessor
shouldIgnoreComments
in class AbstractSimpleImporterProcessor
AbstractSimpleImporterProcessor.COMMENT_START
protected boolean shouldIgnoreFirstLine()
AbstractSimpleImporterProcessor
shouldIgnoreFirstLine
in class AbstractSimpleImporterProcessor
protected int getNumberOfColumns()
getNumberOfColumns
in class AbstractSimpleImporterProcessor
public int getNumberOfProcessors()
public int getNumberOfTaskExecutors()
public void setIdGenerator(IIdGenerator idGenerator)
protected void flushAndClear()
AbstractSimpleImporterProcessor
flushAndClear
in class AbstractSimpleImporterProcessor
public long getNumberOfLinesToProcess()
getNumberOfLinesToProcess
in interface IImporterProcessor
getNumberOfLinesToProcess
in class AbstractSimpleImporterProcessor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |