Show / Hide Table of Contents

Class ScopeEmitter

Generate Scope (U-SQL) code for computing metrics.

Inheritance
Object
ScopeEmitter
Implements
IEmitter
IGenericMetricsPlanTransformer<IDictionary<String, MemoryStream>>
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Mangrove.MetricSetEmitters
Assembly: MetricSetEmitters.dll
Syntax
public class ScopeEmitter : IEmitter, IGenericMetricsPlanTransformer<IDictionary<string, MemoryStream>>

Constructors

View Source

ScopeEmitter(String, String, String, ILogger, String, IGenericExpressionVisitor<String>)

Create a Scope emitter for MetricsPlan with exactly one output table.

Declaration
public ScopeEmitter(string scriptName, string preamble, string outputPath, ILogger logger, string cSharpBlock = "", IGenericExpressionVisitor<string> expressionVisitor = null)
Parameters
Type Name Description
String scriptName
String preamble

Arbitrary text to put inside a comment at the start of the generated script.

String outputPath

Cosmos path for output to be written to.

ILogger logger
String cSharpBlock
IGenericExpressionVisitor<String> expressionVisitor

Fields

View Source

MatchFlightDependentDllName

Declaration
public const string MatchFlightDependentDllName = "ForayCommonHelper.dll"
Field Value
Type Description
String
View Source

NGPTagHeader

Declaration
public const string NGPTagHeader = "\r\n#IF(EXISTS(\"/shares/PXSCosmos09.Prod/PXS.DeleteSignal.Prod/PrivacyAnnotation/PrivacyAnnotation.module\"))\r\n    MODULE \"/shares/PXSCosmos09.Prod/PXS.DeleteSignal.Prod/PrivacyAnnotation/PrivacyAnnotation.module\";\r\n#ENDIF\r\n#IF(EXISTS(\"/shares/PXSCosmos08.Prod/PXS.DeleteSignal.Prod/PrivacyAnnotation/PrivacyAnnotation.module\"))\r\n    MODULE \"/shares/PXSCosmos08.Prod/PXS.DeleteSignal.Prod/PrivacyAnnotation/PrivacyAnnotation.module\";\r\n#ENDIF\r\n#IF(EXISTS(\"/shares/PXSCosmos11.Prod/PXS.DeleteSignal.PROD/PrivacyAnnotation/PrivacyAnnotation.module\"))\r\n    MODULE \"/shares/PXSCosmos11.Prod/PXS.DeleteSignal.PROD/PrivacyAnnotation/PrivacyAnnotation.module\";\r\n#ENDIF\r\n#IF(EXISTS(\"/shares/PXSCosmos14.Prod/PXS.DeleteSignal.PROD/PrivacyAnnotation/PrivacyAnnotation.module\"))\r\n    MODULE \"/shares/PXSCosmos14.Prod/PXS.DeleteSignal.PROD/PrivacyAnnotation/PrivacyAnnotation.module\";\r\n#ENDIF\r\n#IF(EXISTS(\"/shares/PXSCosmos15.Prod/PXS.DeleteSignal.PROD/PrivacyAnnotation/PrivacyAnnotation.module\"))\r\n    MODULE \"/shares/PXSCosmos15.Prod/PXS.DeleteSignal.PROD/PrivacyAnnotation/PrivacyAnnotation.module\";\r\n#ENDIF\r\nUSING Privacy;\r\n"
Field Value
Type Description
String
View Source

ScopeSDK_DLLs

Reference blacklist when generate script in ScopeEmitter. The list is composed of system DLLs and Scope DLLs.

Declaration
public static ISet<string> ScopeSDK_DLLs
Field Value
Type Description
ISet<String>
Remarks

WARNING: Redefinition of these DLLs may cause conflicts. TODO: To be fixed by better solutions

Properties

View Source

Assumption

Declaration
public IMetricsPlanValidator Assumption { get; }
Property Value
Type Description
IMetricsPlanValidator
View Source

