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 IDataWriter
buildDataWriter
(ProcessInfo processInfo, String sourceNodeId, String channelId, long batchId, boolean isRetry) void
void
void
static String
filterDataLoaderType
(String dataLoaderType) getConflictSettingsNodeGroupLinks
(NodeGroupLink link, boolean refreshCache) getCurrentIncomingError
(long batchId, String nodeId) protected Map<String,
IDataLoaderFactory> protected IDataLoaderFactory
getFactory
(Channel channel) getIncomingError
(long batchId, String nodeId, long rowNumber) getIncomingErrors
(long batchId, String nodeId) void
insertIncomingError
(ISqlTransaction transaction, IncomingError incomingError) void
insertIncomingError
(IncomingError incomingError) loadDataBatch
(String batchData) loadDataBatch
(String batchData, IProcessInfoListener listener) void
loadDataFromConfig
(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.void
loadDataFromPull
(Node remote, RemoteNodeStatus status) void
loadDataFromPush
(Node sourceNode, InputStream in, OutputStream out) Load database from input stream and write acknowledgment to output stream.void
loadDataFromPush
(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 void
logOrRethrow
(Throwable ex, String sourceNodeId) protected void
purgeLoadBatchesFromStaging
(List<IncomingBatch> batchList) boolean
void
rename
(String oldId, DataLoaderService.ConflictNodeGroupLink setting) void
void
protected void
setTransportManager
(ITransportManager transportManager) Used for unit testsprotected void
updateBatchToSendCount
(Node remote, IIncomingTransport transport) void
updateIncomingError
(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:
refreshFromDatabase
in interfaceIDataLoaderService
-
getAvailableDataLoaderFactories
- Specified by:
getAvailableDataLoaderFactories
in interfaceIDataLoaderService
-
getDataLoaderFactories
-
loadDataBatch
- Specified by:
loadDataBatch
in interfaceIDataLoaderService
-
loadDataBatch
- Specified by:
loadDataBatch
in 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:
loadDataFromPull
in interfaceIDataLoaderService
- Throws:
IOException
-
loadDataFromPull
- Specified by:
loadDataFromPull
in 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:
loadDataFromPush
in 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:
loadDataFromPush
in interfaceIDataLoaderService
- Throws:
IOException
-
purgeLoadBatchesFromStaging
-
loadDataFromOfflineTransport
public List<IncomingBatch> loadDataFromOfflineTransport(Node remote, RemoteNodeStatus status, IIncomingTransport transport) throws IOException - Specified by:
loadDataFromOfflineTransport
in interfaceIDataLoaderService
- Throws:
IOException
-
loadDataFromConfig
public void loadDataFromConfig(Node remote, RemoteNodeStatus status, boolean force) throws IOException - Specified by:
loadDataFromConfig
in interfaceIDataLoaderService
- Throws:
IOException
-
loadDataFromTransport
public List<IncomingBatch> loadDataFromTransport(ProcessInfo processInfo, Node sourceNode, IIncomingTransport transport) throws IOException - Specified by:
loadDataFromTransport
in 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:
getConflictSettingsNodeGroupLinks
in interfaceIDataLoaderService
-
clearCache
public void clearCache()- Specified by:
clearCache
in interfaceIDataLoaderService
-
getConflictSettingsNodeGroupLinks
public List<DataLoaderService.ConflictNodeGroupLink> getConflictSettingsNodeGroupLinks(NodeGroupLink link, boolean refreshCache) - Specified by:
getConflictSettingsNodeGroupLinks
in interfaceIDataLoaderService
-
getConflictSettinsNodeGroupLinksFromDb
public List<DataLoaderService.ConflictNodeGroupLink> getConflictSettinsNodeGroupLinksFromDb(NodeGroupLink link) - Specified by:
getConflictSettinsNodeGroupLinksFromDb
in interfaceIDataLoaderService
-
delete
- Specified by:
delete
in interfaceIDataLoaderService
-
deleteAllConflicts
public void deleteAllConflicts()- Specified by:
deleteAllConflicts
in interfaceIDataLoaderService
-
save
- Specified by:
save
in interfaceIDataLoaderService
-
saveAsCopy
- Specified by:
saveAsCopy
in interfaceIDataLoaderService
-
rename
- Specified by:
rename
in interfaceIDataLoaderService
-
getIncomingErrors
- Specified by:
getIncomingErrors
in interfaceIDataLoaderService
-
getIncomingError
- Specified by:
getIncomingError
in interfaceIDataLoaderService
-
getCurrentIncomingError
- Specified by:
getCurrentIncomingError
in interfaceIDataLoaderService
-
insertIncomingError
- Specified by:
insertIncomingError
in interfaceIDataLoaderService
-
insertIncomingError
- Specified by:
insertIncomingError
in interfaceIDataLoaderService
-
updateIncomingError
- Specified by:
updateIncomingError
in interfaceIDataLoaderService
-
setTransportManager
Used for unit tests -
filterDataLoaderType
-