Skip to content

Commit

Permalink
feat:Formatted code
Browse files Browse the repository at this point in the history
  • Loading branch information
ylxiao5 committed Dec 13, 2023
1 parent 777ea36 commit 174af5e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ public void setOffsets(Map<String, Long> offsets) {
this.offsets = offsets;
}


public String getPath() {
return path;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,8 @@ public void asyncGetXATransaction(
}
}

private ListXAReduceCallback getListXACallback(int count, Map<String, Long> offsets, int size, ListXATransactionsCallback callback) {
private ListXAReduceCallback getListXACallback(
int count, Map<String, Long> offsets, int size, ListXATransactionsCallback callback) {
List<XAResponse.ChainErrorMessage> errors =
Collections.synchronizedList(new LinkedList<>());
Map<String, Long> nextOffsets = new ConcurrentHashMap<>(offsets);
Expand All @@ -600,7 +601,8 @@ private ListXAReduceCallback getListXACallback(int count, Map<String, Long> offs
} else {
response.setXaList(listXAResponse.getXaTransactions());
// update offsets
Long nextOffset = nextOffsets.get(chain) - listXAResponse.getXaTransactions().size();
Long nextOffset =
nextOffsets.get(chain) - listXAResponse.getXaTransactions().size();
nextOffsets.put(chain, nextOffset);
response.setNextOffsets(nextOffsets);
if (nextOffsets.get(chain) == -1) {
Expand All @@ -611,6 +613,7 @@ private ListXAReduceCallback getListXACallback(int count, Map<String, Long> offs
callback.onResponse(null, response);
};
}

public interface ListXATransactionsCallback {
void onResponse(WeCrossException e, XATransactionListResponse xaTransactionListResponse);
}
Expand Down Expand Up @@ -804,10 +807,10 @@ public void asyncListXATransactions(
}

ListXAReduceCallback reduceCallback = null;
if (version.equals("1.4")){
if (version.equals("1.4")) {
// Remove sort operation callback
reduceCallback = getListXACallback(offsets.size(), offsets, size, callback);
}else {
} else {
// has sort operation callback
reduceCallback = getListXAReduceCallback(offsets.size(), offsets, size, callback);
}
Expand Down

0 comments on commit 174af5e

Please sign in to comment.