コード例 #1
0
 public void Dispose()
 {
     if (Client != null)
     {
         Client.MarkAsClosed();
         Client = null;
     }
     if (Pool != null)
     {
         Pool.Close();
         Pool = null;
     }
     CassandraRunner.Stop();
     CassandraRunner.CleanData();
 }
コード例 #2
0
        public HectorSharpFixture()
        {
            CassandraRunner.CleanData();
            CassandraRunner.Start();

            Pool   = new CassandraClientPoolFactory().Create();
            Client = new KeyedCassandraClientFactory(Pool, new KeyedCassandraClientFactory.Config {
                Timeout = 10
            })
                     .Make(new Endpoint("localhost", 9060));
            Keyspace = Client.GetKeyspace("Keyspace1", ConsistencyLevel.ONE, new FailoverPolicy(0)
            {
                Strategy = FailoverStrategy.FAIL_FAST
            });
        }