Seastar
High performance C++ framework for concurrent servers
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
seastar Namespace Reference

Detailed Description

Seastar API namespace.

Namespaces

 alien
 Integration with non-seastar applications.
 
 log_cli
 Configure application logging at run-time with program options.
 
 memory
 
 metrics
 metrics creation and registration
 
 net
 
 scollectd
 
 tls
 

Classes

class  abort_requested_exception
 
class  abort_source
 
struct  accept_result
 The result of an server_socket::accept() call. More...
 
class  adder
 
class  app_template
 
struct  apply_helper
 
struct  apply_helper< Func, Tuple, std::index_sequence< I... > >
 
class  array_map
 
class  async_sharded_service
 
class  basic_rwlock
 
class  basic_semaphore
 Counted resource guard. More...
 
class  basic_sstring
 
class  bool_class
 Type-safe boolean. More...
 
class  broken_condition_variable
 
class  broken_named_semaphore
 
class  broken_pipe_exception
 
struct  broken_promise
 Exception type for broken promises. More...
 
class  broken_semaphore
 
class  checked_ptr
 seastar::checked_ptr class is a wrapper class that may be used with any pointer type (smart like std::unique_ptr or raw pointers like int*). More...
 
class  checked_ptr_is_null_exception
 The exception thrown by a default_null_deref_action. More...
 
class  chunked_fifo
 
class  circular_buffer
 
class  circular_buffer_fixed_capacity
 
class  concrete_execution_stage
 Concrete execution stage class. More...
 
class  condition_variable
 Conditional variable. More...
 
class  condition_variable_timed_out
 
class  connected_socket
 
struct  connected_socket_input_stream_config
 
class  consumption_result
 
struct  continue_consuming
 
struct  cpuset_bpo_wrapper
 
class  data_sink
 
class  data_sink_impl
 
class  data_source
 
class  data_source_impl
 
struct  default_null_deref_action
 Default not engaged seastar::checked_ptr dereferencing action (functor). More...
 
struct  default_timeout_exception_factory
 
class  deferred_action
 
class  deleter
 
struct  directory_entry
 A directory entry being listed. More...
 
struct  dummy_expiry
 
class  enable_lw_shared_from_this
 
class  enable_shared_from_this
 
class  enum_hash
 
struct  exception_future_marker
 
class  execution_stage
 Base execution stage class. More...
 
class  expiring_fifo
 
class  fair_queue
 Fair queuing class. More...
 
class  fair_queue_ticket
 describes a request that passes through the fair_queue. More...
 
class  file
 
class  file_desc
 
class  file_handle
 A shard-transportable handle to a file. More...
 
class  file_input_stream_history
 
struct  file_input_stream_options
 Data structure describing options for opening a file input stream. More...
 
struct  file_open_options
 
struct  file_output_stream_options
 
class  foreign_ptr
 
class  fragmented_memory_input_stream
 
class  fragmented_memory_output_stream
 
struct  frame
 
struct  free_deleter
 
struct  function_input_iterator
 
struct  function_traits
 
struct  function_traits< Ret(*)(Args...)>
 
struct  function_traits< Ret(Args...)>
 
struct  function_traits< Ret(T::*)(Args...) const >
 
struct  function_traits< Ret(T::*)(Args...)>
 
struct  function_traits< T & >
 
class  future
 A representation of a possibly not-yet-computed value. More...
 
struct  future_for_get_promise_marker
 
struct  future_state_base
 
struct  futurize
 Converts a type to a future type, if it isn't already. More...
 
class  gate
 
class  gate_closed_exception
 
struct  indirect_equal_to
 
struct  indirect_hash
 
struct  indirect_less
 
class  inheriting_concrete_execution_stage
 Concrete execution stage class, with support for automatic scheduling_group inheritance. More...
 
class  inheriting_execution_stage
 Base class for execution stages with support for automatic scheduling_group inheritance. More...
 
class  input_stream
 
class  io_completion
 
class  io_queue
 
struct  ipv4_addr
 
struct  ipv6_addr
 
struct  is_future
 Check whether a type is a future. More...
 
struct  is_smart_ptr
 
struct  is_smart_ptr< foreign_ptr< T > >
 
struct  is_smart_ptr< lw_shared_ptr< T > >
 
struct  is_smart_ptr< shared_ptr< T > >
 
struct  is_smart_ptr< std::unique_ptr< T > >
 
class  kernel_completion
 
class  lambda_task
 
class  layered_file_impl
 
struct  lazy_deref_wrapper
 This struct is a wrapper for lazy dereferencing a pointer. More...
 
class  lazy_eval
 This class is a wrapper for a lazy evaluation of a value. More...
 
struct  listen_options
 
class  logger
 Logger class for ostream or syslog. More...
 
class  logger_registry
 used to keep a static registry of loggers since the typical use case is to do: More...
 
struct  logging_settings
 
class  lowres_clock
 Low-resolution and efficient steady clock. More...
 
class  lowres_system_clock
 Low-resolution and efficient system clock. More...
 
class  lw_shared_ptr
 
struct  lw_shared_ptr_counter_base
 
struct  lw_shared_ptr_deleter
 
class  manual_clock
 
class  measuring_output_stream
 
class  memory_input_stream
 
class  memory_output_stream
 
struct  mmap_deleter
 
struct  named_semaphore_exception_factory
 
class  named_semaphore_timed_out
 
struct  nested_exception
 
class  network_interface
 
class  network_stack
 
class  no_sharded_instance_exception
 Exception thrown when a sharded object does not exist. More...
 
class  noncopyable_function
 
class  noncopyable_function< Ret(Args...) noexcept(Noexcept)>
 
class  optimized_optional
 
class  output_stream
 
class  peering_sharded_service
 Provide a sharded service with access to its peers. More...
 
class  pipe
 A fixed-size pipe for communicating between two fibers. More...
 
class  pipe_reader
 Read side of a seastar::pipe. More...
 
class  pipe_writer
 Write side of a seastar::pipe. More...
 
class  pollable_fd
 
class  pollable_fd_state
 
struct  pollfn
 
class  posix_thread
 
struct  prefetcher
 
struct  prefetcher< 0, RW, LOC >
 
class  promise
 promise - allows a future value to be made available at a later time. More...
 
struct  promise_expiry
 
class  queue
 
class  ragel_parser_base
 
class  reactor
 
struct  reactor_config
 
class  readable_eventfd
 
struct  ready_future_marker
 
class  reference_wrapper
 
class  scattered_message
 
class  scheduling_group
 Identifies function calls that are accounted as a group. More...
 
class  scheduling_group_key
 
struct  scheduling_group_key_config
 
struct  semaphore_default_exception_factory
 
class  semaphore_timed_out
 
class  semaphore_units
 
class  server_socket
 A listening socket, waiting to accept incoming network connections. More...
 
class  sharded
 
class  sharded_parameter
 Helper to pass a parameter to a sharded<> object that depends on the shard. It is evaluated on the shard, just before being passed to the local instance. It is useful when passing parameters to sharded::start(). More...
 
class  shared_future
 Like future except the result can be waited for by many fibers. More...
 
class  shared_mutex
 Shared/exclusive mutual exclusion. More...
 
struct  shared_object
 
class  shared_promise
 Like promise except that its counterpart is shared_future instead of future. More...
 
class  shared_ptr
 
struct  shared_ptr_count_base
 
struct  shared_ptr_count_for
 
struct  shared_ptr_make_helper
 
struct  shared_ptr_make_helper< T, false >
 
struct  shared_ptr_make_helper< T, true >
 
struct  shared_ptr_no_esft
 
class  simple_backtrace
 
class  simple_memory_input_stream
 
class  simple_memory_output_stream
 
struct  simple_pollfn
 
class  skip_bytes
 
class  slab_allocator
 
class  slab_class
 
class  slab_item_base
 
struct  slab_page_desc
 
class  sleep_aborted
 exception that is thrown when application is in process of been stopped More...
 
class  smp
 
class  smp_message_queue
 
class  smp_service_group
 
struct  smp_service_group_config
 
struct  smp_submit_to_options
 Options controlling the behaviour of smp::submit_to(). More...
 
class  socket
 
class  socket_address
 
union  socket_address.u
 !< actual size of the relevant 'u' member More...
 
class  sstring_builder
 
struct  stat_data
 Filesystem object stat information. More...
 
class  stop_consuming
 
struct  stop_iteration_tag
 
class  stream
 
class  subscription
 
class  task
 
class  task_entry
 
class  tasktrace
 
