Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-3854

allow users to clear read buffers

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 0.11.0
    • Java - Library
    • None
    • Patch Available
    • Patch

    Description

      My use case (which I believe many others would share):

      • I have a large number of Thrift connections in a connection pool
      • Upon return of the used connection to the pool I would like to eagerly clean up the read buffer because I know it will not be used again until the connection is checked out and a new read puts a new buffer in its place.
      • Eagerly clearing the read buffers of idle connections saves a considerable amount of heap memory in my application, vs. having all of the idle connections keep all of their read buffers allocated.
      • Currently, it looks like someone thought about this and there is a TMemoryInputTransport#clear() , but it isn't callable from people with a TFramedTransport which uses a TMemoryInputTransport for its read buffer (unless you count doing gross and brittle reflection magic).

      I've included a patch, but I'm very flexible / open to opinions of how someone more familiar to this project would want to implement a feature like this.

      Attachments

        Activity

          People

            jking3 James E. King III
            clockfort Chris Lockfort
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: