Rev 929 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
899 | trimarchi | 1 | //fsf_distributed_spare_capacity.h |
2 | //===================================================================== |
||
3 | // FFFFFFIII RRRRR SSTTTTTTT |
||
4 | // FF IIR RR SS |
||
5 | // FF IR SS |
||
6 | // FFFFFF RRRR SSSSST |
||
7 | // FF FI RRR SS |
||
8 | // FF II RRR SS |
||
9 | // FF IIIIIR RS |
||
10 | // |
||
11 | // FSF(FIRST Scheduling Framework) |
||
12 | // distributed spare capacity functionality |
||
13 | //===================================================================== |
||
14 | |||
15 | #include "fsf_core.h" |
||
16 | #include "fsf_distributed.h" |
||
17 | |||
18 | #ifndef _FSF_DISTRIBUTED_SPARE_CAPACITY_H_ |
||
19 | #define _FSF_DISTRIBUTED_SPARE_CAPACITY_H_ |
||
20 | |||
21 | #define FSF_DISTRIBUTED_SPARE_CAPACITY_MODULE_SUPPORTED 1 |
||
22 | |||
23 | |||
24 | //This operation sets the granted capacity flag in the contract |
||
25 | //parameters object pointed to by contract to the boolean specified in |
||
26 | //granted_capacity_flag. This flag indicates to the scheduler that |
||
27 | //once the negotiation of the respective contract is finished, the |
||
28 | //first values for the budget and period given to the corresponding |
||
29 | //server must not be changed due to the negotiation or renegotiation |
||
30 | //of any other contract in the system. The period can change, though, |
||
31 | //if a renegotiation or a change of quality and importance is |
||
32 | //requested for the corresponding server It fails with |
||
33 | //FSF_ERR_BAD_ARGUMENT if contract is NULL. |
||
34 | int |
||
35 | fsf_set_contract_granted_capacity_flag |
||
36 | (fsf_contract_parameters_t *contract, |
||
37 | bool granted_capacity_flag); |
||
38 | |||
39 | |||
40 | //This operation returns in the place pointed to by |
||
41 | //granted_capacity_flag the value of the corresponding flag in the |
||
42 | //contract parameters object pointed to by contract. It fails with |
||
43 | //FSF_ERR_BAD_ARGUMENT if any of the pointers is NULL |
||
44 | int |
||
45 | fsf_get_contract_granted_capacity_flag |
||
46 | (fsf_contract_parameters_t *contract, |
||
47 | bool *granted_capacity_flag); |
||
48 | |||
49 | |||
50 | //This operation is used to return spare capacity that was assigned to |
||
51 | //a server but that cannot be used due to restrictions in other |
||
52 | //servers of a distributed transaction. This operation changes the |
||
53 | //cycle period and budget of the given server to the values given in |
||
54 | //new_period and new_budget, respectively. It fails with |
||
55 | //FSF_ERR_BAD_ARGUMENT if the server does not have the |
||
56 | //granted_capacity flag set, if the new period is less than the |
||
57 | //current one, or if the new budget is larger than the current one. It |
||
58 | //also fails with the same error number if the new period is greater |
||
59 | //than the maximum period currently specified in the contract |
||
60 | //associated to the server or, similarly, if the new budget is smaller |
||
61 | //than the minimum budget in the contract. It also fails with the |
||
62 | //same number if the granularity is discrete and the new period and |
||
63 | //budget do not match any of the period-budget pairs in the |
||
64 | //utilization set of the server |
||
65 | int |
||
66 | fsf_set_server_capacity |
||
67 | (fsf_server_id_t server, |
||
68 | const struct timespec *new_period, |
||
69 | const struct timespec *new_budget); |
||
70 | |||
71 | |||
72 | #endif // _FSF_DISTRIBUTED_SPARE_CAPACITY_H_ |