Unified connection support (#765)

* Added the query to get big data cluster endpoints
Added bigDataClusterEndpoints to ObjectExplorerSession
Added bigDataClusterEndpoints to ServerInfo
Fixes some tests.

* Removed bigDataClusterEndpoints from session

* Since server property to get IsBigDataCluster is not implemented yet, use query of sys.asseblies instead to unblock us. Need to use server property when it is available
Add options to ServerInfo, so no need to change the contract in the further when adding new properties. Will move the existing properties to option later

* Undo changes not needed

* Resolved PR comments.

* Fixed node is null exception when can't find NodePath.

* Added comments

* Removed not used using

* Catch sqlException for the reader of BDC endpoints and set empty list to the option.

* Added comments for returning empty nodes.
This commit is contained in:
Yurong He
2019-01-24 20:06:35 -08:00
committed by GitHub
parent 7cc2636e6a
commit adc13cff82
5 changed files with 74 additions and 6 deletions

View File

@@ -386,7 +386,6 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer
RootNode = session.Root.ToNodeInfo(),
SessionId = uri,
ErrorMessage = session.ErrorMessage
};
await serviceHost.SendEvent(CreateSessionCompleteNotification.Type, response);
return response;
@@ -406,7 +405,20 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer
{
NodeInfo[] nodes = null;
TreeNode node = session.Root.FindNodeByPath(nodePath);
ExpandResponse response = new ExpandResponse { Nodes = new NodeInfo[] { }, ErrorMessage = node.ErrorMessage, SessionId = session.Uri, NodePath = nodePath };
ExpandResponse response = null;
// This node was likely returned from a different node provider. Ignore expansion and return an empty array
// since we don't need to add any nodes under this section of the tree.
if (node == null)
{
response = new ExpandResponse { Nodes = new NodeInfo[] { }, ErrorMessage = string.Empty, SessionId = session.Uri, NodePath = nodePath };
response.Nodes = new NodeInfo[0];
return response;
}
else
{
response = new ExpandResponse { Nodes = new NodeInfo[] { }, ErrorMessage = node.ErrorMessage, SessionId = session.Uri, NodePath = nodePath };
}
if (node != null && Monitor.TryEnter(node.BuildingMetadataLock, LanguageService.OnConnectionWaitTimeout))
{