Subversion Repositories shark

Rev

Rev 929 | 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
986 julio 38
   requested for the corresponding server.
39
 
40
   @param contract   the pointer to the contract object
41
   @param[in] granted_capacity_flag boolean value set to true to
42
     avoid the change in the period due to changes in other servers
43
 
44
   @retval  FSF_ERR_BAD_ARGUMENT :  if contract is NULL
45
*/
899 trimarchi 46
int
47
fsf_set_contract_granted_capacity_flag
48
  (fsf_contract_parameters_t *contract,
49
   bool                    granted_capacity_flag);
50
 
51
 
929 lipari 52
/**
53
   \ingroup distsparemodule
54
 
55
   This operation returns in the place pointed to by
56
   granted_capacity_flag the value of the corresponding flag in the
986 julio 57
   contract parameters object pointed to by contract.
58
 
59
   @param[in] contract   the pointer to the contract object
60
   @param[in] granted_capacity_flag pointer to the variable that
61
     will contain the boolean value of the granted_capacity_flag
62
 
63
   @retval  FSF_ERR_BAD_ARGUMENT :  if any of the pointers is NULL
64
*/
899 trimarchi 65
int
66
fsf_get_contract_granted_capacity_flag
67
  (fsf_contract_parameters_t *contract,
68
   bool                   *granted_capacity_flag);
69
 
70
 
929 lipari 71
/**
72
   \ingroup distsparemodule
73
 
74
   This operation is used to return spare capacity that was assigned
75
   to a server but that cannot be used due to restrictions in other
76
   servers of a distributed transaction.  This operation changes the
77
   cycle period and budget of the given server to the values given in
986 julio 78
   new_period and new_budget, respectively.
79
 
80
   @param [in] server server id
81
   @param [in] new_period pointer to the new period value
82
   @param [in] new_budget pointer to the new budget value
83
 
84
   @retval  FSF_ERR_BAD_ARGUMENT :  if (the server does not have
85
     the granted_capacity flag set) or
86
     (the new period is less than the current one), or
87
     (the new budget is larger than the current one), or
88
     (the new period is greater than the maximum period currently
89
       specified in the contract associated to the server), or
90
     (the new budget is smaller than the minimum budget in the contract) or
91
     (if the granularity is discrete and the new period and budget
92
      do not match any of the period-budget pairs in the utilization
93
      set of the server).
94
*/
899 trimarchi 95
int
96
fsf_set_server_capacity
97
   (fsf_server_id_t          server,
98
    const struct timespec   *new_period,
99
    const struct timespec   *new_budget);
100
 
101
 
102
#endif // _FSF_DISTRIBUTED_SPARE_CAPACITY_H_