|
|
@@ -146,8 +146,9 @@ const generateEntryCacheId = (options: {
|
|
|
path?: string | string[];
|
|
|
paths?: string[][];
|
|
|
namespace: Namespace;
|
|
|
+ computeName: Compute['name'];
|
|
|
}): string => {
|
|
|
- let id = options.namespace.id;
|
|
|
+ let id = `${options.namespace.id}_${options.computeName}`;
|
|
|
if (options.path) {
|
|
|
if (typeof options.path === 'string') {
|
|
|
id += '_' + options.path;
|
|
|
@@ -327,7 +328,11 @@ export class DataCatalog {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- const keyPrefix = generateEntryCacheId({ namespace: namespace, path: pathToClear });
|
|
|
+ const keyPrefix = generateEntryCacheId({
|
|
|
+ namespace: namespace,
|
|
|
+ path: pathToClear,
|
|
|
+ computeName: compute.name
|
|
|
+ });
|
|
|
Object.keys(this.entries).forEach(key => {
|
|
|
if (key.indexOf(keyPrefix) === 0) {
|
|
|
delete this.entries[key];
|
|
|
@@ -515,7 +520,13 @@ export class DataCatalog {
|
|
|
compute: Compute;
|
|
|
path: string | string[];
|
|
|
}): Promise<DataCatalogEntry> {
|
|
|
- return this.entries[generateEntryCacheId(options)];
|
|
|
+ return this.entries[
|
|
|
+ generateEntryCacheId({
|
|
|
+ namespace: options.namespace,
|
|
|
+ path: options.path,
|
|
|
+ computeName: options.compute.name
|
|
|
+ })
|
|
|
+ ];
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -537,7 +548,8 @@ export class DataCatalog {
|
|
|
|
|
|
const sourceIdentifier = generateEntryCacheId({
|
|
|
namespace: options.namespace,
|
|
|
- path: []
|
|
|
+ path: [],
|
|
|
+ computeName: options.compute.name
|
|
|
});
|
|
|
|
|
|
// Create the source entry if not already present
|
|
|
@@ -564,7 +576,8 @@ export class DataCatalog {
|
|
|
const existingTemporaryDatabases = await sourceEntry.getChildren();
|
|
|
const databaseIdentifier = generateEntryCacheId({
|
|
|
namespace: options.namespace,
|
|
|
- path: [database]
|
|
|
+ path: [database],
|
|
|
+ computeName: options.compute.name
|
|
|
});
|
|
|
|
|
|
// Create the database entry if not already present
|
|
|
@@ -593,7 +606,8 @@ export class DataCatalog {
|
|
|
|
|
|
const tableIdentifier = generateEntryCacheId({
|
|
|
namespace: options.namespace,
|
|
|
- path: path
|
|
|
+ path: path,
|
|
|
+ computeName: options.compute.name
|
|
|
});
|
|
|
|
|
|
// Unlink any existing table with the same identifier
|
|
|
@@ -677,7 +691,8 @@ export class DataCatalog {
|
|
|
|
|
|
const columnIdentifier = generateEntryCacheId({
|
|
|
namespace: options.namespace,
|
|
|
- path: columnPath
|
|
|
+ path: columnPath,
|
|
|
+ computeName: options.compute.name
|
|
|
});
|
|
|
identifiersToClean.push(columnIdentifier);
|
|
|
this.temporaryEntries[columnIdentifier] = CancellablePromise.resolve(columnEntry);
|
|
|
@@ -697,7 +712,10 @@ export class DataCatalog {
|
|
|
}
|
|
|
|
|
|
async getEntry(options: GetEntryOptions): Promise<DataCatalogEntry> {
|
|
|
- const identifier = generateEntryCacheId(options);
|
|
|
+ const identifier = generateEntryCacheId({
|
|
|
+ ...options,
|
|
|
+ computeName: options.compute.name
|
|
|
+ });
|
|
|
if (options.temporaryOnly) {
|
|
|
return this.temporaryEntries[identifier] || $.Deferred().reject().promise();
|
|
|
}
|
|
|
@@ -756,7 +774,11 @@ export class DataCatalog {
|
|
|
}
|
|
|
|
|
|
async getMultiTableEntry(options: GetMultiTableEntryOptions): Promise<MultiTableEntry> {
|
|
|
- const identifier = generateEntryCacheId(options);
|
|
|
+ const identifier = generateEntryCacheId({
|
|
|
+ namespace: options.namespace,
|
|
|
+ paths: options.paths,
|
|
|
+ computeName: options.compute.name
|
|
|
+ });
|
|
|
if (this.multiTableEntries[identifier]) {
|
|
|
return this.multiTableEntries[identifier];
|
|
|
}
|