The FreeRADIUS server
$Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
This is free and unencumbered software released into the public domain. More...
#include <freeradius-devel/server/base.h>
#include <freeradius-devel/util/debug.h>
#include <cassandra.h>
#include "rlm_sql.h"
Go to the source code of this file.
Data Structures | |
struct | rlm_sql_cassandra_t |
Cassandra driver instance. More... | |
Macros | |
#define | DO_CASS_OPTION(_opt, _x) |
#define | LOG_PREFIX "sql - cassandra" |
#define | RLM_CASS_ERR_DATA_RETRIVE(_t) |
Variables | |
static fr_table_num_sorted_t const | consistency_levels [] |
static size_t | consistency_levels_len = NUM_ELEMENTS(consistency_levels) |
static const conf_parser_t | driver_config [] |
static conf_parser_t | latency_aware_routing_config [] |
static conf_parser_t | load_balance_dc_aware_config [] |
rlm_sql_driver_t | rlm_sql_cassandra |
rlm_sql_cassandra_conn_t | |
static conf_parser_t | tls_config [] |
static fr_table_num_sorted_t const | verify_cert_table [] |
static size_t | verify_cert_table_len = NUM_ELEMENTS(verify_cert_table) |
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.
In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to http://unlicense.org
Cassandra SQL driver
Definition in file rlm_sql_cassandra.c.
struct rlm_sql_cassandra_t |
Cassandra driver instance.
Definition at line 68 of file rlm_sql_cassandra.c.
Data Fields | ||
---|---|---|
CassCluster * | cluster | Configuration of the cassandra cluster connection. |
pthread_mutex_t | connect_mutex | Mutex to prevent multiple connections attempting to connect a keyspace concurrently. |
uint32_t | connections_per_host | Number of connections to each server in each IO thread. |
uint32_t | connections_per_host_max | Maximum number of connections to each server in each IO threads. |
CassConsistency | consistency | Level of consistency converted to a constant. |
char const * | consistency_str | Level of consistency required. |
bool | done_connect_keyspace | Whether we've connected to a keyspace. |
uint32_t | event_queue_size | Sets the size of the the fixed size queue that stores events. |
uint32_t | io_flush_requests_max | Maximum number of requests processed by an IO worker per flush. |
uint32_t | io_queue_size | Size of the the fixed size queue that stores pending requests. |
uint32_t | io_threads | Number of IO threads. |
double | lar_exclusion_threshold |
How much worse the latency me be, compared to the average latency of the best performing node before it's penalized. This gets mangled to a double. |
uint64_t | lar_min_measured | The minimum number of measurements per-host required to be considered by the policy. |
fr_time_delta_t | lar_retry_period | The amount of time a node is penalized by the policy before being given a second chance when the current average latency exceeds the calculated threshold (exclusion_threshold * best_average_latency). |
fr_time_delta_t | lar_scale |
Weight given to older latencies when calculating the average latency of a node. A bigger scale will give more weight to older latency measurements. |
fr_time_delta_t | lar_update_rate | The rate at which the best average latency is recomputed. |
bool | lbdc_allow_remote_dcs_for_local_cl |
Allows remote hosts to be used if no local. dc hosts are available and the consistency level is LOCAL_ONE or LOCAL_QUORUM. |
uint32_t | lbdc_hosts_per_remote_dc | The number of host used in each remote DC if no hosts are available in the local dc. |
char const * | lbdc_local_dc | The primary data center to try first. |
bool | load_balance_round_robin | Enable round robin load balancing. |
uint32_t | pending_requests_high |
Sets the high water mark for the number of requests queued waiting for a connection in a connection pool. Disables writes to a host on an IO worker if the number of requests queued exceed this value. |
uint32_t | pending_requests_low |
Sets the low water mark for the number of requests queued waiting for a connection in a connection pool. After exceeding high water mark requests, writes to a host will only resume once the number of requests fall below this value. |
uint32_t | protocol_version | The protocol version. |
CassSession * | session | Cluster's connection pool. |
uint32_t | spawn_max | The maximum number of connections that will be created concurrently. |
fr_time_delta_t | spawn_retry_delay | Amount of time to wait before attempting to reconnect. |
bool | spawn_retry_delay_is_set | |
uint32_t | spawn_threshold | Threshold for the maximum number of concurrent requests in-flight on a connection before creating a new connection. |
CassSsl * | ssl | Connection's SSL context. |
uint32_t | tcp_keepalive | How often to send TCP keepalives. |
bool | tcp_nodelay | Disable TCP naggle algorithm. |
char const * | tls_ca_file | Path to the CA used to validate the server's certificate. |
char const * | tls_certificate_file | Public certificate we present to the server. |
char const * | tls_private_key_file | Private key for the certificate we present to the server. |
char const * | tls_private_key_password | String to decrypt private key. |
char const * | tls_verify_cert_str | Whether we validate the cert provided by the server. |
bool | token_aware_routing | Whether to use token aware routing. |
uint32_t | write_bytes_high |
High water mark for the number of bytes outstanding on a connection. Disables writes to a connection if the number of bytes queued exceed this value. |
uint32_t | write_bytes_low |
Low water mark for number of bytes outstanding on a connection. After exceeding high water mark bytes, writes will only resume once the number of bytes fall below this value. |
#define DO_CASS_OPTION | ( | _opt, | |
_x | |||
) |
#define LOG_PREFIX "sql - cassandra" |
Definition at line 36 of file rlm_sql_cassandra.c.
#define RLM_CASS_ERR_DATA_RETRIVE | ( | _t | ) |
|
static |
Log callback for libcassandra.
libcassandra seems to use this to log global events in the library, other messages like query errors are not logged here, and should be retrieved with functions like cass_future_error_message();
Messages here do not need to be made available via sql_error.
message | Contains the log message and information about its source. |
data | user data (not used). |
Definition at line 289 of file rlm_sql_cassandra.c.
|
static |
DIAG_OFF | ( | strict- | prototypes | ) |
Cassandra cluster connection.
< Result from executing a query.
< Row set iterator.
< Prevent unneeded memory allocation by keeping a permanent pool, to store log entries.
Definition at line 44 of file rlm_sql_cassandra.c.
|
static |
Definition at line 710 of file rlm_sql_cassandra.c.
|
static |
|
static |
|
static |
Definition at line 938 of file rlm_sql_cassandra.c.
|
static |
Definition at line 705 of file rlm_sql_cassandra.c.
|
static |
Definition at line 668 of file rlm_sql_cassandra.c.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 482 of file rlm_sql_cassandra.c.
|
static |
|
static |
Replace the last error messages associated with the connection.
This could be modified in future to maintain a circular buffer of log entries, but it's not required for now.
conn | to replace log message in. |
message | from libcassandra. |
len | of message. |
Definition at line 344 of file rlm_sql_cassandra.c.
|
static |
Replace the last error messages associated with the connection.
This could be modified in future to maintain a circular buffer of log entries, but it's not required for now.
conn | to replace log message in. |
fmt | of message. |
... | args. |
Definition at line 364 of file rlm_sql_cassandra.c.
|
static |
|
static |
Definition at line 176 of file rlm_sql_cassandra.c.
|
static |
Definition at line 187 of file rlm_sql_cassandra.c.
|
static |
Definition at line 222 of file rlm_sql_cassandra.c.
|
static |
Definition at line 203 of file rlm_sql_cassandra.c.
|
static |
Definition at line 196 of file rlm_sql_cassandra.c.
rlm_sql_driver_t rlm_sql_cassandra |
Definition at line 964 of file rlm_sql_cassandra.c.
rlm_sql_cassandra_conn_t |
Definition at line 63 of file rlm_sql_cassandra.c.
|
static |
Definition at line 212 of file rlm_sql_cassandra.c.
|
static |
Definition at line 189 of file rlm_sql_cassandra.c.
|
static |
Definition at line 194 of file rlm_sql_cassandra.c.