14158070bf
The API changes made so far turned out to increase the memory footprint and consumption while our intention was actually decreasing them. Memory consumption issue: When there are many connections which does not exchange data frequently, the old Netty 4 API spent a lot more memory than 3 because it always allocates per-handler buffer for each connection unless otherwise explicitly stated by a user. In a usual real world load, a client doesn't always send requests without pausing, so the idea of having a buffer whose life cycle if bound to the life cycle of a connection didn't work as expected. Memory footprint issue: The old Netty 4 API decreased overall memory footprint by a great deal in many cases. It was mainly because the old Netty 4 API did not allocate a new buffer and event object for each read. Instead, it created a new buffer for each handler in a pipeline. This works pretty well as long as the number of handlers in a pipeline is only a few. However, for a highly modular application with many handlers which handles connections which lasts for relatively short period, it actually makes the memory footprint issue much worse. Changes: All in all, this is about retaining all the good changes we made in 4 so far such as better thread model and going back to the way how we dealt with message events in 3. To fix the memory consumption/footprint issue mentioned above, we made a hard decision to break the backward compatibility again with the following changes: - Remove MessageBuf - Merge Buf into ByteBuf - Merge ChannelInboundByte/MessageHandler and ChannelStateHandler into ChannelInboundHandler - Similar changes were made to the adapter classes - Merge ChannelOutboundByte/MessageHandler and ChannelOperationHandler into ChannelOutboundHandler - Similar changes were made to the adapter classes - Introduce MessageList which is similar to `MessageEvent` in Netty 3 - Replace inboundBufferUpdated(ctx) with messageReceived(ctx, MessageList) - Replace flush(ctx, promise) with write(ctx, MessageList, promise) - Remove ByteToByteEncoder/Decoder/Codec - Replaced by MessageToByteEncoder<ByteBuf>, ByteToMessageDecoder<ByteBuf>, and ByteMessageCodec<ByteBuf> - Merge EmbeddedByteChannel and EmbeddedMessageChannel into EmbeddedChannel - Add SimpleChannelInboundHandler which is sometimes more useful than ChannelInboundHandlerAdapter - Bring back Channel.isWritable() from Netty 3 - Add ChannelInboundHandler.channelWritabilityChanges() event - Add RecvByteBufAllocator configuration property - Similar to ReceiveBufferSizePredictor in Netty 3 - Some existing configuration properties such as DatagramChannelConfig.receivePacketSize is gone now. - Remove suspend/resumeIntermediaryDeallocation() in ByteBuf This change would have been impossible without @normanmaurer's help. He fixed, ported, and improved many parts of the changes.
354 lines
11 KiB
XML
354 lines
11 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!--
|
|
~ Copyright 2012 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.
|
|
-->
|
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
|
|
|
<modelVersion>4.0.0</modelVersion>
|
|
<parent>
|
|
<groupId>io.netty</groupId>
|
|
<artifactId>netty-parent</artifactId>
|
|
<version>4.0.0.CR4-SNAPSHOT</version>
|
|
</parent>
|
|
|
|
<artifactId>netty-all</artifactId>
|
|
<packaging>jar</packaging>
|
|
|
|
<name>Netty/All-in-One</name>
|
|
|
|
<properties>
|
|
<quickbuild>true</quickbuild>
|
|
</properties>
|
|
|
|
<profiles>
|
|
<profile>
|
|
<id>full</id>
|
|
<properties>
|
|
<quickbuild>false</quickbuild>
|
|
</properties>
|
|
</profile>
|
|
<profile>
|
|
<id>sonatype-oss-release</id>
|
|
<properties>
|
|
<quickbuild>false</quickbuild>
|
|
</properties>
|
|
</profile>
|
|
<profile>
|
|
<id>release</id>
|
|
<properties>
|
|
<quickbuild>false</quickbuild>
|
|
</properties>
|
|
</profile>
|
|
</profiles>
|
|
|
|
<dependencies>
|
|
|
|
<!-- All release modules -->
|
|
<dependency>
|
|
<groupId>${project.groupId}</groupId>
|
|
<artifactId>netty-buffer</artifactId>
|
|
<version>${project.version}</version>
|
|
<scope>compile</scope>
|
|
<optional>true</optional>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>${project.groupId}</groupId>
|
|
<artifactId>netty-codec</artifactId>
|
|
<version>${project.version}</version>
|
|
<scope>compile</scope>
|
|
<optional>true</optional>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>${project.groupId}</groupId>
|
|
<artifactId>netty-codec-http</artifactId>
|
|
<version>${project.version}</version>
|
|
<scope>compile</scope>
|
|
<optional>true</optional>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>${project.groupId}</groupId>
|
|
<artifactId>netty-codec-socks</artifactId>
|
|
<version>${project.version}</version>
|
|
<scope>compile</scope>
|
|
<optional>true</optional>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>${project.groupId}</groupId>
|
|
<artifactId>netty-common</artifactId>
|
|
<version>${project.version}</version>
|
|
<scope>compile</scope>
|
|
<optional>true</optional>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>${project.groupId}</groupId>
|
|
<artifactId>netty-handler</artifactId>
|
|
<version>${project.version}</version>
|
|
<scope>compile</scope>
|
|
<optional>true</optional>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>${project.groupId}</groupId>
|
|
<artifactId>netty-transport</artifactId>
|
|
<version>${project.version}</version>
|
|
<scope>compile</scope>
|
|
<optional>true</optional>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>${project.groupId}</groupId>
|
|
<artifactId>netty-transport-rxtx</artifactId>
|
|
<version>${project.version}</version>
|
|
<scope>compile</scope>
|
|
<optional>true</optional>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>${project.groupId}</groupId>
|
|
<artifactId>netty-transport-sctp</artifactId>
|
|
<version>${project.version}</version>
|
|
<scope>compile</scope>
|
|
<optional>true</optional>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>${project.groupId}</groupId>
|
|
<artifactId>netty-transport-udt</artifactId>
|
|
<version>${project.version}</version>
|
|
<scope>compile</scope>
|
|
<optional>true</optional>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>${project.groupId}</groupId>
|
|
<artifactId>netty-example</artifactId>
|
|
<version>${project.version}</version>
|
|
<scope>compile</scope>
|
|
<optional>true</optional>
|
|
</dependency>
|
|
|
|
<!-- Add optional dependencies explicitly to avoid Javadoc warnings and errors. -->
|
|
<dependency>
|
|
<groupId>com.google.protobuf</groupId>
|
|
<artifactId>protobuf-java</artifactId>
|
|
<scope>compile</scope>
|
|
<optional>true</optional>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.jboss.marshalling</groupId>
|
|
<artifactId>jboss-marshalling</artifactId>
|
|
<scope>compile</scope>
|
|
<optional>true</optional>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.slf4j</groupId>
|
|
<artifactId>slf4j-api</artifactId>
|
|
<optional>true</optional>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>commons-logging</groupId>
|
|
<artifactId>commons-logging</artifactId>
|
|
<optional>true</optional>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>log4j</groupId>
|
|
<artifactId>log4j</artifactId>
|
|
<optional>true</optional>
|
|
</dependency>
|
|
</dependencies>
|
|
|
|
<build>
|
|
<plugins>
|
|
<plugin>
|
|
<artifactId>maven-clean-plugin</artifactId>
|
|
<executions>
|
|
<execution>
|
|
<id>clean-first</id>
|
|
<phase>generate-resources</phase>
|
|
<goals>
|
|
<goal>clean</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
<plugin>
|
|
<artifactId>maven-dependency-plugin</artifactId>
|
|
<executions>
|
|
<execution>
|
|
<id>unpack-sources</id>
|
|
<phase>prepare-package</phase>
|
|
<goals>
|
|
<goal>unpack-dependencies</goal>
|
|
</goals>
|
|
<configuration>
|
|
<classifier>sources</classifier>
|
|
<includes>io/netty/**</includes>
|
|
<includeGroupIds>${project.groupId}</includeGroupIds>
|
|
<outputDirectory>${project.build.directory}/src</outputDirectory>
|
|
</configuration>
|
|
</execution>
|
|
<execution>
|
|
<id>unpack-jars</id>
|
|
<phase>prepare-package</phase>
|
|
<goals>
|
|
<goal>unpack-dependencies</goal>
|
|
</goals>
|
|
<configuration>
|
|
<includes>io/netty/**</includes>
|
|
<excludes>io/netty/example/**</excludes>
|
|
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
|
|
</configuration>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
<plugin>
|
|
<groupId>org.codehaus.mojo</groupId>
|
|
<artifactId>build-helper-maven-plugin</artifactId>
|
|
<executions>
|
|
<execution>
|
|
<id>add-source</id>
|
|
<phase>prepare-package</phase>
|
|
<goals>
|
|
<goal>add-source</goal>
|
|
</goals>
|
|
<configuration>
|
|
<sources>
|
|
<source>target/src</source>
|
|
</sources>
|
|
</configuration>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
|
|
<!-- Disable animal sniffer -->
|
|
<plugin>
|
|
<groupId>org.codehaus.mojo</groupId>
|
|
<artifactId>animal-sniffer-maven-plugin</artifactId>
|
|
<executions>
|
|
<execution>
|
|
<id>default</id>
|
|
<phase>none</phase>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
<!-- Disable checkstyle -->
|
|
<plugin>
|
|
<artifactId>maven-checkstyle-plugin</artifactId>
|
|
<executions>
|
|
<execution>
|
|
<id>check-style</id>
|
|
<phase>none</phase>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
<!-- Disable all plugin executions configured by jar packaging -->
|
|
<plugin>
|
|
<artifactId>maven-resources-plugin</artifactId>
|
|
<executions>
|
|
<execution>
|
|
<id>default-resources</id>
|
|
<phase>none</phase>
|
|
</execution>
|
|
<execution>
|
|
<id>default-testResources</id>
|
|
<phase>none</phase>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
<plugin>
|
|
<artifactId>maven-compiler-plugin</artifactId>
|
|
<executions>
|
|
<execution>
|
|
<id>default-compile</id>
|
|
<phase>none</phase>
|
|
</execution>
|
|
<execution>
|
|
<id>default-testCompile</id>
|
|
<phase>none</phase>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
<plugin>
|
|
<artifactId>maven-surefire-plugin</artifactId>
|
|
<executions>
|
|
<execution>
|
|
<id>default-test</id>
|
|
<phase>none</phase>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
<plugin>
|
|
<artifactId>maven-jxr-plugin</artifactId>
|
|
<executions>
|
|
<execution>
|
|
<id>generate-xref</id>
|
|
<phase>package</phase>
|
|
<goals>
|
|
<goal>jxr</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
<configuration>
|
|
<skip>${quickbuild}</skip>
|
|
<linkJavadoc>true</linkJavadoc>
|
|
<destDir>${project.build.directory}/xref</destDir>
|
|
<javadocDir>${project.build.directory}/api</javadocDir>
|
|
<docTitle>Netty Source Xref (${project.version})</docTitle>
|
|
<windowTitle>Netty Source Xref (${project.version})</windowTitle>
|
|
</configuration>
|
|
<dependencies>
|
|
<dependency>
|
|
<groupId>${project.groupId}</groupId>
|
|
<artifactId>netty-build</artifactId>
|
|
<version>10</version>
|
|
</dependency>
|
|
</dependencies>
|
|
</plugin>
|
|
<plugin>
|
|
<artifactId>maven-javadoc-plugin</artifactId>
|
|
<executions>
|
|
<execution>
|
|
<id>attach-javadocs</id>
|
|
<goals>
|
|
<goal>jar</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
<configuration>
|
|
<skip>${quickbuild}</skip>
|
|
<excludePackageNames>*.internal,*.example</excludePackageNames>
|
|
<docfilessubdirs>true</docfilessubdirs>
|
|
<outputDirectory>${project.build.directory}/api</outputDirectory>
|
|
<overview>${basedir}/src/javadoc/overview.html</overview>
|
|
<doctitle>Netty API Reference (${project.version})</doctitle>
|
|
<windowtitle>Netty API Reference (${project.version})</windowtitle>
|
|
<detectJavaApiLink>false</detectJavaApiLink>
|
|
<additionalparam>
|
|
-link http://docs.oracle.com/javase/7/docs/api/
|
|
-link http://code.google.com/apis/protocolbuffers/docs/reference/java/
|
|
-link http://docs.oracle.com/javaee/6/api/
|
|
-link http://www.slf4j.org/apidocs/
|
|
-link http://commons.apache.org/logging/commons-logging-1.1.1/apidocs/
|
|
-link http://logging.apache.org/log4j/1.2/apidocs/
|
|
|
|
-group "Low-level data representation" io.netty.buffer*
|
|
-group "Central interface for all I/O operations" io.netty.channel*
|
|
-group "Client & Server bootstrapping utilities" io.netty.bootstrap*
|
|
-group "Reusable I/O event interceptors" io.netty.handler*
|
|
-group "Miscellaneous" io.netty.util*
|
|
</additionalparam>
|
|
<locale>en_US</locale>
|
|
</configuration>
|
|
</plugin>
|
|
</plugins>
|
|
</build>
|
|
</project>
|
|
|