use of io.seata.server.storage.file.ReloadableStore in project seata by seata.
the class WriteStoreTest method readAll.
private static Map<SessionStorable, LogOperation> readAll(TransactionStoreManager transactionStoreManager) {
Map<SessionStorable, LogOperation> resultMap = new HashMap<>(65535 * 5 * 9);
while (((ReloadableStore) transactionStoreManager).hasRemaining(true)) {
List<TransactionWriteStore> transactionWriteStores = ((ReloadableStore) transactionStoreManager).readWriteStore(2000, true);
if (transactionWriteStores != null) {
for (TransactionWriteStore transactionWriteStore : transactionWriteStores) {
printLog(transactionWriteStore);
resultMap.put(transactionWriteStore.getSessionRequest(), transactionWriteStore.getOperate());
}
}
}
while (((ReloadableStore) transactionStoreManager).hasRemaining(false)) {
List<TransactionWriteStore> transactionWriteStores = ((ReloadableStore) transactionStoreManager).readWriteStore(2000, false);
if (transactionWriteStores != null) {
for (TransactionWriteStore transactionWriteStore : transactionWriteStores) {
printLog(transactionWriteStore);
resultMap.put(transactionWriteStore.getSessionRequest(), transactionWriteStore.getOperate());
}
}
}
return resultMap;
}
Aggregations