次の方法で共有


PipelineComponent.GetDependentInputs メソッド

追加のデータを待っているために特定の入力をブロックしている入力の入力 ID のコレクションを返します。

名前空間:  Microsoft.SqlServer.Dts.Pipeline
アセンブリ:  Microsoft.SqlServer.PipelineHost (Microsoft.SqlServer.PipelineHost.dll)

構文

'宣言
Public Overridable Function GetDependentInputs ( _
    blockedInputID As Integer _
) As Collection(Of Integer)
'使用
Dim instance As PipelineComponent 
Dim blockedInputID As Integer 
Dim returnValue As Collection(Of Integer)

returnValue = instance.GetDependentInputs(blockedInputID)
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 function GetDependentInputs(
    blockedInputID : int
) : Collection<int>

パラメーター

  • blockedInputID
    型: System.Int32
    他の入力がデータを待っている間にブロックされた入力の ID です。

戻り値

型: System.Collections.ObjectModel.Collection<Int32>
追加のデータを待っているために blockedInputID パラメーターで識別された入力をブロックしている入力の入力 ID のコレクションです。

説明

DtsPipelineComponentAttributeDtsPipelineComponentAttribute.SupportsBackPressure プロパティの値を true に設定したときにカスタム データ フロー コンポーネントが 3 つ以上の入力をサポートしている場合は、GetDependentInputs メソッドも実装する必要があります。

データ フロー エンジンは、ユーザーが 3 つ以上の入力をコンポーネントにアタッチする場合に、GetDependentInputs メソッドを呼び出すだけです。 コンポーネントの入力が 2 つしかないときに 1 つの入力がブロックされていることが IsInputReady メソッドによって示される場合 (canProcess = false)、データ フロー エンジンは、もう一方の入力が追加のデータを待っていることを認識します。 ただし、3 つ以上の入力があるときに 1 つの入力がブロックされていることが IsInputReady メソッドによって示される場合、GetDependentInputs メソッドの追加のコードにより、追加のデータを待っている入力を識別できます。

カスタム データ フロー コンポーネントの複数の入力によってデータが不均一なレートで生成される場合に過度なメモリ消費を処理する方法の詳細については、「複数の入力を持つデータ フロー コンポーネントの開発」を参照してください。

使用例

ブロックされている特定の入力に対し、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;
        }

関連項目

参照

PipelineComponent クラス

Microsoft.SqlServer.Dts.Pipeline 名前空間