Class DataLoaderService
java.lang.Object
org.jumpmind.symmetric.service.impl.AbstractService
org.jumpmind.symmetric.service.impl.DataLoaderService
- All Implemented Interfaces:
IDataLoaderService,IService
Responsible for writing batch data to the database
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class org.jumpmind.symmetric.service.impl.AbstractService
log, parameterService, platform, sqlTemplate, sqlTemplateDirty, symmetricDialect, tablePrefix -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected IDataWriterbuildDataWriter(ProcessInfo processInfo, String sourceNodeId, String channelId, long batchId, boolean isRetry) voidvoidvoidstatic StringfilterDataLoaderType(String dataLoaderType) getConflictSettingsNodeGroupLinks(NodeGroupLink link, boolean refreshCache) getCurrentIncomingError(long batchId, String nodeId) protected Map<String,IDataLoaderFactory> protected IDataLoaderFactorygetFactory(Channel channel) getIncomingError(long batchId, String nodeId, long rowNumber) getIncomingErrors(long batchId, String nodeId) voidinsertIncomingError(ISqlTransaction transaction, IncomingError incomingError) voidinsertIncomingError(IncomingError incomingError) loadDataBatch(String batchData) loadDataBatch(String batchData, IProcessInfoListener listener) voidloadDataFromConfig(Node remote, RemoteNodeStatus status, boolean force) loadDataFromOfflineTransport(Node remote, RemoteNodeStatus status, IIncomingTransport transport) loadDataFromPull(Node remote, String queue) Connect to the remote node and pull data.voidloadDataFromPull(Node remote, RemoteNodeStatus status) voidloadDataFromPush(Node sourceNode, InputStream in, OutputStream out) Load database from input stream and write acknowledgment to output stream.voidloadDataFromPush(Node sourceNode, String queue, InputStream in, OutputStream out) Load database from input stream and write acknowledgment to output stream.loadDataFromTransport(ProcessInfo processInfo, Node sourceNode, IIncomingTransport transport) protected List<IncomingBatch>loadDataFromTransport(ProcessInfo transferInfo, Node sourceNode, IIncomingTransport transport, OutputStream out, RemoteNodeStatus status) Load database from input stream and return a list of batch statuses.protected voidlogOrRethrow(Throwable ex, String sourceNodeId) protected voidpurgeLoadBatchesFromStaging(List<IncomingBatch> batchList) booleanvoidrename(String oldId, DataLoaderService.ConflictNodeGroupLink setting) voidvoidprotected voidsetTransportManager(ITransportManager transportManager) Used for unit testsprotected voidupdateBatchToSendCount(Node remote, IIncomingTransport transport) voidupdateIncomingError(IncomingError incomingError) Methods inherited from class org.jumpmind.symmetric.service.impl.AbstractService
assertNotNull, buildBatchOrderBy, buildBatchParams, buildBatchWhere, buildBatchWhereFromFilter, close, createSqlReplacementTokens, getJdbcTemplate, getParameterService, getSql, getSymmetricDialect, getTablePrefix, getTargetDialect, getTargetPlatform, getTargetPlatform, isCalledFromSymmetricAdminTool, isSet, isStreamClosedByClient, isSymmetricTable, logOnce, maxDate, readAcks, sendAck, setSqlMap, synchronize, toNodeIds, toNodeIds
-
Constructor Details
-
DataLoaderService
-
-
Method Details
-
refreshFromDatabase
public boolean refreshFromDatabase()- Specified by:
refreshFromDatabasein interfaceIDataLoaderService
-
getAvailableDataLoaderFactories
- Specified by:
getAvailableDataLoaderFactoriesin interfaceIDataLoaderService
-
getDataLoaderFactories
-
loadDataBatch
- Specified by:
loadDataBatchin interfaceIDataLoaderService
-
loadDataBatch
- Specified by:
loadDataBatchin interfaceIDataLoaderService
-
loadDataFromPull
Connect to the remote node and pull data. The acknowledgment of commit/error status is sent separately after the data is processed.- Specified by:
loadDataFromPullin interfaceIDataLoaderService- Throws:
IOException
-
loadDataFromPull
- Specified by:
loadDataFromPullin interfaceIDataLoaderService- Throws:
IOException
-
updateBatchToSendCount
-
loadDataFromPush
Load database from input stream and write acknowledgment to output stream. This is used for a "push" request with a response of an acknowledgment.- Specified by:
loadDataFromPushin interfaceIDataLoaderService- Throws:
IOException
-
loadDataFromPush
public void loadDataFromPush(Node sourceNode, String queue, InputStream in, OutputStream out) throws IOException Load database from input stream and write acknowledgment to output stream. This is used for a "push" request with a response of an acknowledgment.- Specified by:
loadDataFromPushin interfaceIDataLoaderService- Throws:
IOException
-
purgeLoadBatchesFromStaging
-
loadDataFromOfflineTransport
public List<IncomingBatch> loadDataFromOfflineTransport(Node remote, RemoteNodeStatus status, IIncomingTransport transport) throws IOException - Specified by:
loadDataFromOfflineTransportin interfaceIDataLoaderService- Throws:
IOException
-
loadDataFromConfig
public void loadDataFromConfig(Node remote, RemoteNodeStatus status, boolean force) throws IOException - Specified by:
loadDataFromConfigin interfaceIDataLoaderService- Throws:
IOException
-
loadDataFromTransport
public List<IncomingBatch> loadDataFromTransport(ProcessInfo processInfo, Node sourceNode, IIncomingTransport transport) throws IOException - Specified by:
loadDataFromTransportin interfaceIDataLoaderService- Throws:
IOException
-
loadDataFromTransport
protected List<IncomingBatch> loadDataFromTransport(ProcessInfo transferInfo, Node sourceNode, IIncomingTransport transport, OutputStream out, RemoteNodeStatus status) throws IOException Load database from input stream and return a list of batch statuses. This is used for a pull request that responds with data, and the acknowledgment is sent later.- Throws:
IOException
-
logOrRethrow
- Throws:
IOException
-
buildDataWriter
protected IDataWriter buildDataWriter(ProcessInfo processInfo, String sourceNodeId, String channelId, long batchId, boolean isRetry) -
getFactory
-
getConflictSettingsNodeGroupLinks
- Specified by:
getConflictSettingsNodeGroupLinksin interfaceIDataLoaderService
-
clearCache
public void clearCache()- Specified by:
clearCachein interfaceIDataLoaderService
-
getConflictSettingsNodeGroupLinks
public List<DataLoaderService.ConflictNodeGroupLink> getConflictSettingsNodeGroupLinks(NodeGroupLink link, boolean refreshCache) - Specified by:
getConflictSettingsNodeGroupLinksin interfaceIDataLoaderService
-
getConflictSettinsNodeGroupLinksFromDb
public List<DataLoaderService.ConflictNodeGroupLink> getConflictSettinsNodeGroupLinksFromDb(NodeGroupLink link) - Specified by:
getConflictSettinsNodeGroupLinksFromDbin interfaceIDataLoaderService
-
delete
- Specified by:
deletein interfaceIDataLoaderService
-
deleteAllConflicts
public void deleteAllConflicts()- Specified by:
deleteAllConflictsin interfaceIDataLoaderService
-
save
- Specified by:
savein interfaceIDataLoaderService
-
saveAsCopy
- Specified by:
saveAsCopyin interfaceIDataLoaderService
-
rename
- Specified by:
renamein interfaceIDataLoaderService
-
getIncomingErrors
- Specified by:
getIncomingErrorsin interfaceIDataLoaderService
-
getIncomingError
- Specified by:
getIncomingErrorin interfaceIDataLoaderService
-
getCurrentIncomingError
- Specified by:
getCurrentIncomingErrorin interfaceIDataLoaderService
-
insertIncomingError
- Specified by:
insertIncomingErrorin interfaceIDataLoaderService
-
insertIncomingError
- Specified by:
insertIncomingErrorin interfaceIDataLoaderService
-
updateIncomingError
- Specified by:
updateIncomingErrorin interfaceIDataLoaderService
-
setTransportManager
Used for unit tests -
filterDataLoaderType
-