class  temporary_buffer
 
class  thread
 thread - stateful thread of execution More...
 
class  thread_attributes
 Class that holds attributes controling the behavior of a thread. More...
 
class  thread_cputime_clock
 
class  timed_out_error
 
class  timer
 
class  timer_set
 
class  tmp_dir
 
class  tmp_file
 
class  transform_iterator
 
struct  tuple_map_types
 
struct  tuple_map_types< MapClass, std::tuple< Elements... > >
 
struct  unaligned
 
struct  unix_domain_addr
 
class  unread_overflow_exception
 
struct  usecfmt_wrapper
 
class  vector_data_sink
 
class  weak_ptr
 
class  weakly_referencable
 
struct  with_clock
 Changes the clock used by shared_future<> and shared_promise<> when passed as the first template parameter. More...
 
class  writeable_eventfd
 

Typedefs

template<typename Service >
using distributed = sharded< Service >
 
template<typename T >
using futurize_t = typename futurize< T >::type
 
using work_waiting_on_reactor = const noncopyable_function< bool()> &
 
using idle_cpu_handler = noncopyable_function< idle_cpu_handler_result(work_waiting_on_reactor poll)>
 
using pollable_fd_state_ptr = boost::intrusive_ptr< pollable_fd_state >
 
using shard_id = unsigned
 
using stop_iteration = bool_class< stop_iteration_tag >
 
using mmap_area = std::unique_ptr< char[], mmap_deleter >
 
using rwlock = basic_rwlock<>
 
using follow_symlink = bool_class< follow_symlink_tag >
 
using semaphore = basic_semaphore< semaphore_default_exception_factory >
 
using named_semaphore = basic_semaphore< named_semaphore_exception_factory >
 
using shared_ptr_counter_type = long
 
template<typename T >
using shared_ptr_equal_by_value = indirect_equal_to< shared_ptr< T > >
 
template<typename T >
using shared_ptr_value_hash = indirect_hash< shared_ptr< T > >
 
using simple_input_stream = simple_memory_input_stream
 
using simple_output_stream = simple_memory_output_stream
 
using smp_timeout_clock = lowres_clock
 
using smp_service_group_semaphore = basic_semaphore< named_semaphore_exception_factory, smp_timeout_clock >
 
using smp_service_group_semaphore_units = semaphore_units< named_semaphore_exception_factory, smp_timeout_clock >
 
using sstring = std::string
 
using steady_clock_type = std::chrono::steady_clock
 
using rss_key_type = std::basic_string_view< uint8_t >
 
using shared_backtrace = seastar::lw_shared_ptr< simple_backtrace >
 
using saved_backtrace = tasktrace
 

Enumerations

enum  open_flags {
  rw = O_RDWR, ro = O_RDONLY, wo = O_WRONLY, create = O_CREAT,
  truncate = O_TRUNC, exclusive = O_EXCL, dsync = O_DSYNC
}
 
enum  directory_entry_type {
  unknown, block_device, char_device, directory,
  fifo, link, regular, socket
}
 
enum  fs_type {
  other, xfs, ext2, ext3,
  ext4, btrfs, hfs, tmpfs
}
 Enumeration describing the type of a particular filesystem.
 
enum  access_flags {
  exists = F_OK, read = R_OK, write = W_OK, execute = X_OK,
  lookup = execute
}
 
enum  file_permissions {
  user_read = S_IRUSR, user_write = S_IWUSR, user_execute = S_IXUSR, group_read = S_IRGRP,
  group_write = S_IWGRP, group_execute = S_IXGRP, others_read = S_IROTH, others_write = S_IWOTH,
  others_execute = S_IXOTH, user_permissions = user_read | user_write | user_execute, group_permissions = group_read | group_write | group_execute, others_permissions = others_read | others_write | others_execute,
  all_permissions = user_permissions | group_permissions | others_permissions, default_file_permissions = user_read | user_write | group_read | group_write | others_read | others_write, default_dir_permissions = all_permissions
}
 
enum  idle_cpu_handler_result { idle_cpu_handler_result::no_more_work, idle_cpu_handler_result::interrupted_by_higher_priority_task }
 
enum  transport { TCP = IPPROTO_TCP, SCTP = IPPROTO_SCTP }
 
enum  log_level {
  error, warn, info, debug,
  trace
}
 log level used with More...
 
enum  logger_timestamp_style { none, boot, real }
 
enum  logger_ostream_type { none, stdout, stderr }
 

Functions

void set_abort_on_ebadf (bool do_abort)
 
bool is_abort_on_ebadf_enabled ()
 
template<typename T >
constexpr T align_up (T v, T align)
 
template<typename T >
constexpr T * align_up (T *v, size_t align)
 
template<typename T >
constexpr T align_down (T v, T align)
 
template<typename T >
constexpr T * align_down (T *v, size_t align)
 
template<typename CharType >
std::unique_ptr< CharType[], free_deleterallocate_aligned_buffer (size_t size, size_t align)
 
template<typename Func , typename... T>
auto apply (Func &&func, std::tuple< T... > &&args)
 
template<typename Func , typename... T>
auto apply (Func &&func, std::tuple< T... > &args)
 
template<typename Func , typename... T>
auto apply (Func &&func, const std::tuple< T... > &args)
 
constexpr unsigned count_leading_zeros (unsigned x)
 
constexpr unsigned count_leading_zeros (unsigned long x)
 
constexpr unsigned count_leading_zeros (unsigned long long x)
 
constexpr unsigned count_trailing_zeros (unsigned x)
 
constexpr unsigned count_trailing_zeros (unsigned long x)
 
constexpr unsigned count_trailing_zeros (unsigned long long x)
 
template<typename T >
constexpr unsigned log2ceil (T n)
 
template<typename T >
constexpr unsigned log2floor (T n)
 
uint8_t cpu_to_le (uint8_t x) noexcept
 
uint8_t le_to_cpu (uint8_t x) noexcept
 
uint16_t cpu_to_le (uint16_t x) noexcept
 
uint16_t le_to_cpu (uint16_t x) noexcept
 
uint32_t cpu_to_le (uint32_t x) noexcept
 
uint32_t le_to_cpu (uint32_t x) noexcept
 
uint64_t cpu_to_le (uint64_t x) noexcept
 
uint64_t le_to_cpu (uint64_t x) noexcept
 
int8_t cpu_to_le (int8_t x) noexcept
 
int8_t le_to_cpu (int8_t x) noexcept
 
int16_t cpu_to_le (int16_t x) noexcept
 
int16_t le_to_cpu (int16_t x) noexcept
 
int32_t cpu_to_le (int32_t x) noexcept
 
int32_t le_to_cpu (int32_t x) noexcept
 
int64_t cpu_to_le (int64_t x) noexcept
 
int64_t le_to_cpu (int64_t x) noexcept
 
uint8_t cpu_to_be (uint8_t x) noexcept
 
uint8_t be_to_cpu (uint8_t x) noexcept
 
uint16_t cpu_to_be (uint16_t x) noexcept
 
uint16_t be_to_cpu (uint16_t x) noexcept
 
uint32_t cpu_to_be (uint32_t x) noexcept
 
uint32_t be_to_cpu (uint32_t x) noexcept
 
uint64_t cpu_to_be (uint64_t x) noexcept
 
uint64_t be_to_cpu (uint64_t x) noexcept
 
int8_t cpu_to_be (int8_t x) noexcept
 
int8_t be_to_cpu (int8_t x) noexcept
 
int16_t cpu_to_be (int16_t x) noexcept
 
int16_t be_to_cpu (int16_t x) noexcept
 
int32_t cpu_to_be (int32_t x) noexcept
 
int32_t be_to_cpu (int32_t x) noexcept
 
int64_t cpu_to_be (int64_t x) noexcept
 
int64_t be_to_cpu (int64_t x) noexcept
 
template<typename T >
cpu_to_le (const unaligned< T > &v) noexcept
 
template<typename T >
le_to_cpu (const unaligned< T > &v) noexcept
 
template<typename T >
read_le (const char *p) noexcept
 
template<typename T >
void write_le (char *p, T datum) noexcept
 
template<typename T >
read_be (const char *p) noexcept
 
template<typename T >
void write_be (char *p, T datum) noexcept
 
template<typename T >
consume_be (const char *&p) noexcept
 
template<typename T >
void produce_be (char *&p, T datum) noexcept
 
template<typename... T>
auto operator co_await (future< T... > f) noexcept
 
template<typename T1 , typename T2 , typename... More>
auto do_with (T1 &&rv1, T2 &&rv2, More &&... more) noexcept
 
