Commit Graph

212 Commits

Author SHA1 Message Date
Chris Vest
c665db6ec7
Merge pull request #51 from netty/composite-buffer
Composite buffer API updates
2021-04-29 11:33:53 +02:00
Chris Vest
e5d55e2a8e Use covariant return types in CompositeBuffer 2021-04-28 12:46:58 +02:00
Chris Vest
6506e29569 Make tests on composite buffers pass again 2021-04-28 12:33:40 +02:00
Chris Vest
e1cc445d11 The CompositeBuffer.compose methods must return CompositeBuffer instead of Buffer 2021-04-28 12:27:03 +02:00
Chris Vest
f2033263dd Replace CompositeBuffer.extendComposite with extendWith 2021-04-27 16:11:30 +02:00
Chris Vest
2f12455fa9 Make CompositeBuffer part of the public API
And move the composite buffer related methods to it.
2021-04-27 16:11:30 +02:00
Chris Vest
86c929dd5a Remove Deref
This abstraction was only used to allow composing over both buffers and sends of buffers, but we can also do that with method overloads.

The Deref had weird semantics and consequences that didn't make much sense.
In other words, it did not pay a return on its complexity cost.
2021-04-27 16:11:30 +02:00
Chris Vest
ec0dbb6b5e
Merge pull request #44 from netty/slice-bifurcate
More docs and examples of slice() and bifurcate()
2021-04-27 16:10:55 +02:00
Chris Vest
0db6a745dc Always attach test results to PR builds
Previously the test results were only attached to passing builds, which is, like, the opposite of useful.

Also finally figured out how to nerf the local docker layer cache.
Recorded this new knowledge as make commands.
2021-04-27 15:06:43 +02:00
Chris Vest
49deb77fd3 Allow running AlternativeMessageDecoderTest from Maven 2021-04-27 14:09:27 +02:00
Chris Vest
25b234acd2 Make the BufferBulkAccessTest.writeBytesMustTransferDataAndUpdateOffsets test run faster
Only run a sample of 10% of the possible combinations, and then run them in parallel.
2021-04-27 13:33:28 +02:00
Chris Vest
2fc3666077 Remove deprecated maven build option from docker build 2021-04-27 10:09:40 +02:00
Chris Vest
60954394a5 Use Send.isSendOf to simplify code 2021-04-27 10:03:24 +02:00
Chris Vest
926a1807b4 Clean up code and remove the BufferAdaptor
Instead use Mockito to implement the throwing behaviour on the buffers in those tests.
Sadly Mockito cannot spy or mock our Buffer implementation classes, and does not allow mocking an interface while spying on an implementation, so we have to do a more complicated dance with our mocking.
2021-04-27 10:00:27 +02:00
Chris Vest
c09276373e Fix prose errors 2021-04-27 10:00:27 +02:00
Chris Vest
8c2987a824 Add a Buffer.writeBytes bulk transfer method
This simplifies some of the ByteToMessageDecoder example code.
2021-04-27 10:00:27 +02:00
Chris Vest
d72982a5ef Fix checkstyle issue 2021-04-27 10:00:27 +02:00
Chris Vest
0748d206d2 Add an alternative message decoder implementation
This one is a rewrite, making use of the new APIs where possible.
The test uses bifurcate to cut buffers into segments.
2021-04-27 10:00:27 +02:00
Chris Vest
c081c73885 Port over the ByteToMessageDecoder as an example 2021-04-27 10:00:27 +02:00
Chris Vest
7775460984 Make bifurcate and ensureWritable more flexible
This supports more use cases.
The ensureWritable method can now amortise its allocation cost by allocating more than what is strictly necessary to satisfy the immediate call.
The bifurcate method can now split at a given offset.
2021-04-27 10:00:27 +02:00
Chris Vest
a2d49fed3e Bring slice and bifurcate methods together
They are conceptually related.
2021-04-27 10:00:27 +02:00
Chris Vest
7ac7655e87
Merge pull request #49 from netty/send-instanceof
Rename Deref.isInstanceOf to referentIsInstanceOf
2021-04-27 09:59:27 +02:00
Chris Vest
2decac081a Rename Deref.isInstanceOf to referentIsInstanceOf
Motivation:
Derefs are not necessarily their referents.
This is the case for Send, for instance.

Modification:
The Deref.isInstanceOf method is renamed to referentIsInstanceOf.
And a Send.isSendOf method has been added, that simplifies the check for sends, since it could be the case that one also needs to check if the object in question is also a Send instance.

Result:
Cleaner code that is easier to read, when working with Sends.

This fixes https://github.com/netty/netty-incubator-buffer-api/issues/46
2021-04-26 18:33:52 +02:00
Chris Vest
b541a20b4c
Merge pull request #50 from netty/panama-update
Update APIs with the latest project-panama changes
2021-04-26 18:33:14 +02:00
Chris Vest
ca864c9af4 Only upload the artifacts in the target directory
This makes failed builds complete a lot faster, but we won't have the OpenJDK or Netty files for failed builds.
2021-04-26 17:27:31 +02:00
Chris Vest
b396252682 Update APIs with the latest project-panama changes 2021-04-26 17:08:40 +02:00
Chris Vest
9c87dc8208
Merge pull request #43 from netty/build-test-reports
Add a build step that uploads surefire test reports
2021-04-14 13:42:45 +02:00
Chris Vest
220bbe816b
Merge pull request #39 from netty/unsafe-impl
UnsafeBuffer implementation, based on sun.misc.Unsafe
2021-04-14 12:39:27 +02:00
Chris Vest
4ddd194b91 Add a build step that uploads surefire test reports
Motivation:
When a build fails, the number one priority is figuring out why.
Having surefire test reports readily available on the Github Actions page will make this easier.

