PipelineComponent.GetDependentInputs(Int32) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
返回一组等待更多数据、因此阻塞指定输入的输入 ID。
public:
virtual System::Collections::ObjectModel::Collection<int> ^ GetDependentInputs(int blockedInputID);
public virtual System.Collections.ObjectModel.Collection<int> GetDependentInputs(int blockedInputID);
abstract member GetDependentInputs : int -> System.Collections.ObjectModel.Collection<int>
override this.GetDependentInputs : int -> System.Collections.ObjectModel.Collection<int>
Public Overridable Function GetDependentInputs (blockedInputID As Integer) As Collection(Of Integer)
参数
- blockedInputID
- Int32
一个输入的ID,在其他输入等待更多数据时被阻挡。
返回
一组等待更多数据的输入 ID,因此阻碍了由 blockedInputID 参数识别的输入。
示例
对于被阻塞的特定输入,以下方法实现 GetDependentInputs 返回一组等待接收更多数据的输入,从而阻断指定输入。 组件通过检查指定输入外,是否有当前在缓冲区中无法处理且已接收的数据()来识别阻塞输入(inputBuffers[i].CurrentRow() == null)。
GetDependentInputs该方法随后返回阻塞输入集合,作为输入ID集合。
public override Collection<int> GetDependentInputs(int blockedInputID)
{
Collection<int> currentDependencies = new Collection<int>();
for (int i = 0; i < ComponentMetaData.InputCollection.Count; i++)
{
if (ComponentMetaData.InputCollection[i].ID != blockedInputID
&& inputBuffers[i].CurrentRow() == null)
{
currentDependencies.Add(ComponentMetaData.InputCollection[i].ID);
}
}
return currentDependencies;
}
注解
当你将属性trueDtsPipelineComponentAttribute值设置为 Microsoft.SqlServer.Dts.Pipeline.DtsPipelineComponentAttribute.SupportsBackPressure ,且你的自定义数据流组件支持多个输入时,你还必须为该方法提供实现GetDependentInputs。
数据流引擎只有在用户将多个输入附加到组件时才调用该 GetDependentInputs 方法。 当一个组件只有两个输入,且 IsInputReady 方法显示一个输入被阻塞(canProcess = false),数据流引擎知道另一个输入正在等待接收更多数据。 然而,当输入超过两个且 IsInputReady 方法显示其中一个输入被阻塞时,方法中的 GetDependentInputs 额外代码会识别等待接收更多数据的输入。
关于当自定义 data flow 组件的输入产生数据速率不均时,如何处理过多内存使用的更多信息,请参见《Developing 数据流 Components with Multiple Inputs》。