@cubejs-backend/base-driver 1.7.25 → 1.7.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,33 +1,41 @@
|
|
|
1
1
|
export type QueryDef = any;
|
|
2
2
|
export type QueueId = string | number | bigint;
|
|
3
|
-
export type ProcessingId = string | number | bigint;
|
|
4
3
|
export type QueryKey = (string | [string, any[]]) & {
|
|
5
4
|
persistent?: true;
|
|
6
5
|
};
|
|
7
6
|
export type QueryKeyHash = string & {
|
|
8
7
|
__type: 'QueryKeyHash';
|
|
9
8
|
};
|
|
10
|
-
export type QueryKeysTuple = [keyHash: QueryKeyHash, queueId: QueueId
|
|
9
|
+
export type QueryKeysTuple = [keyHash: QueryKeyHash, queueId: QueueId];
|
|
11
10
|
export type GetActiveAndToProcessResponse = [active: QueryKeysTuple[], toProcess: QueryKeysTuple[]];
|
|
12
|
-
export type AddToQueueResponse = [added: number, queueId: QueueId | null, queueSize: number, addedToQueueTime: number];
|
|
13
11
|
export type QueryStageStateResponse = [active: string[], toProcess: string[]] | [active: string[], toProcess: string[], defs: Record<string, QueryDef>];
|
|
14
|
-
export type RetrieveForProcessingSuccess =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
];
|
|
22
|
-
export type RetrieveForProcessingFail = [
|
|
23
|
-
added: unknown,
|
|
12
|
+
export type RetrieveForProcessingSuccess = {
|
|
13
|
+
active: QueryKeyHash[];
|
|
14
|
+
queueSize: number;
|
|
15
|
+
def: QueryDef;
|
|
16
|
+
};
|
|
17
|
+
export type AddToQueueResponse = [
|
|
18
|
+
added: number,
|
|
24
19
|
queueId: QueueId | null,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
lockAquired: false
|
|
20
|
+
queueSize: number,
|
|
21
|
+
addedToQueueTime: number,
|
|
22
|
+
retrieved: RetrieveForProcessingSuccess | null
|
|
29
23
|
];
|
|
30
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Higher priority wins, older wins within a priority. Only the rungs below carry meaning,
|
|
26
|
+
* the range between them is open: `queuePriority` in a query body and `priority` on a
|
|
27
|
+
* pre-aggregation are arbitrary integers from -10000 to 10000.
|
|
28
|
+
*/
|
|
29
|
+
export declare enum QueuePriority {
|
|
30
|
+
/** A request is blocked on it: a user query, an awaited build, a refresh key */
|
|
31
|
+
Interactive = 10,
|
|
32
|
+
/** Warmup sweep, above the background builds it warms */
|
|
33
|
+
Warmup = 1,
|
|
34
|
+
/** A build nobody is waiting for */
|
|
35
|
+
Background = 0,
|
|
36
|
+
/** Scheduled refresh, newest partition first from here downwards */
|
|
37
|
+
Scheduled = -1
|
|
38
|
+
}
|
|
31
39
|
export interface AddToQueueQuery {
|
|
32
40
|
isJob: boolean;
|
|
33
41
|
orphanedTimeout: unknown;
|
|
@@ -54,17 +62,16 @@ export interface QueueDriverConnectionInterface {
|
|
|
54
62
|
getResult(queryKey: QueryKey, externalId?: string): Promise<any>;
|
|
55
63
|
/**
|
|
56
64
|
* Adds specified by the queryKey query to the queue, returns tuple
|
|
57
|
-
* with the operation result.
|
|
65
|
+
* with the operation result. A driver may also retrieve the item for processing in the same
|
|
66
|
+
* operation, which saves the caller a retrieval round-trip.
|
|
58
67
|
*
|
|
59
|
-
* @param keyScore Redis specific thing
|
|
60
68
|
* @param queryKey
|
|
61
|
-
* @param orphanedTime
|
|
62
69
|
* @param queryHandler Our queue allows using different handlers. For example, query, cvsQuery, etc.
|
|
63
70
|
* @param query
|
|
64
71
|
* @param priority
|
|
65
72
|
* @param options
|
|
66
73
|
*/
|
|
67
|
-
addToQueue(
|
|
74
|
+
addToQueue(queryKey: QueryKey, queryHandler: string, query: AddToQueueQuery, priority: QueuePriority, options: AddToQueueOptions): Promise<AddToQueueResponse>;
|
|
68
75
|
getToProcessQueries(): Promise<QueryKeysTuple[]>;
|
|
69
76
|
getActiveQueries(): Promise<QueryKeysTuple[]>;
|
|
70
77
|
getQueryDef(hash: QueryKeyHash, queueId: QueueId | null): Promise<QueryDef | null>;
|
|
@@ -72,13 +79,11 @@ export interface QueueDriverConnectionInterface {
|
|
|
72
79
|
getStalledQueries(): Promise<QueryKeysTuple[]>;
|
|
73
80
|
getQueryStageState(onlyKeys: boolean): Promise<QueryStageStateResponse>;
|
|
74
81
|
updateHeartBeat(hash: QueryKeyHash, queueId: QueueId | null): Promise<void>;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
freeProcessingLock(hash: QueryKeyHash, processingId: ProcessingId, activated: unknown): Promise<void>;
|
|
78
|
-
optimisticQueryUpdate(hash: QueryKeyHash, toUpdate: unknown, processingId: ProcessingId, queueId: QueueId | null): Promise<boolean>;
|
|
82
|
+
retrieveForProcessing(hash: QueryKeyHash, queueId: QueueId): Promise<RetrieveForProcessingSuccess | null>;
|
|
83
|
+
optimisticQueryUpdate(hash: QueryKeyHash, toUpdate: unknown, queueId: QueueId): Promise<boolean>;
|
|
79
84
|
cancelQuery(queryKey: QueryKey, queueId: QueueId | null): Promise<QueryDef | null>;
|
|
80
85
|
getQueryAndRemove(hash: QueryKeyHash, queueId: QueueId | null): Promise<[QueryDef]>;
|
|
81
|
-
setResultAndRemoveQuery(hash: QueryKeyHash, executionResult: any,
|
|
86
|
+
setResultAndRemoveQuery(hash: QueryKeyHash, executionResult: any, queueId: QueueId): Promise<unknown>;
|
|
82
87
|
release(): void;
|
|
83
88
|
getQueriesToCancel(): Promise<QueryKeysTuple[]>;
|
|
84
89
|
getActiveAndToProcess(): Promise<GetActiveAndToProcessResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue-driver.interface.d.ts","sourceRoot":"","sources":["../../src/queue-driver.interface.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,GAAG,CAAC;AAE3B,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3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AM,WAAW,oBAAoB;IACnC,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAG,YAAY,CAAC;IAC5C,gBAAgB,IAAI,OAAO,CAAC,8BAA8B,CAAC,CAAC;IAC5D,OAAO,CAAC,UAAU,EAAE,8BAA8B,GAAG,IAAI,CAAC;CAC3D"}
|
|
@@ -1,3 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QueuePriority = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Higher priority wins, older wins within a priority. Only the rungs below carry meaning,
|
|
6
|
+
* the range between them is open: `queuePriority` in a query body and `priority` on a
|
|
7
|
+
* pre-aggregation are arbitrary integers from -10000 to 10000.
|
|
8
|
+
*/
|
|
9
|
+
var QueuePriority;
|
|
10
|
+
(function (QueuePriority) {
|
|
11
|
+
/** A request is blocked on it: a user query, an awaited build, a refresh key */
|
|
12
|
+
QueuePriority[QueuePriority["Interactive"] = 10] = "Interactive";
|
|
13
|
+
/** Warmup sweep, above the background builds it warms */
|
|
14
|
+
QueuePriority[QueuePriority["Warmup"] = 1] = "Warmup";
|
|
15
|
+
/** A build nobody is waiting for */
|
|
16
|
+
QueuePriority[QueuePriority["Background"] = 0] = "Background";
|
|
17
|
+
/** Scheduled refresh, newest partition first from here downwards */
|
|
18
|
+
QueuePriority[QueuePriority["Scheduled"] = -1] = "Scheduled";
|
|
19
|
+
})(QueuePriority || (exports.QueuePriority = QueuePriority = {}));
|
|
3
20
|
//# sourceMappingURL=queue-driver.interface.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue-driver.interface.js","sourceRoot":"","sources":["../../src/queue-driver.interface.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"queue-driver.interface.js","sourceRoot":"","sources":["../../src/queue-driver.interface.ts"],"names":[],"mappings":";;;AA0BA;;;;GAIG;AACH,IAAY,aASX;AATD,WAAY,aAAa;IACvB,gFAAgF;IAChF,gEAAgB,CAAA;IAChB,yDAAyD;IACzD,qDAAU,CAAA;IACV,oCAAoC;IACpC,6DAAc,CAAA;IACd,oEAAoE;IACpE,4DAAc,CAAA;AAChB,CAAC,EATW,aAAa,6BAAb,aAAa,QASxB"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@cubejs-backend/base-driver",
|
|
3
3
|
"description": "Cube.js Base Driver",
|
|
4
4
|
"author": "Cube Dev, Inc.",
|
|
5
|
-
"version": "1.7.
|
|
5
|
+
"version": "1.7.27",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/cube-js/cube.git",
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
"@aws-sdk/s3-request-presigner": "^3.49.0",
|
|
34
34
|
"@azure/identity": "^4.4.1",
|
|
35
35
|
"@azure/storage-blob": "^12.9.0",
|
|
36
|
-
"@cubejs-backend/shared": "1.7.
|
|
36
|
+
"@cubejs-backend/shared": "1.7.27",
|
|
37
37
|
"@google-cloud/storage": "^7.13.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@cubejs-backend/linter": "1.7.
|
|
40
|
+
"@cubejs-backend/linter": "1.7.27",
|
|
41
41
|
"@types/jest": "^29",
|
|
42
42
|
"@types/node": "^22",
|
|
43
43
|
"jest": "^29",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"publishConfig": {
|
|
52
52
|
"access": "public"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "43964f87e48c0bef8fc58e7b30c625e832dea4f0"
|
|
55
55
|
}
|