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

Cleanup conversions between bytes and strings

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Low
    • Resolution: Fixed
    • Fix Version/s: 0.7.5
    • Component/s: None
    • Labels:
      None
    • Severity:
      Low

      Description

      There is a bit of inconsistency in our conversions between ByteBuffers and Strings.
      For instance, ByteBufferUtil.string() uses as a default the java default charset, while ByteBufferUtil.bytes(String) assumes UTF8. Moreover, a number of places in the code don't use those functions and uses getBytes() directly. There again, we often encode with the default charset but decode in UTF8 or the contrary.

      Using the default charset is probably a bad idea anyway, since this depends on the actual system the node is running on and could lead to a stupid bug when running in heterogeneous systems.

      This ticket proposes to always assume UTF8 all over the place (and tries to use the ByteBufferUtil as much as possible to help with that).

        Attachments

          Activity

            People

            • Assignee:
              slebresne Sylvain Lebresne Assign to me
              Reporter:
              slebresne Sylvain Lebresne
              Authors:
              Sylvain Lebresne
              Reviewers:
              Jonathan Ellis

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 2h
                2h
                Remaining:
                Remaining Estimate - 2h
                2h
                Logged:
                Time Spent - Not Specified
                Not Specified

                  Issue deployment