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)
TransactionLogStorageadd in interface TransactionLogStoragetransactionLog - transaction logpublic void remove(String id)
TransactionLogStorageremove in interface TransactionLogStorageid - transaction log idpublic List<TransactionLog> findEligibleTransactionLogs(int size, int maxDeliveryTryTimes, long maxDeliveryTryDelayMillis)
TransactionLogStorageTo 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 TransactionLogStoragesize - size of fetch transaction logmaxDeliveryTryTimes - max delivery try timesmaxDeliveryTryDelayMillis - max delivery try delay millispublic void increaseAsyncDeliveryTryTimes(String id)
TransactionLogStorageincreaseAsyncDeliveryTryTimes in interface TransactionLogStorageid - transaction log idpublic boolean processData(Connection connection, TransactionLog transactionLog, int maxDeliveryTryTimes)
TransactionLogStorageprocessData in interface TransactionLogStorageconnection - connection for business apptransactionLog - transaction logmaxDeliveryTryTimes - max delivery try timesCopyright © 2018. All rights reserved.