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

Lyuben Todorov commented on CASSANDRA-6157:
-------------------------------------------

+1 on the python set literals {{{'dc1', 'dc2'}}}, we will however have to wrap 
them in quotes to keep snake yaml happy and so end up with {{"{'dc1', 
'dc2'}"}}. This will require some extra parsing on our end to strip the *'* 
however it will allow for spaces in DC names. As for DCs with comma names, 
where we split the parameter supplied we can use regular expressions to only 
split on commas that are outside of the single quotation marks above, eg:

{noformat}
// in cassandra.yaml we have = hinted_handoff_enabled: "{'DC1','DC,2'}"
final String [] dcs = hinted_handoff_enabled.substring(1, 
hinted_handoff_enabled.length() - 1).split(",(?=([^']*'[^']*')*[^']*$)");
for(final String dc : dcs)
{
    System.out.println(" DC  => " + dc);
    hinted_handoff_enabled_by_dc.add(dc.trim());
}

// Output
// DC  => 'DC1'
// DC  => 'DC,2'
{noformat} 

> Selectively Disable hinted handoff for a data center
> ----------------------------------------------------
>
>                 Key: CASSANDRA-6157
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6157
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: sankalp kohli
>            Assignee: sankalp kohli
>            Priority: Minor
>             Fix For: 2.0.5
>
>         Attachments: trunk-6157-v2.diff, trunk-6157-v3.diff, 
> trunk-6157-v4.diff, trunk-6157.txt
>
>
> Cassandra supports disabling the hints or reducing the window for hints. 
> It would be helpful to have a switch which stops hints to a down data center 
> but continue hints to other DCs.
> This is helpful during data center fail over as hints will put more 
> unnecessary pressure on the DC taking double traffic. Also since now 
> Cassandra is under reduced reduncany, we don't want to disable hints within 
> the DC. 



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to