PipelineComponent.GetDependentInputs Method (Int32)

 

Applies To: SQL Server 2016 Preview

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

Namespace:   Microsoft.SqlServer.Dts.Pipeline
Assembly:  Microsoft.SqlServer.PipelineHost (in Microsoft.SqlServer.PipelineHost.dll)

Syntax

public virtual Collection<int> GetDependentInputs(
    int blockedInputID
)
public:
virtual Collection<int>^ GetDependentInputs(
    int blockedInputID
)
abstract GetDependentInputs : 
        blockedInputID:int -> Collection<int>
override GetDependentInputs : 
        blockedInputID:int -> Collection<int>
Public Overridable Function GetDependentInputs (
    blockedInputID As Integer
) As Collection(Of Integer)

Parameters

  • blockedInputID
    Type: System.Int32

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

Return Value

Type: System.Collections.ObjectModel.Collection<Int32>

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.

Remarks

When you set the value of the 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.

Examples

Legacy Code Example

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

See Also

PipelineComponent Class
Microsoft.SqlServer.Dts.Pipeline Namespace

Return to top