@Override public io.netty.util.concurrent.ScheduledFuture<?> scheduleWithFixedDelay(Runnable runnable, long l, long l1, TimeUnit timeUnit) { return delegate.scheduleWithFixedDelay(runnable, l, l1, timeUnit); }
public IdleConnectionWatcher(final ConnectionManager manager, final MasterSlaveServersConfig config) { monitorFuture = manager.getGroup().scheduleWithFixedDelay(new Runnable() { @Override public void run() { long currTime = System.currentTimeMillis(); for (Entry entry : entries) { if (!validateAmount(entry)) { continue; } for (final RedisConnection c : entry.connections) { final long timeInPool = currTime - c.getLastUsageTime(); if (timeInPool > config.getIdleConnectionTimeout() && validateAmount(entry) && entry.connections.remove(c)) { ChannelFuture future = c.closeAsync(); future.addListener(new FutureListener<Void>() { @Override public void operationComplete(Future<Void> future) throws Exception { log.debug("Connection {} has been closed due to idle timeout. Not used for {} ms", c.getChannel(), timeInPool); } }); } } } } }, config.getIdleConnectionTimeout(), config.getIdleConnectionTimeout(), TimeUnit.MILLISECONDS); }
public IdleConnectionWatcher(final ConnectionManager manager, final MasterSlaveServersConfig config) { monitorFuture = manager.getGroup().scheduleWithFixedDelay(new Runnable() { @Override public void run() { long currTime = System.currentTimeMillis(); for (Entry entry : entries) { if (!validateAmount(entry)) { continue; } for (final RedisConnection c : entry.connections) { final long timeInPool = currTime - c.getLastUsageTime(); if (timeInPool > config.getIdleConnectionTimeout() && validateAmount(entry) && entry.connections.remove(c)) { ChannelFuture future = c.closeAsync(); future.addListener(new FutureListener<Void>() { @Override public void operationComplete(Future<Void> future) throws Exception { log.debug("Connection {} has been closed due to idle timeout. Not used for {} ms", c.getChannel(), timeInPool); } }); } } } } }, config.getIdleConnectionTimeout(), config.getIdleConnectionTimeout(), TimeUnit.MILLISECONDS); }
keyGeneratorTask = client.eventLoopGroup().scheduleWithFixedDelay(() -> { try { msgCrypto.addPublicKeyCipher(conf.getEncryptionKeys(), conf.getCryptoKeyReader());
@Override public io.netty.util.concurrent.ScheduledFuture<?> scheduleWithFixedDelay(Runnable runnable, long l, long l1, TimeUnit timeUnit) { return delegate.scheduleWithFixedDelay(runnable, l, l1, timeUnit); }
@Override public io.netty.util.concurrent.ScheduledFuture<?> scheduleWithFixedDelay(Runnable runnable, long l, long l1, TimeUnit timeUnit) { return delegate.scheduleWithFixedDelay(runnable, l, l1, timeUnit); }
@Override public io.netty.util.concurrent.ScheduledFuture<?> scheduleWithFixedDelay(Runnable runnable, long l, long l1, TimeUnit timeUnit) { return delegate.scheduleWithFixedDelay(runnable, l, l1, timeUnit); }
@Override public io.netty.util.concurrent.ScheduledFuture<?> scheduleWithFixedDelay(Runnable runnable, long l, long l1, TimeUnit timeUnit) { return delegate.scheduleWithFixedDelay(runnable, l, l1, timeUnit); }
@Override public io.netty.util.concurrent.ScheduledFuture<?> scheduleWithFixedDelay(Runnable runnable, long l, long l1, TimeUnit timeUnit) { return delegate.scheduleWithFixedDelay(runnable, l, l1, timeUnit); }
@Override public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) { return delegate.scheduleWithFixedDelay(command, initialDelay, delay, unit); }
@Override public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) { return delegate.scheduleWithFixedDelay(command, initialDelay, delay, unit); }
@Override public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) { return delegate.scheduleWithFixedDelay(capturer.makeClosure(command), initialDelay, delay, unit); }
public IdleConnectionWatcher(final ConnectionManager manager, final MasterSlaveServersConfig config) { monitorFuture = manager.getGroup().scheduleWithFixedDelay(new Runnable() { @Override public void run() { long currTime = System.currentTimeMillis(); for (Entry entry : entries) { if (!validateAmount(entry)) { continue; } for (final RedisConnection c : entry.connections) { final long timeInPool = currTime - c.getLastUsageTime(); if (timeInPool > config.getIdleConnectionTimeout() && validateAmount(entry) && entry.connections.remove(c)) { ChannelFuture future = c.closeAsync(); future.addListener(new FutureListener<Void>() { @Override public void operationComplete(Future<Void> future) throws Exception { log.debug("Connection {} has been closed due to idle timeout. Not used for {} ms", c.getChannel(), timeInPool); } }); } } } } }, config.getIdleConnectionTimeout(), config.getIdleConnectionTimeout(), TimeUnit.MILLISECONDS); }
@Override public void start(String jobManagerAkkaUrl) throws Exception { LOG.info("Starting with JobManager {} on port {}", jobManagerAkkaUrl, getServerPort()); synchronized (startupShutdownLock) { jobManagerAddressPromise.success(jobManagerAkkaUrl); leaderRetrievalService.start(retriever); long delay = backPressureStatsTracker.getCleanUpInterval(); // Scheduled back pressure stats tracker cache cleanup. We schedule // this here repeatedly, because cache clean up only happens on // interactions with the cache. We need it to make sure that we // don't leak memory after completed jobs or long ago accessed stats. netty.getBootstrap().childGroup().scheduleWithFixedDelay(new Runnable() { @Override public void run() { try { backPressureStatsTracker.cleanUpOperatorStatsCache(); } catch (Throwable t) { LOG.error("Error during back pressure stats cache cleanup.", t); } } }, delay, delay, TimeUnit.MILLISECONDS); } }
keyGeneratorTask = client.eventLoopGroup().scheduleWithFixedDelay(() -> { try { msgCrypto.addPublicKeyCipher(conf.getEncryptionKeys(), conf.getCryptoKeyReader());