Rev 986 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1063 | tullio | 1 | |
2 | /* |
||
3 | * This program is free software; you can redistribute it and/or modify |
||
4 | * it under the terms of the GNU General Public License as published by |
||
5 | * the Free Software Foundation; either version 2 of the License, or |
||
6 | * (at your option) any later version. |
||
7 | * |
||
8 | * This program is distributed in the hope that it will be useful, |
||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
11 | * GNU General Public License for more details. |
||
12 | * |
||
13 | * You should have received a copy of the GNU General Public License |
||
14 | * along with this program; if not, write to the Free Software |
||
15 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
||
16 | * |
||
17 | */ |
||
18 | |||
929 | lipari | 19 | /** |
20 | @file distributed spare capacity |
||
21 | */ |
||
22 | |||
899 | trimarchi | 23 | //fsf_distributed_spare_capacity.h |
24 | //===================================================================== |
||
25 | // FFFFFFIII RRRRR SSTTTTTTT |
||
26 | // FF IIR RR SS |
||
27 | // FF IR SS |
||
28 | // FFFFFF RRRR SSSSST |
||
29 | // FF FI RRR SS |
||
30 | // FF II RRR SS |
||
31 | // FF IIIIIR RS |
||
32 | // |
||
33 | // FSF(FIRST Scheduling Framework) |
||
34 | // distributed spare capacity functionality |
||
35 | //===================================================================== |
||
36 | |||
37 | #include "fsf_core.h" |
||
38 | #include "fsf_distributed.h" |
||
39 | |||
40 | #ifndef _FSF_DISTRIBUTED_SPARE_CAPACITY_H_ |
||
41 | #define _FSF_DISTRIBUTED_SPARE_CAPACITY_H_ |
||
42 | |||
43 | #define FSF_DISTRIBUTED_SPARE_CAPACITY_MODULE_SUPPORTED 1 |
||
44 | |||
929 | lipari | 45 | /** |
46 | \ingroup distsparemodule |
||
899 | trimarchi | 47 | |
929 | lipari | 48 | This operation sets the granted capacity flag in the contract |
49 | parameters object pointed to by contract to the boolean specified |
||
50 | in granted_capacity_flag. This flag indicates to the scheduler that |
||
51 | once the negotiation of the respective contract is finished, the |
||
52 | first values for the budget and period given to the corresponding |
||
53 | server must not be changed due to the negotiation or renegotiation |
||
54 | of any other contract in the system. The period can change, though, |
||
55 | if a renegotiation or a change of quality and importance is |
||
986 | julio | 56 | requested for the corresponding server. |
57 | |||
58 | @param contract the pointer to the contract object |
||
59 | @param[in] granted_capacity_flag boolean value set to true to |
||
60 | avoid the change in the period due to changes in other servers |
||
61 | |||
62 | @retval FSF_ERR_BAD_ARGUMENT : if contract is NULL |
||
63 | */ |
||
899 | trimarchi | 64 | int |
65 | fsf_set_contract_granted_capacity_flag |
||
66 | (fsf_contract_parameters_t *contract, |
||
67 | bool granted_capacity_flag); |
||
68 | |||
69 | |||
929 | lipari | 70 | /** |
71 | \ingroup distsparemodule |
||
72 | |||
73 | This operation returns in the place pointed to by |
||
74 | granted_capacity_flag the value of the corresponding flag in the |
||
986 | julio | 75 | contract parameters object pointed to by contract. |
76 | |||
77 | @param[in] contract the pointer to the contract object |
||
78 | @param[in] granted_capacity_flag pointer to the variable that |
||
79 | will contain the boolean value of the granted_capacity_flag |
||
80 | |||
81 | @retval FSF_ERR_BAD_ARGUMENT : if any of the pointers is NULL |
||
82 | */ |
||
899 | trimarchi | 83 | int |
84 | fsf_get_contract_granted_capacity_flag |
||
85 | (fsf_contract_parameters_t *contract, |
||
86 | bool *granted_capacity_flag); |
||
87 | |||
88 | |||
929 | lipari | 89 | /** |
90 | \ingroup distsparemodule |
||
91 | |||
92 | This operation is used to return spare capacity that was assigned |
||
93 | to a server but that cannot be used due to restrictions in other |
||
94 | servers of a distributed transaction. This operation changes the |
||
95 | cycle period and budget of the given server to the values given in |
||
986 | julio | 96 | new_period and new_budget, respectively. |
97 | |||
98 | @param [in] server server id |
||
99 | @param [in] new_period pointer to the new period value |
||
100 | @param [in] new_budget pointer to the new budget value |
||
101 | |||
102 | @retval FSF_ERR_BAD_ARGUMENT : if (the server does not have |
||
103 | the granted_capacity flag set) or |
||
104 | (the new period is less than the current one), or |
||
105 | (the new budget is larger than the current one), or |
||
106 | (the new period is greater than the maximum period currently |
||
107 | specified in the contract associated to the server), or |
||
108 | (the new budget is smaller than the minimum budget in the contract) or |
||
109 | (if the granularity is discrete and the new period and budget |
||
110 | do not match any of the period-budget pairs in the utilization |
||
111 | set of the server). |
||
112 | */ |
||
899 | trimarchi | 113 | int |
114 | fsf_set_server_capacity |
||
115 | (fsf_server_id_t server, |
||
116 | const struct timespec *new_period, |
||
117 | const struct timespec *new_budget); |
||
118 | |||
119 | |||
120 | #endif // _FSF_DISTRIBUTED_SPARE_CAPACITY_H_ |