Skip to content

Commit 19e998a

Browse files
committed
rename PollItem to reflect its current role as a facade on executor
1 parent 73571be commit 19e998a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

parsl/jobs/job_status_poller.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
logger = logging.getLogger(__name__)
1717

1818

19-
class PollItem:
19+
class PolledExecutorFacade:
2020
def __init__(self, executor: BlockProviderExecutor, dfk: Optional["parsl.dataflow.dflow.DataFlowKernel"] = None):
2121
self._executor = executor
2222
self._dfk = dfk
@@ -110,7 +110,7 @@ class JobStatusPoller(Timer):
110110
def __init__(self, *, strategy: Optional[str], max_idletime: float,
111111
strategy_period: Union[float, int],
112112
dfk: Optional["parsl.dataflow.dflow.DataFlowKernel"] = None) -> None:
113-
self._poll_items = [] # type: List[PollItem]
113+
self._poll_items = [] # type: List[PolledExecutorFacade]
114114
self.dfk = dfk
115115
self._strategy = Strategy(strategy=strategy,
116116
max_idletime=max_idletime)
@@ -121,7 +121,7 @@ def poll(self) -> None:
121121
self._run_error_handlers(self._poll_items)
122122
self._strategy.strategize(self._poll_items)
123123

124-
def _run_error_handlers(self, status: List[PollItem]) -> None:
124+
def _run_error_handlers(self, status: List[PolledExecutorFacade]) -> None:
125125
for es in status:
126126
es.executor.handle_errors(es.status)
127127

@@ -134,5 +134,5 @@ def add_executors(self, executors: Sequence[BlockProviderExecutor]) -> None:
134134
for executor in executors:
135135
if executor.status_polling_interval > 0:
136136
logger.debug("Adding executor {}".format(executor.label))
137-
self._poll_items.append(PollItem(executor, self.dfk))
137+
self._poll_items.append(PolledExecutorFacade(executor, self.dfk))
138138
self._strategy.add_executors(executors)

parsl/jobs/strategy.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def add_executors(self, executors: Sequence[ParslExecutor]) -> None:
146146
for executor in executors:
147147
self.executors[executor.label] = {'idle_since': None}
148148

149-
def _strategy_init_only(self, status_list: List[jsp.PollItem]) -> None:
149+
def _strategy_init_only(self, status_list: List[jsp.PolledExecutorFacade]) -> None:
150150
"""Scale up to init_blocks at the start, then nothing more.
151151
"""
152152
for exec_status in status_list:
@@ -158,10 +158,10 @@ def _strategy_init_only(self, status_list: List[jsp.PollItem]) -> None:
158158
else:
159159
logger.debug("strategy_init_only: doing nothing")
160160

161-
def _strategy_simple(self, status_list: List[jsp.PollItem]) -> None:
161+
def _strategy_simple(self, status_list: List[jsp.PolledExecutorFacade]) -> None:
162162
self._general_strategy(status_list, strategy_type='simple')
163163

164-
def _strategy_htex_auto_scale(self, status_list: List[jsp.PollItem]) -> None:
164+
def _strategy_htex_auto_scale(self, status_list: List[jsp.PolledExecutorFacade]) -> None:
165165
"""HTEX specific auto scaling strategy
166166
167167
This strategy works only for HTEX. This strategy will scale out by

0 commit comments

Comments
 (0)