Пример #1
0
        public DefaultAquilesCluster(CassandraClusterElement configuration)
        {
            this.KeySpaces = new Dictionary<string, AquilesKeyspace>();
            this.FriendlyName = configuration.FriendlyName;

            this.connectionFactory = ConnectionFactoryHelper.Create(configuration.Connection.FactoryType);
            this.connectionFactory.SpecialConnectionParameters = configuration.Connection.SpecialConnectionParameters;
            this.endpointManager = EndpointManagerHelper.Create(configuration.EndpointManager);
            this.connectionPool = ConnectionPoolHelper.Create(configuration.Connection.PoolType);
            this.connectionPool.Name = String.Format(CultureInfo.InvariantCulture, "{0}_Pool", this.FriendlyName);
            this.endpointManager.ConnectionFactory = this.connectionFactory;
            this.connectionPool.ConnectionFactory = this.connectionFactory;
            this.connectionPool.EndpointManager = this.endpointManager;
            this.connectionPool.SpecialConnectionParameters = configuration.Connection.SpecialConnectionParameters;
        }
 /// <summary>
 /// Remove the specified CassandraClusterElement from the inner Array
 /// </summary>
 /// <seealso cref="Aquiles.Configuration.CassandraClusterElement"/>
 /// <param name="element">element to be removed</param>
 public void Remove(CassandraClusterElement element)
 {
     if (BaseIndexOf(element) >= 0)
         BaseRemove(element.FriendlyName);
 }
 /// <summary>
 /// Add CassandraClusterElement on the inner Array
 /// </summary>
 /// <seealso cref="Aquiles.Configuration.CassandraClusterElement"/>
 /// <param name="element">element to be added</param>
 public void Add(CassandraClusterElement element)
 {
     BaseAdd(element);
 }
 /// <summary>
 /// Given a CassandraClusterElement, it returns its position on the array
 /// </summary>
 /// <seealso cref="Aquiles.Configuration.CassandraClusterElement"/>
 /// <param name="element">a CassandraClusterElement contained on the array</param>
 /// <returns>the position of the element</returns>
 public int IndexOf(CassandraClusterElement element)
 {
     return BaseIndexOf(element);
 }