https://github.com/voldemort/voldemort
Revision 4a87d692990341749ed53a2f0f21204f8234a250 authored by ARUNACHALAM THIRUPATHI on 24 August 2014, 19:58:38 UTC, committed by Arunachalam Thirupathi on 16 April 2015, 00:00:40 UTC
Client either writes/reads from socket, never does them together.
So the buffer can be shared which will bring down the memory requirement
for the client by half.

But the client has to watch for 2 things
1) On Write the buffer expands as necessary. So the buffer needs to be
reinitialized if it grows.
2) On Read, if the buffer can't accomodate it grows as necessary, this
case also needs to be handled.

This works as expected and the unit tests are passing. Will put it
through VPL to measure the efficiency of the fixes.

Created a new class to hold the Buffer reference. This helps to share
the buffer between input and output streams easily. Previously you have
to watch out for places where one buffer moves away from the other and need
to call an explicit method to update it.

Also moved many buffer growing and resetting logic to a common code, so it
is more readable and understandable.

Should I rename the ByteBufferContainer to MutableByteBuffer this fits the
MutableInt pattern nicely where a single int can be shared by multiple classes
and updating one is visible to others.
1 parent 298bdc1
History
Tip revision: 4a87d692990341749ed53a2f0f21204f8234a250 authored by ARUNACHALAM THIRUPATHI on 24 August 2014, 19:58:38 UTC
client sharing read/write buffer
Tip revision: 4a87d69
File Mode Size
.settings
bin
clients
config
contrib
docs
example
gradle
private-lib
public-lib
src
test
voldemort-contrib
.gitignore -rw-r--r-- 242 bytes
CONTRIBUTORS -rw-r--r-- 659 bytes
LICENSE -rw-r--r-- 11.1 KB
NOTES -rw-r--r-- 2.5 KB
NOTICE -rw-r--r-- 8.1 KB
README.md -rw-r--r-- 4.4 KB
build.gradle -rw-r--r-- 19.8 KB
build.xml -rw-r--r-- 22.1 KB
gradle.properties -rw-r--r-- 1.2 KB
gradlew -rwxr-xr-x 5.0 KB
gradlew.bat -rw-r--r-- 2.3 KB
release_notes.txt -rw-r--r-- 41.2 KB
settings.gradle -rw-r--r-- 149 bytes
tomcat-tasks.properties -rw-r--r-- 420 bytes
web.xml -rw-r--r-- 1.1 KB

README.md

back to top