public abstract class AbstractUndoLogManager extends Object implements UndoLogManager
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractUndoLogManager.State |
| Modifier and Type | Field and Description |
|---|---|
protected static String |
DELETE_UNDO_LOG_SQL |
protected static boolean |
ROLLBACK_INFO_COMPRESS_ENABLE |
protected static long |
ROLLBACK_INFO_COMPRESS_THRESHOLD |
protected static CompressorType |
ROLLBACK_INFO_COMPRESS_TYPE |
protected static String |
SELECT_UNDO_LOG_SQL |
protected static String |
UNDO_LOG_TABLE_NAME |
| Constructor and Description |
|---|
AbstractUndoLogManager() |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
appendInParam(int size,
StringBuilder sqlBuilder) |
void |
batchDeleteUndoLog(Set<String> xids,
Set<Long> branchIds,
Connection conn)
batch Delete undo log.
|
protected String |
buildContext(String serializer,
CompressorType compressorType) |
protected String |
buildSelectUndoSql()
Construct a lock query sql
|
protected static boolean |
canUndo(int state) |
void |
deleteUndoLog(String xid,
long branchId,
Connection conn)
Delete undo log.
|
void |
flushUndoLogs(ConnectionProxy cp)
Flush undo logs.
|
protected String |
getCheckUndoLogTableExistSql() |
static String |
getCurrentSerializer() |
protected byte[] |
getRollbackInfo(ResultSet rs)
RollbackInfo to bytes
|
boolean |
hasUndoLogTable(Connection conn)
does this resource have undolog table?(some may not have, if they don't use AT mode at all)
|
protected abstract void |
insertUndoLogWithGlobalFinished(String xid,
long branchId,
UndoLogParser undoLogParser,
Connection conn)
insert uodo log when global finished
|
protected abstract void |
insertUndoLogWithNormal(String xid,
long branchId,
String rollbackCtx,
byte[] undoLogContent,
Connection conn)
insert uodo log when normal
|
protected boolean |
needCompress(byte[] undoLogContent)
if the undoLogContent is big enough to be compress
|
protected Map<String,String> |
parseContext(String data) |
static void |
removeCurrentSerializer() |
static void |
setCurrentSerializer(String serializer) |
protected static String |
toBatchDeleteUndoLogSql(int xidSize,
int branchIdSize) |
void |
undo(DataSourceProxy dataSourceProxy,
String xid,
long branchId)
Undo.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdeleteUndoLogByLogCreatedprotected static final String UNDO_LOG_TABLE_NAME
protected static final String SELECT_UNDO_LOG_SQL
protected static final String DELETE_UNDO_LOG_SQL
protected static final boolean ROLLBACK_INFO_COMPRESS_ENABLE
protected static final CompressorType ROLLBACK_INFO_COMPRESS_TYPE
protected static final long ROLLBACK_INFO_COMPRESS_THRESHOLD
public static String getCurrentSerializer()
public static void setCurrentSerializer(String serializer)
public static void removeCurrentSerializer()
public void deleteUndoLog(String xid, long branchId, Connection conn) throws SQLException
deleteUndoLog in interface UndoLogManagerxid - the xidbranchId - the branch idconn - the connSQLException - the sql exceptionpublic void batchDeleteUndoLog(Set<String> xids, Set<Long> branchIds, Connection conn) throws SQLException
batchDeleteUndoLog in interface UndoLogManagerxids - xidbranchIds - branch Idconn - connectionSQLException - the sql exceptionprotected static String toBatchDeleteUndoLogSql(int xidSize, int branchIdSize)
protected static void appendInParam(int size,
StringBuilder sqlBuilder)
protected static boolean canUndo(int state)
protected String buildContext(String serializer, CompressorType compressorType)
public void flushUndoLogs(ConnectionProxy cp) throws SQLException
flushUndoLogs in interface UndoLogManagercp - the cpSQLException - the sql exceptionpublic void undo(DataSourceProxy dataSourceProxy, String xid, long branchId) throws TransactionException
undo in interface UndoLogManagerdataSourceProxy - the data source proxyxid - the xidbranchId - the branch idTransactionException - the transaction exceptionprotected String buildSelectUndoSql()
protected abstract void insertUndoLogWithGlobalFinished(String xid, long branchId, UndoLogParser undoLogParser, Connection conn) throws SQLException
xid - the xidbranchId - the branchIdundoLogParser - the undoLogParseconn - sql connectionSQLException - SQLExceptionprotected abstract void insertUndoLogWithNormal(String xid, long branchId, String rollbackCtx, byte[] undoLogContent, Connection conn) throws SQLException
xid - the xidbranchId - the branchIdrollbackCtx - the rollbackContextundoLogContent - the undoLogContentconn - sql connectionSQLException - SQLExceptionprotected byte[] getRollbackInfo(ResultSet rs) throws SQLException
rs - result setSQLException - SQLExceptionprotected boolean needCompress(byte[] undoLogContent)
undoLogContent - undoLogContentpublic boolean hasUndoLogTable(Connection conn)
UndoLogManagerhasUndoLogTable in interface UndoLogManagerconn - connection of the resourceprotected String getCheckUndoLogTableExistSql()
Copyright © 2024 Apache. All rights reserved.