NCBI C++ ToolKit
netcache_admin.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef CONN___NETCACHE_ADMIN__HPP
2 #define CONN___NETCACHE_ADMIN__HPP
3 
4 /* $Id: netcache_admin.hpp 64963 2014-10-27 18:24:02Z sadyrovr $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Dmitry Kazimirov
30  *
31  * File Description:
32  * Administrative API for NetCache.
33  *
34  */
35 
36 /// @file netcache_admin.hpp
37 /// Administrative API for NetCache.
38 ///
39 
40 #include "netcomponent.hpp"
41 
42 
44 
45 
46 /** @addtogroup NetCacheClient
47  *
48  * @{
49  */
50 
51 
52 struct SNetCacheAdminImpl;
53 
55 {
56  NCBI_NET_COMPONENT(NetCacheAdmin);
57 
58  /// Shutdown options
59  ///
61  eNormalShutdown, ///< Normal shutdown is requested.
62  eDrain, ///< Wait for all blobs to expire.
63  };
64 
65  /// Shutdown the server daemon.
66  ///
67  /// @note
68  /// Protected to avoid a temptation to call it from time to time. :)
69  void ShutdownServer(EShutdownOption shutdown_option = eNormalShutdown);
70 
71  /// Reload configuration options
73  eCompleteReload, ///< Complete reload is requested.
74  eMirrorReload, ///< Parameters related to mirroring will only be reloaded.
75  };
76 
77  /// Reload configuration parameters from the same source.
78  void ReloadServerConfig(EReloadConfigOption reload_option = eCompleteReload);
79 
80  /// Remove all blobs from an ICache database.
81  void Purge(const string& cache_name);
82 
83  /// Print contents of the configuration file
84  void PrintConfig(CNcbiOstream& output_stream);
85 
86  /// Enumeration for use with PrintStat(). Indicates
87  /// whether to return the current (incomplete) aggregation
88  /// period or the previous one (which is complete).
91  eReturnCompletePeriod
92  };
93 
94  /// Print server statistics
95  /// @param output_stream Stream for printing
96  /// the GETSTAT command output.
97  /// @param aggregation_period Statistics aggregation
98  /// interval to print ('1min', '1h', 'life', and so on).
99  /// @param period_completeness Whether to print statistics
100  /// for the previous (complete) aggregation interval
101  /// (as opposed to printing the current but incomplete
102  /// statistics).
103  void PrintStat(CNcbiOstream& output_stream,
104  const string& aggregation_period = kEmptyStr,
105  EStatPeriodCompleteness period_completeness = eReturnCurrentPeriod);
106 
107  // Print server health information
108  void PrintHealth(CNcbiOstream& output_stream);
109 
110  void GetServerVersion(CNcbiOstream& output_stream);
111 };
112 
113 /* @} */
114 
115 
117 
118 #endif /* CONN___NETCACHE_ADMIN__HPP */
EStatPeriodCompleteness
Enumeration for use with PrintStat().
EShutdownOption
Shutdown options.
EReloadConfigOption
Reload configuration options.
@ eNormalShutdown
Normal shutdown is requested.
@ eDrain
Wait for all blobs to expire.
@ eMirrorReload
Parameters related to mirroring will only be reloaded.
@ eCompleteReload
Complete reload is requested.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
Definition: ncbistre.hpp:149
#define kEmptyStr
Definition: ncbistr.hpp:123
#define NCBI_XCONNECT_EXPORT
#define NCBI_NET_COMPONENT(component)
Modified on Fri Sep 20 14:58:23 2024 by modify_doxy.py rev. 669887