mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-19 17:23:55 -05:00
Renames ShowPlan directories along with corresponding namespaces (#1435)
* Renames ShowPlan directories along with corresponding namespaces * Renames ShowPlanGraphUtils to ExecutionPlanGraphUtils * Revert "Renames ShowPlanGraphUtils to ExecutionPlanGraphUtils" This reverts commit 5dc2696ae906598447eed7360a3f342218432b83. * Reverts show plan tests name change. * Renames show plan test XML files. * Renames ported directory to ShowPlan and updates namespace accordingly
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan
|
||||
{
|
||||
/// <summary>
|
||||
/// Execution plan graph object that is sent over JSON RPC
|
||||
@@ -6,7 +6,7 @@
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.SqlTools.Hosting.Protocol.Contracts;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan
|
||||
{
|
||||
public class GetExecutionPlanParams
|
||||
{
|
||||
@@ -8,7 +8,7 @@ using System.Threading.Tasks;
|
||||
using Microsoft.SqlTools.Hosting.Protocol;
|
||||
using Microsoft.SqlTools.ServiceLayer.Hosting;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan
|
||||
{
|
||||
/// <summary>
|
||||
/// Main class for Migration Service functionality
|
||||
@@ -3,7 +3,7 @@
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds hierarchy of Graph objects from SQL 2000 Actual ShowPlan Record Set
|
||||
@@ -8,7 +8,7 @@ using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
#region FloatTypeConverter
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph.Comparison
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan.Comparison
|
||||
{
|
||||
/// <summary>
|
||||
/// Handles operations for creating and comparing skeletons of showplan trees
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph.Comparison
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan.Comparison
|
||||
{
|
||||
public class SkeletonNode
|
||||
{
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
internal sealed class ConditionParser : XmlPlanHierarchyParser
|
||||
{
|
||||
@@ -3,7 +3,7 @@
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
public class Constants
|
||||
{
|
||||
@@ -3,7 +3,7 @@
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
/// <summary>
|
||||
/// Parses StmtCursorType ShowPlan XML nodes
|
||||
@@ -3,7 +3,7 @@
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
/// <summary>
|
||||
/// Parses StmtCursorType ShowPlan XML nodes
|
||||
@@ -11,7 +11,7 @@ using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
/// <summary>
|
||||
/// Base class for building hierarchy of Graph objects from ShowPlan Record Set
|
||||
@@ -6,7 +6,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
public class Description
|
||||
{
|
||||
@@ -7,7 +7,7 @@ using System;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
public class Edge
|
||||
{
|
||||
@@ -3,7 +3,7 @@
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds hierarchy of Graph objects from SQL 2000 Estimated ShowPlan Record Set
|
||||
@@ -8,7 +8,7 @@ using System.Collections;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
|
||||
public class ExpandableArrayWrapper : ExpandableObjectWrapper
|
||||
@@ -6,7 +6,7 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
public class ExpandableObjectWrapper : ObjectParser, ICustomTypeDescriptor
|
||||
{
|
||||
@@ -6,7 +6,7 @@
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
/// <summary>
|
||||
/// Parses ShowPlan XML objects derived from RelOpBaseType type
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
internal sealed class FunctionTypeParser : XmlPlanParser
|
||||
{
|
||||
@@ -3,7 +3,7 @@
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
public class Graph
|
||||
{
|
||||
@@ -3,7 +3,7 @@
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface represents an abstract builder that gets
|
||||
@@ -3,7 +3,7 @@
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface represents ability to split an data source containing multiple
|
||||
@@ -6,7 +6,7 @@
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
/// <summary>
|
||||
/// Parses ShowPlan XML objects derived from RelOpBaseType type
|
||||
@@ -6,7 +6,7 @@
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
/// <summary>
|
||||
/// Parses ShowPlan XML objects derived from RelOpBaseType type
|
||||
@@ -9,7 +9,7 @@ using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
/// <summary>
|
||||
/// Status of operator
|
||||
@@ -3,7 +3,7 @@
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
public class NodeBuilderContext
|
||||
{
|
||||
@@ -7,7 +7,7 @@ using System;
|
||||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
/// <summary>
|
||||
/// Class that creates concrete INodeBuilder instances.
|
||||
@@ -7,7 +7,7 @@ using System;
|
||||
using System.ComponentModel;
|
||||
using System.Collections;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
/// <summary>
|
||||
/// Base class for all object / Node parsers
|
||||
@@ -13,7 +13,7 @@ using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
/// <summary>
|
||||
/// This class converts methods for converting from ShowPlanXML native classes
|
||||
@@ -6,7 +6,7 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
public sealed class Operation
|
||||
{
|
||||
@@ -8,7 +8,7 @@ using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
/// <summary>
|
||||
/// A class that holds information about a physical or logical operator, or a statement.
|
||||
@@ -9,7 +9,7 @@ using System.Xml.Serialization;
|
||||
using System.Reflection;
|
||||
using System.Collections;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
/// <summary>
|
||||
/// PropertyFactory creates properties based on template properties (this class public properties)
|
||||
@@ -7,7 +7,7 @@ using System;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
internal sealed class PropertyValue : PropertyDescriptor
|
||||
{
|
||||
@@ -6,7 +6,7 @@
|
||||
using System.ComponentModel;
|
||||
using System.Collections;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
/// <summary>
|
||||
/// Parses ShowPlan XML objects derived from RelOpBaseType type
|
||||
@@ -10,7 +10,7 @@ using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
internal sealed class RelOpTypeParser : XmlPlanParser
|
||||
{
|
||||
@@ -8,7 +8,7 @@ using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
/// <summary>
|
||||
/// RunTimeCounters class stores RunTimeCountersPerThread information
|
||||
@@ -7,7 +7,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
/// <summary>
|
||||
/// Parses stytement type ShowPlan XML nodes
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
internal class XmlPlanHierarchyParser : XmlPlanParser
|
||||
{
|
||||
@@ -13,7 +13,7 @@ using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds hierarchy of Graph objects from ShowPlan XML
|
||||
@@ -9,7 +9,7 @@ using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for enumerating FunctionType objects
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
internal static class XmlPlanParserFactory
|
||||
{
|
||||
@@ -3,7 +3,7 @@
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
/// <summary>
|
||||
/// A class that lists String constants common to XML Show Plan Node Parsing
|
||||
@@ -6,7 +6,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan
|
||||
{
|
||||
/// <summary>
|
||||
/// Extension of graph with some handy included methods specific for ShowPlan use
|
||||
@@ -16,7 +16,7 @@
|
||||
//
|
||||
// This source code was auto-generated by xsd, Version=4.8.3928.0.
|
||||
//
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph {
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan {
|
||||
using System.Xml.Serialization;
|
||||
|
||||
|
||||
@@ -7,17 +7,17 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using Microsoft.SqlTools.ServiceLayer.ShowPlan.ShowPlanGraph;
|
||||
using Microsoft.SqlTools.ServiceLayer.ExecutionPlan.ShowPlan;
|
||||
using Microsoft.SqlTools.Utility;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ShowPlan
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan
|
||||
{
|
||||
public class ShowPlanGraphUtils
|
||||
{
|
||||
public static List<ExecutionPlanGraph> CreateShowPlanGraph(string xml, string fileName)
|
||||
{
|
||||
ShowPlanGraph.ShowPlanGraph[] graphs = ShowPlanGraph.ShowPlanGraph.ParseShowPlanXML(xml, ShowPlanGraph.ShowPlanType.Unknown);
|
||||
ShowPlan.ShowPlanGraph[] graphs = ShowPlan.ShowPlanGraph.ParseShowPlanXML(xml, ShowPlan.ShowPlanType.Unknown);
|
||||
return graphs.Select(g => new ExecutionPlanGraph
|
||||
{
|
||||
Root = ConvertShowPlanTreeToExecutionPlanTree(g.Root),
|
||||
@@ -96,7 +96,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ShowPlan
|
||||
return propsList;
|
||||
}
|
||||
|
||||
private static List<ExecutionPlanRecommendation> ParseRecommendations(ShowPlanGraph.ShowPlanGraph g, string fileName)
|
||||
private static List<ExecutionPlanRecommendation> ParseRecommendations(ShowPlan.ShowPlanGraph g, string fileName)
|
||||
{
|
||||
return g.Description.MissingIndices.Select(mi => new ExecutionPlanRecommendation
|
||||
{
|
||||
@@ -166,8 +166,8 @@ namespace Microsoft.SqlTools.ServiceLayer
|
||||
InitializeHostedServices(serviceProvider, serviceHost);
|
||||
serviceHost.ServiceProvider = serviceProvider;
|
||||
|
||||
ShowPlan.ExecutionPlanService.Instance.InitializeService(serviceHost);
|
||||
serviceProvider.RegisterSingleService(ShowPlan.ExecutionPlanService.Instance);
|
||||
ExecutionPlan.ExecutionPlanService.Instance.InitializeService(serviceHost);
|
||||
serviceProvider.RegisterSingleService(ExecutionPlan.ExecutionPlanService.Instance);
|
||||
|
||||
serviceHost.InitializeRequestHandlers();
|
||||
}
|
||||
|
||||
@@ -572,7 +572,7 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution
|
||||
/// </summary>
|
||||
/// <param name="resultSetIndex">The index for selecting the result set</param>
|
||||
/// <returns>An execution plan object</returns>
|
||||
public Task<ExecutionPlan> GetExecutionPlan(int resultSetIndex)
|
||||
public Task<Contracts.ExecutionPlan> GetExecutionPlan(int resultSetIndex)
|
||||
{
|
||||
ResultSet targetResultSet;
|
||||
lock (resultSets)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.SqlTools.Hosting.Protocol.Contracts;
|
||||
using Microsoft.SqlTools.ServiceLayer.ShowPlan;
|
||||
using Microsoft.SqlTools.ServiceLayer.ExecutionPlan;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.QueryExecution.Contracts.ExecuteRequests
|
||||
{
|
||||
|
||||
@@ -353,7 +353,7 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution
|
||||
/// <param name="batchIndex">The index for selecting the batch item</param>
|
||||
/// <param name="resultSetIndex">The index for selecting the result set</param>
|
||||
/// <returns>The Execution Plan, if the result set has one</returns>
|
||||
public Task<ExecutionPlan> GetExecutionPlan(int batchIndex, int resultSetIndex)
|
||||
public Task<Contracts.ExecutionPlan> GetExecutionPlan(int batchIndex, int resultSetIndex)
|
||||
{
|
||||
// Sanity check to make sure that the batch is within bounds
|
||||
if (batchIndex < 0 || batchIndex >= Batches.Length)
|
||||
|
||||
@@ -16,7 +16,7 @@ using Microsoft.SqlTools.ServiceLayer.Hosting;
|
||||
using Microsoft.SqlTools.ServiceLayer.QueryExecution.Contracts.ExecuteRequests;
|
||||
using Microsoft.SqlTools.ServiceLayer.QueryExecution.Contracts;
|
||||
using Microsoft.SqlTools.ServiceLayer.QueryExecution.DataStorage;
|
||||
using Microsoft.SqlTools.ServiceLayer.ShowPlan;
|
||||
using Microsoft.SqlTools.ServiceLayer.ExecutionPlan;
|
||||
using Microsoft.SqlTools.ServiceLayer.SqlContext;
|
||||
using Microsoft.SqlTools.ServiceLayer.Workspace.Contracts;
|
||||
using Microsoft.SqlTools.ServiceLayer.Workspace;
|
||||
|
||||
@@ -309,7 +309,7 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution
|
||||
/// Generates the execution plan from the table returned
|
||||
/// </summary>
|
||||
/// <returns>An execution plan object</returns>
|
||||
public Task<ExecutionPlan> GetExecutionPlan()
|
||||
public Task<Contracts.ExecutionPlan> GetExecutionPlan()
|
||||
{
|
||||
// Process the action just in case it hasn't been yet
|
||||
ProcessSpecialAction();
|
||||
@@ -342,7 +342,7 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution
|
||||
}
|
||||
}
|
||||
|
||||
return new ExecutionPlan
|
||||
return new Contracts.ExecutionPlan
|
||||
{
|
||||
Format = format,
|
||||
Content = content
|
||||
|
||||
@@ -31,10 +31,9 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Remove=".\ShowPlan\TestExecution.xml" />
|
||||
<EmbeddedResource Include=".\ShowPlan\TestExecutionPlan.xml" />
|
||||
<EmbeddedResource Include="ShowPlan\TestShowPlan.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Remove=".\ShowPlan\TestExecutionPlanRecommendations.xml" />
|
||||
<EmbeddedResource Include=".\ShowPlan\TestExecutionPlanRecommendations.xml" />
|
||||
<EmbeddedResource Include="ShowPlan\TestShowPlanRecommendations.xml" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -30,7 +30,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.QueryExecution
|
||||
// If:
|
||||
// ... I have a result set and I ask for a valid execution plan
|
||||
ResultSet planResultSet = b.ResultSets.First();
|
||||
ExecutionPlan plan = planResultSet.GetExecutionPlan().Result;
|
||||
ServiceLayer.QueryExecution.Contracts.ExecutionPlan plan = planResultSet.GetExecutionPlan().Result;
|
||||
Assert.AreEqual("xml", plan.Format);
|
||||
Assert.That(plan.Content, Does.Contain("Execution Plan"), "I should get the execution plan back");
|
||||
}
|
||||
@@ -62,7 +62,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.QueryExecution
|
||||
Batch b = Common.GetExecutedBatchWithExecutionPlan();
|
||||
|
||||
// ... And I ask for a valid execution plan
|
||||
ExecutionPlan plan = b.GetExecutionPlan(0).Result;
|
||||
ServiceLayer.QueryExecution.Contracts.ExecutionPlan plan = b.GetExecutionPlan(0).Result;
|
||||
|
||||
Assert.AreEqual("xml", plan.Format);
|
||||
Assert.That(plan.Content, Does.Contain("Execution Plan"), "I should get the execution plan back");
|
||||
|
||||
@@ -4,16 +4,11 @@
|
||||
//
|
||||
|
||||
using System;
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using NUnit.Framework;
|
||||
using Microsoft.SqlTools.ServiceLayer.ShowPlan;
|
||||
using Microsoft.SqlTools.ServiceLayer.ExecutionPlan;
|
||||
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.UnitTests.ShowPlan
|
||||
@@ -25,7 +20,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.ShowPlan
|
||||
[Test]
|
||||
public void ParseXMLFileReturnsValidShowPlanGraph()
|
||||
{
|
||||
ReadFile(".ShowPlan.TestExecutionPlan.xml");
|
||||
ReadFile(".ShowPlan.TestShowPlan.xml");
|
||||
var showPlanGraphs = ShowPlanGraphUtils.CreateShowPlanGraph(queryPlanFileText, "testFile.sql");
|
||||
Assert.AreEqual(1, showPlanGraphs.Count, "exactly one show plan graph should be returned");
|
||||
Assert.NotNull(showPlanGraphs[0], "graph should not be null");
|
||||
@@ -35,7 +30,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.ShowPlan
|
||||
[Test]
|
||||
public void ParsingNestedProperties()
|
||||
{
|
||||
ReadFile(".ShowPlan.TestExecutionPlan.xml");
|
||||
ReadFile(".ShowPlan.TestShowPlan.xml");
|
||||
string[] commonNestedPropertiesNames = { "MemoryGrantInfo", "OptimizerHardwareDependentProperties" };
|
||||
var showPlanGraphs = ShowPlanGraphUtils.CreateShowPlanGraph(queryPlanFileText, "testFile.sql");
|
||||
ExecutionPlanNode rootNode = showPlanGraphs[0].Root;
|
||||
@@ -52,7 +47,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.ShowPlan
|
||||
public void ParseXMLFileWithRecommendations()
|
||||
{
|
||||
//The first graph in this execution plan has 3 recommendations
|
||||
ReadFile(".ShowPlan.TestExecutionPlanRecommendations.xml");
|
||||
ReadFile(".ShowPlan.TestShowPlanRecommendations.xml");
|
||||
string[] commonNestedPropertiesNames = { "MemoryGrantInfo", "OptimizerHardwareDependentProperties" };
|
||||
var showPlanGraphs = ShowPlanGraphUtils.CreateShowPlanGraph(queryPlanFileText, "testFile.sql");
|
||||
List<ExecutionPlanRecommendation> rootNode = showPlanGraphs[0].Recommendations;
|
||||
|
||||
Reference in New Issue
Block a user