Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
xinyiZzz committed Jan 2, 2025
1 parent 518faa3 commit 5525980
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,13 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.concurrent.atomic.AtomicInteger;

public class FlightSessionsWithTokenManager implements FlightSessionsManager {
private static final Logger LOG = LogManager.getLogger(FlightSessionsWithTokenManager.class);

private final FlightTokenManager flightTokenManager;
private final AtomicInteger nextConnectionId;

public FlightSessionsWithTokenManager(FlightTokenManager flightTokenManager) {
this.flightTokenManager = flightTokenManager;
this.nextConnectionId = new AtomicInteger(0);
}

@Override
Expand Down Expand Up @@ -69,8 +65,7 @@ public ConnectContext createConnectContext(String peerIdentity) {
flightTokenDetails.setCreatedSession(true);
ConnectContext connectContext = FlightSessionsManager.buildConnectContext(peerIdentity,
flightTokenDetails.getUserIdentity(), flightTokenDetails.getRemoteIp());
connectContext.setConnectionId(nextConnectionId.getAndAdd(1));
connectContext.resetLoginTime();
ExecuteEnv.getInstance().getScheduler().submit(connectContext);
if (!ExecuteEnv.getInstance().getScheduler().registerConnection(connectContext)) {
String err = "Reach limit of connections, increase `qe_max_connection` in fe.conf, or decrease "
+ "`arrow_flight_token_cache_size` to evict unused bearer tokens and it connections faster";
Expand Down

0 comments on commit 5525980

Please sign in to comment.