[ 
https://issues.apache.org/jira/browse/CASSANDRA-8755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15005267#comment-15005267
 ] 

Robert Stupp commented on CASSANDRA-8755:
-----------------------------------------

Thanks for your work so far! Some comments on your changes:

* the changes in {{CommitLogReplayer}}, {{StorageService}} should use 
{{StringUtils.countMatches}}
* the changes that remove a single char from a string should use 
{{StringUtils.remove(String,char)}}
* you can omit all the changes in the {{tools}} and {{stress}} packages and to 
{{Client}}, {{CQLTester}}, {{Sample}} classes. These are not on a hot path and 
only affect the initialization of these tools or are just used very rarely. 
Just don’t want to change something that buys us basically nothing.
* also prefer not to change the hadoop classes
* the constant {{SLASH}} in {{PropertyFileSnitch}} should be at the beginning 
of the class
* the name {{PATTERN_FINAL_DOLLAR}} in {{CassandraMetricsRegistry}} is incorrect

Generally we require unit tests that ensure the changes work as expected. You 
can use the old code in the unit tests to verify the new production code 
against a bunch of input parameters.

I’ve triggered a CI run against your changes. Unit tests 
([here|http://cassci.datastax.com/job/snazy-8755-testall/]) look good, but some 
dtests failed ([here|http://cassci.datastax.com/job/snazy-8755-dtest/]) (more 
than currently on trunk) - but probably not caused by your patch.

I recommend that you create a separate branch for this change off of trunk. You 
can safely squash these 4 commits into a single one - also the changes 
mentioned above. Having a separate branch also has the advantage that you can 
rebase and/or base on another branch.


> Replace trivial uses of String.replace/replaceAll/split with StringUtils 
> methods
> --------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-8755
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-8755
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Jaroslav Kamenik
>            Priority: Trivial
>              Labels: lhf
>         Attachments: 8755.tar.gz, trunk-8755.patch, trunk-8755.txt
>
>
> There are places in the code where those regex based methods are  used with 
> plain, not regexp, strings, so StringUtils alternatives should be faster.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to