共用方式為


PipelineComponent.GetDependentInputs(Int32) Method

Definition

Returns a collection of the input IDs of inputs that are waiting for more data, and thus are blocking the specified input.

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)

Parameters

blockedInputID
Int32

The ID of an input that is blocked while other inputs are waiting for more data.

Returns

A collection of the input IDs of inputs that are waiting for more data, and thus are blocking the input that is identified by the blockedInputID parameter.

Examples

For a specific input that is blocked, the following implementation of the GetDependentInputs method returns a collection of the inputs that are waiting to receive more data, and thus are blocking the specified input. The component identifies the blocking inputs by checking for inputs other than the specified input that do not currently have data available to process in the buffers that the component has already received (inputBuffers[i].CurrentRow() == null). The GetDependentInputs method then returns the collection of blocking inputs as a collection of input IDs.

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;  
}  

Remarks

When you set the value of the Microsoft.SqlServer.Dts.Pipeline.DtsPipelineComponentAttribute.SupportsBackPressure property to true in the DtsPipelineComponentAttribute, and your custom data flow component supports more than two inputs, then you must also provide an implementation for the GetDependentInputs method.

The data flow engine only calls the GetDependentInputs method when the user attaches more than two inputs to the component. When a component has only two inputs, and the IsInputReady method indicates that one input is blocked (canProcess = false), the data flow engine knows that the other input is waiting to receive more data. However, when there are more than two inputs, and the IsInputReady method indicates that one input is blocked, the extra code in the GetDependentInputs method identifies the inputs that are waiting to receive more data.

For more information about the handling of excessive memory usage if the inputs of a custom data flow component produce data at uneven rates, see Developing Data Flow Components with Multiple Inputs.

Applies to