Skip to content

Commit

Permalink
Fix HDFS node to only show up for BDC connections (#12714)
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles-Gagnon authored Oct 2, 2020
1 parent 6dd7c7d commit 572310b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ export class MssqlObjectExplorerNodeProvider extends ProviderBase implements azd
let sqlConnProfile = await azdata.objectexplorer.getSessionConnectionProfile(session.sessionId);
if (!sqlConnProfile) { return false; }

const isBigDataCluster = await utils.isBigDataCluster(sqlConnProfile.id);
if (!isBigDataCluster) { return false; }

let clusterSession = new SqlClusterSession(session, sqlConnProfile, this.appContext, this);
this.clusterSessionMap.set(session.sessionId, clusterSession);
return true;
Expand Down
6 changes: 6 additions & 0 deletions extensions/mssql/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,12 @@ export function getClusterEndpoints(serverInfo: azdata.ServerInfo): bdc.IEndpoin
});
}

export async function isBigDataCluster(connectionId: string): Promise<boolean> {
const serverInfo = await azdata.connection.getServerInfo(connectionId);

return !!serverInfo?.options?.[constants.isBigDataClusterProperty];
}

export type HostAndIp = { host: string, port: string };

export function getHostAndPortFromEndpoint(endpoint: string): HostAndIp {
Expand Down

0 comments on commit 572310b

Please sign in to comment.