google / caliper

Micro-benchmarking library for Java
Apache License 2.0
816 stars 109 forks source link

Moe Sync #391

Closed ronshapiro closed 6 years ago

ronshapiro commented 6 years ago

This code has been reviewed and submitted internally. Feel free to discuss on the PR and we can submit follow-up changes as necessary.

Commits:

Change ServerSocketService to provide a way of receiving a connection as a simple InputStream rather than as an OpenedSocket (which is for serialized object based communication). As part of this, change the UUID associated with each socket connection to be sent as raw bytes rather than as a serialized Java object so that connections can be established without either end needing to create an ObjectInputStream or ObjectOutputStream. 2e0da16a5ac22a092d772abccebc97e7b50cf9d0 -------

Change OpenedSocket.Writer.write(Object) to automatically flush after writing since every single place write() was called was immediately followed by flush(), several times with a comment about how that was necessary to prevent deadlock. Also make it accept varargs and write each object so it works with the one place that was writing multiple objects before flushing. 7c82fc07ed7d382cd07b383c71872629ad98b5d6