Class GenericMultiThreadedImporter
- java.lang.Object
-
- org.nuxeo.ecm.platform.importer.base.GenericMultiThreadedImporter
-
- All Implemented Interfaces:
Runnable
,ImporterRunner
public class GenericMultiThreadedImporter extends Object implements ImporterRunner
Generic importer- Author:
- Thierry Delprat
-
-
Field Summary
Fields Modifier and Type Field Description protected Integer
batchSize
protected static int
DEFAULT_QUEUE_SIZE
protected boolean
enablePerfLogging
protected ImporterDocumentModelFactory
factory
protected List<ImporterFilter>
filters
protected List<ImportingDocumentFilter>
importingDocumentFilters
protected SourceNode
importSource
protected static ThreadPoolExecutor
importTP
protected String
importWritePath
protected String
jobName
protected List<ImporterListener>
listeners
protected ImporterLogger
log
protected static Map<String,Long>
nbCreatedDocsByThreads
protected Integer
nbThreads
protected static String[]
PERF_HEADERS
protected int
queueSize
protected String
repositoryName
protected GenericThreadedImportTask
rootImportTask
protected CoreSession
session
protected Boolean
skipRootContainerCreation
protected DocumentModel
targetContainer
protected ImporterThreadingPolicy
threadPolicy
protected Integer
transactionTimeout
-
Constructor Summary
Constructors Constructor Description GenericMultiThreadedImporter(ImporterRunnerConfiguration configuration)
GenericMultiThreadedImporter(SourceNode sourceNode, String importWritePath, Boolean skipRootContainerCreation, Integer batchSize, Integer nbThreads, String jobName, ImporterLogger log)
GenericMultiThreadedImporter(SourceNode sourceNode, String importWritePath, Boolean skipRootContainerCreation, Integer batchSize, Integer nbThreads, ImporterLogger log)
GenericMultiThreadedImporter(SourceNode sourceNode, String importWritePath, Boolean skipRootContainerCreation, Integer batchSize, Integer nbThreads, ImporterLogger log, int queueSize)
GenericMultiThreadedImporter(SourceNode sourceNode, String importWritePath, Integer batchSize, Integer nbThreads, String jobName, ImporterLogger log)
GenericMultiThreadedImporter(SourceNode sourceNode, String importWritePath, Integer batchSize, Integer nbThreads, ImporterLogger log)
-
Method Summary
-
-
-
Field Detail
-
importTP
protected static ThreadPoolExecutor importTP
-
threadPolicy
protected ImporterThreadingPolicy threadPolicy
-
factory
protected ImporterDocumentModelFactory factory
-
importSource
protected SourceNode importSource
-
targetContainer
protected DocumentModel targetContainer
-
batchSize
protected Integer batchSize
-
nbThreads
protected Integer nbThreads
-
transactionTimeout
protected Integer transactionTimeout
-
log
protected ImporterLogger log
-
session
protected CoreSession session
-
importWritePath
protected String importWritePath
-
skipRootContainerCreation
protected Boolean skipRootContainerCreation
-
jobName
protected String jobName
-
enablePerfLogging
protected boolean enablePerfLogging
-
filters
protected List<ImporterFilter> filters
-
listeners
protected List<ImporterListener> listeners
-
importingDocumentFilters
protected List<ImportingDocumentFilter> importingDocumentFilters
-
rootImportTask
protected GenericThreadedImportTask rootImportTask
-
DEFAULT_QUEUE_SIZE
protected static final int DEFAULT_QUEUE_SIZE
- See Also:
- Constant Field Values
-
queueSize
protected int queueSize
-
repositoryName
protected String repositoryName
-
PERF_HEADERS
protected static final String[] PERF_HEADERS
-
-
Constructor Detail
-
GenericMultiThreadedImporter
public GenericMultiThreadedImporter(SourceNode sourceNode, String importWritePath, Boolean skipRootContainerCreation, Integer batchSize, Integer nbThreads, ImporterLogger log, int queueSize)
-
GenericMultiThreadedImporter
public GenericMultiThreadedImporter(SourceNode sourceNode, String importWritePath, Boolean skipRootContainerCreation, Integer batchSize, Integer nbThreads, ImporterLogger log)
-
GenericMultiThreadedImporter
public GenericMultiThreadedImporter(SourceNode sourceNode, String importWritePath, Integer batchSize, Integer nbThreads, ImporterLogger log)
-
GenericMultiThreadedImporter
public GenericMultiThreadedImporter(SourceNode sourceNode, String importWritePath, Boolean skipRootContainerCreation, Integer batchSize, Integer nbThreads, String jobName, ImporterLogger log)
-
GenericMultiThreadedImporter
public GenericMultiThreadedImporter(SourceNode sourceNode, String importWritePath, Integer batchSize, Integer nbThreads, String jobName, ImporterLogger log)
-
GenericMultiThreadedImporter
public GenericMultiThreadedImporter(ImporterRunnerConfiguration configuration)
-
-
Method Detail
-
getExecutor
public static ThreadPoolExecutor getExecutor()
-
addCreatedDoc
public static void addCreatedDoc(String taskId, long nbDocs)
-
getCreatedDocsCounter
public static long getCreatedDocsCounter()
-
addFilter
public void addFilter(ImporterFilter filter)
-
addListeners
public void addListeners(ImporterListener... listeners)
-
addListeners
public void addListeners(Collection<ImporterListener> listeners)
-
addImportingDocumentFilters
public void addImportingDocumentFilters(ImportingDocumentFilter... importingDocumentFilters)
-
addImportingDocumentFilters
public void addImportingDocumentFilters(Collection<ImportingDocumentFilter> importingDocumentFilters)
-
setRootImportTask
public void setRootImportTask(GenericThreadedImportTask rootImportTask)
-
initRootTask
protected GenericThreadedImportTask initRootTask(SourceNode importSource, DocumentModel targetContainer, boolean skipRootContainerCreation, ImporterLogger log, Integer batchSize, String jobName)
-
doRun
protected void doRun() throws IOException
- Throws:
IOException
-
sleep
protected static void sleep(int millis)
-
getTargetContainer
protected DocumentModel getTargetContainer()
-
createTargetContainer
protected DocumentModel createTargetContainer()
Creates the target container where the import will // TODO Auto-generated constructor stub }be done. Can be overridden in subclasses.
-
getThreadPolicy
public ImporterThreadingPolicy getThreadPolicy()
-
setThreadPolicy
public void setThreadPolicy(ImporterThreadingPolicy threadPolicy)
-
getFactory
public ImporterDocumentModelFactory getFactory()
-
setFactory
public void setFactory(ImporterDocumentModelFactory factory)
-
setTransactionTimeout
public void setTransactionTimeout(int transactionTimeout)
- Since:
- 5.9.4
-
setEnablePerfLogging
public void setEnablePerfLogging(boolean enablePerfLogging)
-
stopImportProcrocess
public void stopImportProcrocess()
- Specified by:
stopImportProcrocess
in interfaceImporterRunner
-
notifyBeforeImport
protected void notifyBeforeImport()
-
notifyAfterImport
protected void notifyAfterImport()
-
getRepositoryName
public String getRepositoryName()
- Since:
- 7.1
-
setRepositoryName
public void setRepositoryName(String repositoryName)
- Since:
- 7.1
-
-