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_on_expiry
 
class  abort_requested_exception
 
class  abort_source
 
struct  free_deleter
 
class  app_template
 
class  array_map
 
class  checked_ptr_is_null_exception
 The exception thrown by a default_null_deref_action. More...
 
struct  default_null_deref_action
 Default not engaged seastar::checked_ptr dereferencing action (functor). More...
 
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  chunked_fifo
 
class  circular_buffer
 
class  circular_buffer_fixed_capacity
 
class  broken_condition_variable
 
class  condition_variable_timed_out
 
class  condition_variable
 Conditional variable. More...
 
class  deleter
 
class  enum_hash
 
class  execution_stage
 Base execution stage class. More...
 
class  concrete_execution_stage
 Concrete execution stage class. More...
 
class  inheriting_execution_stage
 Base class for execution stages with support for automatic scheduling_group inheritance. More...
 
class  inheriting_concrete_execution_stage
 Concrete execution stage class, with support for automatic scheduling_group inheritance. More...
 
struct  dummy_expiry
 
struct  promise_expiry
 
class  expiring_fifo
 
class  fair_queue_ticket
 describes a request that passes through the fair_queue. More...
 
class  fair_queue_entry
 
class  fair_group
 Group of queues class. More...
 
class  fair_queue
 Fair queuing class. More...
 
struct  directory_entry
 A directory entry being listed. More...
 
struct  stat_data
 Filesystem object stat information. More...
 
struct  file_open_options
 
class  file_handle_impl
 
class  file_impl
 
class  file
 
class  file_handle
 A shard-transportable handle to a file. More...
 
class  cancelled_error
 An exception Cancelled IOs resolve their future into (see io_intent) More...
 
class  file_input_stream_history
 
struct  file_input_stream_options
 Data structure describing options for opening a file input stream. More...
 
struct  file_output_stream_options
 
struct  function_traits
 
struct  function_traits< Ret(Args...)>
 
struct  function_traits< Ret(*)(Args...)>
 
struct  function_traits< Ret(T::*)(Args...)>
 
struct  function_traits< Ret(T::*)(Args...) const >
 
struct  function_traits< T & >
 
struct  nested_exception
 
class  promise
 promise - allows a future value to be made available at a later time. More...
 
class  future
 A representation of a possibly not-yet-computed value. More...
 
class  shared_future
 Like future except the result can be waited for by many fibers. More...
 
struct  broken_promise
 Exception type for broken promises. More...
 
struct  future_state_base
 
struct  ready_future_marker
 
struct  exception_future_marker
 
struct  future_for_get_promise_marker
 
struct  is_future
 Check whether a type is a future. More...
 
struct  futurize
 Converts a type to a future type, if it isn't already. More...
 
class  gate_closed_exception
 
class  gate
 
class  temporary_buffer
 
class  kernel_completion
 
struct  pollfn
 
struct  simple_pollfn
 
class  pollable_fd_state
 
class  pollable_fd
 
class  readable_eventfd
 
class  writeable_eventfd
 
class  io_intent
 
class  io_queue
 
class  io_group
 
class  data_source_impl
 
class  data_source
 
class  data_sink_impl
 
class  data_sink
 
struct  continue_consuming
 
class  stop_consuming
 
class  skip_bytes
 
class  consumption_result
 
class  input_stream
 
struct  output_stream_options
 
class  output_stream
 
class  layered_file_impl
 
struct  stop_iteration_tag
 
class  lowres_clock
 Low-resolution and efficient steady clock. More...
 
class  lowres_system_clock
 Low-resolution and efficient system clock. More...
 
class  lambda_task
 
class  manual_clock
 
class  adder
 
class  broken_pipe_exception
 
class  unread_overflow_exception
 
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...
 
struct  mmap_deleter
 
class  file_desc
 
class  posix_thread
 
struct  prefetcher
 
struct  prefetcher< 0, RW, LOC >
 
struct  usecfmt_wrapper
 
class  queue
 
class  sstring_builder
 
class  ragel_parser_base
 
class  io_completion
 
class  reactor
 
struct  reactor_options
 Configuration for the reactor. More...
 
class  basic_rwlock
 
class  scattered_message
 
struct  scheduling_group_key_config
 
class  scheduling_group_key
 
class  scheduling_group
 Identifies function calls that are accounted as a group. More...
 
class  broken_semaphore
 
class  semaphore_timed_out
 
class  semaphore_aborted
 
struct  semaphore_default_exception_factory
 
class  named_semaphore_timed_out
 
class  broken_named_semaphore
 
class  named_semaphore_aborted
 
struct  named_semaphore_exception_factory
 
