Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-9096

Improve ByteBuffer compression interface

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 2.2.0 rc1
    • None

    Description

      Now that we have a few uses of compression/decompression on ByteBuffers it is time to finalize the interface before it becomes set in stone with 2.2. The current code has some shortcomings:

      • The interface uses the buffers' positions and limits instead of accepting offset and length as parameters. This necessitates that the buffers be duplicated before they can be compressed for thread-safety, something that adds burden to the caller, is prone to being forgotten, and we could generally do without for performance.
      • The direct/non-direct buffer support needs to be more clearly defined. The current useDirectOutputByteBuffers is not named well.
      • If we don't want to support non-direct buffers everywhere as a fallback, we should clearly state the decision and rationale.
      • How should WrappedByteBuffer treat direct/indirect buffers?
      • More testing is necessary as e.g. errors in DeflateCompressor were only caught in CASSANDRA-6809.

      Attachments

        1. 9096-tests.tar.gz
          100 kB
          Alan Boudreault

        Issue Links

          Activity

            People

              blambov Branimir Lambov
              blambov Branimir Lambov
              Branimir Lambov
              Joshua McKenzie
              Alan Boudreault Alan Boudreault
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: