public final class MemoryTransactionLogStorage extends Object implements TransactionLogStorage
Constructor and Description |
---|
MemoryTransactionLogStorage() |
Modifier and Type | Method and Description |
---|---|
void |
add(TransactionLog transactionLog)
Save transaction log.
|
List<TransactionLog> |
findEligibleTransactionLogs(int size,
int maxDeliveryTryTimes,
long maxDeliveryTryDelayMillis)
Find eligible transaction logs.
|
void |
increaseAsyncDeliveryTryTimes(String id)
Increase asynchronized delivery try times.
|
boolean |
processData(Connection connection,
TransactionLog transactionLog,
int maxDeliveryTryTimes)
Process transaction logs.
|
void |
remove(String id)
Remove transaction log.
|
public void add(TransactionLog transactionLog)
TransactionLogStorage
add
in interface TransactionLogStorage
transactionLog
- transaction logpublic void remove(String id)
TransactionLogStorage
remove
in interface TransactionLogStorage
id
- transaction log idpublic List<TransactionLog> findEligibleTransactionLogs(int size, int maxDeliveryTryTimes, long maxDeliveryTryDelayMillis)
TransactionLogStorage
To be processed transaction logs:
1. retry times less than max retry times.
2. transaction log last retry timestamp interval early than last retry timestamp.
findEligibleTransactionLogs
in interface TransactionLogStorage
size
- size of fetch transaction logmaxDeliveryTryTimes
- max delivery try timesmaxDeliveryTryDelayMillis
- max delivery try delay millispublic void increaseAsyncDeliveryTryTimes(String id)
TransactionLogStorage
increaseAsyncDeliveryTryTimes
in interface TransactionLogStorage
id
- transaction log idpublic boolean processData(Connection connection, TransactionLog transactionLog, int maxDeliveryTryTimes)
TransactionLogStorage
processData
in interface TransactionLogStorage
connection
- connection for business apptransactionLog
- transaction logmaxDeliveryTryTimes
- max delivery try timesCopyright © 2018. All rights reserved.