-
Notifications
You must be signed in to change notification settings - Fork 0
/
FSQueue.py
75 lines (46 loc) · 1.43 KB
/
FSQueue.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
'''
Created on Jan 8, 2015
@author: niuzhaojie
'''
import abc
import sys
from Schedulable import Schedulable
class FSQueue(Schedulable):
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def __init__(self, name, parent, scheduler):
super(FSQueue, self).__init__()
self._name = name
self._parent = parent
self._scheduler = scheduler
self._policy = None
self._maxApps = sys.maxint
self._bestMulResFitness = -1.0
self._bestResourceEntropy = -1.0
def setMaxApps(self, num):
self._maxApps = num
def getName(self):
return self._name
def getPolicy(self):
return self._policy
def setPolicy(self, policy):
self._policy = policy
def getStartTime(self):
return 0;
def setMultiResFitness(self, best):
self._bestMulResFitness = best
def getMultiResFitness(self):
return self._bestMulResFitness
def setResEntropy(self, entropy):
self._bestResourceEntropy = entropy
def getResEntropy(self):
return self._bestResourceEntropy
@abc.abstractmethod
def recomputeShares(self):
return
@abc.abstractmethod
def getChildQueues(self):
return
@abc.abstractmethod
def getAllAppSchedulables(self):
return