0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
StatusPersister.h
Go to the documentation of this file.
1 /* -*- c++ -*-
2  * Copyright (C) 2007-2014 Hypertable, Inc.
3  *
4  * This file is part of Hypertable.
5  *
6  * Hypertable is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; version 3 of the
9  * License, or any later version.
10  *
11  * Hypertable is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  * 02110-1301, USA.
20  */
21 
26 
27 #ifndef Common_StatusPersister_h
28 #define Common_StatusPersister_h
29 
30 #include <Common/Filesystem.h>
31 #include <Common/Status.h>
32 
33 #include <mutex>
34 #include <string>
35 #include <vector>
36 
37 namespace Hypertable {
38 
41 
44 
45  public:
46 
50  static void set(const Status &status,
51  std::vector<std::string> additional_lines);
52 
57  static void get(Status &status);
58 
59  private:
60 
65  static void initialize();
66 
69 
71  static std::string ms_fname;
72 
74  static Status ms_status;
75 
76  };
77 
79 }
80 
81 
82 #endif // Common_StatusPersister_h
static std::mutex mutex
Definition: Logger.cc:43
Holds Nagios-style program status information.
Definition: Status.h:42
Abstract base class for a filesystem.
Declarations for Status.
static Status ms_status
Current persistent status.
bool status(ContextPtr &context, Timer &timer, Status &status)
Runs a status check on the master.
Definition: Utility.cc:408
static std::mutex ms_mutex
Mutex for serializaing access to members
Hypertable definitions
static void set(const Status &status, std::vector< std::string > additional_lines)
Sets persistent status.
Persists program status information to disk.
static void initialize()
Initializes variables.
static std::string ms_fname
Name of persistent status file.