Class MultiThreadedImportProcessor
- java.lang.Object
-
- de.hybris.platform.impex.jalo.imp.DefaultImportProcessor
-
- de.hybris.platform.impex.jalo.imp.MultiThreadedImportProcessor
-
- All Implemented Interfaces:
ImportProcessor
- Direct Known Subclasses:
ImpExImportJob.MyMultiThreadedImportProcessor
public class MultiThreadedImportProcessor extends DefaultImportProcessor
Import processor forMultiThreadedImpExImportReader. It synchronizes working threads by their existing item query and (if applicable) by the existing item they're about to change. If multiple workers try to fire the same existing items query they're synchronized. If multiple workers have same existing items they're synchronized too.- Since:
- 3.1-u7
-
-
Constructor Summary
Constructors Constructor Description MultiThreadedImportProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidadjustSessionSettings()protected ExistingItemResolvercreateExistingItemsResolver(HeaderDescriptor header, boolean useCache)Overwritten to create a synchronized existing item resolver.protected SessionContextgetCreationContext(ComposedType targetType, java.util.Map<StandardColumnDescriptor,java.lang.Object> attributeValueMappings, ValueLine valueLine)Switching off TA for creation of items in parallel mode due to deadlocks.protected ImpExWorkergetWorker()protected booleanlockItems(ImpExWorker worker, java.util.Collection<Item> matches)protected voidlockQuery(ImpExWorker worker, QueryParameters queryParameters)ItemprocessItemData(ValueLine valueLine)Overwritten to release any worker locks after finishing value line processingvoidsetMaxThreads(int max)-
Methods inherited from class de.hybris.platform.impex.jalo.imp.DefaultImportProcessor
assertTargetTypePermitted, createCUDHandler, debug, enableLegacyFlagWhenLineIsUsingJaloOnlyFeatures, error, getExistingItemResolver, getHandlerForLine, getLanguage, getReader, getSavedValuesMessage, getValueLineTranslator, handleExceptionDuringImport, hasUnresolvedMandatoryOrInitialColumns, info, init, isDebugEnabled, isInfoEnabled, logExceptionDuringImport, processInsertLine, processInsertLine, processInsertLineInternal, processItemCreation, processItemData_Impl, processItemData_TX, processItemRemoval, processItemUpdate, processRemoveLine, processRemoveLine, processUpdateLine, restoreSessionSettings, shouldRetryAfterException, throwImpExOrRuntimeException, translateValueMappings, warn
-
-
-
-
Method Detail
-
setMaxThreads
public void setMaxThreads(int max)
-
getWorker
protected ImpExWorker getWorker()
-
adjustSessionSettings
protected void adjustSessionSettings()
- Overrides:
adjustSessionSettingsin classDefaultImportProcessor
-
getCreationContext
protected SessionContext getCreationContext(ComposedType targetType, java.util.Map<StandardColumnDescriptor,java.lang.Object> attributeValueMappings, ValueLine valueLine)
Switching off TA for creation of items in parallel mode due to deadlocks.- Overrides:
getCreationContextin classDefaultImportProcessor
-
processItemData
public Item processItemData(ValueLine valueLine) throws ImpExException
Overwritten to release any worker locks after finishing value line processing- Specified by:
processItemDatain interfaceImportProcessor- Overrides:
processItemDatain classDefaultImportProcessor- Throws:
ImpExException
-
lockQuery
protected void lockQuery(ImpExWorker worker, QueryParameters queryParameters)
-
lockItems
protected boolean lockItems(ImpExWorker worker, java.util.Collection<Item> matches)
- Returns:
- true if the worker has been waiting
-
createExistingItemsResolver
protected ExistingItemResolver createExistingItemsResolver(HeaderDescriptor header, boolean useCache) throws HeaderValidationException
Overwritten to create a synchronized existing item resolver.- Overrides:
createExistingItemsResolverin classDefaultImportProcessor- Throws:
HeaderValidationException
-
-