当前位置: 首页>>代码示例>>C#>>正文


C# ICluster.CreateOrdinalCommand方法代码示例

本文整理汇总了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();
        }
开发者ID:jopapo,项目名称:thesisExperiment,代码行数:16,代码来源:Keyspace.cs

示例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();
        }
开发者ID:jopapo,项目名称:thesisExperiment,代码行数:17,代码来源:Keyspace.cs

示例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();
        }
开发者ID:Jacky1,项目名称:cassandra-sharp,代码行数:20,代码来源:BinaryProtocolWrapper.cs


注:本文中的ICluster.CreateOrdinalCommand方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。