Skip to content

Commit

Permalink
Merge pull request #174 from NiteshKant/master
Browse files Browse the repository at this point in the history
Fixes issue #150 #175
  • Loading branch information
NiteshKant committed Jul 4, 2014
2 parents 9df0eea + 12b05d9 commit 699b516
Show file tree
Hide file tree
Showing 22 changed files with 115 additions and 658 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public Future<?> shutdownGracefully(long quietPeriod, long timeout, TimeUnit uni
}

@Override
@SuppressWarnings("deprecation")
@Deprecated
public void shutdown() {
if (0 == release()) {
super.shutdown();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.reactivex.netty.client;

import io.netty.bootstrap.Bootstrap;
Expand Down Expand Up @@ -149,12 +150,6 @@ public B withNoIdleConnectionCleanup() {
return returnBuilder();
}

@Deprecated
public B withPoolStatsProvider(PoolStatsProvider statsProvider) {
getPoolBuilder(true).withPoolStatsProvider(statsProvider);
return returnBuilder();
}

public PipelineConfigurator<O, I> getPipelineConfigurator() {
return pipelineConfigurator;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.reactivex.netty.client;

import java.util.concurrent.TimeUnit;
Expand All @@ -36,12 +37,6 @@ public CompositePoolLimitDeterminationStrategy(PoolLimitDeterminationStrategy...
this.strategies = strategies;
}

@Override
@Deprecated
public boolean acquireCreationPermit() {
return acquireCreationPermit(System.currentTimeMillis(), TimeUnit.MILLISECONDS);
}

@Override
public boolean acquireCreationPermit(long acquireStartTime, TimeUnit timeUnit) {
for (int i = 0; i < strategies.length; i++) {
Expand Down Expand Up @@ -97,19 +92,4 @@ public void onSubscribe() {
strategy.onCompleted();
}
}

@Override
public void onError(Throwable e) {
for (PoolLimitDeterminationStrategy strategy : strategies) {
strategy.onError(e);
}
}

@Override
@Deprecated
public void onNext(PoolInsightProvider.PoolStateChangeEvent stateChangeEvent) {
for (PoolLimitDeterminationStrategy strategy : strategies) {
strategy.onNext(stateChangeEvent);
}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.reactivex.netty.client;

import io.reactivex.netty.channel.ObservableConnection;
Expand All @@ -24,8 +25,7 @@
*
* @author Nitesh Kant
*/
@SuppressWarnings("deprecation")
public interface ConnectionPool<I, O> extends PoolInsightProvider, MetricEventsPublisher<ClientMetricsEvent<?>> {
public interface ConnectionPool<I, O> extends MetricEventsPublisher<ClientMetricsEvent<?>> {

Observable<ObservableConnection<I, O>> acquire();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.reactivex.netty.client;

import io.reactivex.netty.channel.RxDefaultThreadFactory;
Expand All @@ -38,7 +39,6 @@ public class ConnectionPoolBuilder<I, O> {
private PoolLimitDeterminationStrategy limitDeterminationStrategy = new MaxConnectionsBasedStrategy();
private ScheduledExecutorService poolIdleCleanupScheduler = SHARED_IDLE_CLEANUP_SCHEDULER;
private long idleConnectionsTimeoutMillis = PoolConfig.DEFAULT_CONFIG.getMaxIdleTimeMillis();
@SuppressWarnings("deprecation") private PoolStatsProvider statsProvider = new PoolStatsImpl();

public ConnectionPoolBuilder(RxClient.ServerInfo serverInfo, ClientChannelFactory<I, O> channelFactory,
MetricEventsSubject<ClientMetricsEvent<?>> eventsSubject) {
Expand Down Expand Up @@ -89,11 +89,6 @@ public ConnectionPoolBuilder<I, O> withNoIdleConnectionCleanup() {
return this;
}

public ConnectionPoolBuilder<I, O> withPoolStatsProvider(@SuppressWarnings("deprecation") PoolStatsProvider statsProvider) {
this.statsProvider = statsProvider;
return this;
}

public ConnectionPoolBuilder<I, O> withChannelFactory(ClientChannelFactory<I, O> factory) {
channelFactory = factory;
return this;
Expand Down Expand Up @@ -121,14 +116,13 @@ public ConnectionPool<I, O> build() {
PoolConfig poolConfig = new PoolConfig(idleConnectionsTimeoutMillis);

return new ConnectionPoolImpl<I, O>(serverInfo, poolConfig, limitDeterminationStrategy, poolIdleCleanupScheduler,
statsProvider, connectionFactory, channelFactory, eventsSubject);
connectionFactory, channelFactory, eventsSubject);
}

public ConnectionPoolBuilder<I, O> copy(RxClient.ServerInfo serverInfo) {
ConnectionPoolBuilder<I, O> copy = new ConnectionPoolBuilder<I, O>(serverInfo, channelFactory, connectionFactory,
eventsSubject);
copy.withIdleConnectionsTimeoutMillis(idleConnectionsTimeoutMillis)
.withPoolStatsProvider(statsProvider)
.withPoolIdleCleanupScheduler(poolIdleCleanupScheduler)
.withConnectionPoolLimitStrategy(limitDeterminationStrategy);

Expand All @@ -146,9 +140,4 @@ public PoolLimitDeterminationStrategy getLimitDeterminationStrategy() {
public ScheduledExecutorService getPoolIdleCleanupScheduler() {
return poolIdleCleanupScheduler;
}

@SuppressWarnings("deprecation")
public PoolStatsProvider getStatsProvider() {
return statsProvider;
}
}
Loading

0 comments on commit 699b516

Please sign in to comment.