cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Ellis (JIRA)" <>
Subject [jira] Commented: (CASSANDRA-1232) is slow and dangerous
Date Wed, 30 Jun 2010 20:35:51 GMT


Jonathan Ellis commented on CASSANDRA-1232:

Stu, we already declare in AbstractType

    public void validate(byte[] bytes)

is that different from what you're thinking of?

> is slow and dangerous
> ----------------------------------------
>                 Key: CASSANDRA-1232
>                 URL:
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Folke Behrens
>            Assignee: Nick Bailey
>             Fix For: 0.6.4
>         Attachments: 0001-Fixes-to-UTF8Type-compare-and-getString-methods.patch
> UTF8Type converts both byte arrays into Strings and then compares them. This is unnecessary
and slow because UTF-8 encoded Strings are already directly comparable. Higher codepoints
yield higher initial and subsequent bytes. One can safely use for UTF-8.
Maybe UTF8Type should be a subclass only overriding getString().
> BTW, It's also dangerous to ignore invalid byte sequences. At this point the byte array
should contain valid UTF-8.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message