Overriding options in create_keyspace() doesn't work. Logic error #16

Closed
sarral opened this Issue Jul 2, 2012 · 1 comment

Comments

Projects
None yet
2 participants
@sarral

sarral commented Jul 2, 2012

The Call:

$CASS->create_keyspace($ks,
{
'strategy' => 'org.apache.cassandra.locator.SimpleStrategy',
'strategy_options' => {
'replication_factor' => 1,
'datacenter1' => '1'
},

} );

The Offending code in Cassandra::Simple.pm (line #1109, 1113)
$params->{strategy_class} = 'org.apache.cassandra.locator.NetworkTopologyStrategy' unless $opt->{strategy};

AND

$params->{strategy_options} = { 'datacenter1' => '1' } unless $opt->{strategy_options};

The codes logic is in Error.

Same type (logic) of code as a test:

my $strategy='one';
my $params = 'two' unless $strategy;
print "OUT: $params\n"; ### parms should equal 'one'.

The error code should be:
$params->{strategy_class} = $opt->{strategy} || 'org.apache.cassandra.locator.NetworkTopologyStrategy';
AND
$params->{strategy_options} = $opt->{strategy_options} || { 'datacenter1' => '1' };

@fmgoncalves

This comment has been minimized.

Show comment Hide comment
@fmgoncalves

fmgoncalves Jul 15, 2012

Owner

You're absolutely right! This would force the default options every time (oops). Thank you for the bug report.

Owner

fmgoncalves commented Jul 15, 2012

You're absolutely right! This would force the default options every time (oops). Thank you for the bug report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment