Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / mds / Mantle.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3 /*
4  * Ceph - scalable distributed file system
5  *
6  * Copyright (C) 2016 Michael Sevilla <mikesevilla3@gmail.com>
7  *
8  * This is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License version 2.1, as published by the Free Software
11  * Foundation.  See file COPYING.
12  *
13  */
14
15 #ifndef CEPH_MANTLE_H
16 #define CEPH_MANTLE_H
17
18 #include <lua.hpp>
19 #include <vector>
20 #include <map>
21 #include <string>
22
23 #include "mdstypes.h"
24
25 class Mantle {
26   public:
27     Mantle();
28     ~Mantle() { if (L) lua_close(L); }
29     int balance(const std::string &script,
30                 mds_rank_t whoami,
31                 const std::vector <std::map<std::string, double>> &metrics,
32                 std::map<mds_rank_t,double> &my_targets);
33
34   protected:
35     lua_State *L;
36 };
37
38 #endif