class  basic_semaphore
 Counted resource guard. More...
 
class  semaphore_units
 
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  sharded
 
class  async_sharded_service
 
class  peering_sharded_service
 Provide a sharded service with access to its peers. More...
 
class  no_sharded_instance_exception
 Exception thrown when a sharded object does not exist. More...
 
class  foreign_ptr
 
struct  is_smart_ptr< foreign_ptr< T > >
 
struct  with_clock
 Changes the clock used by shared_future<> and shared_promise<> when passed as the first template parameter. More...
 
class  shared_promise
 Like promise except that its counterpart is shared_future instead of future. More...
 
class  shared_mutex
 Shared/exclusive mutual exclusion. More...
 
class  lw_shared_ptr
 
class  shared_ptr
 
class  enable_lw_shared_from_this
 
class  enable_shared_from_this
 
struct  lw_shared_ptr_counter_base
 
struct  lw_shared_ptr_no_esft
 
struct  lw_shared_ptr_deleter
 
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  is_smart_ptr< shared_ptr< T > >
 
struct  is_smart_ptr< lw_shared_ptr< T > >
 
class  measuring_output_stream
 
class  memory_output_stream
 
class  fragmented_memory_input_stream
 
class  memory_input_stream
 
class  simple_memory_output_stream
 
class  fragmented_memory_output_stream
 
class  simple_memory_input_stream
 
struct  slab_page_desc
 
class  slab_item_base
 
class  slab_class
 
class  slab_allocator
 
class  sleep_aborted
 exception that is thrown when application is in process of been stopped More...
 
struct  smp_service_group_config
 
class  smp_service_group
 
struct  smp_submit_to_options
 Options controlling the behaviour of smp::submit_to(). More...
 
class  smp_message_queue
 
class  smp
 
struct  smp_options
 Configuration for the multicore aspect of seastar. More...
 
class  basic_sstring
 
class  stream
 
class  subscription
 
class  task
 
class  thread_attributes
 Class that holds attributes controling the behavior of a thread. More...
 
class  thread
 thread - stateful thread of execution More...
 
class  thread_cputime_clock
 
class  timed_out_error
 
struct  default_timeout_exception_factory
 
class  timer_set
 
class  timer
 
struct  unaligned
 
class  vector_data_sink
 
class  weak_ptr
 
class  weakly_referencable
 
struct  when_any_result
 
struct  connected_socket_input_stream_config
 
struct  session_dn
 Distinguished name. More...
 
class  connected_socket
 
class  socket
 
struct  accept_result
 The result of an server_socket::accept() call. More...
 
class  server_socket
 A listening socket, waiting to accept incoming network connections. More...
 
struct  listen_options
 
class  network_interface
 
class  network_stack
 
struct  network_stack_entry
 
class  socket_address
 
struct  ipv4_addr
 
struct  ipv6_addr
 
struct  unix_domain_addr
 
struct  shared_object
 
struct  frame
 
class  simple_backtrace
 
class  task_entry
 
class  tasktrace
 
class  bool_class
 Type-safe boolean. More...
 
class  deferred_close
 
class  deferred_stop
 
class  deferred_action
 
struct  function_input_iterator
 
struct  indirect_equal_to
 
struct  indirect_less
 
struct  indirect_hash
 
struct  is_smart_ptr
 
struct  is_smart_ptr< std::unique_ptr< T > >
 
class  lazy_eval
 This class is a wrapper for a lazy evaluation of a value. More...
 
struct  lazy_deref_wrapper
 This struct is a wrapper for lazy dereferencing a pointer. More...
 
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  noncopyable_function
 
class  noncopyable_function< Ret(Args...) noexcept(Noexcept)>
 
class  optimized_optional
 
class  reference_wrapper
 
class  tmp_file
 
class  tmp_dir
 
class  transform_iterator
 
struct  tuple_map_types
 
struct  tuple_map_types< MapClass, std::tuple< Elements... > >
 
union  socket_address.u
 !< actual size of the relevant 'u' member More...
 

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 io_priority_class_id = unsigned
 
using shard_id = unsigned
 
using stream_id = unsigned
 
using io_group_ptr = std::shared_ptr< io_group >
 
using iovec_keeper = std::vector<::iovec >
 
using stop_iteration = bool_class< stop_iteration_tag >
 
using mmap_area = std::unique_ptr< char[], mmap_deleter >
 
using rwlock = basic_rwlock<>
 
using sched_clock = std::chrono::steady_clock
 
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 class  open_flags {
  rw = O_RDWR , ro = O_RDONLY , wo = O_WRONLY , create = O_CREAT ,
  truncate = O_TRUNC , exclusive = O_EXCL , dsync = O_DSYNC
}
 