Modification:
Add a build step that uploads surefire test reports and attaches them as a check to the PR.

Result:
Easier to diagnose test failures on PRs.
2021-04-14 12:11:14 +02:00
Chris Vest
fdc59cc43c Break up the monolithic BufferTest into multiple test classes
Then run those tests in independent surefire forks.
This should allow Maven to hold on to less test metadata, and cope better with the large number of tests.
2021-04-14 11:44:58 +02:00
Chris Vest
55348fb660 Give more memory to surefire when running the full test suite
There are so many tests now that their metadata takes up a considerable amount of memory.
2021-04-13 15:18:14 +02:00
Chris Vest
26f8bae997 Capture full container output on build failures 2021-04-09 10:15:00 +02:00
Chris Vest
99efb7dab9 Fix compilation error after rebase 2021-04-08 21:10:17 +02:00
Chris Vest
4ed2c59e39 Revert: Try being less edgy with the Fedora image
It seems to be an upstream compilation error in OpenJDK.
2021-04-08 14:44:58 +02:00
Chris Vest
42e05771dd Try being less edgy with the Fedora image 2021-04-08 14:44:58 +02:00
Chris Vest
fd4c051573 Upload whole working directory on build failure
This should help debug JVM crashes.
2021-04-08 14:44:58 +02:00
Chris Vest
fb7279e82f Fix more test failures for UnsafeBuffer 2021-04-08 14:44:58 +02:00
Chris Vest
1fe8abecfa Fix JVM crashes and a number of test failures
Still more test failures left, but getting close now.
2021-04-08 14:44:58 +02:00
Chris Vest
c73dd07384 UnsafeBuffer implementation, based on sun.misc.Unsafe
Motivation:
When Unsafe is available, we can supposedly do certain things faster than when it is not.

Modification:
Add a Buffer implementation that take advantage of sun.misc.Unsafe.
It has not yet been verified if this is faster in any way than, say the ByteBuffer implementation or the MemorySegment implementation.

Result:
Another Buffer implementation that can be used when Unsafe is available.
2021-04-08 14:44:58 +02:00
Chris Vest
e7f7335804
Merge pull request #42 from netty/fix-after-refactoring
Update code to support bleeding edge MemorySegment APIs after the latest refactoring
2021-04-08 14:18:53 +02:00
Chris Vest
a3dfaf535d Fix test sample filtering and disable really slow tests 2021-04-08 11:08:09 +02:00
Chris Vest
7fda986d2c Make CleanerTests faster by reducing iteration count 2021-04-07 17:43:51 +02:00
Chris Vest
987a398700 Fix native memory leak bug
Motivation:
The untethered memory allocated by ensureWritable in a direct MemorySegment based non-pooled Buffer would be allocated without having a Cleaner attached to its ResourceScope.
This could cause that memory to leak if the Buffer instance was cast aside.

Modification:
ManagedBufferAllocator now makes sure to attach a cleaner to the buffer and its memory segment, when allocating untethered memory.

Result:
The BufferTest$CleanerTests now pass.
2021-04-07 17:17:35 +02:00
Chris Vest
ab45a7b053 Fix (some) failing tests
Also introduce test sampling, so when the BufferTest is running from an IDE, only 3% of the tests will actually run.

The Maven build runs all tests.
2021-04-07 16:19:35 +02:00
Chris Vest
513cef1c1e Update code to support bleeding edge MemorySegment APIs after the latest refactoring 2021-04-07 14:28:05 +02:00
Chris Vest
2e162c9ab0
Merge pull request #40 from netty/fix-jdk-branch
Use the memaccess+abi branch of panama-foreign
2021-04-07 11:51:55 +02:00
Chris Vest
da2acfd946 Use the memaccess+abi branch of panama-foreign
Motivation:
The jextract branch is currently suffering from upstream compilation
errors.
And we don't need jextract - memaccess+abi is enough.

Modification:
Avoid checking out the jextract branch of panama by default, and instead
explicitly check out the foreign-memaccess+abi branch when we clone the
JDK.

Result:
Our build should now be able to proceed again.
2021-04-06 16:54:32 +02:00
Chris Vest
3e6eceb58a Make it possible to run all tests in Intellij as well
The previous set-up was only working out for Maven.
2021-03-24 11:21:00 +01:00
Chris Vest
0ed5575fb4 Simplify recovery code for memory segment based buffers 2021-03-19 17:43:05 +01:00
Chris Vest
824d3e0137
Merge pull request #37 from netty/bytebuffer-impl
Add a ByteBuffer based implementation of Buffer
2021-03-19 17:31:10 +01:00