private IConnectionFactory buildBufferedConnectionFactory(CassandraClusterElement clusterConfig) { BufferedTransportConnectionFactory connectionFactory = new BufferedTransportConnectionFactory(); SpecialConnectionParameterElement specialConfig = this.retrieveSpecialParameter(clusterConfig.Connection.SpecialConnectionParameters, CONNECTIONFACTORY_TRANSPORT_BUFFER_SIZE_OPTION); int intTempValue = 0; if (specialConfig != null && Int32.TryParse(specialConfig.Value, out intTempValue)) { connectionFactory.BufferSize = intTempValue; } return connectionFactory; }
protected override IConnectionFactory buildClientFactory(CassandraClusterElement clusterConfig) { IConnectionFactory connectionFactory = null; ConnectionFactoryType connectionFactoryType; connectionFactoryType = (ConnectionFactoryType)Enum.Parse(typeof(ConnectionFactoryType), clusterConfig.Connection.FactoryType, true); switch (connectionFactoryType) { case ConnectionFactoryType.BUFFERED: connectionFactory = this.buildBufferedConnectionFactory(clusterConfig); break; case ConnectionFactoryType.FRAMED: connectionFactory = this.buildFramedConnectionFactory(clusterConfig); break; case ConnectionFactoryType.DEFAULT: connectionFactory = this.buildDefaultConnectionFactory(clusterConfig); break; default: throw new NotImplementedException(String.Format("ConnectionFactoryType '{0}' not implemented.", connectionFactoryType)); } return connectionFactory; }
private IConnectionFactory buildFramedConnectionFactory(CassandraClusterElement clusterConfig) { FramedTransportConnectionFactory connectionFactory = new FramedTransportConnectionFactory(); return connectionFactory; }
private IConnectionFactory buildDefaultConnectionFactory(CassandraClusterElement clusterConfig) { DefaultTransportConnectionFactory connectionFactory = new DefaultTransportConnectionFactory(); return connectionFactory; }