public Map<String, Double> getBackPressurePerHost() { Map<String, Double> map = new HashMap<>(connectionManagers.size()); for (Map.Entry<InetAddress, OutboundTcpConnectionPool> entry : connectionManagers.entrySet()) map.put(entry.getKey().getHostAddress(), entry.getValue().getBackPressureState().getBackPressureRateLimit()); return map; }
public Map<String, Double> getBackPressurePerHost() { Map<String, Double> map = new HashMap<>(connectionManagers.size()); for (Map.Entry<InetAddress, OutboundTcpConnectionPool> entry : connectionManagers.entrySet()) map.put(entry.getKey().getHostAddress(), entry.getValue().getBackPressureState().getBackPressureRateLimit()); return map; }
public Map<String, Double> getBackPressurePerHost() { Map<String, Double> map = new HashMap<>(connectionManagers.size()); for (Map.Entry<InetAddress, OutboundTcpConnectionPool> entry : connectionManagers.entrySet()) map.put(entry.getKey().getHostAddress(), entry.getValue().getBackPressureState().getBackPressureRateLimit()); return map; }
/** * Applies back-pressure for the given hosts, according to the configured strategy. * * If the local host is present, it is removed from the pool, as back-pressure is only applied * to remote hosts. * * @param hosts The hosts to apply back-pressure to. * @param timeoutInNanos The max back-pressure timeout. */ public void applyBackPressure(Iterable<InetAddress> hosts, long timeoutInNanos) { if (DatabaseDescriptor.backPressureEnabled()) { backPressure.apply(StreamSupport.stream(hosts.spliterator(), false) .filter(h -> !h.equals(FBUtilities.getBroadcastAddress())) .map(h -> getConnectionPool(h).getBackPressureState()) .collect(Collectors.toSet()), timeoutInNanos, TimeUnit.NANOSECONDS); } }
/** * Applies back-pressure for the given hosts, according to the configured strategy. * * If the local host is present, it is removed from the pool, as back-pressure is only applied * to remote hosts. * * @param hosts The hosts to apply back-pressure to. * @param timeoutInNanos The max back-pressure timeout. */ public void applyBackPressure(Iterable<InetAddress> hosts, long timeoutInNanos) { if (DatabaseDescriptor.backPressureEnabled()) { backPressure.apply(StreamSupport.stream(hosts.spliterator(), false) .filter(h -> !h.equals(FBUtilities.getBroadcastAddress())) .map(h -> getConnectionPool(h).getBackPressureState()) .collect(Collectors.toSet()), timeoutInNanos, TimeUnit.NANOSECONDS); } }
/** * Applies back-pressure for the given hosts, according to the configured strategy. * * If the local host is present, it is removed from the pool, as back-pressure is only applied * to remote hosts. * * @param hosts The hosts to apply back-pressure to. * @param timeoutInNanos The max back-pressure timeout. */ public void applyBackPressure(Iterable<InetAddress> hosts, long timeoutInNanos) { if (DatabaseDescriptor.backPressureEnabled()) { backPressure.apply(StreamSupport.stream(hosts.spliterator(), false) .filter(h -> !h.equals(FBUtilities.getBroadcastAddress())) .map(h -> getConnectionPool(h).getBackPressureState()) .collect(Collectors.toSet()), timeoutInNanos, TimeUnit.NANOSECONDS); } }
/** * Updates the back-pressure state on sending to the given host if enabled and the given message callback supports it. * * @param host The replica host the back-pressure state refers to. * @param callback The message callback. * @param message The actual message. */ public void updateBackPressureOnSend(InetAddress host, IAsyncCallback callback, MessageOut<?> message) { if (DatabaseDescriptor.backPressureEnabled() && callback.supportsBackPressure()) { BackPressureState backPressureState = getConnectionPool(host).getBackPressureState(); backPressureState.onMessageSent(message); } }
/** * Updates the back-pressure state on sending to the given host if enabled and the given message callback supports it. * * @param host The replica host the back-pressure state refers to. * @param callback The message callback. * @param message The actual message. */ public void updateBackPressureOnSend(InetAddress host, IAsyncCallback callback, MessageOut<?> message) { if (DatabaseDescriptor.backPressureEnabled() && callback.supportsBackPressure()) { BackPressureState backPressureState = getConnectionPool(host).getBackPressureState(); backPressureState.onMessageSent(message); } }
/** * Updates the back-pressure state on sending to the given host if enabled and the given message callback supports it. * * @param host The replica host the back-pressure state refers to. * @param callback The message callback. * @param message The actual message. */ public void updateBackPressureOnSend(InetAddress host, IAsyncCallback callback, MessageOut<?> message) { if (DatabaseDescriptor.backPressureEnabled() && callback.supportsBackPressure()) { BackPressureState backPressureState = getConnectionPool(host).getBackPressureState(); backPressureState.onMessageSent(message); } }
/** * Updates the back-pressure state on reception from the given host if enabled and the given message callback supports it. * * @param host The replica host the back-pressure state refers to. * @param callback The message callback. * @param timeout True if updated following a timeout, false otherwise. */ public void updateBackPressureOnReceive(InetAddress host, IAsyncCallback callback, boolean timeout) { if (DatabaseDescriptor.backPressureEnabled() && callback.supportsBackPressure()) { BackPressureState backPressureState = getConnectionPool(host).getBackPressureState(); if (!timeout) backPressureState.onResponseReceived(); else backPressureState.onResponseTimeout(); } }
/** * Updates the back-pressure state on reception from the given host if enabled and the given message callback supports it. * * @param host The replica host the back-pressure state refers to. * @param callback The message callback. * @param timeout True if updated following a timeout, false otherwise. */ public void updateBackPressureOnReceive(InetAddress host, IAsyncCallback callback, boolean timeout) { if (DatabaseDescriptor.backPressureEnabled() && callback.supportsBackPressure()) { BackPressureState backPressureState = getConnectionPool(host).getBackPressureState(); if (!timeout) backPressureState.onResponseReceived(); else backPressureState.onResponseTimeout(); } }
/** * Updates the back-pressure state on reception from the given host if enabled and the given message callback supports it. * * @param host The replica host the back-pressure state refers to. * @param callback The message callback. * @param timeout True if updated following a timeout, false otherwise. */ public void updateBackPressureOnReceive(InetAddress host, IAsyncCallback callback, boolean timeout) { if (DatabaseDescriptor.backPressureEnabled() && callback.supportsBackPressure()) { BackPressureState backPressureState = getConnectionPool(host).getBackPressureState(); if (!timeout) backPressureState.onResponseReceived(); else backPressureState.onResponseTimeout(); } }