This is an automated email from the ASF dual-hosted git repository.
tabish pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-protonj2.git
The following commit(s) were added to refs/heads/main by this push:
new df2c38a6 PROTON-2599 Remove the unactioned requests map from the
connection
df2c38a6 is described below
commit df2c38a68b2f7b187c18c20212067cb1f5ea0260
Author: Timothy Bish <[email protected]>
AuthorDate: Thu Sep 8 15:59:54 2022 -0400
PROTON-2599 Remove the unactioned requests map from the connection
Removes the leftover requests map from the connection which was still
having objects added but was never actually used due to tracking being
done in different ways now.
---
.../qpid/protonj2/client/impl/ClientConnection.java | 17 -----------------
1 file changed, 17 deletions(-)
diff --git
a/protonj2-client/src/main/java/org/apache/qpid/protonj2/client/impl/ClientConnection.java
b/protonj2-client/src/main/java/org/apache/qpid/protonj2/client/impl/ClientConnection.java
index 09f59556..a1f2dcca 100644
---
a/protonj2-client/src/main/java/org/apache/qpid/protonj2/client/impl/ClientConnection.java
+++
b/protonj2-client/src/main/java/org/apache/qpid/protonj2/client/impl/ClientConnection.java
@@ -21,7 +21,6 @@ import java.io.UncheckedIOException;
import java.security.Principal;
import java.util.Map;
import java.util.Objects;
-import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.LinkedBlockingQueue;
@@ -102,7 +101,6 @@ public final class ClientConnection implements Connection {
private final NettyIOContext ioContext;
private final String connectionId;
private final ScheduledExecutorService executor;
- private final Map<ClientFuture<?>, Object> requests = new
ConcurrentHashMap<>();
private final ThreadPoolExecutor notifications;
private Engine engine;
@@ -592,29 +590,14 @@ public final class ClientConnection implements Connection
{
}
<T> T request(Object requestor, ClientFuture<T> request) throws
ClientException {
- requests.put(request, requestor);
-
try {
return request.get();
} catch (Throwable error) {
request.cancel(false);
throw ClientExceptionSupport.createNonFatalOrPassthrough(error);
- } finally {
- requests.remove(request);
}
}
- void failAllPendingRequests(Object requestor, ClientException cause) {
- requests.entrySet().removeIf(entry -> {
- if (entry.getValue() == requestor) {
- entry.getKey().failed(cause);
- return true;
- }
-
- return false;
- });
- }
-
boolean autoFlushOff() {
boolean oldState = autoFlush;
autoFlush = false;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]