template<typename Lock , typename Func >
auto with_lock (Lock &lock, Func &&func)
 
void init_phdr_cache ()
 
template<typename Function >
auto make_execution_stage (const sstring &name, scheduling_group sg, Function &&fn)
 
template<typename Function >
auto make_execution_stage (const sstring &name, Function &&fn)
 
template<typename Ret , typename Object , typename... Args>
concrete_execution_stage< Ret, Object *, Args... > make_execution_stage (const sstring &name, scheduling_group sg, Ret(Object::*fn)(Args...))
 
template<typename Ret , typename Object , typename... Args>
concrete_execution_stage< Ret, const Object *, Args... > make_execution_stage (const sstring &name, scheduling_group sg, Ret(Object::*fn)(Args...) const)
 
template<typename Ret , typename Object , typename... Args>
concrete_execution_stage< Ret, Object *, Args... > make_execution_stage (const sstring &name, Ret(Object::*fn)(Args...))
 
template<typename Ret , typename Object , typename... Args>
concrete_execution_stage< Ret, const Object *, Args... > make_execution_stage (const sstring &name, Ret(Object::*fn)(Args...) const)
 
open_flags operator| (open_flags a, open_flags b)
 
void operator|= (open_flags &a, open_flags b)
 
open_flags operator& (open_flags a, open_flags b)
 
void operator&= (open_flags &a, open_flags b)
 
access_flags operator| (access_flags a, access_flags b)
 
access_flags operator& (access_flags a, access_flags b)
 
constexpr file_permissions operator| (file_permissions a, file_permissions b)
 
constexpr file_permissions operator& (file_permissions a, file_permissions b)
 
template<typename Func >
auto with_file (future< file > file_fut, Func func) noexcept
 Helper for ensuring a file is closed after func is called. More...
 
template<typename Func >
auto with_file_close_on_failure (future< file > file_fut, Func func) noexcept
 Helper for ensuring a file is closed if func fails. More...
 
bool filesystem_has_good_aio_support (sstring directory, bool verbose=false)
 
input_stream< char > make_file_input_stream (file file, uint64_t offset, uint64_t len, file_input_stream_options options={})
 Creates an input_stream to read a portion of a file. More...
 
input_stream< char > make_file_input_stream (file file, uint64_t offset, file_input_stream_options={})
 
input_stream< char > make_file_input_stream (file file, file_input_stream_options={})
 
template<typename... T, typename... A>
future< T... > make_ready_future (A &&... value) noexcept
 Creates a future in an available, value state. More...
 
template<typename... T>
future< T... > make_exception_future (std::exception_ptr &&value) noexcept
 Creates a future in an available, failed state. More...
 
template<typename... T>
future< T... > make_exception_future (const std::exception_ptr &ex) noexcept
 
template<typename... T>
future< T... > make_exception_future (std::exception_ptr &ex) noexcept
 
template<typename... T>
future< T... > current_exception_as_future () noexcept
 Returns std::current_exception() wrapped in a future. More...
 
void report_failed_future (future_state_base::any &&state) noexcept
 
template<typename Func , typename... Args>
auto futurize_invoke (Func &&func, Args &&... args) noexcept
 
template<typename Func , typename... Args>
auto futurize_apply (Func &&func, std::tuple< Args... > &&args) noexcept
 
void log_exception_trace () noexcept
 
template<typename... T, typename Exception >
future< T... > make_exception_future (Exception &&ex) noexcept
 Creates a future in an available, failed state. More...
 
template<typename... T, typename Exception >
future< T... > make_exception_future_with_backtrace (Exception &&ex) noexcept
 
void set_idle_cpu_handler (idle_cpu_handler &&handler)
 
future rename_priority_class (io_priority_class pc, sstring new_name)
 
void add_to_flush_poller (output_stream< char > *x)
 
template<typename CharType >
future copy (input_stream< CharType > &, output_stream< CharType > &)
 copy all the content from the input stream to the output stream
 
template future copy< char > (input_stream< char > &, output_stream< char > &)
 
template<typename AsyncAction >
future repeat (const AsyncAction &action) noexcept=delete
 
template<typename AsyncAction >
future repeat (AsyncAction &action) noexcept=delete
 
template<typename AsyncAction >
future repeat (AsyncAction &&action) noexcept
 
template<typename AsyncAction >
repeat_until_value_return_type< AsyncAction > repeat_until_value (AsyncAction action) noexcept
 
template<typename AsyncAction , typename StopCondition >
future do_until (StopCondition stop_cond, AsyncAction action) noexcept
 
template<typename AsyncAction >
future keep_doing (AsyncAction action) noexcept
 
template<typename Iterator , typename AsyncAction >
future do_for_each (Iterator begin, Iterator end, AsyncAction action) noexcept
 Call a function for each item in a range, sequentially (iterator version). More...
 
template<typename Container , typename AsyncAction >
future do_for_each (Container &c, AsyncAction action) noexcept
 Call a function for each item in a range, sequentially (range version). More...
 
template<typename Iterator , typename Func >
future parallel_for_each (Iterator begin, Iterator end, Func &&func) noexcept
 Run tasks in parallel (iterator version). More...
 
template<typename Range , typename Func >
future parallel_for_each (Range &&range, Func &&func) noexcept
 
template<typename Iterator , typename Func >
future max_concurrent_for_each (Iterator begin, Iterator end, size_t max_concurrent, Func &&func) noexcept
 
template<typename Range , typename Func >
future max_concurrent_for_each (Range &&range, size_t max_concurrent, Func &&func) noexcept
 
template<typename Func >
lambda_task< Func > * make_task (Func &&func) noexcept
 
template<typename Func >
lambda_task< Func > * make_task (scheduling_group sg, Func &&func) noexcept
 
template<typename Iterator , typename Mapper , typename Reducer >
auto map_reduce (Iterator begin, Iterator end, Mapper &&mapper, Reducer &&r) -> typename reducer_traits< Reducer >::future_type
 
template<typename Iterator , typename Mapper , typename Initial , typename Reduce >
future< Initial > map_reduce (Iterator begin, Iterator end, Mapper &&mapper, Initial initial, Reduce reduce)
 
template<typename Range , typename Mapper , typename Initial , typename Reduce >
future< Initial > map_reduce (Range &&range, Mapper &&mapper, Initial initial, Reduce reduce)
 
void set_abort_on_internal_error (bool do_abort)
 
void on_internal_error (logger &logger, std::string_view reason)
 
void on_internal_error (logger &logger, std::exception_ptr ex)
 
void on_internal_error_noexcept (logger &logger, std::string_view reason) noexcept
 
template<typename CharType >
temporary_buffer< CharType > make_temporary_buffer (std::pmr::polymorphic_allocator< CharType > *allocator, std::size_t size)
 
void throw_system_error_on (bool condition, const char *what_arg="")
 
template<typename T >
void throw_kernel_error (T r)
 
mmap_area mmap_anonymous (void *addr, size_t length, int prot, int flags)
 
template<typename T >
void throw_pthread_error (T r)
 
sigset_t make_sigset_mask (int signo)
 
sigset_t make_full_sigset_mask ()
 
sigset_t make_empty_sigset_mask ()
 
void pin_this_thread (unsigned cpu_id)
 
bool need_preempt () noexcept
 
template<typename T , int LOC = 3>
void prefetch (T *ptr)
 
template<typename Iterator , int LOC = 3>
void prefetch (Iterator begin, Iterator end)
 
template<size_t C, typename T , int LOC = 3>
void prefetch_n (T **pptr)
 
template<size_t L, int LOC = 3>
void prefetch (void *ptr)
 
template<size_t L, typename Iterator , int LOC = 3>
void prefetch_n (Iterator begin, Iterator end)
 
template<size_t L, size_t C, typename T , int LOC = 3>
void prefetch_n (T **pptr)
 
template<typename T , int LOC = 3>
void prefetchw (T *ptr)
 
template<typename Iterator , int LOC = 3>
void prefetchw_n (Iterator begin, Iterator end)
 
template<size_t C, typename T , int LOC = 3>
void prefetchw_n (T **pptr)
 
template<size_t L, int LOC = 3>
void prefetchw (void *ptr)
 
template<size_t L, typename Iterator , int LOC = 3>
void prefetchw_n (Iterator begin, Iterator end)
 
template<size_t L, size_t C, typename T , int LOC = 3>
void prefetchw_n (T **pptr)
 
template<typename... A>
std::ostream & fprint (std::ostream &os, const char *fmt, A &&... a)
 