enum class  directory_entry_type {
  unknown , block_device , char_device , directory ,
  fifo , link , regular , socket
}
 
enum class  fs_type {
  other , xfs , ext2 , ext3 ,
  ext4 , btrfs , hfs , tmpfs
}
 Enumeration describing the type of a particular filesystem.
 
enum class  access_flags {
  exists = F_OK , read = R_OK , write = W_OK , execute = X_OK ,
  lookup = execute
}
 
enum class  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 class  idle_cpu_handler_result { no_more_work , interrupted_by_higher_priority_task }
 
enum class  memory_allocator { seastar , standard }
 
enum class  transport { TCP = IPPROTO_TCP , SCTP = IPPROTO_SCTP }
 
enum class  log_level {
  error , warn , info , debug ,
  trace
}
 log level used with More...
 
enum class  logger_timestamp_style { none , boot , real }
 Timestamp style.
 
enum class  logger_ostream_type { none , cout = 1 , cerr = 2 }
 Output stream to use for logging.
 

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)
 
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)
 
template<typename T >
cpu_to_le (T x) noexcept
 
template<typename T >
le_to_cpu (T x) noexcept
 
template<typename T >
cpu_to_be (T x) noexcept
 
template<typename T >
be_to_cpu (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... T>
auto operator co_await (coroutine::without_preemption_check< 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)
 
future< shared_ptr< file_impl > > make_file_impl (int fd, file_open_options options, int oflags, struct stat st) noexcept
 
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={})
 
future< output_stream< char > > make_file_output_stream (file file, uint64_t buffer_size=8192) noexcept
 
future< output_stream< char > > make_file_output_stream (file file, file_output_stream_options options) noexcept
 
future< data_sinkmake_file_data_sink (file, file_output_stream_options) noexcept
 
template<typename T = void, typename... A>
future< T > make_ready_future (A &&... value) noexcept
 Creates a future in an available, value state. More...
 
template<typename T = void>
future< T > make_exception_future (std::exception_ptr &&value) noexcept
 Creates a future in an available, failed state. More...
 
template<typename T = void, typename Exception >
future< T > make_exception_future (Exception &&ex) noexcept
 Creates a future in an available, failed state. More...
 
template<typename T = void>
future< T > make_exception_future (const std::exception_ptr &ex) noexcept
 
template<typename T = void>
future< T > make_exception_future (std::exception_ptr &ex) noexcept
 
template<typename T = void>
future< T > make_exception_future (const std::exception_ptr &&ex) noexcept
 
template<typename T = void>
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_with_backtrace (Exception &&ex) noexcept
 
void set_idle_cpu_handler (idle_cpu_handler &&handler)
 
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 Sentinel , typename Func >
future parallel_for_each (Iterator begin, Sentinel 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 Sentinel , typename Func >
future max_concurrent_for_each (Iterator begin, Sentinel 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)
 
bool set_abort_on_internal_error (bool do_abort) noexcept
 
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
 
void on_fatal_internal_error (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)
 
template<typename T >
void throw_pthread_error (T r)
 
mmap_area mmap_anonymous (void *addr, size_t length, int prot, int flags)
 
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)
 
std::set< unsigned > get_current_cpuset ()
 
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)
 
void trim_trailing_spaces_and_tabs (sstring &str)
 
reactorengine ()
 
bool engine_is_ready ()
 
int hrtimer_signal ()
 
void report_exception (std::string_view message, std::exception_ptr) noexcept
 
cpu_set_t cpuid_to_cpuset (unsigned cpuid)
 
constexpr unsigned max_scheduling_groups ()
 
future< scheduling_groupcreate_scheduling_group (sstring name, float shares) noexcept
 
future< scheduling_groupcreate_scheduling_group (sstring name, sstring shortname, float shares) noexcept
 
future destroy_scheduling_group (scheduling_group sg) noexcept
 
future rename_scheduling_group (scheduling_group sg, sstring new_name) noexcept
 
future rename_scheduling_group (scheduling_group sg, sstring new_name, sstring new_shortname) 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)
 
net::datagram_channel make_unbound_datagram_channel (sa_family_t family)
 
net::datagram_channel make_bound_datagram_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...
 
SEASTAR_MODULE_EXPORT_BEGIN shard_id this_shard_id () noexcept
 Returns shard_id of the of the current shard.
 
template<typename Func >
std::enable_if_t<!std::is_nothrow_move_constructible_v< Func >, futurize_t< std::result_of_t< Func()> > > with_shared (shared_mutex &sm, Func &&func) noexcept
 
