PipelineComponent.GetDependentInputs(Int32) 方法

定义

返回正在等待更多数据的输入 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;  
}  

注解

如果在 中DtsPipelineComponentAttribute将 属性的值Microsoft.SqlServer.Dts.Pipeline.DtsPipelineComponentAttribute.SupportsBackPressure设置为 true ,并且自定义数据流组件支持两个以上的输入,则还必须提供 方法的GetDependentInputs实现。

在用户将多个输入附加到组件时,数据流引擎仅调用 GetDependentInputs 方法。 当一个组件只有两个输入,并且 IsInputReady 方法指示一个输入被阻止 (canProcess = false) 时,数据流引擎知道另一个输入正在等待接收更多数据。 但是,当存在两个以上的输入,并且 IsInputReady 方法指示一个输入被阻止时,该方法中的 GetDependentInputs 额外代码将标识等待接收更多数据的输入。

有关在自定义数据流组件的输入以不均匀速率生成数据时处理过多内存使用的详细信息,请参阅使用多个输入开发数据流组件

适用于