template<typename... A>
void print (const char *fmt, A &&... a)
 
template<typename... A>
std::string sprint (const char *fmt, A &&... a)
 
template<typename... A>
std::string sprint (const sstring &fmt, A &&... a)
 
template<typename Iterator >
std::string format_separated (Iterator b, Iterator e, const char *sep=", ")
 
template<typename TimePoint >
usecfmt_wrapper< TimePoint > usecfmt (TimePoint tp)
 
template<typename Clock , typename Rep , typename Period >
std::ostream & operator<< (std::ostream &os, usecfmt_wrapper< std::chrono::time_point< Clock, std::chrono::duration< Rep, Period >>> tp)
 
template<typename... A>
void log (A &&... a)
 
template<typename... A>
sstring format (const char *fmt, A &&... a)
 
template<typename... A>
std::ostream & fmt_print (std::ostream &os, const char *format, A &&... a)
 
size_t iovec_len (const std::vector< iovec > &iov)
 
void register_network_stack (sstring name, boost::program_options::options_description opts, noncopyable_function< future< std::unique_ptr< network_stack >>(boost::program_options::variables_map opts)> create, bool make_default=false)
 
reactorengine ()
 
bool engine_is_ready ()
 
size_t iovec_len (const iovec *begin, size_t len)
 
int hrtimer_signal ()
 
void report_exception (std::string_view message, std::exception_ptr) noexcept
 
cpu_set_t cpuid_to_cpuset (unsigned cpuid)
 
void validate (boost::any &v, const std::vector< std::string > &values, cpuset_bpo_wrapper *target_type, int)
 
constexpr unsigned max_scheduling_groups ()
 
future< scheduling_groupcreate_scheduling_group (sstring name, float shares) noexcept
 
future destroy_scheduling_group (scheduling_group sg) noexcept
 
future rename_scheduling_group (scheduling_group sg, sstring new_name) noexcept
 
template<typename T , typename... ConstructorArgs>
scheduling_group_key_config make_scheduling_group_key_config (ConstructorArgs... args)
 
future< scheduling_group_keyscheduling_group_key_create (scheduling_group_key_config cfg) noexcept
 
template<typename T >
T & scheduling_group_get_specific (scheduling_group sg, scheduling_group_key key)
 
scheduling_group current_scheduling_group () noexcept
 Returns the current scheduling group.
 
scheduling_group default_scheduling_group () noexcept
 
template<typename T >
T & scheduling_group_get_specific (scheduling_group_key key) noexcept
 
template<typename SpecificValType , typename Mapper , typename Reducer , typename Initial >
future< typename function_traits< Reducer >::return_type > map_reduce_scheduling_group_specific (Mapper mapper, Reducer reducer, Initial initial_val, scheduling_group_key key)
 
template<typename SpecificValType , typename Reducer , typename Initial >
future< typename function_traits< Reducer >::return_type > reduce_scheduling_group_specific (Reducer reducer, Initial initial_val, scheduling_group_key key)
 
server_socket listen (socket_address sa)
 
server_socket listen (socket_address sa, listen_options opts)
 
future< connected_socketconnect (socket_address sa)
 
future< connected_socketconnect (socket_address sa, socket_address local, transport proto)
 
socket make_socket ()
 
net::udp_channel make_udp_channel ()
 
net::udp_channel make_udp_channel (const socket_address &local)
 
future check_direct_io_support (std::string_view path) noexcept
 
future make_directory (std::string_view name, file_permissions permissions=file_permissions::default_dir_permissions) noexcept
 
future touch_directory (std::string_view name, file_permissions permissions=file_permissions::default_dir_permissions) noexcept
 
future recursive_touch_directory (std::string_view name, file_permissions permissions=file_permissions::default_dir_permissions) noexcept
 
future sync_directory (std::string_view name) noexcept
 
future remove_file (std::string_view name) noexcept
 
future rename_file (std::string_view old_name, std::string_view new_name) noexcept
 
future< stat_datafile_stat (std::string_view name, follow_symlink fs=follow_symlink::yes) noexcept
 
future< uint64_t > file_size (std::string_view name) noexcept
 
future< bool > file_accessible (std::string_view name, access_flags flags) noexcept
 
future< bool > file_exists (std::string_view name) noexcept
 
future< std::optional< directory_entry_type > > file_type (std::string_view name, follow_symlink follow=follow_symlink::yes) noexcept
 
future link_file (std::string_view oldpath, std::string_view newpath) noexcept
 
future chmod (std::string_view name, file_permissions permissions) noexcept
 
future< fs_typefile_system_at (std::string_view name) noexcept
 
future< uint64_t > fs_avail (std::string_view name) noexcept
 
future< uint64_t > fs_free (std::string_view name) noexcept
 
template<typename ExceptionFactory , typename Clock = typename timer<>::clock>
semaphore_units< ExceptionFactory, Clock > consume_units (basic_semaphore< ExceptionFactory, Clock > &sem, size_t units) noexcept
 Consume units from semaphore temporarily. More...
 
template<typename T , typename... A>
lw_shared_ptr< T > make_lw_shared (A &&... a)
 
template<typename T >
lw_shared_ptr< T > make_lw_shared (T &&a)
 
template<typename T >
lw_shared_ptr< T > make_lw_shared (T &a)
 
template<typename T , typename... A>
shared_ptr< T > make_shared (A &&... a)
 
template<typename T >
shared_ptr< T > make_shared (T &&a)
 
template<typename T , typename U >
shared_ptr< T > static_pointer_cast (const shared_ptr< U > &p)
 
template<typename T , typename U >
shared_ptr< T > dynamic_pointer_cast (const shared_ptr< U > &p)
 
template<typename T , typename U >
shared_ptr< T > const_pointer_cast (const shared_ptr< U > &p)
 
template<typename T >
static std::ostream & operator<< (std::ostream &out, const lw_shared_ptr< T > &p)
 
template<typename T , typename U >
bool operator== (const shared_ptr< T > &x, const shared_ptr< U > &y)
 
template<typename T >
bool operator== (const shared_ptr< T > &x, std::nullptr_t)
 
template<typename T >
bool operator== (std::nullptr_t, const shared_ptr< T > &y)
 
template<typename T , typename U >
bool operator!= (const shared_ptr< T > &x, const shared_ptr< U > &y)
 
template<typename T >
bool operator!= (const shared_ptr< T > &x, std::nullptr_t)
 
template<typename T >
bool operator!= (std::nullptr_t, const shared_ptr< T > &y)
 
template<typename T , typename U >
bool operator< (const shared_ptr< T > &x, const shared_ptr< U > &y)
 
template<typename T >
bool operator< (const shared_ptr< T > &x, std::nullptr_t)
 
template<typename T >
bool operator< (std::nullptr_t, const shared_ptr< T > &y)
 
template<typename T , typename U >
bool operator<= (const shared_ptr< T > &x, const shared_ptr< U > &y)
 
template<typename T >
bool operator<= (const shared_ptr< T > &x, std::nullptr_t)
 
template<typename T >
bool operator<= (std::nullptr_t, const shared_ptr< T > &y)
 
template<typename T , typename U >
bool operator> (const shared_ptr< T > &x, const shared_ptr< U > &y)
 
template<typename T >
bool operator> (const shared_ptr< T > &x, std::nullptr_t)
 
template<typename T >
bool operator> (std::nullptr_t, const shared_ptr< T > &y)
 
template<typename T , typename U >
bool operator>= (const shared_ptr< T > &x, const shared_ptr< U > &y)
 
template<typename T >
bool operator>= (const shared_ptr< T > &x, std::nullptr_t)
 
template<typename T >
bool operator>= (std::nullptr_t, const shared_ptr< T > &y)
 
template<typename T >
static std::ostream & operator<< (std::ostream &out, const shared_ptr< T > &p)
 
template<typename Stream , typename StreamVisitor , typename = std::enable_if_t<Stream::has_with_stream::value>>
static decltype(auto) with_serialized_stream (Stream &stream, StreamVisitor &&visitor)
 
template<typename Stream , typename StreamVisitor , typename = std::enable_if_t<!Stream::has_with_stream::value>, typename = void>
static decltype(auto) with_serialized_stream (Stream &stream, StreamVisitor &&visitor)
 
template<typename Clock = steady_clock_type, typename Rep , typename Period >
future sleep (std::chrono::duration< Rep, Period > dur)
 
template<typename Clock = steady_clock_type>
future sleep_abortable (typename Clock::duration dur)
 
