Package com.ibm.di.server
Class CSDeltaTaskComponent
- java.lang.Object
-
- com.ibm.di.server.AssemblyLineComponent
-
- com.ibm.di.server.CSDeltaTaskComponent
-
- All Implemented Interfaces:
java.util.Map
public class CSDeltaTaskComponent extends AssemblyLineComponent
This class represents a component extending the functionality of the AssemblyLineComponent. It uses the Delta FC logic to commit and rollback transactions to database.
-
-
Field Summary
-
Fields inherited from class com.ibm.di.server.AssemblyLineComponent
addmap, CHECKPOINT_GETS, config, connConfig, connector, connPool, END_OF_DATA, handler, HOOKS_INVOKED, imap, INITIALIZE, initializeCount, LAST_CONN, LAST_ERROR, log, modmap, name, NUM_ADD, NUM_CALLREPLY, NUM_DELETE, NUM_ERRORS, NUM_GET, NUM_GET_TRIES, NUM_GETCLIENT, NUM_GETCLIENT_TRIES, NUM_IGNORED, NUM_LOOKUP, NUM_MODIFY, NUM_NOCHANGE, NUM_SKIPPED, parent, pooledConnector, SELECT, stats, SUCCESSFUL
-
-
Constructor Summary
Constructors Constructor Description CSDeltaTaskComponent(AssemblyLine parent, java.lang.String name, ConnectorConfig config, ConnectorInterface conn, boolean isRestarting)
Constructor.CSDeltaTaskComponent(AssemblyLine parent, java.lang.String name, ConnectorConfig config, ConnectorInterface conn, boolean isRestarting, boolean forceRuntime)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
commitDeltaState()
Commit the last transactions in Derby databasevoid
commitOnEndIter()
Commit if in commit mode "On end of AL cycle"static boolean
deltaEnabled(ConnectorConfig config)
Determines whether the delta of the given connector configuration is enable.void
doConnectorInitialize()
This method calls the appropriate hooks and the connector's initialize method.void
doConnectorTerminate()
This method calls the appropriate hooks and the connector's terminate method.Entry
getnext(Entry work)
The method returns the next entry from the connector.boolean
markEntryInDeltaStore(Entry work)
Marks an Entry in the Delta Store.Entry
nextDeletedEntry(Entry work)
Return the next deleted entry.void
rollbackDeltaState()
Rollback the last transactions in Derby database.void
saveDeltaState()
Commit the last transactions in Derby database (alias for commitDeltaState)-
Methods inherited from class com.ibm.di.server.AssemblyLineComponent
add, callreply, checkInitialize, checkTerminate, clear, close, componentInitialized, containsKey, containsValue, debug, delete, deleteEntry, delta, doConnectorTerminate, dumpEntry, dumpObjects, entrySet, executeOperation, expandParameters, failBack, failOver, get, getBaseConfiguration, getConfig, getConfiguration, getConnector, getConnectorParam, getCriteria, getCurrent, getDebug, getDuplicateEntryCount, getFirstDuplicateEntry, getHandler, getLastEntry, getLastReadEntry, getLog, getName, getnext, getnextClient, getNextDuplicateEntry, getRestartInfoEntry, getSimulatingState, getStats, getType, handleException, handleSuccess, initialize, isCheckpointRestartEnabled, isDeltaMode, isEmpty, isEnabled, isExceptionFatal, isFailOvered, keySet, logmsg, lookup, lookup, mapEntry, modify, pushback, put, putAll, reconnect, remove, reply, resetStatus, setConnectorParam, setCriteria, setCriteria, setCurrent, setDebug, setDuplicateEntryCount, setErrorObject, setName, setRestartInfoEntry, setSimulatingState, setSuccessful, size, toString, trigger, trigger, trigger, triggerImpl, update, useAttributeMap, useAttributeMap, useAttributeMap, useInputMap, useMap, useMap, useOutputMap, values, verifySchema, wasConfigurationModified, wasSuccessful, willExecute
-
-
-
-
Constructor Detail
-
CSDeltaTaskComponent
public CSDeltaTaskComponent(AssemblyLine parent, java.lang.String name, ConnectorConfig config, ConnectorInterface conn, boolean isRestarting) throws java.lang.Exception
Constructor.- Parameters:
parent
- the parent AssemblyLinename
- the component nameconfig
- the connector configurationconn
- the connectorisRestarting
- ignored- Throws:
java.lang.Exception
- if a problem occurs
-
CSDeltaTaskComponent
public CSDeltaTaskComponent(AssemblyLine parent, java.lang.String name, ConnectorConfig config, ConnectorInterface conn, boolean isRestarting, boolean forceRuntime) throws java.lang.Exception
Constructor.- Parameters:
parent
- the parent AssemblyLinename
- the component nameconfig
- the connector configurationconn
- the connectorisRestarting
- ignoredforceRuntime
- whether to use runtime provided connector- Throws:
java.lang.Exception
- if a problem occurs
-
-
Method Detail
-
deltaEnabled
public static boolean deltaEnabled(ConnectorConfig config)
Determines whether the delta of the given connector configuration is enable.- Parameters:
config
- a connector configuration- Returns:
true
if it is enabled, otherwisefalse
-
doConnectorInitialize
public void doConnectorInitialize() throws java.lang.Exception
Description copied from class:AssemblyLineComponent
This method calls the appropriate hooks and the connector's initialize method.- Overrides:
doConnectorInitialize
in classAssemblyLineComponent
- Throws:
java.lang.Exception
- if the connector's initialization fails or an error in one of the executed hooks occurred.
-
doConnectorTerminate
public void doConnectorTerminate() throws java.lang.Exception
This method calls the appropriate hooks and the connector's terminate method. The DeltaStore is also closed.- Overrides:
doConnectorTerminate
in classAssemblyLineComponent
- Throws:
java.lang.Exception
- if a problem occurs
-
getnext
public Entry getnext(Entry work) throws java.lang.Exception
The method returns the next entry from the connector. It is called by theAssemblyLineComponent.getnext()
method if we are working in Iterator mode.- Overrides:
getnext
in classAssemblyLineComponent
- Parameters:
work
- the work entry to fill in- Returns:
- the work entry filled with the next input entry
- Throws:
java.lang.Exception
- if a problem occurs
-
nextDeletedEntry
public Entry nextDeletedEntry(Entry work) throws java.lang.Exception
Return the next deleted entry.- Parameters:
work
- the work entry to fill in- Returns:
- the work entry filled with the next input entry
- Throws:
java.lang.Exception
- if a problem occurs
-
commitDeltaState
public void commitDeltaState() throws java.sql.SQLException
Commit the last transactions in Derby database- Throws:
java.sql.SQLException
- Thrown if an error occurs
-
rollbackDeltaState
public void rollbackDeltaState() throws java.sql.SQLException
Rollback the last transactions in Derby database. The operation will NOT be executed if at the moment the Delta Store is iterating deleted entries.- Throws:
java.sql.SQLException
- Thrown if an error occurs- See Also:
markEntryInDeltaStore(com.ibm.di.entry.Entry)
-
saveDeltaState
public void saveDeltaState() throws java.sql.SQLException
Commit the last transactions in Derby database (alias for commitDeltaState)- Throws:
java.sql.SQLException
- Thrown if an error occurs
-
commitOnEndIter
public void commitOnEndIter() throws java.sql.SQLException
Commit if in commit mode "On end of AL cycle"- Throws:
java.sql.SQLException
- Thrown if an error occurs
-
markEntryInDeltaStore
public boolean markEntryInDeltaStore(Entry work)
Marks an Entry in the Delta Store. This can be useful if the current change can not be propagated properly, and you want to roll back the delta state. You can then use code like this, assuming this Component is called MyIterator:MyIterator.rollbackDeltaState(); MyIterator.markEntryInDeltaStore(work); MyIterator.commitDeltaState();
- Parameters:
work
- The Entry that contains the key information- Returns:
- true if the Entry contained a meaningful key and could be marked in the delta store
-
-