Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix HDFS node to only show up for BDC connections #12714

Merged
merged 1 commit into from
Oct 2, 2020
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
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