예제 #1
0
        public void SetFixture()
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US");
            var clusterb = Cluster.Builder();

            clusterb.WithReconnectionPolicy(new ConstantReconnectionPolicy(100));

            var rp = new RoundRobinPolicyWithReconnectionRetries(new ConstantReconnectionPolicy(100));

            rp.ReconnectionEvent += new EventHandler <RoundRobinPolicyWithReconnectionRetriesEventArgs>((s, ev) =>
            {
                Console.Write("o");
                System.Threading.Thread.Sleep((int)ev.DelayMs);
            });
            clusterb.WithLoadBalancingPolicy(rp);
            clusterb.WithQueryTimeout(60 * 1000);

            CCMCluster = CCMBridge.CCMCluster.Create(2, clusterb);
            Session    = CCMCluster.Session;
            Cluster    = CCMCluster.Cluster;
        }
예제 #2
0
        public void SetFixture(Dev.SettingsFixture setFix)
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US");

            var clusterb = Cluster.Builder().AddContactPoint("cassi.cloudapp.net");
            clusterb.WithReconnectionPolicy(new ConstantReconnectionPolicy(100));
            if (_compression)
                clusterb.WithCompression(CompressionType.Snappy);

            if (_noBuffering)
                clusterb.WithoutRowSetBuffering();

            var rp = new RoundRobinPolicyWithReconnectionRetries(new ConstantReconnectionPolicy(100));
            rp.ReconnectionEvent += new EventHandler<RoundRobinPolicyWithReconnectionRetriesEventArgs>((s, ev) => {
                Console.Write("o");
                Thread.Sleep((int)ev.DelayMs);
            });
            clusterb.WithLoadBalancingPolicy(rp);
            clusterb.WithQueryTimeout(60*1000);
            var cluster = clusterb.Build();
            Session = cluster.Connect(this.Keyspace);

            Message = setFix.InfoMessage;
        }
예제 #3
0
        public void SetFixture()
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US");
               	     var clusterb = Cluster.Builder();
            clusterb.WithReconnectionPolicy(new ConstantReconnectionPolicy(100));

            var rp = new RoundRobinPolicyWithReconnectionRetries(new ConstantReconnectionPolicy(100));
            rp.ReconnectionEvent += new EventHandler<RoundRobinPolicyWithReconnectionRetriesEventArgs>((s, ev) =>
            {
                Console.Write("o");
                System.Threading.Thread.Sleep((int)ev.DelayMs);
            });
            clusterb.WithLoadBalancingPolicy(rp);
            clusterb.WithQueryTimeout(60 * 1000);

            CCMCluster = CCMBridge.CCMCluster.Create(2, clusterb);
            Session = CCMCluster.Session;
            Cluster = CCMCluster.Cluster;
        }
예제 #4
0
        public void SetFixture()
        {
            System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture("en-US");
            var clusterb = Cluster.Builder().AddContactPoint("cassi.cloudapp.net");
            clusterb.WithReconnectionPolicy(new ConstantReconnectionPolicy(100));
            if (Cassandra.MSTest.Properties.Settings.Default.Compression)
            {
                clusterb.WithCompression(CompressionType.Snappy);
                Console.WriteLine("Compression: Snappy Compression");
            }
            else Console.WriteLine("Compression: No Compression");

            if (!Cassandra.MSTest.Properties.Settings.Default.Buffering)
            {
                clusterb.WithoutRowSetBuffering();
                Console.WriteLine("Buffering: Without Row Set Buffering");
            }

            var rp = new RoundRobinPolicyWithReconnectionRetries(new ConstantReconnectionPolicy(100));
            rp.ReconnectionEvent += new EventHandler<RoundRobinPolicyWithReconnectionRetriesEventArgs>((s, ev) =>
            {
                Console.Write("o");
                System.Threading.Thread.Sleep((int)ev.DelayMs);
            });
            clusterb.WithLoadBalancingPolicy(rp);
            clusterb.WithQueryTimeout(60 * 1000);
            Cluster = clusterb.Build();
            Session = Cluster.Connect(this.Keyspace);
        }