Skip to content

Commit

Permalink
Tx frame fragments (#189) (#194)
Browse files Browse the repository at this point in the history
* Tx frame fragments (#189)

* partially done migration to tx-frame

* wip

* it does not work

* some fixes

* fix log level

* refactor write responsibility into the objects that are Writeable

* fix javadoc

* make classes final

* refactor Writeable interface, refactor RelpWriteImpl

* exit RelpWriteImpl on error

* make ManualPerformanceTest work again

* remove unnecessary copying of txn

* Revert "remove unnecessary copying of txn"

This reverts commit 19b312f.

* contains broken code, but improves performance, fixes later

* sync on 2024-06-03

* sync 2024-06-11

* more sync

* more buffer arrays

* remove obsolete TODO messages, increment PoolingDelegateTest delay

* move Writable and it's Decrations to package com.teragrep.rlp_03.channel.buffer.writable;

* add reporting capability for outstanding writes

* add todo for read not to throw on error but just to close the connection

* add outstanding() to RelpWriteFake

* reading refactor

* rename BufferLease isRefCountZero -> isTerminated

* remove unused BufferPool argument from Leaseful implementations

* fix BufferLease

* refactor Supplier<FrameDelegate> into ClockFactory

* Fixes javadoc issues

---------

Co-authored-by: StrongestNumber9 <16169054+StrongestNumber9@users.noreply.github.com>

* Adds maven enforcer and jacoco (#195)

* fix swapped arguments in com.teragrep.rlp_03.frame.delegate.event.RelpEventServerClose, which did not appear in tests because payload is zero length (#200)

* implement a fix for 198 (#201)

* implement a fix for 198

* clarify errors when NeedsReadException or NeedsWriteException interest op changes throw unexpectedly

* move  lock.unlock(); before debug logging in RelpReadImpl finally statement to avoid exception from logger causing lock to be left behind (#202)

* rename RelpRead to Ingress and RelpWrite to Egress (#203)

* rename RelpRead to Ingress and RelpWrite to Egress

* rename method relpWrite() to egress() in EstablishedContext

* net_01 restructuring (#204)

* re-structure networking code from rlp_03 package to net_01 package

* apply spotless

* extract common client code to EstablishedContextFactory (#205)

* extract common client code to EstablishedContextFactory

* avoid returning null on error in RelpClientFactory in case establishedContextFactory throws one

* fix exception type in RelpClientFactory from RuntimeException to CompletionException

* uncomment logging statements (#207)

* Adds dynamic properties based RelpEventOpen version string (#208)

* Adds dynamic properties based RelpEventOpen version string

* make version an object

* rename tag -> version, as it is in the properties

---------

Co-authored-by: Motoko Kusanagi <kordex@gmail.com>

* ingress interested (#209)

* ingress interested

* fix typo

* move register(clock) out from EstablishedContextImpl constructor

* allow Clock to re-register into a connection

* add note about Clock's responsibility to read all data

* add note about Clock's responsibility to read all data

* fix thread safety of IngressImpl register(clock) and unregister(clock)

* clarify exception messages, remove obsolete TODO

* apply spotless

* implement workaround for EstablishedContextStub being closed (#210)

* move com.teragrep.net_01.channel.context.frame; to com.teragrep.rlp_0… (#213)

* move com.teragrep.net_01.channel.context.frame; to com.teragrep.rlp_03.frame;

* apply spotless

* Removes net_01 files (#214)

* Removes IngressFake (#215)

* Should fix ReadmeTest (#216)

---------

Co-authored-by: Mikko Kortelainen <kortemik@users.noreply.github.com>
Co-authored-by: Motoko Kusanagi <kordex@gmail.com>
  • Loading branch information
3 people authored Jun 27, 2024
1 parent eddf804 commit cd0cd20
Show file tree
Hide file tree
Showing 111 changed files with 877 additions and 4,983 deletions.
17 changes: 9 additions & 8 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Current
</project>
----

NOTE: See https://github.com/teragrep/rlp_01[rlp_01] for relp client
NOTE: See https://github.com/teragrep/rlp_01[rlp_01] for relp relpClient

NOTE: See https://github.com/teragrep/rlo_06[rlo_06] for syslog decoding

Expand All @@ -51,7 +51,7 @@ Dependencies for examples
<artifactId>rlp_03</artifactId>
<version>${see_latest_at_github}</version>
</dependency>
<!-- rlp_01 for relp-client -->
<!-- rlp_01 for relp-relpClient -->
<dependency>
<groupId>com.teragrep</groupId>
<artifactId>rlp_01</artifactId>
Expand All @@ -61,19 +61,19 @@ Dependencies for examples
</project>
----

Server with shared handler for all connections. See ExampleRelpClient.java for client.
Server with shared handler for all connections. See ExampleRelpClient.java for relpClient.

[source,java]
----
package com.teragrep.rlp_03.readme;
import com.teragrep.rlp_03.eventloop.EventLoop;
import com.teragrep.rlp_03.eventloop.EventLoopFactory;
import com.teragrep.net_01.eventloop.EventLoop;
import com.teragrep.net_01.eventloop.EventLoopFactory;
import com.teragrep.rlp_03.frame.delegate.DefaultFrameDelegate;
import com.teragrep.rlp_03.frame.delegate.FrameContext;
import com.teragrep.rlp_03.frame.delegate.FrameDelegate;
import com.teragrep.rlp_03.server.ServerFactory;
import com.teragrep.rlp_03.channel.socket.PlainFactory;
import com.teragrep.net_01.server.ServerFactory;
import com.teragrep.net_01.channel.socket.PlainFactory;
import org.junit.jupiter.api.Test;
import java.io.IOException;
Expand Down Expand Up @@ -110,6 +110,7 @@ public class ReadmeTest {
* New instance of the frameDelegate is provided for every connection
*/
Supplier<FrameDelegate> frameDelegateSupplier = new Supplier<FrameDelegate>() {
@Override
public FrameDelegate get() {
System.out.println("Providing frameDelegate for a connection");
Expand Down Expand Up @@ -142,7 +143,7 @@ public class ReadmeTest {
eventLoop,
executorService,
new PlainFactory(),
frameDelegateSupplier
new FrameDelegationClockFactory(frameDelegateSupplier)
);
try {
Expand Down
59 changes: 59 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
<sha1></sha1>
</properties>
<dependencies>
<dependency>
<groupId>com.teragrep</groupId>
<artifactId>net_01</artifactId>
<version>1.0.1</version>
</dependency>
<!-- slf4j -->
<dependency>
<groupId>org.slf4j</groupId>
Expand Down Expand Up @@ -114,7 +119,59 @@
<build>
<directory>${project.basedir}/target</directory>
<finalName>rlp_03</finalName>
<resources>
<resource>
<filtering>true</filtering>
<directory>src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.4.1</version>
<executions>
<execution>
<id>enforce-maven</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>3.2.5</version>
</requireMavenVersion>
<requireJavaVersion>
<version>1.8</version>
</requireJavaVersion>
</rules>
</configuration>
</execution>
<execution>
<id>enforce</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.12</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<goals>
<goal>report</goal>
</goals>
<phase>prepare-package</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
Expand Down Expand Up @@ -203,6 +260,8 @@
<!-- misc scripts -->
<exclude>src/test/resources/tls/create-certs.sh</exclude>
<exclude>test.sh</exclude>
<!-- properties file -->
<exclude>src/main/resources/**</exclude>
</excludes>
</configuration>
<executions>
Expand Down

This file was deleted.

89 changes: 0 additions & 89 deletions src/main/java/com/teragrep/rlp_03/channel/buffer/BufferLease.java

This file was deleted.

Loading

0 comments on commit cd0cd20

Please sign in to comment.