MADARA
3.4.1
|
Container for quality-of-service settings. More...
#include <QoSTransportSettings.h>
Public Types | |
typedef std::vector< std::string > | Voters |
Public Member Functions | |
QoSTransportSettings () | |
Default constructor. More... | |
QoSTransportSettings (const QoSTransportSettings &settings) | |
Copy constructor. More... | |
QoSTransportSettings (const TransportSettings &settings) | |
Copy constructor. More... | |
virtual | ~QoSTransportSettings () |
Destructor. More... | |
void | add_banned_peer (const std::string &peer) |
Adds a banned peer. More... | |
void | add_filter (boost::python::object &object) |
Adds a python buffer filter to the chain. More... | |
void | add_filter (filters::BufferFilter *filter) |
Adds a buffer filter to the chain. More... | |
void | add_filter (jobject &object) |
Adds a Java buffer filter to the chain. More... | |
void | add_host (const std::string &host) |
Safely add hosts to the settings. More... | |
void | add_read_domain (const std::string &domain) |
Adds a read domain to the list of domains to read from. More... | |
void | add_rebroadcast_filter (boost::python::object &object) |
Adds an aggregate filter for a map of variables to values after receiving and before rebroadcasting (if TTL > 0) More... | |
void | add_rebroadcast_filter (filters::AggregateFilter *filter) |
Adds an aggregate update filter that will be applied before rebroadcasting, after individual record filters. More... | |
void | add_rebroadcast_filter (jobject &object) |
Adds an aggregate filter for a map of variables to values after receiving and before rebroadcasting (if TTL > 0) More... | |
void | add_rebroadcast_filter (uint32_t types, boost::python::object &object) |
Adds a filter that will be applied to certain types after receiving and before rebroadcasting (if TTL > 0) More... | |
void | add_rebroadcast_filter (uint32_t types, filters::RecordFilter *filter) |
Adds a filter that will be applied to certain types after receiving and before rebroadcasting (if TTL > 0) More... | |
void | add_rebroadcast_filter (uint32_t types, jobject &object) |
Adds a filter that will be applied to certain types after receiving and before rebroadcasting (if TTL > 0) More... | |
void | add_rebroadcast_filter (uint32_t types, knowledge::KnowledgeRecord(*function)(knowledge::FunctionArguments &, knowledge::Variables &)) |
Adds a filter that will be applied to certain types after receiving and before rebroadcasting (if TTL > 0) More... | |
void | add_rebroadcast_filter (void(*function)(knowledge::KnowledgeMap &, const TransportContext &, knowledge::Variables &)) |
Adds an aggregate update filter that will be applied before rebroadcasting, after individual record filters. More... | |
void | add_receive_filter (boost::python::object &object) |
Adds an aggregate filter for a map of variables to values before applying updates to the KnowledgeBase. More... | |
void | add_receive_filter (filters::AggregateFilter *filter) |
Adds an aggregate update filter that will be applied after receiving, after individual record filters. More... | |
void | add_receive_filter (jobject &object) |
Adds an aggregate filter for a map of variables to values before applying updates to the KnowledgeBase. More... | |
void | add_receive_filter (uint32_t types, boost::python::object &object) |
Adds a filter that will be applied to certain types after receiving and before applying updates to the KnowledgeBase. More... | |
void | add_receive_filter (uint32_t types, filters::RecordFilter *filter) |
Adds a filter that will be applied to certain types after receiving. More... | |
void | add_receive_filter (uint32_t types, jobject &object) |
Adds a filter that will be applied to certain types after receiving and before applying updates to the KnowledgeBase. More... | |
void | add_receive_filter (uint32_t types, knowledge::KnowledgeRecord(*function)(knowledge::FunctionArguments &, knowledge::Variables &)) |
Adds a filter that will be applied to certain types after receiving and before applying to the local knowledge base. More... | |
void | add_receive_filter (void(*function)(knowledge::KnowledgeMap &, const TransportContext &, knowledge::Variables &)) |
Adds an aggregate update filter that will be applied after receiving, after individual record filters. More... | |
void | add_send_filter (boost::python::object &object) |
Adds an aggregate filter for a map of variables to values before sending. More... | |
void | add_send_filter (filters::AggregateFilter *filter) |
Adds an aggregate update filter that will be applied before sending, after individual record filters. More... | |
void | add_send_filter (jobject &object) |
Adds an aggregate filter for a map of variables to values before sending. More... | |
void | add_send_filter (uint32_t types, boost::python::object &object) |
Adds a filter that will be applied to certain types before sending. More... | |
void | add_send_filter (uint32_t types, filters::RecordFilter *filter) |
Adds a filter that will be applied to certain types before sending. More... | |
void | add_send_filter (uint32_t types, jobject &object) |
Adds a filter that will be applied to certain types before sending. More... | |
void | add_send_filter (uint32_t types, knowledge::KnowledgeRecord(*function)(knowledge::FunctionArguments &, knowledge::Variables &)) |
Adds a filter that will be applied to certain types before sending. More... | |
void | add_send_filter (void(*function)(knowledge::KnowledgeMap &, const TransportContext &, knowledge::Variables &)) |
Adds an aggregate update filter that will be applied before sending, after individual record filters. More... | |
void | add_trusted_peer (const std::string &peer) |
Adds a trusted peer. More... | |
void | attach (knowledge::ThreadSafeContext *context) |
Attaches a context to the various filtering systems. More... | |
void | clear_buffer_filters (void) |
Clears the list of buffer filters. More... | |
void | clear_hosts (void) |
Safely clears hosts from the settings. More... | |
void | clear_read_domains (void) |
Clears the list of read domains. More... | |
void | clear_rebroadcast_aggregate_filters (void) |
Clears the list of rebroadcast time aggregate filters. More... | |
void | clear_rebroadcast_filters (uint32_t types) |
Clears the list of filters for the specified types. More... | |
void | clear_receive_aggregate_filters (void) |
Clears the list of receive time aggregate filters. More... | |
void | clear_receive_filters (uint32_t types) |
Clears the list of filters for the specified types. More... | |
void | clear_send_aggregate_filters (void) |
Clears the list of send time aggregate filters. More... | |
void | clear_send_filters (uint32_t types) |
Clears the list of filters for the specified types. More... | |
void | debug_to_kb (const std::string &prefix=".transport") |
Requests all debugging for threads go into the data plane KB instead of the control plane. More... | |
void | enable_participant_ttl (unsigned char maximum_ttl=255) |
Enables rebroadcast support up to a certain time to live for other agent's messages. More... | |
int | filter_decode (char *source, int size, int max_size) const |
Calls decode on the the buffer filter chain. More... | |
int | filter_encode (char *source, int size, int max_size) const |
Calls encode on the the buffer filter chain. More... | |
knowledge::KnowledgeRecord | filter_rebroadcast (const madara::knowledge::KnowledgeRecord &input, const std::string &name, transport::TransportContext &context) const |
Filters an input according to the rebroadcast filter chain. More... | |
void | filter_rebroadcast (knowledge::KnowledgeMap &records, const transport::TransportContext &transport_context) const |
Filters aggregate records according to the rebroadcast filter chain. More... | |
knowledge::KnowledgeRecord | filter_receive (const madara::knowledge::KnowledgeRecord &input, const std::string &name, transport::TransportContext &context) const |
Filters an input according to the receive filter chain. More... | |
void | filter_receive (knowledge::KnowledgeMap &records, const transport::TransportContext &transport_context) const |
Filters aggregate records according to the receive filter chain. More... | |
knowledge::KnowledgeRecord | filter_send (const madara::knowledge::KnowledgeRecord &input, const std::string &name, transport::TransportContext &context) const |
Filters an input according to send's filter chain. More... | |
void | filter_send (knowledge::KnowledgeMap &records, const transport::TransportContext &transport_context) const |
Filters aggregate records according to the send filter chain. More... | |
double | get_deadline (void) const |
Returns the latency deadline in seconds. More... | |
uint64_t | get_drop_burst (void) const |
Returns the bursts of packet drops. More... | |
double | get_drop_rate (void) const |
Returns the percentage of dropped packets to enforce on sends. More... | |
int | get_drop_type (void) const |
Returns the policy type for packet drops. More... | |
size_t | get_number_of_buffer_filters (void) const |
Returns the number of buffer filters. More... | |
size_t | get_number_of_rebroadcast_aggregate_filters (void) const |
Returns the number of aggregate filters applied before rebroadcasting @ return the number of aggregate filters. More... | |
size_t | get_number_of_rebroadcast_filtered_types (void) const |
Returns the number of types that are filtered before rebroadcast. More... | |
size_t | get_number_of_receive_aggregate_filters (void) const |
Returns the number of aggregate filters applied after receiving @ return the number of aggregate filters. More... | |
size_t | get_number_of_receive_filtered_types (void) const |
Returns the number of types that are filtered after received. More... | |
size_t | get_number_of_send_aggregate_filters (void) const |
Returns the number of aggregate filters applied before sending @ return the number of aggregate filters. More... | |
size_t | get_number_of_send_filtered_types (void) const |
Returns the number of types that are filtered before send. More... | |
unsigned char | get_participant_ttl (void) const |
Returns the maximum time to live participation of this transport in rebroadcasting of other agent's messages. More... | |
void | get_read_domains (std::vector< std::string > &domains) const |
Retrieves the list of read domains. More... | |
unsigned char | get_rebroadcast_ttl (void) const |
Gets the time to live for rebroadcasting (number of rebroadcasts per message). More... | |
int64_t | get_send_bandwidth_limit (void) const |
Returns the limit for sending on this transport in bytes per second. More... | |
int64_t | get_total_bandwidth_limit (void) const |
Returns the total limit for this transport in bytes per second. More... | |
bool | is_reading_domain (const std::string domain) const |
Checks if a domain is in the domain read list. More... | |
bool | is_trusted (const std::string &peer) const |
Checks if a peer is trusted. More... | |
virtual void | load (const std::string &filename, const std::string &prefix="transport") |
Loads the settings from a binary file. More... | |
virtual void | load_text (const std::string &filename, const std::string &prefix="transport") |
Loads the settings from a text file. More... | |
size_t | num_read_domains (void) const |
Returns the number of read domains. More... | |
void | operator= (const QoSTransportSettings &settings) |
Assignment operator. More... | |
void | operator= (const TransportSettings &settings) |
Assignment operator. More... | |
void | print_num_filters_rebroadcast (void) const |
Prints the number of filters chained for each type to the rebroadcast filter. More... | |
void | print_num_filters_receive (void) const |
Prints the number of filters chained for each type to the receive filter. More... | |
void | print_num_filters_send (void) const |
Prints the number of filters chained for each type to the send filter. More... | |
bool | remove_banned_peer (const std::string &peer) |
Removes a trusted peer, if it exists in the list. More... | |
bool | remove_trusted_peer (const std::string &peer) |
Removes a trusted peer, if it exists in the list. More... | |
virtual void | save (const std::string &filename, const std::string &prefix="transport") const |
Saves the settings from a binary file. More... | |
virtual void | save_text (const std::string &filename, const std::string &prefix="transport") const |
Saves the settings from a text file. More... | |
void | set_deadline (double deadline) |
Sets the packet deadline in seconds. More... | |
void | set_rebroadcast_ttl (unsigned char ttl) |
Sets the time to live for our packets. More... | |
void | set_send_bandwidth_limit (int64_t bandwidth) |
Sets a bandwidth limit for sending on this transport in bytes per sec. More... | |
void | set_total_bandwidth_limit (int64_t bandwidth) |
Sets a bandwidth limit for receiving and sending over the transport. More... | |
void | update_drop_rate (double drop_rate, int drop_type=PACKET_DROP_DETERMINISTIC, uint64_t drop_burst=1) |
Updates a packet drop rate, type, and burst. More... | |
Public Attributes | |
std::string | debug_to_kb_prefix = "" |
if not empty, save debug information to knowledge base at prefix More... | |
bool | delay_launch = false |
Delay launching transports until explicit activate call. More... | |
OriginatorFragmentMap | fragment_map |
Map of fragments received by originator. More... | |
uint32_t | fragment_queue_length = 100 |
Indicates queue length for holding clock-keyed fragments. More... | |
std::vector< std::string > | hosts |
Host information for transports that require it. More... | |
uint32_t | id = 0 |
The id of this process (DEPRECATED). You do not need to set this. More... | |
uint32_t | max_fragment_size = 62000 |
Maximum allowed fragment size for partitioning large messages. More... | |
double | max_send_hertz = 0.0 |
Maximum rate of sending messages. More... | |
bool | never_exit = false |
Prevent MADARA from exiting on fatal errors and invalid state. More... | |
bool | no_receiving = false |
if true, never receive over transport More... | |
bool | no_sending = false |
if true, never send over transport More... | |
std::string | on_data_received_logic |
Logic to be evaluated after every successful update. More... | |
uint32_t | processes = 1 |
Number of processes (DEPRECATED). You do not need to set this. More... | |
uint32_t | queue_length = DEFAULT_QUEUE_LENGTH |
Length of the buffer used to store history of events. More... | |
double | read_thread_hertz = 1000.0 |
Number of valid messages allowed to be received per second. More... | |
uint32_t | read_threads = 1 |
the number of read threads to start More... | |
uint32_t | reliability = DEFAULT_RELIABILITY |
Reliability required of the transport. More... | |
int | resend_attempts = 10 |
Maximum number of attempts to resend if transport is busy. More... | |
bool | send_history = false |
if true, send all updates since last send, for records that have history enabled (if the history capacity was exceeded since last send, the oldest updates are lost). More... | |
bool | send_reduced_message_header = false |
Send a reduced message header (clock, size, updates, KaRL id) More... | |
double | slack_time = 0 |
Time to sleep between sends and rebroadcasts. More... | |
uint32_t | type = DEFAULT_TRANSPORT |
Type of transport. See madara::transport::Types for options. More... | |
std::string | write_domain = "KaRL" |
All class members are accessible to users for easy setup. More... | |
Static Public Attributes | |
static const uint32_t | DEFAULT_DEADLINE = 0 |
Default deadline. More... | |
static const uint32_t | DEFAULT_QUEUE_LENGTH = 500000 |
Default queue length for event history (must be high for reliable transport. More... | |
static const uint32_t | DEFAULT_RELIABILITY = RELIABLE |
Default reliability. More... | |
static const uint32_t | DEFAULT_TRANSPORT = NO_TRANSPORT |
Default transport. More... | |
Private Attributes | |
std::map< std::string, int > | banned_peers_ |
A container of all banned peers. More... | |
filters::BufferFilters | buffer_filters_ |
buffer filters have an encode and decode method More... | |
double | deadline_ |
Deadline for packets at which packets drop. More... | |
int64_t | max_send_bandwidth_ |
Maximum send bandwidth usage per second before packets drop. More... | |
int64_t | max_total_bandwidth_ |
Maximum bandwidth usage for the transport (receive/send) before drop. More... | |
uint64_t | packet_drop_burst_ |
Burst of packet drops. More... | |
double | packet_drop_rate_ |
Rate for dropping packets. More... | |
int | packet_drop_type_ |
Drop rate type. More... | |
unsigned char | participant_rebroadcast_ttl_ |
This field is meant to limit the number of rebroadcasts that this transport will participate in. More... | |
std::map< std::string, int > | read_domains_ |
Any acceptable read domain is added here. More... | |
knowledge::KnowledgeRecordFilters | rebroadcast_filters_ |
A container for rebroadcast filters. More... | |
unsigned char | rebroadcast_ttl_ |
number of rebroadcasts for receivers to ultimately do. More... | |
knowledge::KnowledgeRecordFilters | receive_filters_ |
A container for receive filters. More... | |
knowledge::KnowledgeRecordFilters | send_filters_ |
A container for filters applied before sending from this host. More... | |
std::map< std::string, int > | trusted_peers_ |
A container of all trusted peers. More... | |
Container for quality-of-service settings.
Definition at line 49 of file QoSTransportSettings.h.
|
inherited |
Definition at line 88 of file TransportSettings.h.
madara::transport::QoSTransportSettings::QoSTransportSettings | ( | ) |
Default constructor.
Definition at line 11 of file QoSTransportSettings.cpp.
madara::transport::QoSTransportSettings::QoSTransportSettings | ( | const QoSTransportSettings & | settings | ) |
Copy constructor.
settings | the settings to copy from |
Definition at line 25 of file QoSTransportSettings.cpp.
madara::transport::QoSTransportSettings::QoSTransportSettings | ( | const TransportSettings & | settings | ) |
Copy constructor.
settings | the settings to copy from |
Definition at line 45 of file QoSTransportSettings.cpp.
|
virtual |
Destructor.
Definition at line 83 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::add_banned_peer | ( | const std::string & | peer | ) |
Adds a banned peer.
By default, all peers are trusted unless a trusted peer or banned peer is added to the settings.
peer | peer to add (generally ip:port) |
Definition at line 172 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::add_filter | ( | boost::python::object & | object | ) |
Adds a python buffer filter to the chain.
object | a python callback that takes in a list of args and the Variables interface. |
void madara::transport::QoSTransportSettings::add_filter | ( | filters::BufferFilter * | filter | ) |
Adds a buffer filter to the chain.
filter | an instance of a buffer filter |
Definition at line 259 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::add_filter | ( | jobject & | object | ) |
Adds a Java buffer filter to the chain.
object | a java callback that takes in a list of args and the Variables interface. |
|
inherited |
Safely add hosts to the settings.
If you are unsure if the user application and the library will be compiled with the same STL implementation for strings and vectors, this function combined with the clear_hosts function are safe ways to force the MADARA library to contain the full implementations of deallocation.
host | host to add to the list |
Definition at line 139 of file TransportSettings.cpp.
|
inlineinherited |
Adds a read domain to the list of domains to read from.
domain | domain to add to the read list |
Definition at line 13 of file TransportSettings.inl.
void madara::transport::QoSTransportSettings::add_rebroadcast_filter | ( | boost::python::object & | object | ) |
Adds an aggregate filter for a map of variables to values after receiving and before rebroadcasting (if TTL > 0)
object | a python callback that takes in a list of args and the Variables interface. |
Definition at line 386 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::add_rebroadcast_filter | ( | filters::AggregateFilter * | filter | ) |
Adds an aggregate update filter that will be applied before rebroadcasting, after individual record filters.
filter | an instance of an aggregate record filter that will be managed by the underlying infrastructure |
Definition at line 305 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::add_rebroadcast_filter | ( | jobject & | object | ) |
Adds an aggregate filter for a map of variables to values after receiving and before rebroadcasting (if TTL > 0)
object | a java callback that takes in a list of args and the Variables interface. |
Definition at line 346 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::add_rebroadcast_filter | ( | uint32_t | types, |
boost::python::object & | object | ||
) |
Adds a filter that will be applied to certain types after receiving and before rebroadcasting (if TTL > 0)
types | the types to add the filter to |
object | a python callback that takes in a list of args and the Variables interface. |
Definition at line 368 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::add_rebroadcast_filter | ( | uint32_t | types, |
filters::RecordFilter * | filter | ||
) |
Adds a filter that will be applied to certain types after receiving and before rebroadcasting (if TTL > 0)
types | the types to add the filter to |
filter | an instance of an individual record filter that will be managed by the underlying infrastructure |
Definition at line 292 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::add_rebroadcast_filter | ( | uint32_t | types, |
jobject & | object | ||
) |
Adds a filter that will be applied to certain types after receiving and before rebroadcasting (if TTL > 0)
types | the types to add the filter to |
object | a java callback that takes in a list of args and the Variables interface. |
Definition at line 329 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::add_rebroadcast_filter | ( | uint32_t | types, |
knowledge::KnowledgeRecord(*)(knowledge::FunctionArguments &, knowledge::Variables &) | function | ||
) |
Adds a filter that will be applied to certain types after receiving and before rebroadcasting (if TTL > 0)
types | the types to add the filter to |
function | the function that will take the knowledge record in FunctionArguments. |
Definition at line 285 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::add_rebroadcast_filter | ( | void(*)(knowledge::KnowledgeMap &, const TransportContext &, knowledge::Variables &) | function | ) |
Adds an aggregate update filter that will be applied before rebroadcasting, after individual record filters.
function | an aggregate update filter |
Definition at line 298 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::add_receive_filter | ( | boost::python::object & | object | ) |
Adds an aggregate filter for a map of variables to values before applying updates to the KnowledgeBase.
object | a python callback that takes in a list of args and the Variables interface. |
Definition at line 374 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::add_receive_filter | ( | filters::AggregateFilter * | filter | ) |
Adds an aggregate update filter that will be applied after receiving, after individual record filters.
filter | an instance of an aggregate record filter that will be managed by the underlying infrastructure |
Definition at line 253 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::add_receive_filter | ( | jobject & | object | ) |
Adds an aggregate filter for a map of variables to values before applying updates to the KnowledgeBase.
object | a java callback that takes in a list of args and the Variables interface. |
Definition at line 335 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::add_receive_filter | ( | uint32_t | types, |
boost::python::object & | object | ||
) |
Adds a filter that will be applied to certain types after receiving and before applying updates to the KnowledgeBase.
types | the types to add the filter to |
object | a python callback that takes in a list of args and the Variables interface. |
Definition at line 356 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::add_receive_filter | ( | uint32_t | types, |
filters::RecordFilter * | filter | ||
) |
Adds a filter that will be applied to certain types after receiving.
types | the types to add the filter to |
filter | an instance of an individual record filter that will be managed by the underlying infrastructure |
Definition at line 272 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::add_receive_filter | ( | uint32_t | types, |
jobject & | object | ||
) |
Adds a filter that will be applied to certain types after receiving and before applying updates to the KnowledgeBase.
types | the types to add the filter to |
object | a java callback that takes in a list of args and the Variables interface. |
Definition at line 313 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::add_receive_filter | ( | uint32_t | types, |
knowledge::KnowledgeRecord(*)(knowledge::FunctionArguments &, knowledge::Variables &) | function | ||
) |
Adds a filter that will be applied to certain types after receiving and before applying to the local knowledge base.
types | the types to add the filter to |
function | the function that will take the knowledge record in FunctionArguments. |
Definition at line 265 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::add_receive_filter | ( | void(*)(knowledge::KnowledgeMap &, const TransportContext &, knowledge::Variables &) | function | ) |
Adds an aggregate update filter that will be applied after receiving, after individual record filters.
function | an aggregate update filter |
Definition at line 278 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::add_send_filter | ( | boost::python::object & | object | ) |
Adds an aggregate filter for a map of variables to values before sending.
object | a python callback that takes in a list of args and the Variables interface. |
Definition at line 380 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::add_send_filter | ( | filters::AggregateFilter * | filter | ) |
Adds an aggregate update filter that will be applied before sending, after individual record filters.
filter | an instance of an aggregate record filter that will be managed by the underlying infrastructure |
Definition at line 247 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::add_send_filter | ( | jobject & | object | ) |
Adds an aggregate filter for a map of variables to values before sending.
object | a java callback that takes in a list of args and the Variables interface. |
Definition at line 341 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::add_send_filter | ( | uint32_t | types, |
boost::python::object & | object | ||
) |
Adds a filter that will be applied to certain types before sending.
types | the types to add the filter to |
object | a python callback that takes in a list of args and the Variables interface. |
Definition at line 362 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::add_send_filter | ( | uint32_t | types, |
filters::RecordFilter * | filter | ||
) |
Adds a filter that will be applied to certain types before sending.
types | the types to add the filter to |
filter | an instance of an individual record filter that will be managed by the underlying infrastructure |
Definition at line 235 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::add_send_filter | ( | uint32_t | types, |
jobject & | object | ||
) |
Adds a filter that will be applied to certain types before sending.
types | the types to add the filter to |
object | a java callback that takes in a list of args and the Variables interface. |
Definition at line 323 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::add_send_filter | ( | uint32_t | types, |
knowledge::KnowledgeRecord(*)(knowledge::FunctionArguments &, knowledge::Variables &) | function | ||
) |
Adds a filter that will be applied to certain types before sending.
types | the types to add the filter to |
function | the function that will take the knowledge record in FunctionArguments. |
Definition at line 228 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::add_send_filter | ( | void(*)(knowledge::KnowledgeMap &, const TransportContext &, knowledge::Variables &) | function | ) |
Adds an aggregate update filter that will be applied before sending, after individual record filters.
function | an aggregate update filter |
Definition at line 241 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::add_trusted_peer | ( | const std::string & | peer | ) |
Adds a trusted peer.
By default, all peers are trusted unless a trusted peer or banned peer is added to the settings.
peer | peer to add (generally ip:port) |
Definition at line 165 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::attach | ( | knowledge::ThreadSafeContext * | context | ) |
Attaches a context to the various filtering systems.
If the context ever goes out of scope, a 0 should be passed into this function to the context.
context | context to be used for Variable lookups |
Definition at line 394 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::clear_buffer_filters | ( | void | ) |
Clears the list of buffer filters.
Definition at line 429 of file QoSTransportSettings.cpp.
|
inherited |
Safely clears hosts from the settings.
If you are unsure if the user application and the library will be compiled with the same STL implementation for strings and vectors, this function provides a safe way to clear the vector of strings.
Definition at line 145 of file TransportSettings.cpp.
|
inlineinherited |
Clears the list of read domains.
Definition at line 19 of file TransportSettings.inl.
void madara::transport::QoSTransportSettings::clear_rebroadcast_aggregate_filters | ( | void | ) |
Clears the list of rebroadcast time aggregate filters.
Definition at line 434 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::clear_rebroadcast_filters | ( | uint32_t | types | ) |
Clears the list of filters for the specified types.
types | the types to clear the filters of |
Definition at line 423 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::clear_receive_aggregate_filters | ( | void | ) |
Clears the list of receive time aggregate filters.
Definition at line 418 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::clear_receive_filters | ( | uint32_t | types | ) |
Clears the list of filters for the specified types.
types | the types to clear the filters of |
Definition at line 412 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::clear_send_aggregate_filters | ( | void | ) |
Clears the list of send time aggregate filters.
Definition at line 407 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::clear_send_filters | ( | uint32_t | types | ) |
Clears the list of filters for the specified types.
types | the types to clear the filters of |
Definition at line 402 of file QoSTransportSettings.cpp.
|
inlineinherited |
Requests all debugging for threads go into the data plane KB instead of the control plane.
This will impact performance of your main knowledge base, so you should use it sparingly, if possible.
prefix | prefix to save debug info into data plane KB |
Definition at line 24 of file TransportSettings.inl.
void madara::transport::QoSTransportSettings::enable_participant_ttl | ( | unsigned char | maximum_ttl = 255 | ) |
Enables rebroadcast support up to a certain time to live for other agent's messages.
Default is 0 (no participation in rebroadcasts)
maximum_ttl | Maximum time to live to support (0 for not participating in rebroadcasts). A transport cannot participate in more than 255 resends. |
Definition at line 153 of file QoSTransportSettings.cpp.
int madara::transport::QoSTransportSettings::filter_decode | ( | char * | source, |
int | size, | ||
int | max_size | ||
) | const |
Calls decode on the the buffer filter chain.
source | the source and destination buffer |
size | the amount of data in the buffer in bytes |
max_size | the amount of bytes the buffer can hold |
Definition at line 507 of file QoSTransportSettings.cpp.
int madara::transport::QoSTransportSettings::filter_encode | ( | char * | source, |
int | size, | ||
int | max_size | ||
) | const |
Calls encode on the the buffer filter chain.
source | the source and destination buffer |
size | the amount of data in the buffer in bytes |
max_size | the amount of bytes the buffer can hold |
exceptions::MemoryException | if max_size is not big enough |
Definition at line 455 of file QoSTransportSettings.cpp.
madara::knowledge::KnowledgeRecord madara::transport::QoSTransportSettings::filter_rebroadcast | ( | const madara::knowledge::KnowledgeRecord & | input, |
const std::string & | name, | ||
transport::TransportContext & | context | ||
) | const |
Filters an input according to the rebroadcast filter chain.
input | the argument to the filter chain |
name | variable name of input ("" for unnamed) |
context | the context of the transport |
Definition at line 662 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::filter_rebroadcast | ( | knowledge::KnowledgeMap & | records, |
const transport::TransportContext & | transport_context | ||
) | const |
Filters aggregate records according to the rebroadcast filter chain.
records | the aggregate record map |
transport_context | the context of the transport |
Definition at line 669 of file QoSTransportSettings.cpp.
madara::knowledge::KnowledgeRecord madara::transport::QoSTransportSettings::filter_receive | ( | const madara::knowledge::KnowledgeRecord & | input, |
const std::string & | name, | ||
transport::TransportContext & | context | ||
) | const |
Filters an input according to the receive filter chain.
input | the argument to the filter chain |
name | variable name of input ("" for unnamed) |
context | the context of the transport |
Definition at line 647 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::filter_receive | ( | knowledge::KnowledgeMap & | records, |
const transport::TransportContext & | transport_context | ||
) | const |
Filters aggregate records according to the receive filter chain.
records | the aggregate record map |
transport_context | the context of the transport |
Definition at line 654 of file QoSTransportSettings.cpp.
madara::knowledge::KnowledgeRecord madara::transport::QoSTransportSettings::filter_send | ( | const madara::knowledge::KnowledgeRecord & | input, |
const std::string & | name, | ||
transport::TransportContext & | context | ||
) | const |
Filters an input according to send's filter chain.
input | the argument to the filter chain |
name | variable name of input ("" for unnamed) |
context | the context of the transport |
Definition at line 441 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::filter_send | ( | knowledge::KnowledgeMap & | records, |
const transport::TransportContext & | transport_context | ||
) | const |
Filters aggregate records according to the send filter chain.
records | the aggregate record map |
transport_context | the context of the transport |
Definition at line 448 of file QoSTransportSettings.cpp.
double madara::transport::QoSTransportSettings::get_deadline | ( | void | ) | const |
Returns the latency deadline in seconds.
-1 means no deadline.
Definition at line 790 of file QoSTransportSettings.cpp.
uint64_t madara::transport::QoSTransportSettings::get_drop_burst | ( | void | ) | const |
Returns the bursts of packet drops.
Definition at line 756 of file QoSTransportSettings.cpp.
double madara::transport::QoSTransportSettings::get_drop_rate | ( | void | ) | const |
Returns the percentage of dropped packets to enforce on sends.
Definition at line 746 of file QoSTransportSettings.cpp.
int madara::transport::QoSTransportSettings::get_drop_type | ( | void | ) | const |
Returns the policy type for packet drops.
Definition at line 751 of file QoSTransportSettings.cpp.
size_t madara::transport::QoSTransportSettings::get_number_of_buffer_filters | ( | void | ) | const |
Returns the number of buffer filters.
Definition at line 732 of file QoSTransportSettings.cpp.
size_t madara::transport::QoSTransportSettings::get_number_of_rebroadcast_aggregate_filters | ( | void | ) | const |
Returns the number of aggregate filters applied before rebroadcasting @ return the number of aggregate filters.
Definition at line 713 of file QoSTransportSettings.cpp.
size_t madara::transport::QoSTransportSettings::get_number_of_rebroadcast_filtered_types | ( | void | ) | const |
Returns the number of types that are filtered before rebroadcast.
Definition at line 707 of file QoSTransportSettings.cpp.
size_t madara::transport::QoSTransportSettings::get_number_of_receive_aggregate_filters | ( | void | ) | const |
Returns the number of aggregate filters applied after receiving @ return the number of aggregate filters.
Definition at line 726 of file QoSTransportSettings.cpp.
size_t madara::transport::QoSTransportSettings::get_number_of_receive_filtered_types | ( | void | ) | const |
Returns the number of types that are filtered after received.
Definition at line 720 of file QoSTransportSettings.cpp.
size_t madara::transport::QoSTransportSettings::get_number_of_send_aggregate_filters | ( | void | ) | const |
Returns the number of aggregate filters applied before sending @ return the number of aggregate filters.
Definition at line 701 of file QoSTransportSettings.cpp.
size_t madara::transport::QoSTransportSettings::get_number_of_send_filtered_types | ( | void | ) | const |
Returns the number of types that are filtered before send.
Definition at line 694 of file QoSTransportSettings.cpp.
unsigned char madara::transport::QoSTransportSettings::get_participant_ttl | ( | void | ) | const |
Returns the maximum time to live participation of this transport in rebroadcasting of other agent's messages.
Definition at line 159 of file QoSTransportSettings.cpp.
|
inlineinherited |
Retrieves the list of read domains.
domains | the list to fill with all read domains |
Definition at line 30 of file TransportSettings.inl.
unsigned char madara::transport::QoSTransportSettings::get_rebroadcast_ttl | ( | void | ) | const |
Gets the time to live for rebroadcasting (number of rebroadcasts per message).
Definition at line 147 of file QoSTransportSettings.cpp.
int64_t madara::transport::QoSTransportSettings::get_send_bandwidth_limit | ( | void | ) | const |
Returns the limit for sending on this transport in bytes per second.
Definition at line 767 of file QoSTransportSettings.cpp.
int64_t madara::transport::QoSTransportSettings::get_total_bandwidth_limit | ( | void | ) | const |
Returns the total limit for this transport in bytes per second.
-1 means no limit.
Definition at line 779 of file QoSTransportSettings.cpp.
|
inlineinherited |
Checks if a domain is in the domain read list.
domain | domain to check |
Definition at line 41 of file TransportSettings.inl.
bool madara::transport::QoSTransportSettings::is_trusted | ( | const std::string & | peer | ) | const |
Checks if a peer is trusted.
peer | peer to check (generally ip:port) |
There are three conditions when a peer is trusted. The first is when the trusted_peers are everyone (empty set) and the peer does not exist in the banned list. The second is when trusted_peers contains the peer.
Definition at line 203 of file QoSTransportSettings.cpp.
|
virtual |
Loads the settings from a binary file.
filename | the file to load from |
prefix | prefix for all transports settings |
Reimplemented from madara::transport::TransportSettings.
Definition at line 795 of file QoSTransportSettings.cpp.
|
virtual |
Loads the settings from a text file.
filename | the file to load from |
prefix | prefix for all transports settings |
Reimplemented from madara::transport::TransportSettings.
Definition at line 866 of file QoSTransportSettings.cpp.
|
inlineinherited |
Returns the number of read domains.
Definition at line 47 of file TransportSettings.inl.
void madara::transport::QoSTransportSettings::operator= | ( | const QoSTransportSettings & | settings | ) |
Assignment operator.
settings | the settings to copy from |
Definition at line 88 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::operator= | ( | const TransportSettings & | settings | ) |
Assignment operator.
settings | the settings to copy from |
Definition at line 115 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::print_num_filters_rebroadcast | ( | void | ) | const |
Prints the number of filters chained for each type to the rebroadcast filter.
Definition at line 687 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::print_num_filters_receive | ( | void | ) | const |
Prints the number of filters chained for each type to the receive filter.
Definition at line 681 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::print_num_filters_send | ( | void | ) | const |
Prints the number of filters chained for each type to the send filter.
Definition at line 676 of file QoSTransportSettings.cpp.
bool madara::transport::QoSTransportSettings::remove_banned_peer | ( | const std::string & | peer | ) |
Removes a trusted peer, if it exists in the list.
peer | peer to remove (generally ip:port) |
Definition at line 191 of file QoSTransportSettings.cpp.
bool madara::transport::QoSTransportSettings::remove_trusted_peer | ( | const std::string & | peer | ) |
Removes a trusted peer, if it exists in the list.
peer | peer to remove (generally ip:port) |
Definition at line 179 of file QoSTransportSettings.cpp.
|
virtual |
Saves the settings from a binary file.
filename | the file to load from |
prefix | prefix for all transports settings |
Reimplemented from madara::transport::TransportSettings.
Definition at line 943 of file QoSTransportSettings.cpp.
|
virtual |
Saves the settings from a text file.
filename | the file to load from |
prefix | prefix for all transports settings |
Reimplemented from madara::transport::TransportSettings.
Definition at line 983 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::set_deadline | ( | double | deadline | ) |
Sets the packet deadline in seconds.
Note that most transports only enforce deadline in seconds. However, future transports may allow for microsecond or millisecond deadlines, so we use a double here for expansion purposes. -1 means no deadline.
deadline | deadline in seconds |
Definition at line 785 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::set_rebroadcast_ttl | ( | unsigned char | ttl | ) |
Sets the time to live for our packets.
This number is decremented by one by each receiver. If time to live is greater than 0, the message will be rebroadcasted. Default is 0.
ttl | time-to-live for message sent over this transport |
Definition at line 141 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::set_send_bandwidth_limit | ( | int64_t | bandwidth | ) |
Sets a bandwidth limit for sending on this transport in bytes per sec.
bandwidth | send bandwidth in bytes per second |
Definition at line 761 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::set_total_bandwidth_limit | ( | int64_t | bandwidth | ) |
Sets a bandwidth limit for receiving and sending over the transport.
-1 means no limit.
bandwidth | total bandwidth limit in bytes per second |
Definition at line 773 of file QoSTransportSettings.cpp.
void madara::transport::QoSTransportSettings::update_drop_rate | ( | double | drop_rate, |
int | drop_type = PACKET_DROP_DETERMINISTIC , |
||
uint64_t | drop_burst = 1 |
||
) |
Updates a packet drop rate, type, and burst.
drop_rate | percent drop rate for sending packets |
drop_type | type of drop rate policy to use |
drop_burst | number of packets to drop consecutively |
Definition at line 738 of file QoSTransportSettings.cpp.
|
private |
A container of all banned peers.
Definition at line 699 of file QoSTransportSettings.h.
|
private |
buffer filters have an encode and decode method
Definition at line 719 of file QoSTransportSettings.h.
|
private |
Deadline for packets at which packets drop.
Definition at line 749 of file QoSTransportSettings.h.
|
inherited |
if not empty, save debug information to knowledge base at prefix
Definition at line 330 of file TransportSettings.h.
|
staticinherited |
Default deadline.
Definition at line 95 of file TransportSettings.h.
|
staticinherited |
Default queue length for event history (must be high for reliable transport.
Definition at line 92 of file TransportSettings.h.
|
staticinherited |
Default reliability.
Definition at line 101 of file TransportSettings.h.
|
staticinherited |
Default transport.
Definition at line 98 of file TransportSettings.h.
|
inherited |
Delay launching transports until explicit activate call.
Definition at line 273 of file TransportSettings.h.
|
mutableinherited |
Map of fragments received by originator.
Definition at line 282 of file TransportSettings.h.
|
inherited |
Indicates queue length for holding clock-keyed fragments.
Note that this does not limit the number of fragments–only how many clock values we want to queue for defragmentation. So, if you have a fragment_queue_length of 3, and your last three received fragmented clock values were 1=4GB, 2=4GB, 3=4GB, then you could have 12GB, regardless of max_fragment_size.
Definition at line 257 of file TransportSettings.h.
|
inherited |
Host information for transports that require it.
The format of these is transport specific, but for UDP, you might have "localhost:1234" for a host named localhost and a port of 1234. See the specific transport for more information.
Definition at line 308 of file TransportSettings.h.
|
inherited |
The id of this process (DEPRECATED). You do not need to set this.
Definition at line 264 of file TransportSettings.h.
|
inherited |
Maximum allowed fragment size for partitioning large messages.
Definition at line 244 of file TransportSettings.h.
|
private |
Maximum send bandwidth usage per second before packets drop.
Definition at line 739 of file QoSTransportSettings.h.
|
inherited |
Maximum rate of sending messages.
This is not a bandwidth limit. This specifically limits the number of times the transport can send in a second. Under the hood, it is causing the transport to enforce sleeps between sends to provide time for the OS or transport to recover. May be especially useful to UDP transports.
Definition at line 300 of file TransportSettings.h.
|
private |
Maximum bandwidth usage for the transport (receive/send) before drop.
Definition at line 744 of file QoSTransportSettings.h.
|
inherited |
Prevent MADARA from exiting on fatal errors and invalid state.
Definition at line 276 of file TransportSettings.h.
|
inherited |
if true, never receive over transport
Definition at line 318 of file TransportSettings.h.
|
inherited |
if true, never send over transport
Definition at line 313 of file TransportSettings.h.
|
inherited |
Logic to be evaluated after every successful update.
Definition at line 270 of file TransportSettings.h.
|
private |
Burst of packet drops.
Definition at line 734 of file QoSTransportSettings.h.
|
private |
Rate for dropping packets.
Definition at line 724 of file QoSTransportSettings.h.
|
private |
Drop rate type.
Definition at line 729 of file QoSTransportSettings.h.
|
private |
This field is meant to limit the number of rebroadcasts that this transport will participate in.
If a ttl > 0 is received on a message header, the new ttl for rebroadcasts will be set to the minimum of this field and the decrement of the ttl of the message. A zero here means the transport will not participate in rebroadcasts
Definition at line 689 of file QoSTransportSettings.h.
|
inherited |
Number of processes (DEPRECATED). You do not need to set this.
Definition at line 267 of file TransportSettings.h.
|
inherited |
Length of the buffer used to store history of events.
For almost all transports, this is the buffer size used by the operating system and transport layer. You should set this to essentially be enough to hold at least 1 second-worth of data. So, if you sending 1KB of data at 1khz, you need at least 1MB and possibly 5MB to have smooth delivery that can handle operating system busy periods without losing too much data.
Definition at line 238 of file TransportSettings.h.
|
privateinherited |
Any acceptable read domain is added here.
Definition at line 336 of file TransportSettings.h.
|
inherited |
Number of valid messages allowed to be received per second.
This value can be -1 or 0.0 to go as fast as possible
Definition at line 291 of file TransportSettings.h.
|
inherited |
the number of read threads to start
Definition at line 227 of file TransportSettings.h.
|
private |
A container for rebroadcast filters.
Definition at line 704 of file QoSTransportSettings.h.
|
private |
number of rebroadcasts for receivers to ultimately do.
This field is experimental and is meant to allow for rebroadcasting messages across a number of loosely connected agents or amongst a routing network. For instance, if A is connected to B and B is connected to C, and A would like to have its update known to C, then a rebroadcast_ttl of 1 would instruct B to rebroadcast updates with a ttl of (rebroadcast_ttl - 1), resulting in 0 ttl when received by C (it will not rebroadcast).
Definition at line 680 of file QoSTransportSettings.h.
|
private |
A container for receive filters.
Definition at line 709 of file QoSTransportSettings.h.
|
inherited |
Reliability required of the transport.
See madara::transport::Reliabilities for options
Definition at line 261 of file TransportSettings.h.
|
inherited |
Maximum number of attempts to resend if transport is busy.
Definition at line 247 of file TransportSettings.h.
|
private |
A container for filters applied before sending from this host.
Definition at line 714 of file QoSTransportSettings.h.
|
inherited |
if true, send all updates since last send, for records that have history enabled (if the history capacity was exceeded since last send, the oldest updates are lost).
Definition at line 325 of file TransportSettings.h.
|
inherited |
Send a reduced message header (clock, size, updates, KaRL id)
Definition at line 279 of file TransportSettings.h.
|
inherited |
Time to sleep between sends and rebroadcasts.
Definition at line 285 of file TransportSettings.h.
|
private |
A container of all trusted peers.
Definition at line 694 of file QoSTransportSettings.h.
|
inherited |
Type of transport. See madara::transport::Types for options.
Definition at line 241 of file TransportSettings.h.
|
inherited |
All class members are accessible to users for easy setup.
We only write to one domain
Definition at line 224 of file TransportSettings.h.