Skip to content

Commit

Permalink
feat(query-orchestrator): Introduce CubeStoreCacheDriver
Browse files Browse the repository at this point in the history
  • Loading branch information
ovr committed Oct 10, 2022
1 parent e4099b3 commit 6eba544
Show file tree
Hide file tree
Showing 25 changed files with 242 additions and 102 deletions.
67 changes: 34 additions & 33 deletions packages/cubejs-backend-native/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions packages/cubejs-base-driver/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export * from './BaseDriver';
export * from './utils';
export * from './driver.interface';
export * from './queue-driver.interface';
export * from './cache-driver.interface';
23 changes: 23 additions & 0 deletions packages/cubejs-base-driver/src/queue-driver.interface.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export interface LocalQueueDriverConnectionInterface {
getResultBlocking(queryKey: string): Promise<unknown>;
getResult(queryKey: string): Promise<unknown>;
addToQueue(queryKey: string): Promise<unknown>;
getToProcessQueries(): Promise<unknown>;
getActiveQueries(): Promise<unknown>;
getOrphanedQueries(): Promise<unknown>;
getStalledQueries(): Promise<unknown>;
getQueryStageState(onlyKeys: any): Promise<unknown>;
updateHeartBeat(queryKey: string): Promise<void>;
getNextProcessingId(): Promise<string>;
retrieveForProcessing(queryKey: string, processingId: string): Promise<unknown>;
freeProcessingLock(queryKe: string, processingId: string, activated: unknown): Promise<unknown>;
optimisticQueryUpdate(queryKey, toUpdate, processingId): Promise<unknown>;
cancelQuery(queryKey: string): Promise<unknown>;
setResultAndRemoveQuery(queryKey: string, executionResult: any, processingId: any): Promise<unknown>;
release(): Promise<void>;
}

export interface QueueDriverInterface {
createConnection(): Promise<LocalQueueDriverConnectionInterface>;
release(connection: LocalQueueDriverConnectionInterface): Promise<void>;
}
18 changes: 8 additions & 10 deletions packages/cubejs-cubestore-driver/index.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
const fromExports = require('./dist/src');
const { CubeStoreDriver } = require('./dist/src/CubeStoreDriver');
const { CubeStoreDevDriver } = require('./dist/src/CubeStoreDevDriver');
const { isCubeStoreSupported, CubeStoreHandler } = require('./dist/src/rexport');

/**
* After 5 years working with TypeScript, now I know
* that commonjs and nodejs require is not compatibility with using export default
*/
module.exports = CubeStoreDriver;
const toExport = CubeStoreDriver;

/**
* It's needed to move our CLI to destructing style on import
* Please sync this file with src/index.ts
*/
module.exports.CubeStoreDevDriver = CubeStoreDevDriver;
module.exports.isCubeStoreSupported = isCubeStoreSupported;
module.exports.CubeStoreHandler = CubeStoreHandler;
// eslint-disable-next-line no-restricted-syntax
for (const [key, module] of Object.entries(fromExports)) {
toExport[key] = module;
}

module.exports = toExport;
1 change: 0 additions & 1 deletion packages/cubejs-cubestore-driver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"dependencies": {
"@cubejs-backend/base-driver": "^0.31.3",
"@cubejs-backend/cubestore": "^0.31.2",
"@cubejs-backend/schema-compiler": "^0.31.3",
"@cubejs-backend/shared": "^0.31.0",
"csv-write-stream": "^2.0.0",
"flatbuffers": "^1.12.0",
Expand Down
Loading

0 comments on commit 6eba544

Please sign in to comment.