開始卡桑德拉服務器和客戶端卡桑德拉後,我創建「Keyspace1」,列族「標準1」成功。使用Net-Cassandra-Easy-0.15,我執行了一個Perl程序並得到結果:淨卡桑德拉易於設置密鑰空間
$VAR1=bless({
'why'=>'You have not set a keyspace for this session'
},'Net::GenCassandra::InvalidrequestException');
你有什麼提示來解決這個問題嗎?
我的Perl程序如下:
#!/usr/bin/perl
use lib './lib';
use strict;
use warnings;
use Net::Cassandra::Easy;
use Data::Dumper;
eval {
my $client = Net::Cassandra::Easy->new(
server => 'localhost',
port => 9160,
keyspace => 'Keyspace1');
$client->connect();
my $key = 'rt';
# get
my $result = $client->get([$key],
family => 'Standard1',
byname => [qw/name age site/]);
print Dumper($result);
# insert
$client->mutate([$key],
family => 'Standard1',
insertions => { 'site' => 'rest-term' });
# get
$result = $client->get([$key],
family => 'Standard1',
byname => [qw/name age site/]);
print Dumper($result);
};
die Dumper([email protected]) if [email protected];
欲瞭解更多信息:這個問題發生之前,我得到「無法讀取4個字節......」的錯誤。我取代「BufferedTransport」由「FramedTransport」的Easy.pm模塊中,然後「無法讀取4個字節...」錯誤是固定的。但是這個「你沒有爲這個會話設置密鑰空間」的錯誤,我還不知道有什麼方法可以解決。 – Aloha 2012-02-01 07:36:34