template<typename Func >
std::enable_if_t<!std::is_nothrow_move_constructible_v< Func >, futurize_t< std::result_of_t< Func()> > > with_lock (shared_mutex &sm, Func &&func) noexcept
 
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 >
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 >
bool operator== (const lw_shared_ptr< T > &x, std::nullptr_t)
 
template<typename T >
bool operator== (std::nullptr_t, const lw_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 >
bool operator!= (const lw_shared_ptr< T > &x, std::nullptr_t)
 
template<typename T >
bool operator!= (std::nullptr_t, const lw_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 >
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>>
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>
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 &)
 
template future sleep_abortable< manual_clock > (typename manual_clock::duration, abort_source &)
 
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_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)
 
template<typename T >
static constexpr size_t str_len (const T &s)
 
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)
 
template<typename T >
static void copy_str_to (char *&dst, const T &s)
 
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_checked (task *t) noexcept
 
void schedule_urgent (task *t) noexcept
 
template<typename Func , typename... Args>
futurize_t< std::invoke_result_t< Func, Args... > > async (thread_attributes attr, Func &&func, Args &&... args) noexcept
 
template<typename Func , typename... Args>
futurize_t< std::invoke_result_t< Func, Args... > > async (Func &&func, Args &&... args) noexcept
 
template<typename T , typename Alloc >
void transfer_pass1 (Alloc &a, T *from, T *to, std::enable_if_t< std::is_nothrow_move_constructible_v< T >> *=nullptr)
 
template<typename T , typename Alloc >
void transfer_pass2 (Alloc &, T *, T *, std::enable_if_t< std::is_nothrow_move_constructible_v< T >> *=nullptr)
 
template<typename T , typename Alloc >
void transfer_pass1 (Alloc &a, T *from, T *to, std::enable_if_t<!std::is_nothrow_move_constructible_v< T >> *=nullptr)
 
template<typename T , typename Alloc >
void transfer_pass2 (Alloc &a, T *from, T *, std::enable_if_t<!std::is_nothrow_move_constructible_v< T >> *=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
 
constexpr size_t operator""_KiB (unsigned long long n)
 
constexpr size_t operator""_MiB (unsigned long long n)
 
constexpr size_t operator""_GiB (unsigned long long n)
 
constexpr size_t operator""_TiB (unsigned long long n)
 
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 T >
auto when_all_succeed (std::vector< future< T >> &&futures) noexcept
 
template<class FutureIterator >
auto when_any (FutureIterator begin, FutureIterator end) noexcept -> future< when_any_result< std::vector< std::decay_t< typename std::iterator_traits< FutureIterator >::value_type >>>>
 
template<class... FutOrFuncs>
auto when_any (FutOrFuncs &&... fut_or_funcs) 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...
 
auto operator co_await (coroutine::exception ex) noexcept
 
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 >
uint32_t toeplitz_hash (rss_key_type key, const T &data)
 
std::ostream & operator<< (std::ostream &, const unix_domain_addr &)
 
bool operator== (const frame &a, const frame &b) noexcept
 
frame decorate (uintptr_t addr) noexcept
 
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)
 
template<typename Closeable , typename Func >
futurize_t< std::invoke_result_t< Func, Closeable & > > with_closeable (Closeable &&obj, Func func) noexcept
 
template<typename Stoppable , typename Func >
futurize_t< std::invoke_result_t< Func, Stoppable & > > with_stoppable (Stoppable &&obj, Func func) noexcept
 
size_t parse_memory_size (std::string_view s)
 
static std::vector< char > string2vector (std::string_view 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 yield () noexcept
 Returns a future which is not ready but is scheduled to resolve soon. More...
 
future maybe_yield () noexcept
 
future check_for_io_immediately () noexcept
 
future later () noexcept
 Returns a future which is not ready but is scheduled to resolve soon. More...
 
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 , char Padding = ' '>
char * convert_hex_safe (char *buf, size_t bufsz, Integral n) 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

logger io_log
 
bool aio_nowait_supported
 
__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()
 
constexpr size_t KB = 1 << 10
 
constexpr size_t MB = 1 << 20
 
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::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.
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
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::function_traits

struct seastar::function_traits

◆ seastar::continue_consuming

struct seastar::continue_consuming

◆ seastar::output_stream_options

struct seastar::output_stream_options
Class Members
bool batch_flushes Try to merge flushes with each other.
bool trim_to_size

Make sure that buffers put into sink haven't grown larger than the configured size

◆ seastar::usecfmt_wrapper

struct seastar::usecfmt_wrapper
Class Members
TimePoint val

◆ seastar::lw_shared_ptr_deleter

struct seastar::lw_shared_ptr_deleter

◆ 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::when_any_result

struct seastar::when_any_result
Class Members
Sequence futures
size_t index

◆ seastar::network_stack_entry

struct seastar::network_stack_entry
Class Members
typedef noncopyable_function< future< unique_ptr< network_stack > >(const option_group &)> factory_func
Class Members
factory_func factory
bool is_default
sstring name
unique_ptr< option_group > opts

◆ seastar::shared_object

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

◆ seastar::frame

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

◆ 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
bool with_color

◆ seastar::noncopyable_function

class seastar::noncopyable_function

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

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

◆ 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

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).