template future sleep_abortable< steady_clock_type > (typename steady_clock_type::duration)
 
template future sleep_abortable< lowres_clock > (typename lowres_clock::duration)
 
template<typename Clock = steady_clock_type>
future sleep_abortable (typename Clock::duration dur, abort_source &as)
 
template future sleep_abortable< steady_clock_type > (typename steady_clock_type::duration, abort_source &)
 
template future sleep_abortable< lowres_clock > (typename lowres_clock::duration, abort_source &)
 
shard_id this_shard_id () noexcept
 Returns shard_id of the of the current shard.
 
smp_service_group default_smp_service_group () noexcept
 
future< smp_service_groupcreate_smp_service_group (smp_service_group_config ssgc) noexcept
 
future destroy_smp_service_group (smp_service_group ssg) noexcept
 
void init_default_smp_service_group (shard_id cpu)
 
smp_service_group_semaphoreget_smp_service_groups_semaphore (unsigned ssg_id, shard_id t) noexcept
 
template<typename string_type = sstring>
string_type uninitialized_string (size_t size)
 
template<typename char_type , typename Size , Size max_size, bool NulTerminate>
basic_sstring< char_type, Size, max_size, NulTerminate > uninitialized_string (size_t size)
 
template<typename char_type , typename size_type , size_type Max, size_type N, bool NulTerminate>
basic_sstring< char_type, size_type, Max, NulTerminate > operator+ (const char(&s)[N], const basic_sstring< char_type, size_type, Max, NulTerminate > &t)
 
static size_t str_len ()
 
template<typename First , typename... Tail>
static size_t str_len (const First &first, const Tail &... tail)
 
template<typename char_type , typename size_type , size_type max_size>
void swap (basic_sstring< char_type, size_type, max_size > &x, basic_sstring< char_type, size_type, max_size > &y) noexcept
 
template<typename char_type , typename size_type , size_type max_size, bool NulTerminate, typename char_traits >
std::basic_ostream< char_type, char_traits > & operator<< (std::basic_ostream< char_type, char_traits > &os, const basic_sstring< char_type, size_type, max_size, NulTerminate > &s)
 
template<typename char_type , typename size_type , size_type max_size, bool NulTerminate, typename char_traits >
std::basic_istream< char_type, char_traits > & operator>> (std::basic_istream< char_type, char_traits > &is, basic_sstring< char_type, size_type, max_size, NulTerminate > &s)
 
static char * copy_str_to (char *dst)
 
template<typename Head , typename... Tail>
static char * copy_str_to (char *dst, const Head &head, const Tail &... tail)
 
template<typename String = sstring, typename... Args>
static String make_sstring (Args &&... args)
 
template<typename string_type = sstring, typename T >
string_type to_sstring (T value)
 
void schedule (task *t) noexcept
 
void schedule_urgent (task *t) noexcept
 
template<typename Func , typename... Args>
futurize_t< std::result_of_t< std::decay_t< Func >std::decay_t< Args >...)> > async (thread_attributes attr, Func &&func, Args &&... args) noexcept
 
template<typename Func , typename... Args>
futurize_t< std::result_of_t< std::decay_t< Func >std::decay_t< Args >...)> > async (Func &&func, Args &&... args) noexcept
 
template<typename T , typename Alloc >
void transfer_pass1 (Alloc &a, T *from, T *to, typename std::enable_if< std::is_nothrow_move_constructible< T >::value >::type *=nullptr)
 
template<typename T , typename Alloc >
void transfer_pass2 (Alloc &a, T *from, T *to, typename std::enable_if< std::is_nothrow_move_constructible< T >::value >::type *=nullptr)
 
template<typename T , typename Alloc >
void transfer_pass1 (Alloc &a, T *from, T *to, typename std::enable_if<!std::is_nothrow_move_constructible< T >::value >::type *=nullptr)
 
template<typename T , typename Alloc >
void transfer_pass2 (Alloc &a, T *from, T *to, typename std::enable_if<!std::is_nothrow_move_constructible< T >::value >::type *=nullptr)
 
template<typename T >
struct seastar::unaligned __attribute__ ((packed))
 
template<typename T , typename F >
auto unaligned_cast (F *p) noexcept
 
template<typename T , typename F >
auto unaligned_cast (const F *p) noexcept
 
template<typename... FutOrFuncs>
auto when_all (FutOrFuncs &&... fut_or_funcs) noexcept
 
template<typename FutureIterator >
future< std::vector< typename std::iterator_traits< FutureIterator >::value_type > > when_all (FutureIterator begin, FutureIterator end) noexcept
 
template<typename... FutOrFuncs>
auto when_all_succeed (FutOrFuncs &&... fut_or_funcs) noexcept
 
template<typename FutureIterator , typename = typename std::iterator_traits<FutureIterator>::value_type>
auto when_all_succeed (FutureIterator begin, FutureIterator end) noexcept
 
template<typename Func , typename... Args>
auto with_scheduling_group (scheduling_group sg, Func func, Args &&... args) noexcept
 run a callable (with some arbitrary arguments) in a scheduling group More...
 
template<typename ExceptionFactory = default_timeout_exception_factory, typename Clock , typename Duration , typename... T>
future< T... > with_timeout (std::chrono::time_point< Clock, Duration > timeout, future< T... > f)
 Wait for either a future, or a timeout, whichever comes first. More...
 
bool is_ip_unspecified (const ipv4_addr &addr) noexcept
 
bool is_port_unspecified (const ipv4_addr &addr) noexcept
 
socket_address make_ipv4_address (const ipv4_addr &addr) noexcept
 
socket_address make_ipv4_address (uint32_t ip, uint16_t port) noexcept
 
uint64_t ntohq (uint64_t v)
 
uint64_t htonq (uint64_t v)
 
std::ostream & operator<< (std::ostream &, const socket_address &)
 
std::ostream & operator<< (std::ostream &, const ipv4_addr &)
 
std::ostream & operator<< (std::ostream &, const ipv6_addr &)
 
bool operator== (const ipv4_addr &lhs, const ipv4_addr &rhs) noexcept
 
template<typename T >
static uint32_t toeplitz_hash (rss_key_type key, const T &data)
 
std::ostream & operator<< (std::ostream &, const unix_domain_addr &)
 
std::unique_ptr< net::devicecreate_virtio_net_device (boost::program_options::variables_map opts=boost::program_options::variables_map())
 
boost::program_options::options_description get_virtio_net_options_description ()
 
bool operator== (const frame &a, const frame &b)
 
frame decorate (uintptr_t addr)
 
template<typename Func >
void backtrace (Func &&func) noexcept(noexcept(func(frame())))
 
saved_backtrace current_backtrace () noexcept
 
tasktrace current_tasktrace () noexcept
 
simple_backtrace current_backtrace_tasklocal () noexcept
 
std::ostream & operator<< (std::ostream &out, const tasktrace &b)
 
template<class Exc , typename... Args>
std::exception_ptr make_backtraced_exception_ptr (Args &&... args)
 
template<class Exc , typename... Args>
void throw_with_backtrace (Args &&... args)
 
size_t parse_memory_size (std::string s)
 
static std::vector< char > string2vector (std::string str)
 
template<typename Func >
deferred_action< Func > defer (Func &&func)
 
std::filesystem::filesystem_error make_filesystem_error (const std::string &what, std::filesystem::path path, int error)
 make a filesystem_error for system calls with a single file operand. More...
 
std::filesystem::filesystem_error make_filesystem_error (const std::string &what, std::filesystem::path path1, std::filesystem::path path2, int error)
 make a filesystem_error for system calls with two file operands. More...
 
future recursive_remove_directory (std::filesystem::path path) noexcept
 
template<typename Function , typename State >
function_input_iterator< Function, State > make_function_input_iterator (Function func, State state)
 
template<typename Function , typename State >
function_input_iterator< Function, State > make_function_input_iterator (Function &&func)
 
future now ()
 Returns a ready future.
 
future later () noexcept
 Returns a future which is not ready but is scheduled to resolve soon.
 
template<typename Func >
lazy_eval< Func > value_of (Func &&func)
 
template<typename T >
lazy_deref_wrapper< T > lazy_deref (const T &p)
 
std::ostream & operator<< (std::ostream &out, log_level level)
 
std::istream & operator>> (std::istream &in, log_level &level)
 
logger_registryglobal_logger_registry ()
 
void apply_logging_settings (const logging_settings &)
 
void print_safe (const char *str, size_t len) noexcept
 
void print_safe (const char *str) noexcept
 
