-
Notifications
You must be signed in to change notification settings - Fork 3.8k
/
Copy pathapiReducers.ts
577 lines (501 loc) · 20 KB
/
apiReducers.ts
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
// Copyright 2018 The Cockroach Authors.
//
// Use of this software is governed by the Business Source License
// included in the file licenses/BSL.txt.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, Version 2.0, included in the file
// licenses/APL.txt.
import _ from "lodash";
import { Action, combineReducers } from "redux";
import { ThunkAction, ThunkDispatch } from "redux-thunk";
import moment from "moment";
import { api as clusterUiApi, util } from "@cockroachlabs/cluster-ui";
import {
CachedDataReducer,
CachedDataReducerState,
KeyedCachedDataReducer,
KeyedCachedDataReducerState,
PaginatedCachedDataReducer,
PaginatedCachedDataReducerState,
} from "./cachedDataReducer";
import * as api from "src/util/api";
import { VersionList } from "src/interfaces/cockroachlabs";
import { versionCheck } from "src/util/cockroachlabsAPI";
import { INodeStatus, RollupStoreMetrics } from "src/util/proto";
import * as protos from "src/js/protos";
const { generateStmtDetailsToID } = util;
const SessionsRequest = protos.cockroach.server.serverpb.ListSessionsRequest;
// The primary export of this file are the "refresh" functions of the various
// reducers, which are used by many react components to request fresh data.
// However, some of the reducer objects are also fully exported for use
// in tests.
export const clusterReducerObj = new CachedDataReducer(
api.getCluster,
"cluster",
);
export const refreshCluster = clusterReducerObj.refresh;
const eventsReducerObj = new CachedDataReducer(
api.getEvents,
"events",
moment.duration(10, "s"),
);
export const refreshEvents = eventsReducerObj.refresh;
export type HealthState = CachedDataReducerState<api.HealthResponseMessage>;
export const healthReducerObj = new CachedDataReducer(
api.getHealth,
"health",
moment.duration(2, "s"),
);
export const refreshHealth = healthReducerObj.refresh;
function rollupStoreMetrics(
res: api.NodesResponseExternalMessage,
): INodeStatus[] {
return _.map(res.nodes, node => {
RollupStoreMetrics(node);
return node;
});
}
export const nodesReducerObj = new CachedDataReducer(
(req: api.NodesRequestMessage, timeout?: moment.Duration) =>
api.getNodesUI(req, timeout).then(rollupStoreMetrics),
"nodes",
moment.duration(10, "s"),
);
export const refreshNodes = nodesReducerObj.refresh;
const raftReducerObj = new CachedDataReducer(
api.raftDebug,
"raft",
moment.duration(10, "s"),
);
export const refreshRaft = raftReducerObj.refresh;
export const versionReducerObj = new CachedDataReducer(versionCheck, "version");
export const refreshVersion = versionReducerObj.refresh;
export const locationsReducerObj = new CachedDataReducer(
api.getLocations,
"locations",
moment.duration(10, "m"),
);
export const refreshLocations = locationsReducerObj.refresh;
const databasesReducerObj = new CachedDataReducer(
api.getDatabaseList,
"databases",
);
export const refreshDatabases = databasesReducerObj.refresh;
export const databaseRequestToID = (
req: api.DatabaseDetailsRequestMessage,
): string => req.database;
const databaseDetailsReducerObj = new KeyedCachedDataReducer(
api.getDatabaseDetails,
"databaseDetails",
databaseRequestToID,
);
const hotRangesRequestToID = (req: api.HotRangesRequestMessage) =>
req.page_token;
export const hotRangesReducerObj = new PaginatedCachedDataReducer(
api.getHotRanges,
"hotRanges",
hotRangesRequestToID,
);
export const refreshDatabaseDetails = databaseDetailsReducerObj.refresh;
export const refreshHotRanges = hotRangesReducerObj.refresh;
// NOTE: We encode the db and table name so we can combine them as a string.
// TODO(maxlang): there's probably a nicer way to do this
export function generateTableID(db: string, table: string) {
return `${encodeURIComponent(db)}/${encodeURIComponent(table)}`;
}
export const tableRequestToID = (
req:
| api.TableDetailsRequestMessage
| api.TableStatsRequestMessage
| api.IndexStatsRequestMessage,
): string => generateTableID(req.database, req.table);
const tableDetailsReducerObj = new KeyedCachedDataReducer(
api.getTableDetails,
"tableDetails",
tableRequestToID,
);
export const refreshTableDetails = tableDetailsReducerObj.refresh;
const tableStatsReducerObj = new KeyedCachedDataReducer(
api.getTableStats,
"tableStats",
tableRequestToID,
);
export const refreshTableStats = tableStatsReducerObj.refresh;
const indexStatsReducerObj = new KeyedCachedDataReducer(
api.getIndexStats,
"indexStats",
tableRequestToID,
);
export const invalidateIndexStats =
indexStatsReducerObj.cachedDataReducer.invalidateData;
export const refreshIndexStats = indexStatsReducerObj.refresh;
const nonTableStatsReducerObj = new CachedDataReducer(
api.getNonTableStats,
"nonTableStats",
moment.duration(1, "m"),
);
export const refreshNonTableStats = nonTableStatsReducerObj.refresh;
const logsReducerObj = new CachedDataReducer(
api.getLogs,
"logs",
moment.duration(10, "s"),
);
export const refreshLogs = logsReducerObj.refresh;
export const livenessReducerObj = new CachedDataReducer(
api.getLiveness,
"liveness",
moment.duration(10, "s"),
);
export const refreshLiveness = livenessReducerObj.refresh;
export const jobsKey = (
status: string,
type: protos.cockroach.sql.jobs.jobspb.Type,
limit: number,
) =>
`${encodeURIComponent(status)}/${encodeURIComponent(
type.toString(),
)}/${encodeURIComponent(limit.toString())}`;
const jobsRequestKey = (req: api.JobsRequestMessage): string =>
jobsKey(req.status, req.type, req.limit);
const jobsReducerObj = new KeyedCachedDataReducer(
api.getJobs,
"jobs",
jobsRequestKey,
null,
moment.duration(1, "minute"),
);
export const refreshJobs = jobsReducerObj.refresh;
export const jobRequestKey = (req: api.JobRequestMessage): string =>
`${req.job_id}`;
const jobReducerObj = new KeyedCachedDataReducer(
api.getJob,
"job",
jobRequestKey,
null,
);
export const refreshJob = jobReducerObj.refresh;
export const queryToID = (req: api.QueryPlanRequestMessage): string =>
req.query;
const queryPlanReducerObj = new CachedDataReducer(
api.getQueryPlan,
"queryPlan",
);
export const refreshQueryPlan = queryPlanReducerObj.refresh;
export const problemRangesRequestKey = (
req: api.ProblemRangesRequestMessage,
): string => (_.isEmpty(req.node_id) ? "all" : req.node_id);
const problemRangesReducerObj = new KeyedCachedDataReducer(
api.getProblemRanges,
"problemRanges",
problemRangesRequestKey,
moment.duration(0),
moment.duration(1, "m"),
);
export const refreshProblemRanges = problemRangesReducerObj.refresh;
export const certificatesRequestKey = (
req: api.CertificatesRequestMessage,
): string => (_.isEmpty(req.node_id) ? "none" : req.node_id);
const certificatesReducerObj = new KeyedCachedDataReducer(
api.getCertificates,
"certificates",
certificatesRequestKey,
moment.duration(1, "m"),
);
export const refreshCertificates = certificatesReducerObj.refresh;
export const rangeRequestKey = (req: api.RangeRequestMessage): string =>
_.isNil(req.range_id) ? "none" : req.range_id.toString();
const rangeReducerObj = new KeyedCachedDataReducer(
api.getRange,
"range",
rangeRequestKey,
moment.duration(0),
moment.duration(1, "m"),
);
export const refreshRange = rangeReducerObj.refresh;
export const allocatorRangeRequestKey = (
req: api.AllocatorRangeRequestMessage,
): string => (_.isNil(req.range_id) ? "none" : req.range_id.toString());
const allocatorRangeReducerObj = new KeyedCachedDataReducer(
api.getAllocatorRange,
"allocatorRange",
allocatorRangeRequestKey,
moment.duration(0),
moment.duration(1, "m"),
);
export const refreshAllocatorRange = allocatorRangeReducerObj.refresh;
export const rangeLogRequestKey = (req: api.RangeLogRequestMessage): string =>
_.isNil(req.range_id) ? "none" : req.range_id.toString();
const rangeLogReducerObj = new KeyedCachedDataReducer(
api.getRangeLog,
"rangeLog",
rangeLogRequestKey,
moment.duration(0),
moment.duration(5, "m"),
);
export const refreshRangeLog = rangeLogReducerObj.refresh;
export const settingsReducerObj = new CachedDataReducer(
api.getSettings,
"settings",
moment.duration(0),
moment.duration(1, "m"),
);
export const refreshSettings = settingsReducerObj.refresh;
export const sessionsReducerObj = new CachedDataReducer(
api.getSessions,
"sessions",
// The sessions page is polled at the usage sites.
null,
moment.duration(1, "m"),
);
export const invalidateSessions = sessionsReducerObj.invalidateData;
export const refreshSessions = sessionsReducerObj.refresh;
export const storesRequestKey = (req: api.StoresRequestMessage): string =>
_.isEmpty(req.node_id) ? "none" : req.node_id;
const storesReducerObj = new KeyedCachedDataReducer(
api.getStores,
"stores",
storesRequestKey,
moment.duration(0),
moment.duration(1, "m"),
);
export const refreshStores = storesReducerObj.refresh;
const queriesReducerObj = new CachedDataReducer(
api.getCombinedStatements,
"statements",
null,
moment.duration(30, "m"),
);
export const invalidateStatements = queriesReducerObj.invalidateData;
export const refreshStatements = queriesReducerObj.refresh;
export const statementDetailsRequestToID = (
req: api.StatementDetailsRequestMessage,
): string =>
generateStmtDetailsToID(
req.fingerprint_id.toString(),
req.app_names.toString(),
req.start,
req.end,
);
export const statementDetailsActionNamespace = "statementDetails";
export const statementDetailsReducerObj = new KeyedCachedDataReducer(
api.getStatementDetails,
statementDetailsActionNamespace,
statementDetailsRequestToID,
moment.duration(5, "m"),
moment.duration(30, "m"),
);
export const invalidateStatementDetails =
statementDetailsReducerObj.cachedDataReducer.invalidateData;
export const invalidateAllStatementDetails =
statementDetailsReducerObj.cachedDataReducer.invalidateAllData;
export const refreshStatementDetails = statementDetailsReducerObj.refresh;
const userSQLRolesReducerObj = new CachedDataReducer(
api.getUserSQLRoles,
"userSQLRoles",
moment.duration(1, "m"),
);
export const invalidateUserSQLRoles = userSQLRolesReducerObj.invalidateData;
export const refreshUserSQLRoles = userSQLRolesReducerObj.refresh;
const statementDiagnosticsReportsReducerObj = new CachedDataReducer(
api.getStatementDiagnosticsReports,
"statementDiagnosticsReports",
moment.duration(5, "m"),
moment.duration(1, "m"),
);
export const refreshStatementDiagnosticsRequests =
statementDiagnosticsReportsReducerObj.refresh;
export const invalidateStatementDiagnosticsRequests =
statementDiagnosticsReportsReducerObj.invalidateData;
const dataDistributionReducerObj = new CachedDataReducer(
api.getDataDistribution,
"dataDistribution",
moment.duration(1, "m"),
);
export const refreshDataDistribution = dataDistributionReducerObj.refresh;
const metricMetadataReducerObj = new CachedDataReducer(
api.getAllMetricMetadata,
"metricMetadata",
);
export const refreshMetricMetadata = metricMetadataReducerObj.refresh;
const clusterLocksReducerObj = new CachedDataReducer(
clusterUiApi.getClusterLocksState,
"clusterLocks",
null,
moment.duration(30, "s"),
);
export const refreshClusterLocks = clusterLocksReducerObj.refresh;
export const refreshLiveWorkload = (): ThunkAction<any, any, any, Action> => {
return (dispatch: ThunkDispatch<unknown, unknown, Action>) => {
dispatch(
refreshSessions(new SessionsRequest({ exclude_closed_sessions: true })),
);
dispatch(refreshClusterLocks());
};
};
const transactionInsightsReducerObj = new CachedDataReducer(
clusterUiApi.getTransactionInsightEventState,
"transactionInsights",
moment.duration(10, "s"),
moment.duration(30, "s"),
);
export const refreshTransactionInsights = transactionInsightsReducerObj.refresh;
const statementInsightsReducerObj = new CachedDataReducer(
clusterUiApi.getStatementInsightsApi,
"statementInsights",
null,
moment.duration(30, "s"), // Timeout
);
export const refreshStatementInsights = statementInsightsReducerObj.refresh;
export const transactionInsightRequestKey = (
req: clusterUiApi.TransactionInsightEventDetailsRequest,
): string => `${req.id}`;
const transactionInsightDetailsReducerObj = new KeyedCachedDataReducer(
clusterUiApi.getTransactionInsightEventDetailsState,
"transactionInsightDetails",
transactionInsightRequestKey,
);
export const refreshTransactionInsightDetails =
transactionInsightDetailsReducerObj.refresh;
const schemaInsightsReducerObj = new CachedDataReducer(
clusterUiApi.getSchemaInsights,
"schemaInsights",
null,
moment.duration(30, "s"),
);
export const refreshSchemaInsights = schemaInsightsReducerObj.refresh;
export const schedulesKey = (req: { status: string; limit: number }) =>
`${encodeURIComponent(req.status)}/${encodeURIComponent(
req.limit?.toString(),
)}`;
const schedulesReducerObj = new KeyedCachedDataReducer(
clusterUiApi.getSchedules,
"schedules",
schedulesKey,
moment.duration(10, "s"),
moment.duration(1, "minute"),
);
export const refreshSchedules = schedulesReducerObj.refresh;
export const scheduleKey = (scheduleID: Long): string => scheduleID.toString();
const scheduleReducerObj = new KeyedCachedDataReducer(
clusterUiApi.getSchedule,
"schedule",
scheduleKey,
moment.duration(10, "s"),
);
export const refreshSchedule = scheduleReducerObj.refresh;
export const snapshotsKey = () => "list";
const snapshotsReducerObj = new KeyedCachedDataReducer(
clusterUiApi.listTracingSnapshots,
"snapshots",
snapshotsKey,
moment.duration(10, "s"),
moment.duration(1, "minute"),
);
export const refreshSnapshots = snapshotsReducerObj.refresh;
export const snapshotKey = (snapshotID: number): string =>
snapshotID.toString();
const snapshotReducerObj = new KeyedCachedDataReducer(
clusterUiApi.getTracingSnapshot,
"snapshot",
snapshotKey,
moment.duration(10, "s"),
);
export const refreshSnapshot = snapshotReducerObj.refresh;
export interface APIReducersState {
cluster: CachedDataReducerState<api.ClusterResponseMessage>;
events: CachedDataReducerState<api.EventsResponseMessage>;
health: HealthState;
nodes: CachedDataReducerState<INodeStatus[]>;
raft: CachedDataReducerState<api.RaftDebugResponseMessage>;
version: CachedDataReducerState<VersionList>;
locations: CachedDataReducerState<api.LocationsResponseMessage>;
databases: CachedDataReducerState<api.DatabasesResponseMessage>;
databaseDetails: KeyedCachedDataReducerState<api.DatabaseDetailsResponseMessage>;
tableDetails: KeyedCachedDataReducerState<api.TableDetailsResponseMessage>;
tableStats: KeyedCachedDataReducerState<api.TableStatsResponseMessage>;
indexStats: KeyedCachedDataReducerState<api.IndexStatsResponseMessage>;
nonTableStats: CachedDataReducerState<api.NonTableStatsResponseMessage>;
logs: CachedDataReducerState<api.LogEntriesResponseMessage>;
liveness: CachedDataReducerState<api.LivenessResponseMessage>;
jobs: KeyedCachedDataReducerState<api.JobsResponseMessage>;
job: KeyedCachedDataReducerState<api.JobResponseMessage>;
queryPlan: CachedDataReducerState<api.QueryPlanResponseMessage>;
problemRanges: KeyedCachedDataReducerState<api.ProblemRangesResponseMessage>;
certificates: KeyedCachedDataReducerState<api.CertificatesResponseMessage>;
range: KeyedCachedDataReducerState<api.RangeResponseMessage>;
allocatorRange: KeyedCachedDataReducerState<api.AllocatorRangeResponseMessage>;
rangeLog: KeyedCachedDataReducerState<api.RangeLogResponseMessage>;
sessions: CachedDataReducerState<api.SessionsResponseMessage>;
settings: CachedDataReducerState<api.SettingsResponseMessage>;
stores: KeyedCachedDataReducerState<api.StoresResponseMessage>;
statements: CachedDataReducerState<api.StatementsResponseMessage>;
statementDetails: KeyedCachedDataReducerState<api.StatementDetailsResponseMessage>;
dataDistribution: CachedDataReducerState<api.DataDistributionResponseMessage>;
metricMetadata: CachedDataReducerState<api.MetricMetadataResponseMessage>;
statementDiagnosticsReports: CachedDataReducerState<api.StatementDiagnosticsReportsResponseMessage>;
userSQLRoles: CachedDataReducerState<api.UserSQLRolesResponseMessage>;
hotRanges: PaginatedCachedDataReducerState<api.HotRangesV2ResponseMessage>;
clusterLocks: CachedDataReducerState<clusterUiApi.ClusterLocksResponse>;
transactionInsights: CachedDataReducerState<clusterUiApi.TransactionInsightEventsResponse>;
transactionInsightDetails: KeyedCachedDataReducerState<clusterUiApi.TransactionInsightEventDetailsResponse>;
statementInsights: CachedDataReducerState<clusterUiApi.StatementInsights>;
schemaInsights: CachedDataReducerState<clusterUiApi.InsightRecommendation[]>;
schedules: KeyedCachedDataReducerState<clusterUiApi.Schedules>;
schedule: KeyedCachedDataReducerState<clusterUiApi.Schedule>;
snapshots: KeyedCachedDataReducerState<clusterUiApi.ListTracingSnapshotsResponseMessage>;
snapshot: KeyedCachedDataReducerState<clusterUiApi.GetTracingSnapshotResponseMessage>;
}
export const apiReducersReducer = combineReducers<APIReducersState>({
[clusterReducerObj.actionNamespace]: clusterReducerObj.reducer,
[eventsReducerObj.actionNamespace]: eventsReducerObj.reducer,
[healthReducerObj.actionNamespace]: healthReducerObj.reducer,
[nodesReducerObj.actionNamespace]: nodesReducerObj.reducer,
[raftReducerObj.actionNamespace]: raftReducerObj.reducer,
[versionReducerObj.actionNamespace]: versionReducerObj.reducer,
[locationsReducerObj.actionNamespace]: locationsReducerObj.reducer,
[databasesReducerObj.actionNamespace]: databasesReducerObj.reducer,
[databaseDetailsReducerObj.actionNamespace]:
databaseDetailsReducerObj.reducer,
[tableDetailsReducerObj.actionNamespace]: tableDetailsReducerObj.reducer,
[tableStatsReducerObj.actionNamespace]: tableStatsReducerObj.reducer,
[indexStatsReducerObj.actionNamespace]: indexStatsReducerObj.reducer,
[nonTableStatsReducerObj.actionNamespace]: nonTableStatsReducerObj.reducer,
[logsReducerObj.actionNamespace]: logsReducerObj.reducer,
[livenessReducerObj.actionNamespace]: livenessReducerObj.reducer,
[jobsReducerObj.actionNamespace]: jobsReducerObj.reducer,
[jobReducerObj.actionNamespace]: jobReducerObj.reducer,
[queryPlanReducerObj.actionNamespace]: queryPlanReducerObj.reducer,
[problemRangesReducerObj.actionNamespace]: problemRangesReducerObj.reducer,
[certificatesReducerObj.actionNamespace]: certificatesReducerObj.reducer,
[rangeReducerObj.actionNamespace]: rangeReducerObj.reducer,
[allocatorRangeReducerObj.actionNamespace]: allocatorRangeReducerObj.reducer,
[rangeLogReducerObj.actionNamespace]: rangeLogReducerObj.reducer,
[settingsReducerObj.actionNamespace]: settingsReducerObj.reducer,
[sessionsReducerObj.actionNamespace]: sessionsReducerObj.reducer,
[storesReducerObj.actionNamespace]: storesReducerObj.reducer,
[queriesReducerObj.actionNamespace]: queriesReducerObj.reducer,
[statementDetailsReducerObj.actionNamespace]:
statementDetailsReducerObj.reducer,
[dataDistributionReducerObj.actionNamespace]:
dataDistributionReducerObj.reducer,
[metricMetadataReducerObj.actionNamespace]: metricMetadataReducerObj.reducer,
[statementDiagnosticsReportsReducerObj.actionNamespace]:
statementDiagnosticsReportsReducerObj.reducer,
[userSQLRolesReducerObj.actionNamespace]: userSQLRolesReducerObj.reducer,
[hotRangesReducerObj.actionNamespace]: hotRangesReducerObj.reducer,
[clusterLocksReducerObj.actionNamespace]: clusterLocksReducerObj.reducer,
[transactionInsightsReducerObj.actionNamespace]:
transactionInsightsReducerObj.reducer,
[transactionInsightDetailsReducerObj.actionNamespace]:
transactionInsightDetailsReducerObj.reducer,
[statementInsightsReducerObj.actionNamespace]:
statementInsightsReducerObj.reducer,
[schemaInsightsReducerObj.actionNamespace]: schemaInsightsReducerObj.reducer,
[schedulesReducerObj.actionNamespace]: schedulesReducerObj.reducer,
[scheduleReducerObj.actionNamespace]: scheduleReducerObj.reducer,
[snapshotsReducerObj.actionNamespace]: snapshotsReducerObj.reducer,
[snapshotReducerObj.actionNamespace]: snapshotReducerObj.reducer,
});
export { CachedDataReducerState, KeyedCachedDataReducerState };