Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor to use scattered reads and reusable buffers (#54)
* tests pass, although it does not mean that this is an RC * it does actually work * change to debug, remove sout * remove MessageWriter.java * re-enable selector wakes after interestOps change * optimize a bit * Reporter for ManualTest to log the records per second * more meaningful messages regarding write errors * slight tuning of error message * support resumed writes, support tls * make sure selector thread does not exit due to cancelledKeyException * add todo * implement FrameProcessorPool * add old tests back, run previous perf test with mvn clean test -DrunServerPerformanceTest=true * enhance SocketPoll.poll to catch CancelledKeyException for accepted keys as well * close context if CancelledKeyException is noticed during poll * implement server.startup.waitForCompletion * resumed writes now supported * null is bad * move comment to proper place * debug-wip-sync * tidy up! * catch those CancelledKeyExceptions * TODO is now done for InterestOpsImpl * log about proper instance in FrameProcessorPool.offer close path * support closure * make FrameProcessor return List<RelpFrameTX> instead of single frame, now close notifications should work move FrameProcessorPool to server class, so it's shared across the connections * better IOException messages in RelpWrite * avoid null, by using Optional, in RelpWrite, not bad as null but still wicked * refactor testing, refactor RelpFrameServerRX to include ConnectionContext * remove obsolete FrameProcessor implementations * make InterestOps final in ConnectionContextImpl * refactor SocketPoll into ServerSocket that produces ServerSocketOpen when listening * stops now correctly * refactor Server into immutable by using ServerFactory * refactor FrameProcessorPool out, it was not adequate place for a pool * make ManualPerformanceTest threads configureable via ServerPerformanceTestThreads * make ManualPerformanceTest log number of threads * make ManualPerformanceTest log number of threads * remove string concat from SocketPoll.poll debug logging * make ManualPerformanceTest port configurable * SafeAccess * some SafeAccess on the FragmentImpl * refactor SafeAccess to Access and Lease, avoid race condition by locking * fix function package functions to work properly with partial buffers * refactor RelpFrame to an interface * refactor RelpFrameAssembly into RelpFrame * make RelpFrameAccess immutable * works, but tests are essential, functions need content validation too! * crude support for partial message * test files * command function does now size check * EndOfTransfer test * improve EndOfTransfer parseTest * PayloadFunctionTest * PayloadLengthFunction tests * TransactionFunction tests * change extra logging to debug or disable * remove TODO for Access * RelpFrameTest testConsecutiveFrames * fix frame functions slice calculation * function max length calculation fixes * comment out extra logging in RelpFrameTest * disable logging in FragmentImpl * add toString into RelpFrameLeaseful * RelpFrameImpl stop parsing of partial buffers when frame complete * wip commit, however it works * ByteBuffer cast to RelpWriteImpl to ensure java version compatibility * default to no error in RelpReadImpl readData * log about throwables in RelpReadImpl * ByteBuffer and Buffer casts to ensure java version compatibility * implement non-proper locking for BufferLeasePool * Make ServerFactory create() public * restore FrameProcessorPool * add size() to Fragment * hardcode maximum command size * proposal for FragmentByteStream * pool locking fixed * create BufferLeasePoolTest * change debug print behind isDebugEnabled guard * move locking into BufferLeaseImpl from BufferLeasePool to assign responsibility of self to BufferLeaseImpl * close BufferLeasePool * add ConnectionStormTest for 10k connections * cleanup LOGGER calls * use Lock instead of Atomic in Access, use volatile isOpen in Lease * use static final fields in functions for reduced init cost * remove empty buffer checks from BufferLeasePool.take(), BufferLeaseImpl takes care of clearing them now * add TODOs about semaphore use * add AccessTest content * add content to FragmentTest --------- Co-authored-by: StrongestNumber9 <[email protected]>
- Loading branch information