template<typename Integral >
void convert_zero_padded_hex_safe (char *buf, size_t bufsz, Integral n) noexcept
 
template<typename Integral >
void print_zero_padded_hex_safe (Integral n) noexcept
 
template<typename Integral >
size_t convert_decimal_safe (char *buf, size_t bufsz, Integral n) noexcept
 
template<typename Integral >
void print_decimal_safe (Integral n) noexcept
 
sstring read_first_line (std::filesystem::path sys_file)
 
template<typename Type >
Type read_first_line_as (std::filesystem::path sys_file)
 
template<typename T >
reference_wrapper< T > ref (T &object) noexcept
 Wraps reference in a reference_wrapper.
 
template<typename T >
reference_wrapper< const T > cref (const T &object) noexcept
 Wraps constant reference in a reference_wrapper.
 
const std::filesystem::path & default_tmpdir ()
 
void set_default_tmpdir (std::filesystem::path)
 
future< tmp_filemake_tmp_file (std::filesystem::path path_template=default_tmpdir(), open_flags oflags=open_flags::rw, file_open_options options={}) noexcept
 
future< tmp_dirmake_tmp_dir (std::filesystem::path path_template=default_tmpdir(), file_permissions create_permissions=file_permissions::default_dir_permissions) noexcept
 
template<typename Iterator , typename Func >
transform_iterator< Iterator, Func > make_transform_iterator (Iterator i, Func f)
 
template<template< typename > class FilterClass, typename... Elements>
auto tuple_filter_by_type (const std::tuple< Elements... > &t)
 
template<template< typename > class FilterClass, typename... Elements>
auto tuple_filter_by_type (std::tuple< Elements... > &&t)
 
template<typename Function , typename... Elements>
auto tuple_map (const std::tuple< Elements... > &t, Function &&f)
 
template<typename Function , typename... Elements>
auto tuple_map (std::tuple< Elements... > &&t, Function &&f)
 
template<typename Function , typename... Elements>
void tuple_for_each (const std::tuple< Elements... > &t, Function &&f)
 
template<typename Function , typename... Elements>
void tuple_for_each (std::tuple< Elements... > &t, Function &&f)
 
template<typename Function , typename... Elements>
void tuple_for_each (std::tuple< Elements... > &&t, Function &&f)
 
template<typename... Args>
auto make_visitor (Args &&... args)
 
template<typename Variant , typename... Args>
auto visit (Variant &&variant, Args &&... args)
 
template<typename... Args>
internal::castable_variant< Args... > variant_cast (std::variant< Args... > &&var)
 
template<typename... Args>
internal::castable_variant< Args... > variant_cast (const std::variant< Args... > &var)
 

Variables

bool aio_nowait_supported
 
__thread const internal::preemption_monitor * g_need_preempt
 
__thread reactorlocal_engine
 
__thread size_t task_quota
 
logger seastar_logger
 
static constexpr uint16_t SLAB_MAGIC_NUMBER = 0x51AB
 
static constexpr smp_timeout_clock::time_point smp_no_timeout = smp_timeout_clock::time_point::max()
 
static constexpr size_t KB = 1 << 10
 
static constexpr size_t MB = 1 << 20
 
static constexpr size_t GB = 1 << 30
 
static constexpr uint8_t default_rsskey_40bytes_v []
 
static constexpr rss_key_type default_rsskey_40bytes {default_rsskey_40bytes_v, sizeof(default_rsskey_40bytes_v)}
 
static constexpr uint8_t default_rsskey_52bytes_v []
 
static constexpr rss_key_type default_rsskey_52bytes {default_rsskey_52bytes_v, sizeof(default_rsskey_52bytes_v)}
 

Class Documentation

◆ seastar::apply_helper

struct seastar::apply_helper

◆ seastar::continue_consuming

struct seastar::continue_consuming

◆ seastar::cpuset_bpo_wrapper

struct seastar::cpuset_bpo_wrapper
Class Members
cpuset value

◆ seastar::file_input_stream_options

struct seastar::file_input_stream_options
Class Members
size_t buffer_size I/O buffer size.
lw_shared_ptr< file_input_stream_history > dynamic_adjustments Input stream history, if null dynamic adjustments are disabled.
::io_priority_class io_priority_class
unsigned read_ahead Maximum number of extra read-ahead operations.

◆ seastar::file_output_stream_options

struct seastar::file_output_stream_options
Class Members
unsigned buffer_size
::io_priority_class io_priority_class
unsigned preallocation_size Preallocate extents. For large files, set to a large number (a few megabytes) to reduce fragmentation.
unsigned write_behind Number of buffers to write in parallel.

◆ seastar::frame

struct seastar::frame
Class Members
uintptr_t addr
const shared_object * so

◆ seastar::function_traits

struct seastar::function_traits

◆ seastar::logging_settings

struct seastar::logging_settings
Class Members
log_level default_level
unordered_map< sstring, log_level > logger_levels
logger_ostream_type logger_ostream
bool stdout_enabled
logger_timestamp_style stdout_timestamp_style
bool syslog_enabled

◆ seastar::lw_shared_ptr_deleter

struct seastar::lw_shared_ptr_deleter

◆ seastar::noncopyable_function

class seastar::noncopyable_function

◆ seastar::reactor_config

struct seastar::reactor_config
Class Members
bool auto_handle_sigint_sigterm Handle SIGINT/SIGTERM by calling reactor::stop()

When true, Seastar will set up signal handlers for SIGINT/SIGTERM that call reactor::stop(). The reactor will then execute callbacks installed by reactor::at_exit().

When false, Seastar will not set up signal handlers for SIGINT/SIGTERM automatically. The default behavior (terminate the program) will be kept. You can adjust the behavior of SIGINT/SIGTERM by installing signal handlers via reactor::handle_signal(). automatically terminate on SIGINT/SIGTERM

duration< double > task_quota

default time between polls

◆ seastar::shared_object

struct seastar::shared_object
Class Members
uintptr_t begin
uintptr_t end
sstring name

◆ seastar::shared_ptr_make_helper

struct seastar::shared_ptr_make_helper

◆ seastar::smp_service_group_config

struct seastar::smp_service_group_config
Class Members
optional< sstring > group_name

An optional name for this smp group

If this optional is engaged, timeout exception messages of the group's semaphores will indicate the group's name.

unsigned max_nonlocal_requests

The maximum number of non-local requests that execute on a shard concurrently

Will be adjusted upwards to allow at least one request per non-local shard.

◆ seastar::socket_address.u

union seastar::socket_address.u
Class Members
::sockaddr_in in
::sockaddr_in6 in6
::sockaddr sa
::sockaddr_storage sas
::sockaddr_un un

◆ seastar::tuple_map_types< MapClass, std::tuple< Elements... > >

struct seastar::tuple_map_types< MapClass, std::tuple< Elements... > >
Class Members
type

◆ seastar::usecfmt_wrapper

struct seastar::usecfmt_wrapper
Class Members
TimePoint val

Typedef Documentation

◆ idle_cpu_handler

Signature of a callback provided by the user, that the reactor calls when it has idle cycles.

The poll parameter is a work_waiting_on_reactor function that should be periodically called to check if the idle callback should return with idle_cpu_handler_result::interrupted_by_higher_priority_task

◆ work_waiting_on_reactor

Signature of a callback provided by the reactor to a user callback installed to take advantage of idle cpu cycles, used to periodically check if the CPU is still idle.

Returns
true if the reactor has new work to do

Enumeration Type Documentation

◆ idle_cpu_handler_result

Indicates the outcome of a user callback installed to take advantage of idle CPU cycles.

Enumerator
no_more_work 

The user callback has no more work to perform.

interrupted_by_higher_priority_task 

A call to the work_waiting_on_reactor parameter to idle_cpu_handler returned true

◆ log_level

enum seastar::log_level
strong

log level used with

See also
{logger} used with the logger.do_log method. Levels are in increasing order. That is if you want to see debug(3) logs you will also see error(0), warn(1), info(2).

Function Documentation

◆ apply_logging_settings()

void seastar::apply_logging_settings ( const logging_settings )

Shortcut for configuring the logging system all at once.

◆ create_scheduling_group()

future<scheduling_group> seastar::create_scheduling_group ( sstring  name,
float  shares 
)
noexcept

Creates a scheduling group with a specified number of shares.

The operation is global and affects all shards. The returned scheduling group can then be used in any shard.

Parameters
nameA name that identifiers the group; will be used as a label in the group's metrics
sharesnumber of shares of the CPU time allotted to the group; Use numbers in the 1-1000 range (but can go above).
Returns
a scheduling group that can be used on any shard

