Subversion Repositories shark

Rev

Rev 899 | Rev 986 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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