taskflushmutable.h 1.2 KB

12345678910111213141516171819202122232425262728
  1. //
  2. // Copyright (c) 2017-2026, Manticore Software LTD (https://manticoresearch.com)
  3. // Copyright (c) 2001-2016, Andrew Aksyonoff
  4. // Copyright (c) 2008-2016, Sphinx Technologies Inc
  5. // All rights reserved
  6. //
  7. // This program is free software; you can redistribute it and/or modify
  8. // it under the terms of the GNU General Public License. You should have
  9. // received a copy of the GPL license along with this program; if you
  10. // did not, you can find it at http://www.gnu.org/
  11. //
  12. /// @file taskflushmutable.h
  13. /// Task to check and flush mutable indexes (rt, precloate) when necessary or by timeout
  14. #pragma once
  15. #include "sphinxstd.h"
  16. constexpr int64_t DEFAULT_FLUSH_PERIOD = 10*3600*1000*1000ll; // reschedule in 10h in case planned flush failed
  17. // set from param `rt_flush_period`, see conf_options_reference/searchd_program_configuration_options.html
  18. void SetRtFlushPeriod ( int64_t iPeriod = DEFAULT_FLUSH_PERIOD );
  19. void ShutdownFlushingMutable();
  20. /* this cb attached to local indexes hash table 'add-or-replace' function. It is called for all new arrived indexes,
  21. * and if it suitable for flushing (i.e. if it exists and is mutable), engages flushing task by timer for it.*/
  22. void HookSubscribeMutableFlush ( const CSphString& sName );