◆ create_smp_service_group()

future<smp_service_group> seastar::create_smp_service_group ( smp_service_group_config  ssgc)
noexcept

Creates an smp_service_group with the specified configuration.

The smp_service_group is global, and after this call completes, the returned value can be used on any shard.

◆ default_smp_service_group()

smp_service_group seastar::default_smp_service_group ( )
inlinenoexcept

Returns the default smp_service_group. This smp_service_group does not impose any limits on concurrency in the target shard. This makes is deadlock-safe, but can consume unbounded resources, and should therefore only be used when initiator concurrency is very low (e.g. administrative tasks).

◆ destroy_scheduling_group()

future seastar::destroy_scheduling_group ( scheduling_group  sg)
noexcept

Destroys a scheduling group.

Destroys a scheduling_group previously created with create_scheduling_group(). The destroyed group must not be currently in use and must not be used later.

The operation is global and affects all shards.

Parameters
sgThe scheduling group to be destroyed
Returns
a future that is ready when the scheduling group has been torn down

◆ destroy_smp_service_group()

future seastar::destroy_smp_service_group ( smp_service_group  ssg)
noexcept

Destroy an smp_service_group.

Frees all resources used by an smp_service_group. It must not be used again once this function is called.

◆ format()

template<typename... A>
sstring seastar::format ( const char *  fmt,
A &&...  a 
)

Evaluate the formatted string in a native fmt library format

Parameters
fmtformat string with the native fmt library syntax
apositional parameters
Returns
sstring object with the result of applying the given positional parameters on a given format string.

◆ is_abort_on_ebadf_enabled()

bool seastar::is_abort_on_ebadf_enabled ( )

Queries the current setting for seastar's behavior on invalid file descriptor access. See set_abort_on_ebadf().

◆ lazy_deref()

template<typename T >
lazy_deref_wrapper<T> seastar::lazy_deref ( const T &  p)

Create a seastar::lazy_deref_wrapper object.

The actual dereferencing will happen when the object is inserted into a stream. The pointer is not copied, only a reference is saved to it. Smart pointers are supported as well.

Parameters
pa raw pointer or a smart pointer
Returns
a lazy_deref_wrapper object

◆ make_backtraced_exception_ptr()

template<class Exc , typename... Args>
std::exception_ptr seastar::make_backtraced_exception_ptr ( Args &&...  args)

Create an exception pointer of unspecified type that is derived from Exc type with a backtrace attached to its message.

Template Parameters
Excexception type to be caught at the receiving side
Argstypes of arguments forwarded to the constructor of Exc
Parameters
argsarguments forwarded to the constructor of Exc
Returns
std::exception_ptr containing the exception with the backtrace.

◆ make_file_input_stream()

input_stream<char> seastar::make_file_input_stream ( file  file,
uint64_t  offset,
uint64_t  len,
file_input_stream_options  options = {} 
)

Creates an input_stream to read a portion of a file.

Parameters
fileFile to read; multiple streams for the same file may coexist
offsetStarting offset to read from (no alignment restrictions)
lenMaximum number of bytes to read; the stream will stop at end-of-file even if offset + len is beyond end-of-file.
optionsA set of options controlling the stream.
Note
Multiple input streams may exist concurrently for the same file.

◆ make_filesystem_error() [1/2]

std::filesystem::filesystem_error seastar::make_filesystem_error ( const std::string &  what,
std::filesystem::path  path,
int  error 
)

make a filesystem_error for system calls with a single file operand.

Parameters
what- describes the action that failed
path- path of the file that hit the error
error- the system error number (see errno(3))

◆ make_filesystem_error() [2/2]

std::filesystem::filesystem_error seastar::make_filesystem_error ( const std::string &  what,
std::filesystem::path  path1,
std::filesystem::path  path2,
int  error 
)

make a filesystem_error for system calls with two file operands.

Parameters
what- describes the action that failed
path1,path2- paths of the files that hit the error
error- the system error number (see errno(3))

◆ make_scheduling_group_key_config()

template<typename T , typename... ConstructorArgs>
scheduling_group_key_config seastar::make_scheduling_group_key_config ( ConstructorArgs...  args)

A template function that builds a scheduling group specific value configuration. This configuration is used by the infrastructure to allocate memory for the values and initialize or deinitialize them when they are created or destroyed.

Template Parameters
T- the type for the newly created value.
...ConstructorArgs- the types for the constructor parameters (should be deduced)
Parameters
args- The parameters for the constructor.
Returns
a fully initialized scheduling_group_key_config object.

◆ make_temporary_buffer()

template<typename CharType >
temporary_buffer<CharType> seastar::make_temporary_buffer ( std::pmr::polymorphic_allocator< CharType > *  allocator,
std::size_t  size 
)

Creates a temporary_buffer allocated by a custom allocator

Parameters
allocatorallocator to use when allocating the temporary_buffer
sizesize of the temporary buffer

◆ make_tmp_dir()

future<tmp_dir> seastar::make_tmp_dir ( std::filesystem::path  path_template = default_tmpdir(),
file_permissions  create_permissions = file_permissions::default_dir_permissions 
)
noexcept

Returns a future for a tmp_dir exclusively created by the function.

Parameters
path_template- path where the file is to be created, optionally including a template for the file name.
create_permissions- optional permissions for the newly created directory.
Note
path_template may optionally include a name template in the last component of the path. The template is indicated by two or more consecutive XX's. Those will be replaced in the result path by a unique string.

If no name template is found, then path_template is assumed to refer to the directory where the temporary dir is to be created at (a.k.a. the parent directory) and default_tmp_name_template is appended to the path as the name template for the to-be-created directory.

The parent directory must exist and be writable to the current process.

◆ make_tmp_file()

future<tmp_file> seastar::make_tmp_file ( std::filesystem::path  path_template = default_tmpdir(),
open_flags  oflags = open_flags::rw,
file_open_options  options = {} 
)
noexcept

Returns a future for an opened tmp_file exclusively created by the function.

Parameters
path_template- path where the file is to be created, optionally including a template for the file name.
oflags- optional open_flags (open_flags::create | open_flags::exclusive are added to those by default)
options- additional file_open_options, e.g. for setting the created file permission.
Note
path_template may optionally include a filename template in the last component of the path. The template is indicated by two or more consecutive XX's. Those will be replaced in the result path by a unique string.

If no filename template is found, then path_template is assumed to refer to the directory where the temporary file is to be created at (a.k.a. the parent directory) and default_tmp_name_template is appended to the path as the filename template.

The parent directory must exist and be writable to the current process.

◆ map_reduce_scheduling_group_specific()

template<typename SpecificValType , typename Mapper , typename Reducer , typename Initial >
future<typename function_traits<Reducer>::return_type> seastar::map_reduce_scheduling_group_specific ( Mapper  mapper,
Reducer  reducer,
Initial  initial_val,
scheduling_group_key  key 
)

A map reduce over all values of a specific scheduling group data.

Parameters
mapper- A functor SomeType(SpecificValType&) or SomeType(SpecificValType) that maps the specific data to a value of any type.
reducer- A functor of of type ConvetibleToInitial(Initial, MapperReurnType) that reduces a value of type Initial and of the mapper return type to a value of type convertible to Initial.
initial_val- the initial value to pass in the first call to the reducer.
key- the key to the specific data that the mapper should act upon.
Returns
A future that resolves when the result of the map reduce is ready.
Note
The type of SpecificValType must be given because there is no way to deduce it in a consistent manner.
Theoretically the parameter type of Mapper can be deduced to be the type (function_traits<Mapper>::arg<0>) but then there is a danger when the Mapper accepts a parameter type T where SpecificValType is convertible to SpecificValType.

◆ on_internal_error() [1/2]

void seastar::on_internal_error ( logger logger,
std::exception_ptr  ex 
)

Report an internal error

Depending on the value passed to set_abort_on_internal_error, this will either log to logger and abort or throw the passed-in ex. This overload cannot attach a backtrace to the exception, so if the caller wishes to have one attached they have to do it themselves.

◆ on_internal_error() [2/2]

void seastar::on_internal_error ( logger logger,
std::string_view  reason 
)

Report an internal error

Depending on the value passed to set_abort_on_internal_error, this will either log to logger and abort or throw a std::runtime_error.

◆ on_internal_error_noexcept()

void seastar::on_internal_error_noexcept ( logger logger,
std::string_view  reason 
)
noexcept

