我在升级我的电脑时遇到了很多麻烦
existing library
这是我将要起诉的基本设置
TTransport framedTransport = new TFramedTransport(new TSocket("localhost", 9160));
TTransport socketTransport = new TSocket("localhost", 9160);
TProtocol framedProtocol = new TBinaryProtocol(framedTransport);
TProtocol socketProtocol = new TBinaryProtocol(socketTransport);
然后,我尝试通过以下方式改变客户端的设置切换输入和输出协议:
var client = new Cassandra.Client(framedProtocol, framedProtocol);
var client = new Cassandra.Client(socketProtocol, socketProtocol);
var client = new Cassandra.Client(framedProtocol, socketProtocol);
var client = new Cassandra.Client(socketProtocol, framedProtocol);
from the download
我正在做一个简单的请求,比如一个计数,我希望它返回零,因为没有插入数据。
framedTransport.Open();
socketTransport.Open();
Console.WriteLine("Start");
client.set_keyspace("Keyspace1");
var key = System.Text.Encoding.ASCII.GetBytes("MyKey");
var columns = new List<byte[]>(new[] { System.Text.Encoding.ASCII.GetBytes("MyColumn") });
var column_parent = new ColumnParent {
Column_family = "Standard1"
};
var predicate = new SlicePredicate {
Column_names = columns
};
client.get_count(key, column_parent, predicate, ConsistencyLevel.ALL);
Console.WriteLine("Done");
Console.Read();
我上面提供的4种不同的设置都无法执行。他们中的一些人只是锁定,其他人抛出了一个例外。因此,基本上我一直在尝试与新的Cassandra0.7和.NET框架建立连接。
-
all framed
:在设置键空间时锁定
-
all socket
-
in: framed out: socket
:在设置键空间时锁定
-
in: socket out: framed
:在设置键空间时锁定
我99%确信这与我在Cassandra的节俭层所做的事情有关,因为我无法让这个简单的应用程序工作。但是如果你想浏览我的0.7分支,你可以在这里找到它:
http://github.com/managedfusion/fluentcassandra/tree/0.7