Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Closed
sarral opened this Issue · 1 comment

2 participants

@sarral

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
Owner

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

@fmgoncalves fmgoncalves closed this issue from a commit
@fmgoncalves fixes #16 f7d02fe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.