Extern

Declaration
public ExternKind Extern { get; }
Property Value
Type Description
ExternKind

Methods

View Source

MapOutputTablesToPaths(MetricsPlan, IReadOnlyDictionary<Table, ISet<Expression>>)

Maps leaf Tables to output paths. NOTE: currently only supports a unique output Table.

Declaration
public IDictionary<string, string> MapOutputTablesToPaths(MetricsPlan plan, IReadOnlyDictionary<Table, ISet<Expression>> tableToExpressions)
Parameters
Type Name Description
MetricsPlan plan
IReadOnlyDictionary<Table, ISet<Expression>> tableToExpressions
Returns
Type Description
IDictionary<String, String>
Remarks

A leaf Table (as determined by LeafTables(MetricsPlan)) is considered the the output table if:

  • It has at least one ColumnReferences on it, or
  • It is an ExternTable.

The first condition is there so that the SELECT statement will have at least one column selected. The second condition is needed because ExternTables are not required to have a ColumnReference for them to produce a valid Scope statement.

View Source

ProcessStatement(String, String, IEnumerable<String>)

Declaration
public static string ProcessStatement(string source, string processor, IEnumerable<string> args = null)
Parameters
Type Name Description
String source
String processor
IEnumerable<String> args
Returns
Type Description
String
View Source

ReduceStatement(String, String, IEnumerable<String>, IEnumerable<String>, IEnumerable<String>)

Declaration
public static string ReduceStatement(string source, string reducer, IEnumerable<string> on = null, IEnumerable<string> presort = null, IEnumerable<string> args = null)
Parameters
Type Name Description
String source
String reducer
IEnumerable<String> on
IEnumerable<String> presort
IEnumerable<String> args
Returns
Type Description
String
View Source

ReferencePath(String)

Resolve a file path from a reference name.

Declaration
public static string ReferencePath(string name)
Parameters
Type Name Description
String name
Returns
Type Description
String
View Source

References(MetricsPlan)

Reference

  • all assemblies used by Externs present in the plan any Externs, in case there are deep dependencies,
  • exclude assemblies listed in ScopeSDK_DLLs.
Declaration
public IEnumerable<string> References(MetricsPlan plan)
Parameters
Type Name Description
MetricsPlan plan
Returns
Type Description
IEnumerable<String>
Remarks

Some views silently depend on the assemblies from ScopeSDK_DLLs. I.e., calling the Scope compiler loads those assemblies, but they don't show up as view resources. So if it's not manually excluded, compilation can fail. Fortunately, there is no harm in excluding it even for views which do not silently include this.

View Source

Resources(MetricsPlan)

Resource every file referenced by plan except the ones listed in ScopeSDK_DLLs.

Declaration
public IEnumerable<string> Resources(MetricsPlan plan)
Parameters
Type Name Description
MetricsPlan plan
Returns
Type Description
IEnumerable<String>
Remarks

Some views silently depend on the assemblies from ScopeSDK_DLLs. I.e., calling the Scope compiler loads those assemblies, but they don't show up as view resources. So if it's not manually excluded, compilation can fail. Fortunately, there is no harm in excluding it even for views which do not silently include this.

View Source

ScriptOnly(MetricsPlan)

Declaration
public string ScriptOnly(MetricsPlan plan)
Parameters
Type Name Description
MetricsPlan plan
Returns
Type Description
String
View Source

Transform(MetricsPlan)

Emit the given MetricsPlan as Scope code.

Declaration
public IDictionary<string, MemoryStream> Transform(MetricsPlan plan)
Parameters
Type Name Description
MetricsPlan plan
Returns
Type Description
IDictionary<String, MemoryStream>

Implements

IEmitter
IGenericMetricsPlanTransformer<T>

Extension Methods

ObjectExtensions.EventId(Object)
  • View Source
Back to top Generated by DocFX