/** * Creates a netty channel pool instance with a minimum capacity of 1. * * @param bootstrap the netty bootstrap used to create netty channel * @param maxCapacity the maximum capacity of the pool * @param gcThresholdMs when a channel is older than this threshold and the pool's capacity * is above the minimum capacity(1), it is closed and removed from the pool. */ public NettyChannelPool(Bootstrap bootstrap, int maxCapacity, long gcThresholdMs) { super(Options.defaultOptions().setMaxCapacity(maxCapacity).setGcExecutor(GC_EXECUTOR)); mBootstrap = bootstrap; mGcThresholdMs = gcThresholdMs; }
/** * Creates a new block master client pool. * * @param subject the parent subject * @param address address of the worker * @param maxCapacity the maximum capacity of the pool * @param alluxioConf Alluxio configuration * is above the minimum capacity(1), it is closed and removed from the pool. */ public BlockWorkerClientPool(Subject subject, SocketAddress address, int maxCapacity, AlluxioConfiguration alluxioConf) { super(Options.defaultOptions().setMaxCapacity(maxCapacity).setGcExecutor(GC_EXECUTOR)); mSubject = subject; mAddress = address; mConf = alluxioConf; }
/** * Constructor of TestPool class. * * @param options the Options object to set ScheduledExecutorService object */ public TestPool(Options options) { super(options.setGcExecutor(GC_EXECUTOR)); }
/** * Constructor of TestPool class. * * @param options the Options object to set ScheduledExecutorService object * @param clock the object of Clock class */ public TestPool(Options options, ManualClock clock) { super(options.setGcExecutor(GC_EXECUTOR)); mClock = clock; }