Compare commits

...

22 Commits

Author SHA1 Message Date
Andrea Cavalli 86c9f6678e Rename package 2021-09-17 15:15:29 +02:00
Chris Vest 0973673fce
Make CompositeBuffer an interface (#11687)
Motivation:
Having composite buffer as a class has caused problems in the past.
Making it an interface makes it possible to stub or decorate the composite buffer implementation.

Modification:
Make CompositeBuffer an interface, and move the implementation to DefaultCompositeBuffer.
Then hide the implementation and permit construction only through static factory methods.

Result:
CompositeBuffer is now an interface.
2021-09-16 13:25:45 +02:00
Norman Maurer 8339a00fd6 Ensure bom don't define extra dependencies (#11682)
Motivation:

The bom shouldnt depend on the parent as it may define extra dependencies that would be "pulled" in.

See https://github.com/netty/netty/pull/11672#discussion_r707619462

Modifications:

- Revert commit d6383bf2478267eb62b1f71807c2a3c34794d1b0.
- Add tcnative version and add comments to ensure we keep the version in-sync

Result:

Correct bom for netty
2021-09-16 09:31:39 +02:00
Chris Vest 000f2a0934
Add CompositeBuffer.decomposeBuffer method (#11683)
Motivation:
It may in some cases be useful to unwrap a composite buffer and work on the array of buffers directly.
The decomposeBuffer method makes this possible safely, by killing the composite buffer in the process.

Modification:
Add a CompositeBuffer.decomposeBuffer method, which returns the array of the constituent component buffers of the composite buffer, and at the same time closes the composite buffer without closing its components.
The caller effectively takes ownership of the component buffers away from the composite buffer.

Result:
This API makes buffer composition fully reversible.
2021-09-15 16:38:43 +02:00
Chris Vest cf1ab852d1 Add pinnedHeap/DirectMemory methods to ByteBufAllocatorMetric (#11667)
Motivation:
The "used memory" is the amount of memory that a pooled allocator has currently allocated and committed for itself.
Ths is useful for managing resource usage of the pool versus the available system resources.
However, it is not useful for managing resources of the currently circulating buffer instances versus the pool.
The pinned memory is the memory currently in use by buffers in circulation, plus memory held in the thread-local caches.

Modification:
Add pinned memory accounting to PoolChunk.
We cannot just use the existing freeBytes because that field is only updated when pool subpages are retired, and a chunk will never retire its last subpage instance.
The accounting statistics are available on the PooledByteBufAllocator only, since the metrics interfaces cannot be changed due to backwards compatibility.

Result:
It is now possible to get a fairly accurate (with slight over-counting due to the thread-local caches) picture of how much memory is held up in buffer instances at any given moment.

Fixes #11637
2021-09-15 16:32:52 +02:00
Nitesh Kant 29cae0445a
Introduce `ByteToMessageDecoderForBuffer` (#11654)
__Motivation__

In order to migrate all codec incrementally to use `Buffer`, we need a version of `ByteToMessageDecoder` that uses `Buffer`.

__Modification__

- Added the new version of `ByteToMessageDecoder` with a new name so that both old and new version can co-exist and we can incrementally migrate all codecs
- Migrated `FixedLengthFrameDecoder` as it was simple and used in tests.

__Result__

We have the basic building block to start migrating all codecs to the new `Buffer` API.
2021-09-14 17:06:49 -07:00
Norman Maurer a76842dcd5 Use cpu_relax() implementation for aarch64 (#11677)
Motivation:

We only implement cpu_relax() for x86_64 atm, we should also do for aarch64

Modifications:

Add implementation

Result:

Possible better performance on aarch64 when busy spinning with epoll is used
2021-09-14 08:33:19 +02:00
Norman Maurer 1eb128e2a9 Upgrade to netty-tcnative 2.0.43.Final (#11679)
Motivation:

netty-tcnative 2.0.42.Final did not include all native libs due a problem during the release. This was fixed with the new release.

Modifications:

Upgrade to 2.0.43.Final

Result:

Depend on a netty-tcnative version that includes all native libs.
2021-09-14 08:32:37 +02:00
Nitesh Kant 43f3956030
`CompositeBuffer#split()` should correctly set offsets (#11671)
__Motivation__

While computing offsets from within `CompositeBuffer#split()`, we do not consider a case when the constituents `buffer` array is empty but existing read/write offsets are non-zero. This is possible when the buffer is full.

__Modification__

Correctly set offsets even for the aforementioned case.

__Result__

Read/write offsets are correctly set while splitting composite buffer.
2021-09-10 12:33:16 -07:00
Scott Mitchell efd576e43e
Fix bom indentation, 4 spaces -> 2 (#11676)
Motivation:
Cherry-pick of d6383bf2478267eb62b1f71807c2a3c34794d1b0 added extra
indentation, which fails checkstyle.
2021-09-10 11:33:34 -07:00
Scott Mitchell 62a23f9e29 netty-bom to provide resolved tcnative version (#11672)
Motivation:
Netty's bom includes netty-tcnative dependencies with a variable for the
version [1]. However that variable isn't defined/resolved and therefore
leads to undefined dependencies.

[1] https://search.maven.org/artifact/io.netty/netty-bom/4.1.68.Final/pom

Modifications:
- Netty's bom file should inherit from netty-parent pom so variables can
  be resolved at inclusion time.

Result:
netty-bom allows for netty-tcnative version to be resolved in 3rd party
projects.
2021-09-10 10:01:23 -07:00
Norman Maurer d523e68d83 Fix netty-tcnative* entries in bom
Motivation:

We did use the incorrect classifier and also missed to add the osx-aarch_64 version of netty-tcnative-boringssl-static

Modifications:

Fix entries

Result:

Correct and complete bom
2021-09-09 16:13:29 +02:00
Norman Maurer 537a0d4d81 Merge pull request from GHSA-9vjp-v76f-g363
Motivation:

e Snappy frame decoder function doesn't restrict the size of the compressed data (and the uncompressed data) which may lead to excessive memory usage. Beside this it also may buffer reserved skippable chunks until the whole chunk was received which may lead to excessive memory usage as well.

Modifications:

- Add various validations for the max allowed size of a chunk
- Skip bytes on the fly when an skippable chunk is handled

Result:

No more risk of OOME. Thanks to Ori Hollander of JFrog Security for reporting the issue.
2021-09-09 16:08:33 +02:00
Norman Maurer f2cc94c7d4 Merge pull request from GHSA-grg4-wf29-r9vv
Motivation:

We should do the Bzip2 decoding in a streaming fashion and so ensure we propagate the buffer as soon as possible through the pipeline. This allows the users to release these buffers as fast as possible.

Modification:

- Change the Bzip2Decoder to do the decompression of data in a streaming fashion.
- Add some safety check to ensure the block length never execeeds the maximum (as defined in the spec)

Result:

No more risk of an OOME by decompress some large data via bzip2.

Thanks to Ori Hollander of JFrog Security for reporting the issue.

(we got acquired during the process and now Vdoo is part of JFrog company)
2021-09-09 16:08:21 +02:00
Norman Maurer ebd3f8b4fb Respect jdk.tls.namedGroups when using native SSL implementation (#11660)
Motivation:

When using the JDK implementation for SSL its possible to adjust the used named groups. We should allow to do this as well and also select some default groups that will reduce the number of roundtrips.

Modifications:

- Upgrade netty-tcnative so we can set the curves
- Respect jdk.tls.namedGroups
- Use default groups of "P-256", "P-384", "X25519" so its compatible with what the JDK versions < 13 support as well.

Result:

Be able to set the used groups

Co-authored-by: Nitesh Kant <nitesh_kant@apple.com>
2021-09-09 14:36:29 +02:00
Norman Maurer dcf1e12556 Add support for mac m1 (#11666)
Motivation:

As more and more people switch to a mac m1 we should support it

Modifications:

- Add profiles for cross-compile for mac m1
- Adjust script to finish release

Result:

Mac m1 is supported
2021-09-09 08:40:35 +02:00
Chris Vest 1eb9a9764e
Buffer should not expose nativeAddress() directly (#11665)
Motivation:
Accessing the native address, if a buffer has any, violates the no-aliasing rule for Buffers.
Also, it inherently assumes that a buffer has a single, native memory allocation.
The native address, or addresses, are already available via the Readable- and WritableComponents.
Accessing these via forEachReadable and forEachWritable will also ensure that composite buffers will be handled correctly.

Modification:
Remove the nativeAddress() method from the Buffer API.
Update the ByteBufAdaptor and a few tests to cope with this change.

Result:
Less error prone code, and make unsafe APIs a bit more hidden.
2021-09-08 20:02:59 +02:00
Ran 3152ec76db Throw exceptions when rule violating UDS paths been passed in. (#11663)
Motivation:

Currently, Netty is silently truncating all over the limit UDS paths and ignoring the `sun_path`'s null-termination role, which hurts compatibility with other UDS clients and servers.

Modifications:

Adding a validation in the JNI code, if the UDS path is not satisfying the system limit or Linux spec throw a NativeIoException.

Result:

All UDS paths Netty can successfully bind are connectable by other programs.
2021-09-08 09:22:37 +02:00
Chris Vest 59275fba52
Netty Future no longer extends JDK Future (#11647)
Motivation:
It is important to avoid blocking method calls in an event loop thread, since that can stall the system.
Netty's Future interface was extending the JDK Future interface, which included a number of blocking methods of questionable use in Netty.
We wish to reduce the number of blocking methods on the Future API in order to discourage their use a little.
Further more, the Netty Future specification of the behaviour of the cancel() and isDone() methods are inconsistent with those of the JDK Future.
If Netty's Future stop extending the JDK Future interface, it will also no longer be bound by its specification.

Modification:
Make Netty's Future no longer extend the JDK Future interface.
Change the EvenExecutorGroup interface to no longer extend ScheduledExecutorService.
The EventExecutorGroup still extends Executor, because Executor does not dictate any return type of the `execute()` method — this is also useful in the DefaultFutureCompletionStage implementation.
The Netty ScheduledFuture interface has been removed since it provided no additional features that were actually used.
Numerous changes to use sites that previously relied on the JDK types.
Remove the `Future.cancel()` method that took a boolean argument — this argument was always ignored in our implementations, which was another spec deviation.
Various `invoke*` and `shutdown*` methods have been removed from the EvenExecutorGroup API since it no longer extends ScheduledExecutorService — these were either not used anywhere, or deprecated with better alternatives available.
Updates to cancellation javadocs.

Result:
Cleaner code, leaner API.
2021-09-08 09:06:28 +02:00
Chris Vest 3cbb41a478
Make ByteCursor implementations static final inner classes (#11662)
Motivation:
People might be tempted to use mocking tools like Mockito.spy() on the ByteCursors.
By returning instances where the concrete classes are final, we will be forcing integrators to use stub-like wrappers instead.
Such stubs are more well-behaved since they are implemented in terms of the real instance.
This prevents the mocked objects from (easily) producing behaviour that violates the API specification.

Modification:
All ByteCursor implementations have changed from using anonymous inner classes, to using static-final named inner classes.

Result:
The concrete ByteCursor classes can no longer be extended via byte code generation, such as from mocking tools.
2021-09-08 09:04:16 +02:00
kushalagrawal 3a23094b81 Updated "CipherSuitesConverter" to make it public. (#11656)
Motivation:
While using netty there is sometimes need to handle the cipher suites and
signature algorithm in more strict environment. CipherSuiteConverter is
quite helpful in converting Cipher-Suites to and from java to openSSL.
Making it public would be helpful for the project which are using netty.

Modification:
Updated "CipherSuitesConverter" to make it public.
updated "CipherSuitesConverter.toOpenssl" to public.
updated "CipherSuitesConverter.toJava" to public.

Result:
Fixes #11655
2021-09-06 15:08:06 +02:00
Norman Maurer ee54ea725a
Add default methods to EventExecutor / EventExecutorGroup / EventLoop / EventLoopGroup (#11649)
Motivation:

We can remove some classes and duplication if we add default methods

Modifications:

- Add default methods to EventExecutor / EventExecutorGroup / EventLoop / EventLoopGroup
- Remove code duplication
- Remove AbstractEventExecutorGroup as it is not needed anymore

Result:

Cleanup and removal of code-duplication. Also makes it easier for people to implement their custom executors / groups
2021-09-05 20:05:33 +02:00
2971 changed files with 3353 additions and 372205 deletions

View File

@ -1 +0,0 @@
Please review the [guidelines for contributing](https://netty.io/wiki/developer-guide.html) for this repository.

View File

@ -1,13 +0,0 @@
### Expected behavior
### Actual behavior
### Steps to reproduce
### Minimal yet complete reproducer code (or URL to code)
### Netty version
### JVM version (e.g. `java -version`)
### OS version (e.g. `uname -a`)

View File

@ -1,14 +0,0 @@
Motivation:
Explain here the context, and why you're making that change.
What is the problem you're trying to solve.
Modification:
Describe the modifications you've done.
Result:
Fixes #<GitHub issue number>.
If there is no issue then describe the changes introduced by this PR.

View File

@ -1,33 +0,0 @@
#!/bin/bash
# ----------------------------------------------------------------------------
# Copyright 2021 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:
#
# https://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.
# ----------------------------------------------------------------------------
set -e
if [ "$#" -lt 2 ]; then
echo "Expected branch and maven arguments"
exit 1
fi
MODULES=$(git diff --name-only "$1" | cut -d '/' -f 1 | sort -u | sed -n -e 'H;${x;s/\n/,/g;s/^,//;p;}')
MAVEN_ARGUMENTS=${*:2}
if [ -z "$MODULES" ]; then
echo "No changes detected, skipping build"
exit 0
fi
echo "Changes detected, start the build"
echo "./mvnw -pl $MODULES -amd $MAVEN_ARGUMENTS"
./mvnw -pl "$MODULES" -amd "${@:2}"

View File

@ -1,30 +0,0 @@
#!/bin/bash
# ----------------------------------------------------------------------------
# Copyright 2021 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:
#
# https://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.
# ----------------------------------------------------------------------------
set -e
if [ "$#" -ne 1 ]; then
echo "Expected build log as argument"
exit 1
fi
if grep -q 'BUILD FAILURE' $1 ; then
echo "Build failure detected, please inspect build log"
exit 1
else
echo "Build successful"
exit 0
fi

View File

@ -1,31 +0,0 @@
#!/bin/bash
# ----------------------------------------------------------------------------
# Copyright 2021 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:
#
# https://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.
# ----------------------------------------------------------------------------
set -e
if [ "$#" -ne 1 ]; then
echo "Expected build log as argument"
exit 1
fi
if grep -q 'LEAK:' $1 ; then
echo "Leak detected, please inspect build log"
exit 1
else
echo "No Leak detected"
exit 0
fi

View File

@ -1,35 +0,0 @@
#!/bin/bash
# ----------------------------------------------------------------------------
# Copyright 2021 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:
#
# https://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.
# ----------------------------------------------------------------------------
set -e
if [ "$#" -lt 2 ]; then
echo "Expected target directory and at least one local staging directory"
exit 1
fi
TARGET=$1
for ((i=2; i<=$#; i++))
do
DIR="${!i}"
SUB_DIR=$(ls -d "${DIR}"/* | awk -F / '{print $NF}')
if [ ! -d "${TARGET}/${SUB_DIR}" ]
then
mkdir -p "${TARGET}/${SUB_DIR}"
fi
cat "${DIR}"/"${SUB_DIR}"/.index >> "${TARGET}/${SUB_DIR}"/.index
cp -r "${DIR}"/"${SUB_DIR}"/* "${TARGET}/${SUB_DIR}"/
done

View File

@ -1,28 +0,0 @@
#!/bin/bash
# ----------------------------------------------------------------------------
# Copyright 2021 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:
#
# https://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.
# ----------------------------------------------------------------------------
set -e
if [ "$#" -ne 1 ]; then
echo "Expected release.properties file"
exit 1
fi
TAG=$(grep scm.tag= "$1" | cut -d'=' -f2)
echo "Checkout tag $TAG"
git checkout "$TAG"
exit 0

View File

@ -1,29 +0,0 @@
#!/bin/bash
# ----------------------------------------------------------------------------
# Copyright 2021 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:
#
# https://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.
# ----------------------------------------------------------------------------
set -e
if [ "$#" -ne 3 ]; then
echo "Expected release.properties file, repository name and branch"
exit 1
fi
TAG=$(grep scm.tag= "$1" | cut -d'=' -f2)
git remote set-url origin git@github.com:"$2".git
git fetch
git checkout "$3"
./mvnw -B --file pom.xml release:rollback
git push origin :"$TAG"

View File

@ -1,79 +0,0 @@
# ----------------------------------------------------------------------------
# Copyright 2021 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:
#
# https://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.
# ----------------------------------------------------------------------------
name: Build project
on:
push:
branches: [ "main"]
schedule:
- cron: '30 1 * * 1' # At 01:30 on Monday, every Monday.
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryhandler.count=5 -Dmaven.wagon.httpconnectionManager.ttlSeconds=240
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- setup: linux-x86_64-java11
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml build"
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml run build"
name: ${{ matrix.setup }}
steps:
- uses: actions/checkout@v2
# Cache .m2/repository
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ matrix.setup }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-${{ matrix.setup }}-
${{ runner.os }}-maven-
# Enable caching of Docker layers
- uses: satackey/action-docker-layer-caching@v0.0.11
continue-on-error: true
with:
key: build-docker-cache-${{ matrix.setup }}-{hash}
restore-keys: |
build-docker-cache-${{ matrix.setup }}-
build-docker-cache-
- name: Build docker image
run: docker-compose ${{ matrix.docker-compose-build }}
- name: Build project without leak detection
run: docker-compose ${{ matrix.docker-compose-run }} | tee build.output
- name: Checking for test failures
run: ./.github/scripts/check_build_result.sh build.output
- uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: target
path: |
**/target/surefire-reports/
**/hs_err*.log

View File

@ -1,143 +0,0 @@
# ----------------------------------------------------------------------------
# Copyright 2021 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:
#
# https://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.
# ----------------------------------------------------------------------------
name: Deploy project
on:
push:
branches: [ "main" ]
schedule:
- cron: '30 1 * * 1' # At 01:30 on Monday, every Monday.
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryhandler.count=5 -Dmaven.wagon.httpconnectionManager.ttlSeconds=240
jobs:
stage-snapshot:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- setup: linux-x86_64-java11
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml build"
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml run stage-snapshot"
- setup: linux-aarch64
docker-compose-build: "-f docker/docker-compose.centos-7.yaml build"
docker-compose-run: "-f docker/docker-compose.centos-7.yaml run cross-compile-aarch64-stage-snapshot"
name: stage-snapshot-${{ matrix.setup }}
steps:
- uses: actions/checkout@v2
# Cache .m2/repository
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ matrix.setup }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-${{ matrix.setup }}-
${{ runner.os }}-maven-
# Enable caching of Docker layers
- uses: satackey/action-docker-layer-caching@v0.0.11
env:
docker-cache-name: staging-${{ matrix.setup }}-cache-docker
continue-on-error: true
with:
key: ${{ runner.os }}-staging-${{ env.docker-cache-name }}-{hash}
restore-keys: |
${{ runner.os }}-staging-${{ env.docker-cache-name }}-
- name: Create local staging directory
run: mkdir -p ~/local-staging
- name: Build docker image
run: docker-compose ${{ matrix.docker-compose-build }}
- name: Stage snapshots to local staging directory
run: docker-compose ${{ matrix.docker-compose-run }}
- name: Upload local staging directory
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.setup }}-local-staging
path: ~/local-staging
if-no-files-found: error
deploy-staged-snapshots:
runs-on: ubuntu-18.04
# Wait until we have staged everything
needs: stage-snapshot
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: '11'
# Cache .m2/repository
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-deploy-staged-snapshots-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-deploy-staged-snapshots-
${{ runner.os }}-maven-
# Setup some env to re-use later.
- name: Prepare enviroment variables
run: |
echo "LOCAL_STAGING_DIR=$HOME/local-staging" >> $GITHUB_ENV
# Hardcode the staging artifacts that need to be downloaded.
# These must match the matrix setups. There is currently no way to pull this out of the config.
- name: Download linux-aarch64 staging directory
uses: actions/download-artifact@v2
with:
name: linux-aarch64-local-staging
path: ~/linux-aarch64-local-staging
- name: Download linux-x86_64-java11 staging directory
uses: actions/download-artifact@v2
with:
name: linux-x86_64-java11-local-staging
path: ~/linux-x86_64-java11-local-staging
- name: Merge staging repositories
run: |
mkdir -p ~/local-staging/deferred
cat ~/linux-aarch64-local-staging/deferred/.index >> ~/local-staging/deferred/.index
cp -r ~/linux-aarch64-local-staging/deferred/* ~/local-staging/deferred/
cat ~/linux-x86_64-java11-local-staging/deferred/.index >> ~/local-staging/deferred/.index
cp -r ~/linux-x86_64-java11-local-staging/deferred/* ~/local-staging/deferred/
- uses: s4u/maven-settings-action@v2.2.0
with:
servers: |
[{
"id": "sonatype-nexus-snapshots",
"username": "${{ secrets.SONATYPE_USERNAME }}",
"password": "${{ secrets.SONATYPE_PASSWORD }}"
}]
- name: Deploy local staged artifacts
run: ./mvnw -B --file pom.xml org.sonatype.plugins:nexus-staging-maven-plugin:deploy-staged -DaltStagingDirectory=$LOCAL_STAGING_DIR

View File

@ -1,54 +0,0 @@
# ----------------------------------------------------------------------------
# Copyright 2021 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:
#
# https://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.
# ----------------------------------------------------------------------------
name: PR Reports
on:
workflow_run:
workflows: [ "Build PR" ]
types:
- completed
env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryhandler.count=5 -Dmaven.wagon.httpconnectionManager.ttlSeconds=240
jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ignore-if-missing: [false]
include:
- setup: linux-x86_64-java11
- setup: linux-x86_64-java16
- setup: linux-x86_64-java11-boringssl
- setup: windows-x86_64-java11-boringssl
continue-on-error: ${{ matrix.ignore-if-missing }}
steps:
- name: Download Artifacts
uses: dawidd6/action-download-artifact@v2.14.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: ${{ github.event.workflow_run.workflow_id }}
workflow_conclusion: completed
commit: ${{ github.event.workflow_run.head_commit.id }}
# File location set in ci-pr.yml and must be coordinated.
name: test-results-${{ matrix.setup }}
- name: Publish Test Report
uses: scacap/action-surefire-report@v1.0.13
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
report_paths: '**/target/surefire-reports/TEST-*.xml'
commit: ${{ github.event.workflow_run.head_commit.id }}
check_name: ${{ matrix.setup }} test reports

View File

@ -1,206 +0,0 @@
# ----------------------------------------------------------------------------
# Copyright 2021 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:
#
# https://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.
# ----------------------------------------------------------------------------
name: Build PR
on:
pull_request:
branches: [ "main"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryhandler.count=5 -Dmaven.wagon.httpconnectionManager.ttlSeconds=240
jobs:
verify-pr:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: '11'
# Cache .m2/repository
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-verify-pr-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-verify-pr-
${{ runner.os }}-maven-
- name: Verify with Maven
run: ./mvnw -B -ntp --file pom.xml verify -DskipTests=true
build-pr-windows:
runs-on: windows-2016
name: windows-x86_64-java11-boringssl
needs: verify-pr
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
# Cache .m2/repository
# Caching of maven dependencies
- uses: actions/cache@v2
with:
path: ~/.m2/repository
key: pr-windows-x86_64-maven-cache-${{ hashFiles('**/pom.xml') }}
restore-keys: |
pr-windows-x86_64-maven-cache-
- name: Build project
run: ./mvnw.cmd -B -ntp --file pom.xml clean package -Pboringssl -DskipHttp2Testsuite=true -DskipAutobahnTestsuite=true
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v2
with:
name: test-results-windows-x86_64-java11-boringssl
path: '**/target/surefire-reports/TEST-*.xml'
- uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: build-pr-windows-target
path: |
**/target/surefire-reports/
**/hs_err*.log
build-pr-aarch64:
name: linux-aarch64-verify-native
# The host should always be Linux
runs-on: ubuntu-20.04
needs: verify-pr
steps:
- uses: actions/checkout@v2
# Cache .m2/repository
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-build-pr-aarch64-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-build-pr-aarch64-
${{ runner.os }}-maven-
- uses: uraimo/run-on-arch-action@v2.0.9
name: Run commands
id: runcmd
with:
arch: aarch64
distro: ubuntu20.04
# Not required, but speeds up builds by storing container images in
# a GitHub package registry.
githubToken: ${{ github.token }}
# Mount the .m2/repository
dockerRunArgs: |
--volume "/home/runner/.m2/repository/:/root/.m2/repository"
# Install dependencies
install: |
apt-get update -q -y
apt-get install -q -y openjdk-11-jdk autoconf automake libtool make tar maven git
# Compile native code and the modules it depend on and run NativeLoadingTest. This is enough to ensure
# we can load the native module on aarch64
#
# Use tcnative.classifier that is empty as we don't support using the shared lib version on ubuntu.
run: |
JAVA_HOME=/usr/lib/jvm/java-11-openjdk-arm64 ./mvnw -B -ntp -pl testsuite-native -am clean package -DskipTests=true -Dcheckstyle.skip=true -DskipNativeTestsuite=false -Dtcnative.classifier=
build-pr:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- setup: linux-x86_64-java11
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml build"
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml run build-leak"
- setup: linux-x86_64-java11-graal
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.graalvm111.yaml build"
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.graalvm111.yaml run build-leak"
- setup: linux-x86_64-java16
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.116.yaml build"
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.116.yaml run build-leak"
- setup: linux-x86_64-java17
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.117.yaml build"
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.117.yaml run build-leak"
- setup: linux-x86_64-java11-boringssl
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml build"
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml run build-leak-boringssl-static"
- setup: linux-x86_64-java11-unsafe-buffer
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml build"
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml run build-unsafe-buffer"
name: ${{ matrix.setup }} build
needs: verify-pr
steps:
- uses: actions/checkout@v2
# Cache .m2/repository
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ matrix.setup }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-${{ matrix.setup }}-
${{ runner.os }}-maven-
# Enable caching of Docker layers
- uses: satackey/action-docker-layer-caching@v0.0.11
continue-on-error: true
with:
key: build-docker-cache-${{ matrix.setup }}-{hash}
restore-keys: |
build-docker-cache-${{ matrix.setup }}-
build-docker-cache-
- name: Build docker image
run: docker-compose ${{ matrix.docker-compose-build }}
- name: Build project with leak detection
run: docker-compose ${{ matrix.docker-compose-run }} | tee build-leak.output
- name: Checking for test failures
run: ./.github/scripts/check_build_result.sh build-leak.output
- name: Checking for detected leak
run: ./.github/scripts/check_leak.sh build-leak.output
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v2
with:
name: test-results-${{ matrix.setup }}
path: '**/target/surefire-reports/TEST-*.xml'
- uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: build-${{ matrix.setup }}-target
path: |
**/target/surefire-reports/
**/hs_err*.log

View File

@ -1,249 +0,0 @@
# ----------------------------------------------------------------------------
# Copyright 2021 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:
#
# https://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.
# ----------------------------------------------------------------------------
name: Release
on:
# Releases can only be triggered via the action tab
workflow_dispatch:
env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryhandler.count=5 -Dmaven.wagon.httpconnectionManager.ttlSeconds=240
jobs:
prepare-release:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
ref: main
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: '11'
- name: Setup git configuration
run: |
git config --global user.email "netty-project-bot@users.noreply.github.com"
git config --global user.name "Netty Project Bot"
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY_PEM }}
known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }}
# Cache .m2/repository
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-prepare-release-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-prepare-release-
${{ runner.os }}-maven-
- name: Prepare release with Maven
run: |
./mvnw -B -ntp --file pom.xml release:prepare -DpreparationGoals=clean -DskipTests=true
./mvnw -B -ntp clean
- name: Checkout tag
run: ./.github/scripts/release_checkout_tag.sh release.properties
- name: Upload workspace
uses: actions/upload-artifact@v2
with:
name: prepare-release-workspace
path: ${{ github.workspace }}/**
stage-release-linux:
runs-on: ubuntu-latest
needs: prepare-release
strategy:
matrix:
include:
- setup: linux-x86_64-java11
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.11.yaml build"
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.11.yaml run stage-release"
- setup: linux-aarch64
docker-compose-build: "-f docker/docker-compose.centos-7.yaml build"
docker-compose-run: "-f docker/docker-compose.centos-7.yaml run cross-compile-aarch64-stage-release"
name: stage-release-${{ matrix.setup }}
steps:
- name: Download release-workspace
uses: actions/download-artifact@v2
with:
name: prepare-release-workspace
path: ./prepare-release-workspace/
- name: Adjust mvnw permissions
run: chmod 755 ./prepare-release-workspace/mvnw
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: '11'
- name: Setup git configuration
run: |
git config --global user.email "netty-project-bot@users.noreply.github.com"
git config --global user.name "Netty Project Bot"
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY_PEM }}
known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }}
# Enable caching of Docker layers
- uses: satackey/action-docker-layer-caching@v0.0.11
continue-on-error: true
with:
key: ${{ runner.os }}-staging-docker-cache-${{ matrix.setup }}-{hash}
restore-keys: |
${{ runner.os }}-staging-docker-cache-${{ matrix.setup }}-
${{ runner.os }}-staging-docker-cache-
- uses: s4u/maven-settings-action@v2.2.0
with:
servers: |
[{
"id": "sonatype-nexus-staging",
"username": "${{ secrets.SONATYPE_USERNAME }}",
"password": "${{ secrets.SONATYPE_PASSWORD }}"
}]
# Cache .m2/repository
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ matrix.setup }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-${{ matrix.setup }}-
${{ runner.os }}-maven-
- name: Create local staging directory
run: mkdir -p ~/local-staging
- name: Build docker image
working-directory: ./prepare-release-workspace/
run: docker-compose ${{ matrix.docker-compose-build }}
- name: Stage release to local staging directory
working-directory: ./prepare-release-workspace/
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_KEYNAME: ${{ secrets.GPG_KEYNAME }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: docker-compose ${{ matrix.docker-compose-run }}
- name: Upload local staging directory
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.setup }}-local-staging
path: ~/local-staging
if-no-files-found: error
- name: Rollback release on failure
working-directory: ./prepare-release-workspace/
if: ${{ failure() }}
# Rollback the release in case of an failure
run: bash ./.github/scripts/release_rollback.sh release.properties netty/netty main
deploy-staged-release:
runs-on: ubuntu-18.04
# Wait until we have staged everything
needs: stage-release-linux
steps:
- name: Download release-workspace
uses: actions/download-artifact@v2
with:
name: prepare-release-workspace
path: ./prepare-release-workspace/
- name: Adjust mvnw permissions
run: chmod 755 ./prepare-release-workspace/mvnw
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: '11'
- name: Setup git configuration
run: |
git config --global user.email "netty-project-bot@users.noreply.github.com"
git config --global user.name "Netty Project Bot"
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY_PEM }}
known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }}
# Hardcode the staging artifacts that need to be downloaded.
# These must match the matrix setups. There is currently no way to pull this out of the config.
- name: Download linux-aarch64 staging directory
uses: actions/download-artifact@v2
with:
name: linux-aarch64-local-staging
path: ~/linux-aarch64-local-staging
- name: Download linux-x86_64-java11 staging directory
uses: actions/download-artifact@v2
with:
name: linux-x86_64-java11-local-staging
path: ~/linux-x86_64-java11-local-staging
# This step takes care of merging all the previous staged repositories in a way that will allow us to deploy
# all together with one maven command.
- name: Merge staging repositories
working-directory: ./prepare-release-workspace/
run: bash ./.github/scripts/merge_local_staging.sh /home/runner/local-staging/staging ~/linux-aarch64-local-staging/staging ~/linux-x86_64-java11-local-staging/staging
- uses: s4u/maven-settings-action@v2.2.0
with:
servers: |
[{
"id": "sonatype-nexus-staging",
"username": "${{ secrets.SONATYPE_USERNAME }}",
"password": "${{ secrets.SONATYPE_PASSWORD }}"
}]
# Cache .m2/repository
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-deploy-staged-release-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-deploy-staged-release-
${{ runner.os }}-maven-
- name: Deploy local staged artifacts
working-directory: ./prepare-release-workspace/
# If we don't want to close the repository we can add -DskipStagingRepositoryClose=true
run: ./mvnw -B -ntp --file pom.xml org.sonatype.plugins:nexus-staging-maven-plugin:deploy-staged -DnexusUrl=https://oss.sonatype.org -DserverId=sonatype-nexus-staging -DaltStagingDirectory=/home/runner/local-staging -DskipStagingRepositoryClose=true
- name: Rollback release on failure
working-directory: ./prepare-release-workspace/
if: ${{ failure() }}
# Rollback the release in case of an failure
run: bash ./.github/scripts/release_rollback.sh release.properties netty/netty main

View File

@ -1,102 +0,0 @@
# ----------------------------------------------------------------------------
# Copyright 2021 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:
#
# https://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.
# ----------------------------------------------------------------------------
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
name: "CodeQL"
on:
push:
branches: ["4.1", main]
pull_request:
# The branches below must be a subset of the branches above
branches: ["4.1", main]
schedule:
- cron: '0 13 * * 3'
env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryhandler.count=5 -Dmaven.wagon.httpconnectionManager.ttlSeconds=240
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Override automatic language detection by changing the below list
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
language: ['java', 'cpp' ]
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
# Cache .m2/repository
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ matrix.language }} ${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-${{ matrix.language }}
${{ runner.os }}-maven-
# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
# - name: Autobuild
# uses: github/codeql-action/autobuild@v1
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
- uses: actions/setup-java@v1
with:
java-version: '11' # The JDK version to make available on the path.
- name: Compile project
run: ./mvnw -B -ntp clean package -DskipTests=true
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

Binary file not shown.

View File

@ -1 +0,0 @@
distributionUrl=https://downloads.apache.org/maven/maven-3/3.8.1/binaries/apache-maven-3.8.1-bin.zip

View File

@ -33,32 +33,32 @@ Netty can be used in modular JDK9+ applications as a collection of automatic mod
reverse-DNS style, and are derived from subproject names rather than root packages due to historical reasons. They
are listed below:
* `io.netty.all`
* `io.netty.buffer`
* `io.netty.codec`
* `io.netty.codec.dns`
* `io.netty.codec.haproxy`
* `io.netty.codec.http`
* `io.netty.codec.http2`
* `io.netty.codec.memcache`
* `io.netty.codec.mqtt`
* `io.netty.codec.redis`
* `io.netty.codec.smtp`
* `io.netty.codec.socks`
* `io.netty.codec.stomp`
* `io.netty.codec.xml`
* `io.netty.common`
* `io.netty.handler`
* `io.netty.handler.proxy`
* `io.netty.resolver`
* `io.netty.resolver.dns`
* `io.netty.transport`
* `io.netty.transport.epoll` (`native` omitted - reserved keyword in Java)
* `io.netty.transport.kqueue` (`native` omitted - reserved keyword in Java)
* `io.netty.transport.unix.common` (`native` omitted - reserved keyword in Java)
* `io.netty.transport.rxtx`
* `io.netty.transport.sctp`
* `io.netty.transport.udt`
* `io.net5.all`
* `io.net5.buffer`
* `io.net5.codec`
* `io.net5.codec.dns`
* `io.net5.codec.haproxy`
* `io.net5.codec.http`
* `io.net5.codec.http2`
* `io.net5.codec.memcache`
* `io.net5.codec.mqtt`
* `io.net5.codec.redis`
* `io.net5.codec.smtp`
* `io.net5.codec.socks`
* `io.net5.codec.stomp`
* `io.net5.codec.xml`
* `io.net5.common`
* `io.net5.handler`
* `io.net5.handler.proxy`
* `io.net5.resolver`
* `io.net5.resolver.dns`
* `io.net5.transport`
* `io.net5.transport.epoll` (`native` omitted - reserved keyword in Java)
* `io.net5.transport.kqueue` (`native` omitted - reserved keyword in Java)
* `io.net5.transport.unix.common` (`native` omitted - reserved keyword in Java)
* `io.net5.transport.rxtx`
* `io.net5.transport.sctp`
* `io.net5.transport.udt`

View File

@ -1,631 +0,0 @@
<?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:
~
~ https://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 https://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.netty</groupId>
<artifactId>netty-parent</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
</parent>
<artifactId>netty-all</artifactId>
<packaging>jar</packaging>
<name>Netty/All-in-One</name>
<properties>
<generatedSourceDir>${project.build.directory}/src</generatedSourceDir>
<dependencyVersionsDir>${project.build.directory}/versions</dependencyVersionsDir>
<japicmp.skip>true</japicmp.skip>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-bom</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<profiles>
<!-- If the uber profile is used it will automatically fetch the missing native jar from maven and add it to the all jar as well. -->
<profile>
<id>uber-staging</id>
<repositories>
<repository>
<id>staged-releases</id>
<name>Staged Releases</name>
<url>https://oss.sonatype.org/service/local/repositories/${stagingRepositoryId}/content/</url>
</repository>
</repositories>
<dependencies>
<!-- Depend on all our native jars -->
<!-- As this is executed on either macOS or Linux we directly need to specify the classifier -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<classifier>linux-x86_64</classifier>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<classifier>linux-aarch_64</classifier>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-transport-native-kqueue</artifactId>
<classifier>osx-x86_64</classifier>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-resolver-dns-native-macos</artifactId>
<classifier>osx-x86_64</classifier>
<scope>compile</scope>
<optional>true</optional>
</dependency>
</dependencies>
</profile>
<profile>
<id>uber-snapshot</id>
<dependencies>
<!-- Depend on all our native jars -->
<!-- As this is executed on either macOS or Linux we directly need to specify the classifier -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<classifier>linux-x86_64</classifier>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<classifier>linux-aarch_64</classifier>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-transport-native-kqueue</artifactId>
<classifier>osx-x86_64</classifier>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-resolver-dns-native-macos</artifactId>
<classifier>osx-x86_64</classifier>
<scope>compile</scope>
<optional>true</optional>
</dependency>
</dependencies>
</profile>
<!-- The linux profile will only include the native jar for epol to the all jar.
If you want to also include the native jar for kqueue use -Puber.
-->
<profile>
<id>linux</id>
<activation>
<os>
<family>linux</family>
</os>
</activation>
<dependencies>
<!-- All release modules -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<version>${project.version}</version>
<classifier>${jni.classifier}</classifier>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<!-- Just include the classes for the other platform so these are at least present in the netty-all artifact -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-transport-native-kqueue</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-resolver-dns-native-macos</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>
</dependencies>
</profile>
<!-- The mac, openbsd and freebsd profile will only include the native jar for epol to the all jar.
If you want to also include the native jar for kqueue use -Puber.
-->
<profile>
<id>mac</id>
<activation>
<os>
<family>mac</family>
</os>
</activation>
<dependencies>
<!-- All release modules -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-transport-native-kqueue</artifactId>
<version>${project.version}</version>
<classifier>${jni.classifier}</classifier>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-resolver-dns-native-macos</artifactId>
<version>${project.version}</version>
<classifier>${jni.classifier}</classifier>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<!-- Just include the classes for the other platform so these are at least present in the netty-all artifact -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>
</dependencies>
</profile>
<profile>
<id>freebsd</id>
<activation>
<os>
<family>unix</family>
<name>freebsd</name>
</os>
</activation>
<dependencies>
<!-- All release modules -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-transport-native-kqueue</artifactId>
<version>${project.version}</version>
<classifier>${jni.classifier}</classifier>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-resolver-dns-native-macos</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<!-- Just include the classes for the other platform so these are at least present in the netty-all artifact -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>
</dependencies>
</profile>
<profile>
<id>openbsd</id>
<activation>
<os>
<family>unix</family>
<name>openbsd</name>
</os>
</activation>
<dependencies>
<!-- All release modules -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-transport-native-kqueue</artifactId>
<version>${project.version}</version>
<classifier>${jni.classifier}</classifier>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-resolver-dns-native-macos</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<!-- Just include the classes for the other platform so these are at least present in the netty-all artifact -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>
</dependencies>
</profile>
</profiles>
<dependencies>
<!-- All release modules -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-buffer</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-codec</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-codec-dns</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-codec-haproxy</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-codec-http</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-codec-http2</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-codec-memcache</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-codec-mqtt</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-codec-redis</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-codec-smtp</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-codec-socks</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-codec-stomp</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-codec-xml</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-common</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-handler</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-handler-proxy</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-resolver</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-resolver-dns</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-transport</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-transport-sctp</artifactId>
<scope>compile</scope>
<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>
<!-- Populate the properties whose key is groupId:artifactId:type
and whose value is the path to the artifact -->
<execution>
<id>locate-dependencies</id>
<phase>initialize</phase>
<goals>
<goal>properties</goal>
</goals>
</execution>
<!-- Unpack all source files -->
<execution>
<id>unpack-sources</id>
<phase>prepare-package</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<classifier>sources</classifier>
<includes>io/netty/**</includes>
<includeScope>runtime</includeScope>
<includeGroupIds>${project.groupId}</includeGroupIds>
<outputDirectory>${generatedSourceDir}</outputDirectory>
</configuration>
</execution>
<!-- Unpack all class files -->
<execution>
<id>unpack-jars</id>
<phase>prepare-package</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<excludes>io/netty/internal/tcnative/**,io/netty/example/**,META-INF/native/libnetty_tcnative*,META-INF/native/include/**,META-INF/native/**/*.a</excludes>
<includes>io/netty/**,META-INF/native/**,META-INF/native-image/**</includes>
<includeScope>runtime</includeScope>
<includeGroupIds>${project.groupId}</includeGroupIds>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<!-- Instead of generating a new version property file, merge others' version property files into one. -->
<execution>
<id>write-version-properties</id>
<phase>none</phase>
</execution>
<execution>
<id>merge-version-properties</id>
<phase>prepare-package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<taskdef resource="net/sf/antcontrib/antlib.xml" />
<propertyselector property="versions" match="^(${project.groupId}:(?!netty-example)[^:]+:jar(?::[^:]+)?)$" select="\1" />
<for list="${versions}" param="x">
<sequential>
<unzip src="${@{x}}" dest="${dependencyVersionsDir}">
<patternset>
<include name="META-INF/${project.groupId}.versions.properties" />
</patternset>
</unzip>
<concat destfile="${project.build.outputDirectory}/META-INF/${project.groupId}.versions.properties" append="true">
<path path="${dependencyVersionsDir}/META-INF/${project.groupId}.versions.properties" />
</concat>
</sequential>
</for>
<delete dir="${dependencyVersionsDir}" quiet="true" />
</target>
</configuration>
</execution>
<!-- Clean everything once finished so that IDE doesn't find the unpacked files. -->
<execution>
<id>clean-source-directory</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<delete dir="${generatedSourceDir}" quiet="true" />
<delete dir="${dependencyVersionsDir}" quiet="true" />
<delete dir="${project.build.outputDirectory}" quiet="true" />
</target>
</configuration>
</execution>
</executions>
</plugin>
<!-- Include the directory where the source files were unpacked -->
<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>${generatedSourceDir}</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<!-- Disable OSGi bundle manifest generation -->
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<executions>
<execution>
<id>generate-manifest</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<!-- Override the default JAR configuration -->
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>default-jar</id>
<phase>none</phase>
</execution>
<execution>
<id>all-in-one-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<Automatic-Module-Name>io.netty.all</Automatic-Module-Name>
</manifestEntries>
<index>true</index>
</archive>
</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>
</plugins>
</build>
</project>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2017 The Netty Project
~ Copyright 2017, 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
@ -16,14 +16,15 @@
-->
<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 https://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
<relativePath />
</parent>
<distributionManagement>
<repository>
<id>mchv-snapshot</id>
<name>MCHV Apache Snapshot Maven Packages Distribution</name>
<url>https://mvn.mchv.eu/repository/mchv-snapshot</url>
</repository>
</distributionManagement>
<groupId>io.netty</groupId>
<groupId>io.net5</groupId>
<artifactId>netty-bom</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
<packaging>pom</packaging>
@ -63,240 +64,27 @@
</developer>
</developers>
<properties>
<!-- Keep in sync with ../pom.xml -->
</properties>
<dependencyManagement>
<dependencies>
<!-- All release modules -->
<dependency>
<groupId>io.netty</groupId>
<groupId>io.net5</groupId>
<artifactId>netty-buffer</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-dns</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-haproxy</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-http</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-http2</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-memcache</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-mqtt</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-redis</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-smtp</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-socks</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-stomp</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-xml</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<groupId>io.net5</groupId>
<artifactId>netty-common</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<groupId>io.net5</groupId>
<artifactId>netty-dev-tools</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler-proxy</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-resolver</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-resolver-dns</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-sctp</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-example</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-resolver-dns-native-macos</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-resolver-dns-native-macos</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
<classifier>osx-x86_64</classifier>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-unix-common</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-unix-common</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
<classifier>linux-aarch_64</classifier>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-unix-common</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
<classifier>linux-x86_64</classifier>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-unix-common</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
<classifier>osx-x86_64</classifier>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
<classifier>linux-aarch_64</classifier>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
<classifier>linux-x86_64</classifier>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-kqueue</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-kqueue</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
<classifier>osx-x86_64</classifier>
</dependency>
<!-- Add netty-tcnative* as well as users need to ensure they use the correct version -->
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative</artifactId>
<version>${tcnative.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative</artifactId>
<version>${tcnative.version}</version>
<classifier>linux-x86_64</classifier>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative</artifactId>
<version>${tcnative.version}</version>
<classifier>linux-aarch_64</classifier>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative</artifactId>
<version>${tcnative.version}</version>
<classifier>osx-x86_64</classifier>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>${tcnative.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>${tcnative.version}</version>
<classifier>linux-x86_64</classifier>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>${tcnative.version}</version>
<classifier>linux-aarch_64</classifier>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>${tcnative.version}</version>
<classifier>osx_64</classifier>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>${tcnative.version}</version>
<classifier>windows_64</classifier>
</dependency>
</dependencies>
</dependencyManagement>
</project>
</project>

View File

@ -18,7 +18,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.netty</groupId>
<groupId>io.net5</groupId>
<artifactId>netty-parent</artifactId>
<version>5.0.0.Final-SNAPSHOT</version>
</parent>
@ -29,7 +29,7 @@
<name>Netty/Buffer</name>
<properties>
<javaModuleName>io.netty.buffer</javaModuleName>
<javaModuleName>io.net5.buffer</javaModuleName>
</properties>
<dependencies>

View File

@ -13,18 +13,18 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import io.netty.util.AsciiString;
import io.netty.util.ByteProcessor;
import io.netty.util.CharsetUtil;
import io.netty.util.IllegalReferenceCountException;
import io.netty.util.ResourceLeakDetector;
import io.netty.util.ResourceLeakDetectorFactory;
import io.netty.util.internal.StringUtil;
import io.netty.util.internal.SystemPropertyUtil;
import io.netty.util.internal.logging.InternalLogger;
import io.netty.util.internal.logging.InternalLoggerFactory;
import io.net5.util.AsciiString;
import io.net5.util.ByteProcessor;
import io.net5.util.CharsetUtil;
import io.net5.util.IllegalReferenceCountException;
import io.net5.util.ResourceLeakDetector;
import io.net5.util.ResourceLeakDetectorFactory;
import io.net5.util.internal.StringUtil;
import io.net5.util.internal.SystemPropertyUtil;
import io.net5.util.internal.logging.InternalLogger;
import io.net5.util.internal.logging.InternalLoggerFactory;
import java.io.IOException;
import java.io.InputStream;
@ -36,8 +36,8 @@ import java.nio.channels.GatheringByteChannel;
import java.nio.channels.ScatteringByteChannel;
import java.nio.charset.Charset;
import static io.netty.util.internal.MathUtil.isOutOfBounds;
import static io.netty.util.internal.ObjectUtil.checkPositiveOrZero;
import static io.net5.util.internal.MathUtil.isOutOfBounds;
import static io.net5.util.internal.ObjectUtil.checkPositiveOrZero;
import static java.util.Objects.requireNonNull;
/**
@ -45,9 +45,9 @@ import static java.util.Objects.requireNonNull;
*/
public abstract class AbstractByteBuf extends ByteBuf {
private static final InternalLogger logger = InternalLoggerFactory.getInstance(AbstractByteBuf.class);
private static final String PROP_CHECK_ACCESSIBLE = "io.netty.buffer.checkAccessible";
private static final String PROP_CHECK_ACCESSIBLE = "io.net5.buffer.checkAccessible";
static final boolean checkAccessible; // accessed from CompositeByteBuf
private static final String PROP_CHECK_BOUNDS = "io.netty.buffer.checkBounds";
private static final String PROP_CHECK_BOUNDS = "io.net5.buffer.checkBounds";
private static final boolean checkBounds;
static {

View File

@ -14,15 +14,15 @@
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import static io.netty.util.internal.ObjectUtil.checkPositiveOrZero;
import static io.net5.util.internal.ObjectUtil.checkPositiveOrZero;
import io.netty.util.ResourceLeakDetector;
import io.netty.util.ResourceLeakTracker;
import io.netty.util.internal.MathUtil;
import io.netty.util.internal.PlatformDependent;
import io.netty.util.internal.StringUtil;
import io.net5.util.ResourceLeakDetector;
import io.net5.util.ResourceLeakTracker;
import io.net5.util.internal.MathUtil;
import io.net5.util.internal.PlatformDependent;
import io.net5.util.internal.StringUtil;
/**
* Skeletal {@link ByteBufAllocator} implementation to extend.

View File

@ -14,7 +14,7 @@
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import java.nio.ByteBuffer;

View File

@ -14,9 +14,9 @@
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import io.netty.util.internal.ObjectPool.Handle;
import io.net5.util.internal.ObjectPool.Handle;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;

View File

@ -14,11 +14,11 @@
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import io.netty.util.internal.ReferenceCountUpdater;
import io.net5.util.internal.ReferenceCountUpdater;
/**
* Abstract base class for {@link ByteBuf} implementations that count references.

View File

@ -13,9 +13,9 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import io.netty.util.ByteProcessor;
import io.net5.util.ByteProcessor;
import java.io.IOException;
import java.io.InputStream;
@ -27,7 +27,7 @@ import java.nio.channels.GatheringByteChannel;
import java.nio.channels.ScatteringByteChannel;
import java.nio.charset.Charset;
import static io.netty.util.internal.MathUtil.isOutOfBounds;
import static io.net5.util.internal.MathUtil.isOutOfBounds;
abstract class AbstractUnpooledSlicedByteBuf extends AbstractDerivedByteBuf {
private final ByteBuf buffer;

View File

@ -13,13 +13,13 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import io.netty.util.internal.PlatformDependent;
import io.net5.util.internal.PlatformDependent;
import java.nio.ByteOrder;
import static io.netty.util.internal.PlatformDependent.BIG_ENDIAN_NATIVE_ORDER;
import static io.net5.util.internal.PlatformDependent.BIG_ENDIAN_NATIVE_ORDER;
/**
* Special {@link SwappedByteBuf} for {@link ByteBuf}s that is using unsafe.

View File

@ -14,14 +14,14 @@
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import io.netty.util.ByteProcessor;
import io.netty.util.ResourceLeakDetector;
import io.netty.util.ResourceLeakTracker;
import io.netty.util.internal.SystemPropertyUtil;
import io.netty.util.internal.logging.InternalLogger;
import io.netty.util.internal.logging.InternalLoggerFactory;
import io.net5.util.ByteProcessor;
import io.net5.util.ResourceLeakDetector;
import io.net5.util.ResourceLeakTracker;
import io.net5.util.internal.SystemPropertyUtil;
import io.net5.util.internal.logging.InternalLogger;
import io.net5.util.internal.logging.InternalLoggerFactory;
import java.io.IOException;
import java.io.InputStream;
@ -36,7 +36,7 @@ import java.nio.charset.Charset;
final class AdvancedLeakAwareByteBuf extends SimpleLeakAwareByteBuf {
// If set to true we will only record stacktraces for touch(...), release(...) and retain(...) calls.
private static final String PROP_ACQUIRE_AND_RELEASE_ONLY = "io.netty.leakDetection.acquireAndReleaseOnly";
private static final String PROP_ACQUIRE_AND_RELEASE_ONLY = "io.net5.leakDetection.acquireAndReleaseOnly";
private static final boolean ACQUIRE_AND_RELEASE_ONLY;
private static final InternalLogger logger = InternalLoggerFactory.getInstance(AdvancedLeakAwareByteBuf.class);

View File

@ -13,11 +13,11 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import io.netty.util.ByteProcessor;
import io.netty.util.ResourceLeakTracker;
import io.net5.util.ByteProcessor;
import io.net5.util.ResourceLeakTracker;
import java.io.IOException;
import java.io.InputStream;
@ -31,7 +31,7 @@ import java.nio.charset.Charset;
import java.util.Iterator;
import java.util.List;
import static io.netty.buffer.AdvancedLeakAwareByteBuf.recordLeakNonRefCountingOperation;
import static io.net5.buffer.AdvancedLeakAwareByteBuf.recordLeakNonRefCountingOperation;
final class AdvancedLeakAwareCompositeByteBuf extends SimpleLeakAwareCompositeByteBuf {

View File

@ -13,10 +13,10 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import io.netty.util.ByteProcessor;
import io.netty.util.ReferenceCounted;
import io.net5.util.ByteProcessor;
import io.net5.util.ReferenceCounted;
import java.io.IOException;
import java.io.InputStream;

View File

@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
/**
* Implementations are responsible to allocate buffers. Implementations of this interface are expected to be

View File

@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
public interface ByteBufAllocatorMetric {
/**

View File

@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
public interface ByteBufAllocatorMetricProvider {

View File

@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
/**
* An interface that can be implemented by any object that know how to turn itself into a {@link ByteBuf}.

View File

@ -13,9 +13,9 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import io.netty.util.ReferenceCounted;
import io.net5.util.ReferenceCounted;
/**
* A packet which is send or receive.

View File

@ -13,13 +13,13 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import static java.util.Objects.requireNonNull;
import static io.netty.util.internal.ObjectUtil.checkPositiveOrZero;
import static io.net5.util.internal.ObjectUtil.checkPositiveOrZero;
import io.netty.util.ReferenceCounted;
import io.netty.util.internal.StringUtil;
import io.net5.util.ReferenceCounted;
import io.net5.util.internal.StringUtil;
import java.io.DataInput;
import java.io.DataInputStream;

View File

@ -13,11 +13,11 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import static java.util.Objects.requireNonNull;
import io.netty.util.CharsetUtil;
import io.net5.util.CharsetUtil;
import java.io.DataOutput;
import java.io.DataOutputStream;

View File

@ -14,9 +14,9 @@
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import io.netty.util.ByteProcessor;
import io.net5.util.ByteProcessor;
/**
* @deprecated Use {@link ByteProcessor}.

View File

@ -13,21 +13,21 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import io.netty.util.AsciiString;
import io.netty.util.ByteProcessor;
import io.netty.util.CharsetUtil;
import io.netty.util.IllegalReferenceCountException;
import io.netty.util.concurrent.FastThreadLocal;
import io.netty.util.internal.MathUtil;
import io.netty.util.internal.ObjectPool;
import io.netty.util.internal.ObjectPool.Handle;
import io.netty.util.internal.PlatformDependent;
import io.netty.util.internal.StringUtil;
import io.netty.util.internal.SystemPropertyUtil;
import io.netty.util.internal.logging.InternalLogger;
import io.netty.util.internal.logging.InternalLoggerFactory;
import io.net5.util.AsciiString;
import io.net5.util.ByteProcessor;
import io.net5.util.CharsetUtil;
import io.net5.util.IllegalReferenceCountException;
import io.net5.util.concurrent.FastThreadLocal;
import io.net5.util.internal.MathUtil;
import io.net5.util.internal.ObjectPool;
import io.net5.util.internal.ObjectPool.Handle;
import io.net5.util.internal.PlatformDependent;
import io.net5.util.internal.StringUtil;
import io.net5.util.internal.SystemPropertyUtil;
import io.net5.util.internal.logging.InternalLogger;
import io.net5.util.internal.logging.InternalLoggerFactory;
import java.io.IOException;
import java.io.OutputStream;
@ -43,10 +43,10 @@ import java.nio.charset.CodingErrorAction;
import java.util.Arrays;
import java.util.Locale;
import static io.netty.util.internal.MathUtil.isOutOfBounds;
import static io.netty.util.internal.ObjectUtil.checkPositiveOrZero;
import static io.netty.util.internal.StringUtil.NEWLINE;
import static io.netty.util.internal.StringUtil.isSurrogate;
import static io.net5.util.internal.MathUtil.isOutOfBounds;
import static io.net5.util.internal.ObjectUtil.checkPositiveOrZero;
import static io.net5.util.internal.StringUtil.NEWLINE;
import static io.net5.util.internal.StringUtil.isSurrogate;
import static java.util.Objects.requireNonNull;
/**
@ -74,28 +74,28 @@ public final class ByteBufUtil {
static {
String allocType = SystemPropertyUtil.get(
"io.netty.allocator.type", PlatformDependent.isAndroid() ? "unpooled" : "pooled");
"io.net5.allocator.type", PlatformDependent.isAndroid() ? "unpooled" : "pooled");
allocType = allocType.toLowerCase(Locale.US).trim();
ByteBufAllocator alloc;
if ("unpooled".equals(allocType)) {
alloc = UnpooledByteBufAllocator.DEFAULT;
logger.debug("-Dio.netty.allocator.type: {}", allocType);
logger.debug("-Dio.net5.allocator.type: {}", allocType);
} else if ("pooled".equals(allocType)) {
alloc = PooledByteBufAllocator.DEFAULT;
logger.debug("-Dio.netty.allocator.type: {}", allocType);
logger.debug("-Dio.net5.allocator.type: {}", allocType);
} else {
alloc = PooledByteBufAllocator.DEFAULT;
logger.debug("-Dio.netty.allocator.type: pooled (unknown: {})", allocType);
logger.debug("-Dio.net5.allocator.type: pooled (unknown: {})", allocType);
}
DEFAULT_ALLOCATOR = alloc;
THREAD_LOCAL_BUFFER_SIZE = SystemPropertyUtil.getInt("io.netty.threadLocalDirectBufferSize", 0);
logger.debug("-Dio.netty.threadLocalDirectBufferSize: {}", THREAD_LOCAL_BUFFER_SIZE);
THREAD_LOCAL_BUFFER_SIZE = SystemPropertyUtil.getInt("io.net5.threadLocalDirectBufferSize", 0);
logger.debug("-Dio.net5.threadLocalDirectBufferSize: {}", THREAD_LOCAL_BUFFER_SIZE);
MAX_CHAR_BUFFER_SIZE = SystemPropertyUtil.getInt("io.netty.maxThreadLocalCharBufferSize", 16 * 1024);
logger.debug("-Dio.netty.maxThreadLocalCharBufferSize: {}", MAX_CHAR_BUFFER_SIZE);
MAX_CHAR_BUFFER_SIZE = SystemPropertyUtil.getInt("io.net5.maxThreadLocalCharBufferSize", 16 * 1024);
logger.debug("-Dio.net5.maxThreadLocalCharBufferSize: {}", MAX_CHAR_BUFFER_SIZE);
}
static final int MAX_TL_ARRAY_LEN = 1024;

View File

@ -13,15 +13,15 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import static java.util.Objects.requireNonNull;
import io.netty.util.ByteProcessor;
import io.netty.util.IllegalReferenceCountException;
import io.netty.util.ReferenceCountUtil;
import io.netty.util.internal.EmptyArrays;
import io.netty.util.internal.RecyclableArrayList;
import io.net5.util.ByteProcessor;
import io.net5.util.IllegalReferenceCountException;
import io.net5.util.ReferenceCountUtil;
import io.net5.util.internal.EmptyArrays;
import io.net5.util.internal.RecyclableArrayList;
import java.io.IOException;
import java.io.InputStream;

View File

@ -13,11 +13,11 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import static java.util.Objects.requireNonNull;
import io.netty.util.internal.StringUtil;
import io.net5.util.internal.StringUtil;
/**
* Default implementation of a {@link ByteBufHolder} that holds it's data in a {@link ByteBuf}.

View File

@ -13,9 +13,9 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import io.netty.util.ByteProcessor;
import io.net5.util.ByteProcessor;
import java.io.IOException;
import java.io.InputStream;

View File

@ -14,15 +14,15 @@
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import static io.netty.util.internal.ObjectUtil.checkPositiveOrZero;
import static io.net5.util.internal.ObjectUtil.checkPositiveOrZero;
import static java.util.Objects.requireNonNull;
import io.netty.util.ByteProcessor;
import io.netty.util.internal.EmptyArrays;
import io.netty.util.internal.PlatformDependent;
import io.netty.util.internal.StringUtil;
import io.net5.util.ByteProcessor;
import io.net5.util.internal.EmptyArrays;
import io.net5.util.internal.PlatformDependent;
import io.net5.util.internal.StringUtil;
import java.io.InputStream;
import java.io.OutputStream;

View File

@ -13,10 +13,10 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import io.netty.util.internal.EmptyArrays;
import io.netty.util.internal.RecyclableArrayList;
import io.net5.util.internal.EmptyArrays;
import io.net5.util.internal.RecyclableArrayList;
import java.io.IOException;
import java.io.InputStream;

View File

@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
/**
* Utility class for heap buffers.

View File

@ -14,10 +14,10 @@
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import io.netty.util.internal.PlatformDependent;
import io.netty.util.internal.StringUtil;
import io.net5.util.internal.PlatformDependent;
import io.net5.util.internal.StringUtil;
import java.nio.ByteBuffer;
import java.util.ArrayList;
@ -26,7 +26,7 @@ import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.LongAdder;
import static io.netty.buffer.PoolChunk.isSubpage;
import static io.net5.buffer.PoolChunk.isSubpage;
import static java.lang.Math.max;
abstract class PoolArena<T> extends SizeClasses implements PoolArenaMetric {
@ -455,6 +455,22 @@ abstract class PoolArena<T> extends SizeClasses implements PoolArenaMetric {
return max(0, val);
}
/**
* Return the number of bytes that are currently pinned to buffer instances, by the arena. The pinned memory is not
* accessible for use by any other allocation, until the buffers using have all been released.
*/
public long numPinnedBytes() {
long val = activeBytesHuge.longValue(); // Huge chunks are exact-sized for the buffers they were allocated to.
synchronized (this) {
for (int i = 0; i < chunkListMetrics.size(); i++) {
for (PoolChunkMetric m: chunkListMetrics.get(i)) {
val += ((PoolChunk<?>) m).pinnedBytes();
}
}
}
return max(0, val);
}
protected abstract PoolChunk<T> newChunk(int pageSize, int maxPageIdx, int pageShifts, int chunkSize);
protected abstract PoolChunk<T> newUnpooledChunk(int capacity);
protected abstract PooledByteBuf<T> newByteBuf(int maxCapacity);

View File

@ -14,7 +14,7 @@
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import java.util.List;

View File

@ -13,10 +13,10 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import io.netty.util.internal.LongLongHashMap;
import io.netty.util.internal.LongPriorityQueue;
import io.net5.util.internal.LongLongHashMap;
import io.net5.util.internal.LongPriorityQueue;
import java.nio.ByteBuffer;
import java.util.ArrayDeque;
@ -175,6 +175,7 @@ final class PoolChunk<T> implements PoolChunkMetric {
private final Deque<ByteBuffer> cachedNioBuffers;
int freeBytes;
int pinnedBytes;
PoolChunkList<T> parent;
PoolChunk<T> prev;
@ -342,7 +343,9 @@ final class PoolChunk<T> implements PoolChunkMetric {
handle = splitLargeRun(handle, pages);
}
freeBytes -= runSize(pageShifts, handle);
int pinnedSize = runSize(pageShifts, handle);
freeBytes -= pinnedSize;
pinnedBytes += pinnedSize;
return handle;
}
}
@ -451,6 +454,8 @@ final class PoolChunk<T> implements PoolChunkMetric {
* @param handle handle to free
*/
void free(long handle, int normCapacity, ByteBuffer nioBuffer) {
int runSize = runSize(pageShifts, handle);
pinnedBytes -= runSize;
if (isSubpage(handle)) {
int sizeIdx = arena.size2SizeIdx(normCapacity);
PoolSubpage<T> head = arena.findSubpagePoolHead(sizeIdx);
@ -473,8 +478,6 @@ final class PoolChunk<T> implements PoolChunkMetric {
}
//start free run
int pages = runPages(handle);
synchronized (runsAvail) {
// collapse continuous runs, successfully collapsed runs
// will be removed from runsAvail and runsAvailMap
@ -486,7 +489,7 @@ final class PoolChunk<T> implements PoolChunkMetric {
finalRun &= ~(1L << IS_SUBPAGE_SHIFT);
insertAvailRun(runOffset(finalRun), runPages(finalRun), finalRun);
freeBytes += pages << pageShifts;
freeBytes += runSize;
}
if (nioBuffer != null && cachedNioBuffers != null &&
@ -588,6 +591,12 @@ final class PoolChunk<T> implements PoolChunkMetric {
}
}
public int pinnedBytes() {
synchronized (arena) {
return pinnedBytes;
}
}
@Override
public String toString() {
final int freeBytes;

View File

@ -14,9 +14,9 @@
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import io.netty.util.internal.StringUtil;
import io.net5.util.internal.StringUtil;
import java.util.ArrayList;
import java.util.Collections;

View File

@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
/**
* Metrics for a list of chunks.

View File

@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
/**
* Metrics for a chunk.

View File

@ -14,13 +14,13 @@
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import static io.netty.buffer.PoolChunk.RUN_OFFSET_SHIFT;
import static io.netty.buffer.PoolChunk.SIZE_SHIFT;
import static io.netty.buffer.PoolChunk.IS_USED_SHIFT;
import static io.netty.buffer.PoolChunk.IS_SUBPAGE_SHIFT;
import static io.netty.buffer.SizeClasses.LOG2_QUANTUM;
import static io.net5.buffer.PoolChunk.RUN_OFFSET_SHIFT;
import static io.net5.buffer.PoolChunk.SIZE_SHIFT;
import static io.net5.buffer.PoolChunk.IS_USED_SHIFT;
import static io.net5.buffer.PoolChunk.IS_SUBPAGE_SHIFT;
import static io.net5.buffer.SizeClasses.LOG2_QUANTUM;
final class PoolSubpage<T> implements PoolSubpageMetric {

View File

@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
/**
* Metrics for a sub-page.

View File

@ -14,18 +14,18 @@
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import static io.netty.util.internal.ObjectUtil.checkPositiveOrZero;
import static io.net5.util.internal.ObjectUtil.checkPositiveOrZero;
import io.netty.buffer.PoolArena.SizeClass;
import io.netty.util.internal.MathUtil;
import io.netty.util.internal.ObjectPool;
import io.netty.util.internal.ObjectPool.Handle;
import io.netty.util.internal.PlatformDependent;
import io.netty.util.internal.logging.InternalLogger;
import io.netty.util.internal.logging.InternalLoggerFactory;
import io.net5.buffer.PoolArena.SizeClass;
import io.net5.util.internal.MathUtil;
import io.net5.util.internal.ObjectPool;
import io.net5.util.internal.ObjectPool.Handle;
import io.net5.util.internal.PlatformDependent;
import io.net5.util.internal.logging.InternalLogger;
import io.net5.util.internal.logging.InternalLoggerFactory;
import java.nio.ByteBuffer;
import java.util.ArrayList;

View File

@ -14,9 +14,9 @@
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import io.netty.util.internal.ObjectPool.Handle;
import io.net5.util.internal.ObjectPool.Handle;
import java.io.IOException;
import java.nio.ByteBuffer;

View File

@ -14,20 +14,20 @@
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import static io.netty.util.internal.ObjectUtil.checkPositiveOrZero;
import static io.net5.util.internal.ObjectUtil.checkPositiveOrZero;
import io.netty.util.NettyRuntime;
import io.netty.util.concurrent.EventExecutor;
import io.netty.util.concurrent.FastThreadLocal;
import io.netty.util.concurrent.FastThreadLocalThread;
import io.netty.util.internal.PlatformDependent;
import io.netty.util.internal.StringUtil;
import io.netty.util.internal.SystemPropertyUtil;
import io.netty.util.internal.ThreadExecutorMap;
import io.netty.util.internal.logging.InternalLogger;
import io.netty.util.internal.logging.InternalLoggerFactory;
import io.net5.util.NettyRuntime;
import io.net5.util.concurrent.EventExecutor;
import io.net5.util.concurrent.FastThreadLocal;
import io.net5.util.concurrent.FastThreadLocalThread;
import io.net5.util.internal.PlatformDependent;
import io.net5.util.internal.StringUtil;
import io.net5.util.internal.SystemPropertyUtil;
import io.net5.util.internal.ThreadExecutorMap;
import io.net5.util.internal.logging.InternalLogger;
import io.net5.util.internal.logging.InternalLoggerFactory;
import java.nio.ByteBuffer;
import java.util.ArrayList;
@ -59,8 +59,8 @@ public class PooledByteBufAllocator extends AbstractByteBufAllocator implements
static {
int defaultAlignment = SystemPropertyUtil.getInt(
"io.netty.allocator.directMemoryCacheAlignment", 0);
int defaultPageSize = SystemPropertyUtil.getInt("io.netty.allocator.pageSize", 8192);
"io.net5.allocator.directMemoryCacheAlignment", 0);
int defaultPageSize = SystemPropertyUtil.getInt("io.net5.allocator.pageSize", 8192);
Throwable pageSizeFallbackCause = null;
try {
validateAndCalculatePageShifts(defaultPageSize, defaultAlignment);
@ -72,7 +72,7 @@ public class PooledByteBufAllocator extends AbstractByteBufAllocator implements
DEFAULT_PAGE_SIZE = defaultPageSize;
DEFAULT_DIRECT_MEMORY_CACHE_ALIGNMENT = defaultAlignment;
int defaultMaxOrder = SystemPropertyUtil.getInt("io.netty.allocator.maxOrder", 11);
int defaultMaxOrder = SystemPropertyUtil.getInt("io.net5.allocator.maxOrder", 11);
Throwable maxOrderFallbackCause = null;
try {
validateAndCalculateChunkSize(DEFAULT_PAGE_SIZE, defaultMaxOrder);
@ -97,62 +97,62 @@ public class PooledByteBufAllocator extends AbstractByteBufAllocator implements
final int defaultChunkSize = DEFAULT_PAGE_SIZE << DEFAULT_MAX_ORDER;
DEFAULT_NUM_HEAP_ARENA = Math.max(0,
SystemPropertyUtil.getInt(
"io.netty.allocator.numHeapArenas",
"io.net5.allocator.numHeapArenas",
(int) Math.min(
defaultMinNumArena,
runtime.maxMemory() / defaultChunkSize / 2 / 3)));
DEFAULT_NUM_DIRECT_ARENA = Math.max(0,
SystemPropertyUtil.getInt(
"io.netty.allocator.numDirectArenas",
"io.net5.allocator.numDirectArenas",
(int) Math.min(
defaultMinNumArena,
PlatformDependent.maxDirectMemory() / defaultChunkSize / 2 / 3)));
// cache sizes
DEFAULT_SMALL_CACHE_SIZE = SystemPropertyUtil.getInt("io.netty.allocator.smallCacheSize", 256);
DEFAULT_NORMAL_CACHE_SIZE = SystemPropertyUtil.getInt("io.netty.allocator.normalCacheSize", 64);
DEFAULT_SMALL_CACHE_SIZE = SystemPropertyUtil.getInt("io.net5.allocator.smallCacheSize", 256);
DEFAULT_NORMAL_CACHE_SIZE = SystemPropertyUtil.getInt("io.net5.allocator.normalCacheSize", 64);
// 32 kb is the default maximum capacity of the cached buffer. Similar to what is explained in
// 'Scalable memory allocation using jemalloc'
DEFAULT_MAX_CACHED_BUFFER_CAPACITY = SystemPropertyUtil.getInt(
"io.netty.allocator.maxCachedBufferCapacity", 32 * 1024);
"io.net5.allocator.maxCachedBufferCapacity", 32 * 1024);
// the number of threshold of allocations when cached entries will be freed up if not frequently used
DEFAULT_CACHE_TRIM_INTERVAL = SystemPropertyUtil.getInt(
"io.netty.allocator.cacheTrimInterval", 8192);
"io.net5.allocator.cacheTrimInterval", 8192);
DEFAULT_CACHE_TRIM_INTERVAL_MILLIS = SystemPropertyUtil.getLong(
"io.netty.allocator.cacheTrimIntervalMillis", 0);
"io.net5.allocator.cacheTrimIntervalMillis", 0);
DEFAULT_USE_CACHE_FOR_ALL_THREADS = SystemPropertyUtil.getBoolean(
"io.netty.allocator.useCacheForAllThreads", false);
"io.net5.allocator.useCacheForAllThreads", false);
// Use 1023 by default as we use an ArrayDeque as backing storage which will then allocate an internal array
// of 1024 elements. Otherwise we would allocate 2048 and only use 1024 which is wasteful.
DEFAULT_MAX_CACHED_BYTEBUFFERS_PER_CHUNK = SystemPropertyUtil.getInt(
"io.netty.allocator.maxCachedByteBuffersPerChunk", 1023);
"io.net5.allocator.maxCachedByteBuffersPerChunk", 1023);
if (logger.isDebugEnabled()) {
logger.debug("-Dio.netty.allocator.numHeapArenas: {}", DEFAULT_NUM_HEAP_ARENA);
logger.debug("-Dio.netty.allocator.numDirectArenas: {}", DEFAULT_NUM_DIRECT_ARENA);
logger.debug("-Dio.net5.allocator.numHeapArenas: {}", DEFAULT_NUM_HEAP_ARENA);
logger.debug("-Dio.net5.allocator.numDirectArenas: {}", DEFAULT_NUM_DIRECT_ARENA);
if (pageSizeFallbackCause == null) {
logger.debug("-Dio.netty.allocator.pageSize: {}", DEFAULT_PAGE_SIZE);
logger.debug("-Dio.net5.allocator.pageSize: {}", DEFAULT_PAGE_SIZE);
} else {
logger.debug("-Dio.netty.allocator.pageSize: {}", DEFAULT_PAGE_SIZE, pageSizeFallbackCause);
logger.debug("-Dio.net5.allocator.pageSize: {}", DEFAULT_PAGE_SIZE, pageSizeFallbackCause);
}
if (maxOrderFallbackCause == null) {
logger.debug("-Dio.netty.allocator.maxOrder: {}", DEFAULT_MAX_ORDER);
logger.debug("-Dio.net5.allocator.maxOrder: {}", DEFAULT_MAX_ORDER);
} else {
logger.debug("-Dio.netty.allocator.maxOrder: {}", DEFAULT_MAX_ORDER, maxOrderFallbackCause);
logger.debug("-Dio.net5.allocator.maxOrder: {}", DEFAULT_MAX_ORDER, maxOrderFallbackCause);
}
logger.debug("-Dio.netty.allocator.chunkSize: {}", DEFAULT_PAGE_SIZE << DEFAULT_MAX_ORDER);
logger.debug("-Dio.netty.allocator.smallCacheSize: {}", DEFAULT_SMALL_CACHE_SIZE);
logger.debug("-Dio.netty.allocator.normalCacheSize: {}", DEFAULT_NORMAL_CACHE_SIZE);
logger.debug("-Dio.netty.allocator.maxCachedBufferCapacity: {}", DEFAULT_MAX_CACHED_BUFFER_CAPACITY);
logger.debug("-Dio.netty.allocator.cacheTrimInterval: {}", DEFAULT_CACHE_TRIM_INTERVAL);
logger.debug("-Dio.netty.allocator.cacheTrimIntervalMillis: {}", DEFAULT_CACHE_TRIM_INTERVAL_MILLIS);
logger.debug("-Dio.netty.allocator.useCacheForAllThreads: {}", DEFAULT_USE_CACHE_FOR_ALL_THREADS);
logger.debug("-Dio.netty.allocator.maxCachedByteBuffersPerChunk: {}",
logger.debug("-Dio.net5.allocator.chunkSize: {}", DEFAULT_PAGE_SIZE << DEFAULT_MAX_ORDER);
logger.debug("-Dio.net5.allocator.smallCacheSize: {}", DEFAULT_SMALL_CACHE_SIZE);
logger.debug("-Dio.net5.allocator.normalCacheSize: {}", DEFAULT_NORMAL_CACHE_SIZE);
logger.debug("-Dio.net5.allocator.maxCachedBufferCapacity: {}", DEFAULT_MAX_CACHED_BUFFER_CAPACITY);
logger.debug("-Dio.net5.allocator.cacheTrimInterval: {}", DEFAULT_CACHE_TRIM_INTERVAL);
logger.debug("-Dio.net5.allocator.cacheTrimIntervalMillis: {}", DEFAULT_CACHE_TRIM_INTERVAL_MILLIS);
logger.debug("-Dio.net5.allocator.useCacheForAllThreads: {}", DEFAULT_USE_CACHE_FOR_ALL_THREADS);
logger.debug("-Dio.net5.allocator.maxCachedByteBuffersPerChunk: {}",
DEFAULT_MAX_CACHED_BYTEBUFFERS_PER_CHUNK);
}
}
@ -384,42 +384,42 @@ public class PooledByteBufAllocator extends AbstractByteBufAllocator implements
}
/**
* Default number of heap arenas - System Property: io.netty.allocator.numHeapArenas - default 2 * cores
* Default number of heap arenas - System Property: io.net5.allocator.numHeapArenas - default 2 * cores
*/
public static int defaultNumHeapArena() {
return DEFAULT_NUM_HEAP_ARENA;
}
/**
* Default number of direct arenas - System Property: io.netty.allocator.numDirectArenas - default 2 * cores
* Default number of direct arenas - System Property: io.net5.allocator.numDirectArenas - default 2 * cores
*/
public static int defaultNumDirectArena() {
return DEFAULT_NUM_DIRECT_ARENA;
}
/**
* Default buffer page size - System Property: io.netty.allocator.pageSize - default 8192
* Default buffer page size - System Property: io.net5.allocator.pageSize - default 8192
*/
public static int defaultPageSize() {
return DEFAULT_PAGE_SIZE;
}
/**
* Default maximum order - System Property: io.netty.allocator.maxOrder - default 11
* Default maximum order - System Property: io.net5.allocator.maxOrder - default 11
*/
public static int defaultMaxOrder() {
return DEFAULT_MAX_ORDER;
}
/**
* Default thread caching behavior - System Property: io.netty.allocator.useCacheForAllThreads - default true
* Default thread caching behavior - System Property: io.net5.allocator.useCacheForAllThreads - default true
*/
public static boolean defaultUseCacheForAllThreads() {
return DEFAULT_USE_CACHE_FOR_ALL_THREADS;
}
/**
* Default prefer direct - System Property: io.netty.noPreferDirect - default false
* Default prefer direct - System Property: io.net5.noPreferDirect - default false
*/
public static boolean defaultPreferDirect() {
return PlatformDependent.directBufferPreferred();
@ -436,14 +436,14 @@ public class PooledByteBufAllocator extends AbstractByteBufAllocator implements
}
/**
* Default small cache size - System Property: io.netty.allocator.smallCacheSize - default 256
* Default small cache size - System Property: io.net5.allocator.smallCacheSize - default 256
*/
public static int defaultSmallCacheSize() {
return DEFAULT_SMALL_CACHE_SIZE;
}
/**
* Default normal cache size - System Property: io.netty.allocator.normalCacheSize - default 64
* Default normal cache size - System Property: io.net5.allocator.normalCacheSize - default 64
*/
public static int defaultNormalCacheSize() {
return DEFAULT_NORMAL_CACHE_SIZE;
@ -658,6 +658,40 @@ public class PooledByteBufAllocator extends AbstractByteBufAllocator implements
return used;
}
/**
* Returns the number of bytes of heap memory that is currently pinned to heap buffers allocated by a
* {@link ByteBufAllocator}, or {@code -1} if unknown.
* A buffer can pin more memory than its {@linkplain ByteBuf#capacity() capacity} might indicate,
* due to implementation details of the allocator.
*/
public final long pinnedHeapMemory() {
return pinnedMemory(heapArenas);
}
/**
* Returns the number of bytes of direct memory that is currently pinned to direct buffers allocated by a
* {@link ByteBufAllocator}, or {@code -1} if unknown.
* A buffer can pin more memory than its {@linkplain ByteBuf#capacity() capacity} might indicate,
* due to implementation details of the allocator.
*/
public final long pinnedDirectMemory() {
return pinnedMemory(directArenas);
}
private static long pinnedMemory(PoolArena<?>[] arenas) {
if (arenas == null) {
return -1;
}
long used = 0;
for (PoolArena<?> arena : arenas) {
used += arena.numPinnedBytes();
if (used < 0) {
return Long.MAX_VALUE;
}
}
return used;
}
final PoolThreadCache threadCache() {
PoolThreadCache cache = threadCache.get();
assert cache != null;

View File

@ -13,9 +13,9 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import io.netty.util.internal.StringUtil;
import io.net5.util.internal.StringUtil;
import java.util.List;

View File

@ -14,10 +14,10 @@
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import io.netty.util.internal.ObjectPool;
import io.netty.util.internal.ObjectPool.Handle;
import io.net5.util.internal.ObjectPool;
import io.net5.util.internal.ObjectPool.Handle;
import java.io.IOException;
import java.io.InputStream;

View File

@ -14,11 +14,11 @@
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import io.netty.util.ByteProcessor;
import io.netty.util.internal.ObjectPool;
import io.netty.util.internal.ObjectPool.Handle;
import io.net5.util.ByteProcessor;
import io.net5.util.internal.ObjectPool;
import io.net5.util.internal.ObjectPool.Handle;
import java.io.IOException;
import java.io.InputStream;

View File

@ -12,11 +12,11 @@
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import io.netty.util.internal.ObjectPool;
import io.netty.util.internal.ObjectPool.Handle;
import io.netty.util.internal.PlatformDependent;
import io.net5.util.internal.ObjectPool;
import io.net5.util.internal.ObjectPool.Handle;
import io.net5.util.internal.PlatformDependent;
import java.io.IOException;
import java.io.InputStream;

View File

@ -14,11 +14,11 @@
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import io.netty.util.ByteProcessor;
import io.netty.util.internal.ObjectPool;
import io.netty.util.internal.ObjectPool.Handle;
import io.net5.util.ByteProcessor;
import io.net5.util.internal.ObjectPool;
import io.net5.util.internal.ObjectPool.Handle;
import java.io.IOException;
import java.io.InputStream;
@ -28,7 +28,7 @@ import java.nio.channels.FileChannel;
import java.nio.channels.GatheringByteChannel;
import java.nio.channels.ScatteringByteChannel;
import static io.netty.buffer.AbstractUnpooledSlicedByteBuf.checkSliceOutOfBounds;
import static io.net5.buffer.AbstractUnpooledSlicedByteBuf.checkSliceOutOfBounds;
final class PooledSlicedByteBuf extends AbstractPooledDerivedByteBuf {

View File

@ -14,11 +14,11 @@
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import io.netty.util.internal.ObjectPool;
import io.netty.util.internal.ObjectPool.Handle;
import io.netty.util.internal.PlatformDependent;
import io.net5.util.internal.ObjectPool;
import io.net5.util.internal.ObjectPool.Handle;
import io.net5.util.internal.PlatformDependent;
import java.io.IOException;
import java.io.InputStream;

View File

@ -13,11 +13,11 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import io.netty.util.internal.ObjectPool;
import io.netty.util.internal.ObjectPool.Handle;
import io.netty.util.internal.PlatformDependent;
import io.net5.util.internal.ObjectPool;
import io.net5.util.internal.ObjectPool.Handle;
import io.net5.util.internal.PlatformDependent;
final class PooledUnsafeHeapByteBuf extends PooledHeapByteBuf {

View File

@ -13,9 +13,9 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import io.netty.util.ByteProcessor;
import io.net5.util.ByteProcessor;
import java.io.IOException;
import java.io.InputStream;

View File

@ -13,9 +13,9 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import io.netty.util.internal.StringUtil;
import io.net5.util.internal.StringUtil;
import java.io.IOException;
import java.io.InputStream;

View File

@ -13,14 +13,14 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import static java.util.Objects.requireNonNull;
import java.nio.ByteBuffer;
import io.netty.util.internal.PlatformDependent;
import io.net5.util.internal.PlatformDependent;
/**

View File

@ -14,12 +14,12 @@
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import static java.util.Objects.requireNonNull;
import io.netty.util.ResourceLeakDetector;
import io.netty.util.ResourceLeakTracker;
import io.net5.util.ResourceLeakDetector;
import io.net5.util.ResourceLeakTracker;
import java.nio.ByteOrder;

View File

@ -13,11 +13,11 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import static java.util.Objects.requireNonNull;
import io.netty.util.ResourceLeakTracker;
import io.net5.util.ResourceLeakTracker;
import java.nio.ByteOrder;

View File

@ -13,9 +13,9 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import static io.netty.buffer.PoolThreadCache.*;
import static io.net5.buffer.PoolThreadCache.*;
/**
* SizeClasses requires {@code pageShifts} to be defined prior to inclusion,

View File

@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
/**
* Expose metrics for an SizeClasses.

View File

@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
/**
* A derived buffer which exposes its parent's sub-region only. It is

View File

@ -13,11 +13,11 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import static java.util.Objects.requireNonNull;
import io.netty.util.ByteProcessor;
import io.net5.util.ByteProcessor;
import java.io.IOException;
import java.io.InputStream;

View File

@ -13,13 +13,13 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import static java.util.Objects.requireNonNull;
import io.netty.buffer.CompositeByteBuf.ByteWrapper;
import io.netty.util.CharsetUtil;
import io.netty.util.internal.PlatformDependent;
import io.net5.buffer.CompositeByteBuf.ByteWrapper;
import io.net5.util.CharsetUtil;
import io.net5.util.internal.PlatformDependent;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
@ -36,7 +36,7 @@ import java.util.Arrays;
* This classes is intended to be used with Java 5 static import statement:
*
* <pre>
* import static io.netty.buffer.{@link Unpooled}.*;
* import static io.net5.buffer.{@link Unpooled}.*;
*
* {@link ByteBuf} heapBuffer = buffer(128);
* {@link ByteBuf} directBuffer = directBuffer(256);

View File

@ -13,10 +13,10 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import io.netty.util.internal.PlatformDependent;
import io.netty.util.internal.StringUtil;
import io.net5.util.internal.PlatformDependent;
import io.net5.util.internal.StringUtil;
import java.nio.ByteBuffer;
import java.util.concurrent.atomic.LongAdder;

View File

@ -13,12 +13,12 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import static io.netty.util.internal.ObjectUtil.checkPositiveOrZero;
import static io.net5.util.internal.ObjectUtil.checkPositiveOrZero;
import static java.util.Objects.requireNonNull;
import io.netty.util.internal.PlatformDependent;
import io.net5.util.internal.PlatformDependent;
import java.io.IOException;
import java.io.InputStream;

View File

@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
/**
* {@link DuplicatedByteBuf} implementation that can do optimizations because it knows the duplicated buffer

View File

@ -13,12 +13,12 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import static java.util.Objects.requireNonNull;
import io.netty.util.internal.EmptyArrays;
import io.netty.util.internal.PlatformDependent;
import io.net5.util.internal.EmptyArrays;
import io.net5.util.internal.PlatformDependent;
import java.io.IOException;
import java.io.InputStream;

View File

@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
/**
* A special {@link AbstractUnpooledSlicedByteBuf} that can make optimizations because it knows the sliced buffer is of

View File

@ -13,9 +13,9 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import io.netty.util.internal.PlatformDependent;
import io.net5.util.internal.PlatformDependent;
import java.io.IOException;
import java.io.InputStream;

View File

@ -13,9 +13,9 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import io.netty.util.internal.PlatformDependent;
import io.net5.util.internal.PlatformDependent;
/**
* Big endian Java heap buffer implementation. It is recommended to use

View File

@ -13,9 +13,9 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import io.netty.util.internal.PlatformDependent;
import io.net5.util.internal.PlatformDependent;
import java.nio.ByteBuffer;

View File

@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import static java.util.Objects.requireNonNull;

View File

@ -13,9 +13,9 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import io.netty.util.internal.PlatformDependent;
import io.net5.util.internal.PlatformDependent;
import java.io.IOException;
import java.io.InputStream;
@ -24,8 +24,8 @@ import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException;
import static io.netty.util.internal.MathUtil.isOutOfBounds;
import static io.netty.util.internal.PlatformDependent.BIG_ENDIAN_NATIVE_ORDER;
import static io.net5.util.internal.MathUtil.isOutOfBounds;
import static io.net5.util.internal.PlatformDependent.BIG_ENDIAN_NATIVE_ORDER;
import static java.util.Objects.requireNonNull;
/**

View File

@ -14,9 +14,9 @@
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import io.netty.util.internal.PlatformDependent;
import io.net5.util.internal.PlatformDependent;
/**
* Special {@link SwappedByteBuf} for {@link ByteBuf}s that are backed by a {@code memoryAddress}.

View File

@ -14,9 +14,9 @@
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import io.netty.util.internal.PlatformDependent;
import io.net5.util.internal.PlatformDependent;
/**
* Special {@link SwappedByteBuf} for {@link ByteBuf}s that use unsafe to access the byte array.

View File

@ -14,12 +14,12 @@
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import static java.util.Objects.requireNonNull;
import io.netty.util.ByteProcessor;
import io.netty.util.internal.StringUtil;
import io.net5.util.ByteProcessor;
import io.net5.util.internal.StringUtil;
import java.io.IOException;
import java.io.InputStream;

View File

@ -13,9 +13,9 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import io.netty.util.ByteProcessor;
import io.net5.util.ByteProcessor;
import java.io.IOException;
import java.io.InputStream;

View File

@ -13,9 +13,9 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
package io.net5.buffer;
import io.netty.util.internal.PlatformDependent;
import io.net5.util.internal.PlatformDependent;
import java.nio.ByteBuffer;

View File

@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer.api;
package io.net5.buffer.api;
/**
* An object used by {@linkplain BufferAllocator buffer allocators} to communicate desirable properties of an

View File

@ -13,9 +13,9 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer.api;
package io.net5.buffer.api;
import io.netty.util.internal.UnstableApi;
import io.net5.util.internal.UnstableApi;
/**
* Methods for accessing and controlling the internals of an allocator.

View File

@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer.api;
package io.net5.buffer.api;
import java.nio.ByteBuffer;
@ -172,12 +172,6 @@ public interface Buffer extends Resource<Buffer>, BufferAccessor {
*/
Buffer fill(byte value);
/**
* Gives the native memory address backing this buffer, or return 0 if this buffer has no native memory address.
* @return The native memory address, if any, otherwise 0.
*/
long nativeAddress();
/**
* Makes this buffer read-only. This is irreversible.
* This operation is also idempotent, so calling this method multiple times on the same buffer makes no difference.

View File

@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer.api;
package io.net5.buffer.api;
/**
* This interface is just the primitive data accessor methods that {@link Buffer} exposes.

View File

@ -13,9 +13,9 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer.api;
package io.net5.buffer.api;
import io.netty.buffer.api.pool.PooledBufferAllocator;
import io.net5.buffer.api.pool.PooledBufferAllocator;
import java.util.function.Supplier;
@ -25,8 +25,9 @@ import java.util.function.Supplier;
public interface BufferAllocator extends AutoCloseable {
/**
* Produces a {@link BufferAllocator} that allocates unpooled, on-heap buffers.
* On-heap buffers have a {@code byte[]} internally, and their {@linkplain Buffer#nativeAddress() native address}
* is zero.
* On-heap buffers have a {@code byte[]} internally, and their
* {@linkplain ReadableComponent#readableNativeAddress() readable} and
* {@linkplain WritableComponent#writableNativeAddress() writable} native addresses are zero.
* <p>
* The concrete {@link Buffer} implementation is chosen by {@link MemoryManager#instance()}.
*
@ -39,7 +40,8 @@ public interface BufferAllocator extends AutoCloseable {
/**
* Produces a {@link BufferAllocator} that allocates unpooled, off-heap buffers.
* Off-heap buffers a native memory pointer internally, which can be obtained from their
* {@linkplain Buffer#nativeAddress() native address method.
* {@linkplain ReadableComponent#readableNativeAddress() readable} and
* {@linkplain WritableComponent#writableNativeAddress() writable} native address methods.
* <p>
* The concrete {@link Buffer} implementation is chosen by {@link MemoryManager#instance()}.
*
@ -51,8 +53,9 @@ public interface BufferAllocator extends AutoCloseable {
/**
* Produces a pooling {@link BufferAllocator} that allocates and recycles on-heap buffers.
* On-heap buffers have a {@code byte[]} internally, and their {@linkplain Buffer#nativeAddress() native address}
* is zero.
* On-heap buffers have a {@code byte[]} internally, and their
* {@linkplain ReadableComponent#readableNativeAddress() readable} and
* {@linkplain WritableComponent#writableNativeAddress() writable} native addresses are zero.
* <p>
* The concrete {@link Buffer} implementation is chosen by {@link MemoryManager#instance()}.
*
@ -65,7 +68,8 @@ public interface BufferAllocator extends AutoCloseable {
/**
* Produces a pooling {@link BufferAllocator} that allocates and recycles off-heap buffers.
* Off-heap buffers a native memory pointer internally, which can be obtained from their
* {@linkplain Buffer#nativeAddress() native address method.
* {@linkplain ReadableComponent#readableNativeAddress() readable} and
* {@linkplain WritableComponent#writableNativeAddress() writable} native address methods.
* <p>
* The concrete {@link Buffer} implementation is chosen by {@link MemoryManager#instance()}.
*

View File

@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer.api;
package io.net5.buffer.api;
/**
* An exception thrown when an operation is attempted on a {@link Buffer} when it has been closed.

View File

@ -13,10 +13,10 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer.api;
package io.net5.buffer.api;
import io.netty.buffer.api.internal.ResourceSupport;
import io.netty.buffer.api.internal.Statics;
import io.net5.buffer.api.internal.ResourceSupport;
import io.net5.buffer.api.internal.Statics;
import java.lang.invoke.VarHandle;
import java.util.Objects;

View File

@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer.api;
package io.net5.buffer.api;
/**
* An exception thrown when an operation is attempted on a {@linkplain Buffer#readOnly() read-only} {@link Buffer}.

View File

@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer.api;
package io.net5.buffer.api;
import java.lang.invoke.VarHandle;

View File

@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer.api;
package io.net5.buffer.api;
import java.nio.ByteBuffer;
@ -76,11 +76,6 @@ public class BufferStub implements Buffer {
return delegate.fill(value);
}
@Override
public long nativeAddress() {
return delegate.nativeAddress();
}
@Override
public Buffer makeReadOnly() {
return delegate.makeReadOnly();

View File

@ -12,9 +12,9 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package io.netty.buffer.api;
package io.net5.buffer.api;
import io.netty.util.ByteProcessor;
import io.net5.util.ByteProcessor;
/**
* The ByteCursor scans through a sequence of bytes.

Some files were not shown because too many files have changed in this diff Show More