Package com.ibm.di.store
Class DeltaStore
- java.lang.Object
-
- com.ibm.di.store.DeltaStore
-
public class DeltaStore extends java.lang.ObjectThis class implements the functionality for creating and maintaining a single Delta Store table.Note: For internal use only!
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringTABLE_PREFIX
-
Constructor Summary
Constructors Constructor Description DeltaStore(java.lang.String identifier, boolean isRestarting)DeltaStore(java.lang.String identifier, boolean isRestarting, Log logger, boolean removeDeleted)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseDelta()voidcloseReusedStatements()voidcommit()Commit the last transactions.voidcommitOnEndIter()Commit if in commit mode "On end of AL cycle".voiddeleteEntry(java.lang.String key)EntryfindEntry(java.lang.String key)byte[]findEntryBytesVerify(java.lang.String key)EntryfindEntryVerify(java.lang.String key)EntrygetNextDeletedEntry(boolean deleteEntry)Returns the next deleted Entry.EntrygetNextDeletedEntry(boolean deleteEntry, java.util.Set<java.lang.String> keys)Returns the next deleted Entry, given a Set of keys for unchanged Entries.EntrygetStatistics()java.lang.StringgetStatisticsString()voidinsertEntry(java.lang.String key, Entry entry)voidrollback()Rollback the last transactions.voidselectDeletedEntries()Selects the deleted entries from the Delta Store table.voidsetAllowDuplicateDeltaKeys(boolean allowDuplicateDeltaKeys)Indicates whether the duplicate delta keys are allowed.booleansetCommitMode(java.lang.String mode)Set the commit behavior of Delta.voidsetRowLocking(int level)This method sets the transaction isolation level used when working with the Delta Store.voidupdateEntry(java.lang.String key, Entry entry)voidupdateEntryBytes(java.lang.String key, byte[] entryBytes)voidupdateSequence(java.lang.String key)
-
-
-
Field Detail
-
TABLE_PREFIX
public static final java.lang.String TABLE_PREFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DeltaStore
public DeltaStore(java.lang.String identifier, boolean isRestarting, Log logger, boolean removeDeleted) throws java.lang.Exception- Throws:
java.lang.Exception
-
DeltaStore
public DeltaStore(java.lang.String identifier, boolean isRestarting) throws java.lang.Exception- Throws:
java.lang.Exception
-
-
Method Detail
-
setCommitMode
public boolean setCommitMode(java.lang.String mode)
Set the commit behavior of Delta.- Parameters:
mode- The intended behavior. Possible values are:- "After every database operation"
- "On Connector close"
- "On end of AL cycle"
- "No autocommit"
- Returns:
- false if the requested mode is not a legal value
-
closeDelta
public void closeDelta() throws java.sql.SQLException- Throws:
java.sql.SQLException
-
closeReusedStatements
public void closeReusedStatements() throws java.sql.SQLException- Throws:
java.sql.SQLException
-
updateSequence
public void updateSequence(java.lang.String key) throws java.lang.Exception- Throws:
java.lang.Exception
-
updateEntry
public void updateEntry(java.lang.String key, Entry entry) throws java.lang.Exception- Throws:
java.lang.Exception
-
updateEntryBytes
public void updateEntryBytes(java.lang.String key, byte[] entryBytes) throws java.lang.Exception- Throws:
java.lang.Exception
-
insertEntry
public void insertEntry(java.lang.String key, Entry entry) throws java.lang.Exception- Throws:
java.lang.Exception
-
findEntry
public Entry findEntry(java.lang.String key) throws java.lang.Exception
- Throws:
java.lang.Exception
-
findEntryVerify
public Entry findEntryVerify(java.lang.String key) throws java.lang.Exception
- Throws:
java.lang.Exception
-
findEntryBytesVerify
public byte[] findEntryBytesVerify(java.lang.String key) throws java.lang.Exception- Throws:
java.lang.Exception
-
deleteEntry
public void deleteEntry(java.lang.String key) throws java.lang.Exception- Throws:
java.lang.Exception
-
selectDeletedEntries
public void selectDeletedEntries() throws java.lang.ExceptionSelects the deleted entries from the Delta Store table.- Throws:
java.lang.Exception- if a database access error occurs or the given parameters are not ResultSet constants indicating type and concurrency
-
getNextDeletedEntry
public Entry getNextDeletedEntry(boolean deleteEntry) throws java.lang.Exception
Returns the next deleted Entry.- Throws:
java.lang.Exception
-
getNextDeletedEntry
public Entry getNextDeletedEntry(boolean deleteEntry, java.util.Set<java.lang.String> keys) throws java.lang.Exception
Returns the next deleted Entry, given a Set of keys for unchanged Entries. Will not return any Entry with a key in the given Set.- Parameters:
deleteEntry- - If set, also delete the Entry from the deltaStorekeys- - Should be null, or a Set containing keys for unchanged entries- Returns:
- The next deleted Entry
- Throws:
java.lang.Exception
-
getStatistics
public Entry getStatistics()
-
getStatisticsString
public java.lang.String getStatisticsString()
- Returns:
- The statistics for this run
- Since:
- 7.0
-
commit
public void commit() throws java.sql.SQLExceptionCommit the last transactions. 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
-
rollback
public void rollback() throws java.sql.SQLExceptionRollback the last transactions. 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
-
commitOnEndIter
public void commitOnEndIter() throws java.sql.SQLExceptionCommit if in commit mode "On end of AL cycle". 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
-
setAllowDuplicateDeltaKeys
public void setAllowDuplicateDeltaKeys(boolean allowDuplicateDeltaKeys)
Indicates whether the duplicate delta keys are allowed.- Parameters:
allowDuplicateDeltaKeys-trueif duplicate delta keys are allowedfalseotherwise
-
setRowLocking
public void setRowLocking(int level) throws java.lang.ExceptionThis method sets the transaction isolation level used when working with the Delta Store. Setting higher isolation level reduces the transaction anomalies known as 'dirty reads', 'repeatable reads' and 'phantom reads' by using row and table locks.The transaction level is set only if transactions and the specified level are supported by the underlying database.
- Parameters:
level- the integer value of the level as defined in theConnection- Throws:
java.sql.SQLException- if a database access error occurs.java.lang.Exception
-
-