Skip to content

Commit 8ffc464

Browse files
committed
josh - refactor emr status map
Signed-off-by: Jialiang Liang <[email protected]>
1 parent 135af2c commit 8ffc464

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

src/plugins/dashboard/public/application/utils/direct_query_sync/direct_query_sync.ts

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,19 @@ export const DSL_BASE = `${DIRECT_QUERY_BASE}/dsl`;
1919
// Module for handling EMR states for Dashboards Progress Bar. All of these except "fresh" are
2020
// directly from the EMR job run states. "ord" is used to approximate progress (eyeballed relative
2121
// stage times), and "terminal" indicates whether a job is in progress at all.
22-
export const EMR_STATES = new Map<string, { ord: number; terminal: boolean }>(
23-
Object.entries({
24-
submitted: { ord: 0, terminal: false },
25-
queued: { ord: 10, terminal: false },
26-
pending: { ord: 20, terminal: false },
27-
scheduled: { ord: 30, terminal: false },
28-
running: { ord: 70, terminal: false },
29-
cancelling: { ord: 90, terminal: false },
30-
success: { ord: 100, terminal: true },
31-
failed: { ord: 100, terminal: true },
32-
cancelled: { ord: 100, terminal: true },
33-
// The "null state" for a fresh page load, which components conditionally use on load.
34-
fresh: { ord: 100, terminal: true },
35-
})
36-
);
22+
export const EMR_STATES = new Map<string, { ord: number; terminal: boolean }>([
23+
['submitted', { ord: 0, terminal: false }],
24+
['queued', { ord: 10, terminal: false }],
25+
['pending', { ord: 20, terminal: false }],
26+
['scheduled', { ord: 30, terminal: false }],
27+
['running', { ord: 70, terminal: false }],
28+
['cancelling', { ord: 90, terminal: false }],
29+
['success', { ord: 100, terminal: true }],
30+
['failed', { ord: 100, terminal: true }],
31+
['cancelled', { ord: 100, terminal: true }],
32+
// The "null state" for a fresh page load, which components conditionally use on load.
33+
['fresh', { ord: 100, terminal: true }],
34+
]);
3735

3836
export const MAX_ORD = 100;
3937

0 commit comments

Comments
 (0)