本文整理汇总了C#中ICluster.CreateOrdinalCommand方法的典型用法代码示例。如果您正苦于以下问题:C# ICluster.CreateOrdinalCommand方法的具体用法?C# ICluster.CreateOrdinalCommand怎么用?C# ICluster.CreateOrdinalCommand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICluster
的用法示例。
在下文中一共展示了ICluster.CreateOrdinalCommand方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateBugiotoKeyspace
private void CreateBugiotoKeyspace(ICluster cluster)
{
var list = new List<string>() {
"drop keyspace if exists {0}",
"create keyspace {0} with replication = {{'class' : 'SimpleStrategy', 'replication_factor' : 3}}",
//"CREATE TYPE {0}.type_gameinfo (game text, opponent text)",
"create table {0}.Player (userName text primary key, firstName text, lastName text, gamesGame list<text>, gamesOpponent list<text>)",
//"CREATE TYPE {0}.type_round (id text, moves list<text>)",
"create table {0}.Game (id text primary key, firstPlayer text, secondPlayer text, roundsId list<text>, roundsMoves list<text>, roundsComments list<text>, roundsActions list<text>, roundsSpells list<text>)",
"insert into {0}.Player (userName, firstName, lastName) values ('player1', 'John', 'Fen')",
"insert into {0}.Player (userName, firstName, lastName) values ('player2', 'Fran', 'Bug')" };
var cmd = cluster.CreateOrdinalCommand();
foreach (var c in list)
cmd.Execute(string.Format(c, BUG)).AsFuture().Wait();
}
示例2: CreatePoffoKeyspace
private void CreatePoffoKeyspace(ICluster cluster)
{
var list = new List<string>() {
"drop keyspace if exists {0}",
"create keyspace {0} with replication = {{'class' : 'SimpleStrategy', 'replication_factor' : 3}}",
"create table {0}.Player (userName text primary key, firstName text, lastName text)",
"create table {0}.GameInfo (userName text, Game text, primary key (userName, Game))",
"create table {0}.Game (id text primary key, firstPlayer text, secondPlayer text)",
"create table {0}.GameRound (id text, Round text, primary key (id, Round))",
"create table {0}.Round (id text primary key, game text, moves list<text>, comments list<text>, actions list<text>, spells list<text>)",
"insert into {0}.Player (userName, firstName, lastName) values ('player1', 'John', 'Fen')",
"insert into {0}.Player (userName, firstName, lastName) values ('player2', 'Fran', 'Bug')" };
var cmd = cluster.CreateOrdinalCommand();
foreach (var c in list)
cmd.Execute(string.Format(c, POF)).AsFuture().Wait();
}
示例3: Open
public override void Open(string hostname)
{
//run Write Performance Test using cassandra-sharp driver
CassandraSharpConfig cassandraSharpConfig = new CassandraSharpConfig();
cassandraSharpConfig.Instrumentation = new InstrumentationConfig();
cassandraSharpConfig.Instrumentation.Type = typeof(PerformanceInstrumentation).AssemblyQualifiedName;
ClusterManager.Configure(cassandraSharpConfig);
ClusterConfig clusterConfig = new ClusterConfig
{
Endpoints = new EndpointsConfig
{
Servers = new[] {hostname}
},
};
_cluster = ClusterManager.GetCluster(clusterConfig);
_cmd = _cluster.CreateOrdinalCommand();
}