◆ memory_allocator

Enumerator
seastar 

Seastar's own allocator, optimized for its shard-per core design. Strongly recommended for most seastar apps.

standard 

The standard allocator from libc. Useful when writing seastar-based tool apps that want to minimize their footprint on the system they run on.

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() [1/2]

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_scheduling_group() [2/2]

future<scheduling_group> seastar::create_scheduling_group ( sstring  name,
sstring  shortname,
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 identifies the group; will be used as a label in the group's metrics
shortnameA name that identifies the group; will be printed in the logging message aside of the shard id. please note, the shortname will be truncated to 4 characters.
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_data_sink()

future<data_sink> seastar::make_file_data_sink ( file  ,
file_output_stream_options   
)
noexcept

Create a data_sink for writing starting at the position zero of a newly created file. Closes the file if the sink creation fails.

◆ 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_file_output_stream() [1/2]

future<output_stream<char> > seastar::make_file_output_stream ( file  file,
file_output_stream_options  options 
)
noexcept

Create an output_stream for writing starting at the position zero of a newly created file. NOTE: flush() should be the last thing to be called on a file output stream. Closes the file if the stream creation fails.

◆ make_file_output_stream() [2/2]

future<output_stream<char> > seastar::make_file_output_stream ( file  file,
uint64_t  buffer_size = 8192 
)
noexcept

Create an output_stream for writing starting at the position zero of a newly created file. NOTE: flush() should be the last thing to be called on a file output stream. Closes the file if the stream creation fails.

Examples
file_demo.cc.

◆ 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_fatal_internal_error()

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

Report an internal error and abort unconditionally

The error will be logged to \logger and the program will be aborted, regardless of the abort_on_internal_error setting. This overload can be used to replace assert().

◆ 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 abort or throw the passed-in ex. In both cases an error will be logged with logger, containing ex and the current backtrace. 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 abort or throw a std::runtime_error. In both cases an error will be logged with logger, containing reason and the current backtrace.

◆ 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.

◆ operator co_await()

template<typename... T>
auto seastar::operator co_await ( coroutine::without_preemption_check< T... >  f)
noexcept

Wait for a future without a preemption check

Parameters
fa future<> wrapped with without_preemption_check

◆ 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_scheduling_group() [1/2]

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

◆ rename_scheduling_group() [2/2]

future seastar::rename_scheduling_group ( scheduling_group  sg,
sstring  new_name,
sstring  new_shortname 
)
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.
new_shortnameThe new shortname 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()

bool seastar::set_abort_on_internal_error ( bool  do_abort)
noexcept

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

Returns
the current abort_on_internal_error state.

◆ 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

◆ when_any() [1/2]

template<class... FutOrFuncs>
auto seastar::when_any ( FutOrFuncs &&...  fut_or_funcs)
noexcept

Wait for the first of multiple futures to complete (variadic version).

Each future can be passed directly, or a function that returns a future can be given instead.

Returns a when_any_result (following the concurrency TS from the standard library), containing a std::tuple to all futures and the index (into the vector) of the future that resolved.

Parameters
fut_or_funcsfutures or functions that return futures
Returns
a when_any_result containing a tuple of all futures and and index; when ready, at least one of the contained futures (the one indicated by index) will be ready.

◆ when_any() [2/2]

template<class FutureIterator >
auto seastar::when_any ( FutureIterator  begin,
FutureIterator  end 
) -> future<when_any_result<std::vector<std::decay_t<typename std::iterator_traits<FutureIterator>::value_type>>>>
noexcept

Wait for the first of multiple futures to complete (iterator version).

Given a range of futures as input, wait for the first of them to resolve (either successfully or with an exception), and return all of them in a when_any_result (following the concurrency TS from the standard library), containing a std::vector to all futures and the index (into the vector) of the future that resolved.

Parameters
beginan InputIterator designating the beginning of the range of futures
endan InputIterator designating the end of the range of futures
Returns
a when_any_result of all the futures in the input; when ready, at least one of the contained futures (the one indicated by index) will be ready.

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
}