diff --git a/transport/src/main/java/io/netty/channel/AdaptiveReceiveBufferSizePredictor.java b/transport/src/main/java/io/netty/channel/AdaptiveReceiveBufferSizePredictor.java deleted file mode 100644 index 7e6665df33..0000000000 --- a/transport/src/main/java/io/netty/channel/AdaptiveReceiveBufferSizePredictor.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Copyright 2011 The Netty Project - * - * The Netty Project licenses this file to you under the Apache License, - * version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - */ -package io.netty.channel; - -import java.util.ArrayList; -import java.util.List; - -/** - * The {@link ReceiveBufferSizePredictor} that automatically increases and - * decreases the predicted buffer size on feed back. - *
- * It gradually increases the expected number of readable bytes if the previous
- * read fully filled the allocated buffer. It gradually decreases the expected
- * number of readable bytes if the read operation was not able to fill a certain
- * amount of the allocated buffer two times consecutively. Otherwise, it keeps
- * returning the same prediction.
- */
-public class AdaptiveReceiveBufferSizePredictor implements
- ReceiveBufferSizePredictor {
-
- static final int DEFAULT_MINIMUM = 64;
- static final int DEFAULT_INITIAL = 1024;
- static final int DEFAULT_MAXIMUM = 65536;
-
- private static final int INDEX_INCREMENT = 4;
- private static final int INDEX_DECREMENT = 1;
-
- private static final int[] SIZE_TABLE;
-
- static {
- List
@@ -93,38 +90,6 @@ public interface ChannelConfig {
*/
boolean setOption(String name, Object value);
- /**
- * Returns the default {@link ChannelBufferFactory} used to create a new
- * {@link ChannelBuffer}. The default is {@link HeapChannelBufferFactory}.
- * You can specify a different factory to change the default
- * {@link ByteOrder} for example.
- */
- ChannelBufferFactory getBufferFactory();
-
- /**
- * Sets the default {@link ChannelBufferFactory} used to create a new
- * {@link ChannelBuffer}. The default is {@link HeapChannelBufferFactory}.
- * You can specify a different factory to change the default
- * {@link ByteOrder} for example.
- */
- void setBufferFactory(ChannelBufferFactory bufferFactory);
-
- /**
- * Returns the {@link ChannelPipelineFactory} which will be used when
- * a child channel is created. If the {@link Channel} does not create
- * a child channel, this property is not used at all, and therefore will
- * be ignored.
- */
- ChannelPipelineFactory getPipelineFactory();
-
- /**
- * Sets the {@link ChannelPipelineFactory} which will be used when
- * a child channel is created. If the {@link Channel} does not create
- * a child channel, this property is not used at all, and therefore will
- * be ignored.
- */
- void setPipelineFactory(ChannelPipelineFactory pipelineFactory);
-
/**
* Returns the connect timeout of the channel in milliseconds. If the
* {@link Channel} does not support connect operation, this property is not
diff --git a/transport/src/main/java/io/netty/channel/FixedReceiveBufferSizePredictor.java b/transport/src/main/java/io/netty/channel/FixedReceiveBufferSizePredictor.java
deleted file mode 100644
index 2adbdd7034..0000000000
--- a/transport/src/main/java/io/netty/channel/FixedReceiveBufferSizePredictor.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2011 The Netty Project
- *
- * The Netty Project licenses this file to you under the Apache License,
- * version 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at:
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-package io.netty.channel;
-
-
-/**
- * The {@link ReceiveBufferSizePredictor} that always yields the same buffer
- * size prediction. This predictor ignores the feed back from the I/O thread.
- */
-public class FixedReceiveBufferSizePredictor implements
- ReceiveBufferSizePredictor {
-
- private final int bufferSize;
-
- /**
- * Creates a new predictor that always returns the same prediction of
- * the specified buffer size.
- */
- public FixedReceiveBufferSizePredictor(int bufferSize) {
- if (bufferSize <= 0) {
- throw new IllegalArgumentException(
- "bufferSize must greater than 0: " + bufferSize);
- }
- this.bufferSize = bufferSize;
- }
-
- @Override
- public int nextReceiveBufferSize() {
- return bufferSize;
- }
-
- @Override
- public void previousReceiveBufferSize(int previousReceiveBufferSize) {
- // Ignore
- }
-}
diff --git a/transport/src/main/java/io/netty/channel/FixedReceiveBufferSizePredictorFactory.java b/transport/src/main/java/io/netty/channel/FixedReceiveBufferSizePredictorFactory.java
deleted file mode 100644
index f7bf42f3a0..0000000000
--- a/transport/src/main/java/io/netty/channel/FixedReceiveBufferSizePredictorFactory.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright 2011 The Netty Project
- *
- * The Netty Project licenses this file to you under the Apache License,
- * version 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at:
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-package io.netty.channel;
-
-
-/**
- * The {@link ReceiveBufferSizePredictorFactory} that returns a
- * {@link FixedReceiveBufferSizePredictor} with the pre-defined configuration.
- */
-public class FixedReceiveBufferSizePredictorFactory implements
- ReceiveBufferSizePredictorFactory {
-
- private final ReceiveBufferSizePredictor predictor;
-
- /**
- * Creates a new factory that returns a {@link FixedReceiveBufferSizePredictor}
- * which always returns the same prediction of the specified buffer size.
- */
- public FixedReceiveBufferSizePredictorFactory(int bufferSize) {
- predictor = new FixedReceiveBufferSizePredictor(bufferSize);
- }
-
- @Override
- public ReceiveBufferSizePredictor getPredictor() throws Exception {
- return predictor;
- }
-}
diff --git a/transport/src/main/java/io/netty/channel/ReceiveBufferSizePredictor.java b/transport/src/main/java/io/netty/channel/ReceiveBufferSizePredictor.java
deleted file mode 100644
index f63e5d3e92..0000000000
--- a/transport/src/main/java/io/netty/channel/ReceiveBufferSizePredictor.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2011 The Netty Project
- *
- * The Netty Project licenses this file to you under the Apache License,
- * version 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at:
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-package io.netty.channel;
-
-import io.netty.buffer.ChannelBuffer;
-
-/**
- * Predicts the number of readable bytes in the receive buffer of a
- * {@link Channel}.
- *
- * It calculates the close-to-optimal capacity of the {@link ChannelBuffer}
- * for the next read operation depending on the actual number of read bytes
- * in the previous read operation. More accurate the prediction is, more
- * effective the memory utilization will be.
- *
- * Once a read operation is performed and the actual number of read bytes is
- * known, an I/O thread will call {@link #previousReceiveBufferSize(int)} to
- * update the predictor so it can predict more accurately next time.
- */
-public interface ReceiveBufferSizePredictor {
-
- /**
- * Predicts the capacity of the {@link ChannelBuffer} for the next
- * read operation depending on the actual number of read bytes in the
- * previous read operation.
- *
- * @return the expected number of readable bytes this time
- */
- int nextReceiveBufferSize();
-
- /**
- * Updates this predictor by specifying the actual number of read bytes
- * in the previous read operation.
- *
- * @param previousReceiveBufferSize
- * the actual number of read bytes in the previous read operation
- */
- void previousReceiveBufferSize(int previousReceiveBufferSize);
-}
diff --git a/transport/src/main/java/io/netty/channel/ReceiveBufferSizePredictorFactory.java b/transport/src/main/java/io/netty/channel/ReceiveBufferSizePredictorFactory.java
deleted file mode 100644
index 15261b73e4..0000000000
--- a/transport/src/main/java/io/netty/channel/ReceiveBufferSizePredictorFactory.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2011 The Netty Project
- *
- * The Netty Project licenses this file to you under the Apache License,
- * version 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at:
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-package io.netty.channel;
-
-/**
- * Creates a new {@link ReceiveBufferSizePredictor}.
- * @apiviz.has io.netty.channel.ReceiveBufferSizePredictor oneway - - creates
- */
-public interface ReceiveBufferSizePredictorFactory {
-
- /**
- * Returns a newly created {@link ReceiveBufferSizePredictor}.
- */
- ReceiveBufferSizePredictor getPredictor() throws Exception;
-}