Report an internal error in a noexcept context

The error will be logged to \logger and if set_abort_on_internal_error, was set to true, the program will be aborted. This overload can be used in noexcept contexts like destructors or noexcept functions.

◆ recursive_remove_directory()

future seastar::recursive_remove_directory ( std::filesystem::path  path)
noexcept

Recursively removes a directory and all of its contents.

Parameters
pathpath of the directory to recursively remove
Note
Unlike rm -rf path has to be a directory and may not refer to a regular file.

The function flushes the parent directory of the removed path and so guaranteeing that the remove is stable on disk.

The function bails out on first error. In that case, some files and/or sub-directories (and their contents) may be left behind at the level in which the error was detected.

◆ reduce_scheduling_group_specific()

template<typename SpecificValType , typename Reducer , typename Initial >
future<typename function_traits<Reducer>::return_type> seastar::reduce_scheduling_group_specific ( Reducer  reducer,
Initial  initial_val,
scheduling_group_key  key 
)

A reduce over all values of a specific scheduling group data.

Parameters
reducer- A functor of of type ConvetibleToInitial(Initial, SpecificValType) that reduces a value of type Initial and of the sg specific data type to a value of type convertible to Initial.
initial_val- the initial value to pass in the first call to the reducer.
key- the key to the specific data that the mapper should act upon.
Returns
A future that resolves when the result of the reduce is ready.
Note
The type of SpecificValType must be given because there is no way to deduce it in a consistent manner.
Theoretically the parameter type of Reducer can be deduced to be the type (function_traits<Reducer>::arg<0>) but then there is a danger when the Reducer accepts a parameter type T where SpecificValType is convertible to SpecificValType.

◆ rename_priority_class()

future seastar::rename_priority_class ( io_priority_class  pc,
sstring  new_name 
)

Renames an io priority class

Renames an io_priority_class previously created with register_one_priority_class().

The operation is global and affects all shards. The operation affects the exported statistics labels.

Parameters
pcThe io priority class to be renamed
new_nameThe new name for the io priority class
Returns
a future that is ready when the io priority class have been renamed

◆ rename_scheduling_group()

future seastar::rename_scheduling_group ( scheduling_group  sg,
sstring  new_name 
)
noexcept

Rename scheduling group.

Renames a scheduling_group previously created with create_scheduling_group().

The operation is global and affects all shards. The operation affects the exported statistics labels.

Parameters
sgThe scheduling group to be renamed
new_nameThe new name for the scheduling group.
Returns
a future that is ready when the scheduling group has been renamed

◆ scheduling_group_get_specific() [1/2]

template<typename T >
T & seastar::scheduling_group_get_specific ( scheduling_group  sg,
scheduling_group_key  key 
)

Returnes a reference to the given scheduling group specific value

Template Parameters
T- the type of the scheduling specific type (cannot be deduced)
Parameters
sg- the scheduling group which it's specific value to retrieve
key- the key of the value to retrieve.
Returns
A reference to the scheduling specific value.

Returns a reference to the given scheduling group specific data.

Parameters
sg- The scheduling group which it's data needs to be accessed
key- The scheduling group key that for the data to access
Returns
A reference of type T& to the data.
Note
The parameter T has to be given since there is no way to deduce it. May throw std::invalid_argument if sg does not exist or is uninitialized.

◆ scheduling_group_get_specific() [2/2]

template<typename T >
T& seastar::scheduling_group_get_specific ( scheduling_group_key  key)
noexcept

Returns a reference to the current specific data.

Parameters
key- The scheduling group key that for the data to access
Returns
A reference of type T& to the data.
Note
The parameter T has to be given since there is no way to deduce it.

◆ scheduling_group_key_create()

future<scheduling_group_key> seastar::scheduling_group_key_create ( scheduling_group_key_config  cfg)
noexcept

Returns a future that holds a scheduling key and resolves when this key can be used to access the scheduling group specific value it represents.

Parameters
cfg- A scheduling_group_key_config object (by recomendation: initialized with make_scheduling_group_key_config )
Returns
A future containing scheduling_group_key for the newly created specific value.

◆ set_abort_on_ebadf()

void seastar::set_abort_on_ebadf ( bool  do_abort)

Determines whether seastar should throw or abort when operation made by seastar fails because the target file descriptor is not valid. This is detected when underlying system calls return EBADF or ENOTSOCK. The default behavior is to throw std::system_error.

◆ set_abort_on_internal_error()

void seastar::set_abort_on_internal_error ( bool  do_abort)

Controls whether on_internal_error() aborts or throws. The default is to throw.

◆ set_idle_cpu_handler()

void seastar::set_idle_cpu_handler ( idle_cpu_handler &&  handler)

Set a handler that will be called when there is no task to execute on cpu. Handler should do a low priority work.

Handler's return value determines whether handler did any actual work. If no work was done then reactor will go into sleep.

Handler's argument is a function that returns true if a task which should be executed on cpu appears or false otherwise. This function should be used by a handler to return early if a task appears.

◆ sleep()

template<typename Clock = steady_clock_type, typename Rep , typename Period >
future seastar::sleep ( std::chrono::duration< Rep, Period >  dur)

Returns a future which completes after a specified time has elapsed.

Parameters
durminimum amount of time before the returned future becomes ready.
Returns
A future which becomes ready when the sleep duration elapses.

◆ sleep_abortable() [1/2]

template<typename Clock = steady_clock_type>
future seastar::sleep_abortable ( typename Clock::duration  dur)

Returns a future which completes after a specified time has elapsed or throws sleep_aborted exception if application is aborted

Parameters
durminimum amount of time before the returned future becomes ready.
Returns
A future which becomes ready when the sleep duration elapses.

◆ sleep_abortable() [2/2]

template<typename Clock = steady_clock_type>
future seastar::sleep_abortable ( typename Clock::duration  dur,
abort_source as 
)

Returns a future which completes after a specified time has elapsed or throws sleep_aborted exception if the sleep is aborted.

Parameters
durminimum amount of time before the returned future becomes ready.
asthe abort_source that eventually notifies that the sleep should be aborted.
Returns
A future which becomes ready when the sleep duration elapses.

◆ throw_with_backtrace()

template<class Exc , typename... Args>
void seastar::throw_with_backtrace ( Args &&...  args)

Throws an exception of unspecified type that is derived from the Exc type with a backtrace attached to its message

Template Parameters
Excexception type to be caught at the receiving side
Argstypes of arguments forwarded to the constructor of Exc
Parameters
argsarguments forwarded to the constructor of Exc
Returns
never returns (throws an exception)

◆ value_of()

template<typename Func >
lazy_eval<Func> seastar::value_of ( Func &&  func)
inline

Create a seastar::lazy_eval object that will use a given functor for evaluating a value when the evaluation is triggered.

The actual evaluation is triggered by applying a () operator on a returned object.

Parameters
funca functor to evaluate the value
Returns
a lazy_eval object that may be used for evaluating a value

Variable Documentation

◆ default_rsskey_40bytes_v

constexpr uint8_t seastar::default_rsskey_40bytes_v[]
staticconstexpr
Initial value:
= {
0xd1, 0x81, 0xc6, 0x2c, 0xf7, 0xf4, 0xdb, 0x5b,
0x19, 0x83, 0xa2, 0xfc, 0x94, 0x3e, 0x1a, 0xdb,
0xd9, 0x38, 0x9e, 0x6b, 0xd1, 0x03, 0x9c, 0x2c,
0xa7, 0x44, 0x99, 0xad, 0x59, 0x3d, 0x56, 0xd9,
0xf3, 0x25, 0x3c, 0x06, 0x2a, 0xdc, 0x1f, 0xfc
}

◆ default_rsskey_52bytes_v

constexpr uint8_t seastar::default_rsskey_52bytes_v[]
staticconstexpr
Initial value:
= {
0x44, 0x39, 0x79, 0x6b, 0xb5, 0x4c, 0x50, 0x23,
0xb6, 0x75, 0xea, 0x5b, 0x12, 0x4f, 0x9f, 0x30,
0xb8, 0xa2, 0xc0, 0x3d, 0xdf, 0xdc, 0x4d, 0x02,
0xa0, 0x8c, 0x9b, 0x33, 0x4a, 0xf6, 0x4a, 0x4c,
0x05, 0xc6, 0xfa, 0x34, 0x39, 0x58, 0xd8, 0x55,
0x7d, 0x99, 0x58, 0x3a, 0xe1, 0x38, 0xc9, 0x2e,
0x81, 0x15, 0x03, 0x66
}