Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/cubejs-backend-native/python/cube/src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class Configuration:
logger: Callable
context_to_app_id: Union[str, Callable[[RequestContext], str]]
context_to_orchestrator_id: Union[str, Callable[[RequestContext], str]]
context_to_cube_store_router_id: Union[str, Callable[[RequestContext], str]]
driver_factory: Callable[[RequestContext], Dict]
external_driver_factory: Callable[[RequestContext], Dict]
db_type: Union[str, Callable[[RequestContext], str]]
Expand Down Expand Up @@ -108,6 +109,7 @@ def __init__(self):
self.logger = None
self.context_to_app_id = None
self.context_to_orchestrator_id = None
self.context_to_cube_store_router_id = None
self.driver_factory = None
self.external_driver_factory = None
self.db_type = None
Expand Down
1 change: 1 addition & 0 deletions packages/cubejs-backend-native/src/python/cube_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ impl CubeConfigPy {
"logger",
"context_to_app_id",
"context_to_orchestrator_id",
"context_to_cube_store_router_id",
"driver_factory",
"external_driver_factory",
"db_type",
Expand Down
1 change: 1 addition & 0 deletions packages/cubejs-server-core/src/core/optionsValidate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ const schemaOptions = Joi.object().keys({
contextToAppId: Joi.func(),
contextToRoles: Joi.func(),
contextToOrchestratorId: Joi.func(),
contextToCubeStoreRouterId: Joi.func(),
contextToDataSourceId: Joi.func(),
contextToApiScopes: Joi.func(),
repositoryFactory: Joi.func(),
Expand Down
5 changes: 5 additions & 0 deletions packages/cubejs-server-core/src/core/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ import type {
DriverContext,
LoggerFn,
DriverConfig,
ContextToCubeStoreRouterIdFn,
} from './types';

import { ContextToOrchestratorIdFn, ContextAcceptanceResult, ContextAcceptanceResultHttp, ContextAcceptanceResultWs, ContextAcceptor } from './types';

const { version } = require('../../../package.json');
Expand Down Expand Up @@ -117,6 +119,8 @@ export class CubejsServerCore {

protected readonly contextToOrchestratorId: ContextToOrchestratorIdFn;

protected readonly contextToCubeStoreRouterId: ContextToCubeStoreRouterIdFn | null;

protected readonly preAggregationsSchema: PreAggregationsSchemaFn;

protected readonly orchestratorOptions: OrchestratorOptionsFn;
Expand Down Expand Up @@ -192,6 +196,7 @@ export class CubejsServerCore {
}

this.contextToOrchestratorId = this.options.contextToOrchestratorId || (() => 'STANDALONE');
this.contextToCubeStoreRouterId = this.options.contextToCubeStoreRouterId;

// proactively free up old cache values occasionally
if (this.options.maxCompilerCacheKeepAlive) {
Expand Down
2 changes: 2 additions & 0 deletions packages/cubejs-server-core/src/core/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export type DatabaseType =
export type ContextToAppIdFn = (context: RequestContext) => string | Promise<string>;
export type ContextToRolesFn = (context: RequestContext) => string[] | Promise<string[]>;
export type ContextToOrchestratorIdFn = (context: RequestContext) => string | Promise<string>;
export type ContextToCubeStoreRouterIdFn = (context: RequestContext) => string | Promise<string>;

export type OrchestratorOptionsFn = (context: RequestContext) => OrchestratorOptions | Promise<OrchestratorOptions>;

Expand Down Expand Up @@ -179,6 +180,7 @@ export interface CreateOptions {
contextToAppId?: ContextToAppIdFn;
contextToRoles?: ContextToRolesFn;
contextToOrchestratorId?: ContextToOrchestratorIdFn;
contextToCubeStoreRouterId?: ContextToCubeStoreRouterIdFn;
contextToApiScopes?: ContextToApiScopesFn;
repositoryFactory?: (context: RequestContext) => SchemaFileRepository;
checkAuth?: CheckAuthFn;
Expand Down
Loading