PipelineBuffer 클래스

Provides an in-memory data store containing rows and columns of data.

상속 계층

System.Object
  Microsoft.SqlServer.Dts.Pipeline.PipelineBuffer

네임스페이스:  Microsoft.SqlServer.Dts.Pipeline
어셈블리:  Microsoft.SqlServer.PipelineHost(Microsoft.SqlServer.PipelineHost.dll)

구문

‘선언
Public Class PipelineBuffer _
    Implements IDisposable
‘사용 방법
Dim instance As PipelineBuffer
public class PipelineBuffer : IDisposable
public ref class PipelineBuffer : IDisposable
type PipelineBuffer =  
    class 
        interface IDisposable 
    end
public class PipelineBuffer implements IDisposable

PipelineBuffer 유형에서 다음 멤버를 표시합니다.

생성자

  이름 설명
보호된 메서드 PipelineBuffer(IntPtr, PipelineBufferMode) Instantiates a new instance of the PipelineBuffer.
공용 메서드 PipelineBuffer(UInt32, UInt32, UInt64, IntPtr*, DTP_BUFFCOL*, Boolean)

맨 위로 이동

속성

  이름 설명
공용 속성 ColumnCount Gets the number of columns in the PipelineBuffer.
공용 속성 ColumnInfo
공용 속성 CurrentRow Gets the index of the current row in the PipelineBuffer.
공용 속성 EndOfRowset Gets a value indicating whether the current PipelineBuffer is the final buffer.
공용 속성 Item Gets the data stored in a buffer column.
공용 속성 Mode Gets a value indicating whether a PipelineBuffer is an IDTSInput100 buffer or an IDTSOutput100 buffer.
공용 속성 RowCount Gets the number of rows in the PipelineBuffer object.
공용 속성 RowSize
공용 속성 RowStarts

맨 위로 이동

메서드

  이름 설명
공용 메서드 AddBlobData(Int32, array<Byte[]) Adds an array of bytes to a PipelineBuffer column.
공용 메서드 AddBlobData(Int32, array<Byte[], Int32) Adds an array of a specified number of bytes to a PipelineBuffer column.
공용 메서드 AddRow Adds a row to the PipelineBuffer object.
공용 메서드 DirectErrorRow(Int32, Int32, Int32) Sends a PipelineBuffer row to an IDTSOutput100 whose IsErrorOut property is true.
공용 메서드 DirectErrorRow(Int32, Int32, Int32, Int32) Sends a PipelineBuffer row to an IDTSOutput100 whose IsErrorOut property is true.
공용 메서드 DirectRow Sends a row from a PipelineBuffer to the specified IDTSOutput100.
공용 메서드 Dispose() Releases all resources used by the PipelineBuffer.
보호된 메서드 Dispose(Boolean) Releases the unmanaged resources that are used by the PipelineBuffer, and optionally releases the managed resources.
공용 메서드 Equals (Object에서 상속됨)
보호된 메서드 Finalize Releases all resources used by the PipelineBuffer. (Object.Finalize()을(를) 재정의함)
공용 메서드 GetBlobData Retrieves an array of bytes from a binary large object (BLOB) stored in a PipelineBuffer column.
공용 메서드 GetBlobLength Gets the number of bytes contained in a binary large object (BLOB) PipelineBuffer column.
공용 메서드 GetBoolean Gets the bool value stored in the PipelineBuffer column.
공용 메서드 GetByte Gets the byte value stored in the PipelineBuffer column.
공용 메서드 GetBytes Gets the array of bytes stored in a buffer column.
공용 메서드 GetColumnInfo Retrieves the BufferColumn structure for a PipelineBuffer column.
공용 메서드 GetDate Gets the DateTime value stored in the PipelineBuffer column.
공용 메서드 GetDateTime Gets the DateTime value stored in the PipelineBuffer column.
공용 메서드 GetDateTimeOffset Gets the DateTimeOffset value stored in the PipelineBuffer column.
공용 메서드 GetDecimal Gets the decimal value stored in the PipelineBuffer column.
공용 메서드 GetDouble Gets the double stored in the PipelineBuffer column.
공용 메서드 GetGuid Gets the Guid value stored in the PipelineBuffer column.
공용 메서드 GetHashCode (Object에서 상속됨)
공용 메서드 GetInt16 Gets the short stored in the PipelineBuffer column.
공용 메서드 GetInt32 Gets the int stored in a PipelineBuffer column.
공용 메서드 GetInt64 Gets the long stored in the PipelineBuffer column.
공용 메서드 GetSByte Gets the SByte value stored in a PipelineBuffer column.
공용 메서드 GetSingle Gets the float stored in a PipelineBuffer column.
공용 메서드 GetString Gets the string stored in the buffer column.
공용 메서드 GetTime Gets the TimeSpan value stored in the PipelineBuffer column.
공용 메서드 GetType (Object에서 상속됨)
공용 메서드 GetUInt16 Gets the ushort value stored in the buffer column.
공용 메서드 GetUInt32 Gets the UInt32 value stored in the buffer column.
공용 메서드 GetUInt64 Gets the ulong value stored in the buffer column.
공용 메서드 IsNull Checks to see if the data in a buffer column is null.
보호된 메서드 MemberwiseClone (Object에서 상속됨)
공용 메서드 NextRow Advances the PipelineBuffer to the next row.
공용 메서드 RemoveRow Removes the current row from the PipelineBuffer.
공용 메서드 ResetBlobData Deletes the contents of the specified BLOB column.
공용 메서드 SetBoolean Assigns a bool value to a PipelineBuffer column.
공용 메서드 SetByte Assigns a byte to a PipelineBuffer column.
공용 메서드 SetBytes Assigns an array of bytes to a buffer column.
공용 메서드 SetDate Assigns a DateTime value to the PipelineBuffer column.
공용 메서드 SetDateTime Assigns a DateTime value to the PipelineBuffer column.
공용 메서드 SetDateTimeOffset Assigns a DateTimeOffset value to the PipelineBuffer column.
공용 메서드 SetDecimal Assigns a decimal to a buffer column.
공용 메서드 SetDouble Assigns a double to a PipelineBuffer column.
공용 메서드 SetEndOfRowset Notifies the PipelineBuffer that a component has finished adding rows to the buffer.
공용 메서드 SetErrorInfo Sets the error information for the current PipelineBuffer row.
공용 메서드 SetGuid Assigns a Guid to a buffer column.
공용 메서드 SetInt16 Assigns a 16-bit signed integer to a buffer column.
공용 메서드 SetInt32 Assigns a 32-bit signed integer to a buffer column.
공용 메서드 SetInt64 Assigns a 64-bit signed integer to a buffer column.
공용 메서드 SetNull Assigns nullnull 참조(Visual Basic에서는 Nothing) to a buffer column.
공용 메서드 SetSByte Assigns a signed 8-bit integer to a buffer column.
공용 메서드 SetSingle Assigns a float to a buffer column.
공용 메서드 SetString Assigns a string to a buffer column.
공용 메서드 SetTime Assigns a TimeSpan value to the PipelineBuffer column.
공용 메서드 SetUInt16 Assigns an unsigned 16-bit integer to a buffer column.
공용 메서드 SetUInt32 Assigns an unsigned 32-bit integer to a buffer column.
공용 메서드 SetUInt64 Assigns an unsigned 64-bit integer to a buffer column.
공용 메서드 ToString (Object에서 상속됨)

맨 위로 이동

주의

The PipelineBuffer is an in-memory two-dimensional data store containing rows and columns. It is created by the data flow task and supplied to managed data flow components during execution. The columns contained in a buffer are based on the columns in the IDTSOutputColumnCollection100 collections of the components in the graph.

Source components and components with asynchronous outputs receive a buffer for each of the output objects that are connected to a downstream component. These buffers are referred to as output buffers and do not contain rows. The component that receives the output buffer adds rows to the buffer and calls the SetEndOfRowset method when finished. This method sets the value of the EndOfRowset property to true on the final buffer. The data flow task then provides that buffer to the next component in the graph.

Transformation components with synchronous outputs and destination components receive PipelineBuffer objects in the ProcessInput method. The PipelineBuffer received in this method is an Input buffer and contains the rows that were added to by upstream components. This buffer is restricted and cannot be used to add or remove rows from the buffer.

The PipelineBuffer is written in managed code and supports managed data flow component developers by marshalling data between managed code and the underlying IDTSBuffer100 COM object.

For a complete list of Integration Services data types and the corresponding Get and Set methods of the PipelineBuffer class to use with each data type, see 데이터 흐름의 데이터 형식 작업.

The following example shows a transformation component that iterates the rows and columns of a PipelineBuffer in ProcessInput.

using System;
using Microsoft.SqlServer.Dts;
using Microsoft.SqlServer.Dts.Pipeline;
using Microsoft.SqlServer.Dts.Pipeline.Wrapper;
using Microsoft.SqlServer.Dts.Runtime.Wrapper;


namespace Microsoft.Samples.SqlServer.Dts
{
   [DtsPipelineComponent
   (
   DisplayName="SampleComponent",
   ComponentType=ComponentType.Transform
   )]
   public class SampleComponent: PipelineComponent
   {
      public override void ProvideComponentProperties()
      {
         base.ProvideComponentProperties();

         ///Name the input and output add by the base class.
         ComponentMetaData.InputCollection[0].Name = "SampleInput";
         ComponentMetaData.OutputCollection[0].Name = "SampleOutput";
      }

      public override void ProcessInput(int inputID, PipelineBuffer buffer)
      {

      IDTSInput100 input = ComponentMetaData.InputCollection.GetObjectByID(inputID);

      while (buffer.NextRow())
      {
         foreach (IDTSInputColumn100 col in input.InputColumnCollection)
         {
            int colIndex = BufferManager.FindColumnByLineageID(input.Buffer,col.LineageID);
            object colData = buffer[colIndex];
            //TODO: Do something with the column data.
         }
      }
      }
   }
}

The following example shows a source component that adds rows to the output buffer in PrimeOutput.

using System;
using Microsoft.SqlServer.Dts;
using Microsoft.SqlServer.Dts.Pipeline;
using Microsoft.SqlServer.Dts.Pipeline.Wrapper;
using Microsoft.SqlServer.Dts.Runtime.Wrapper;


namespace Microsoft.Samples.SqlServer.Dts
{
   [DtsPipelineComponent
   (
      DisplayName="SampleComponent",
      ComponentType=ComponentType.SourceComponent
)]
   public class SampleComponent: PipelineComponent
   {
      public override void PrimeOutput(int outputs, int[] outputIDs,PipelineBuffer[] buffers)
      {
         int rows = 100;
         PipelineBuffer buf = buffers[0];
         IDTSOutput100 output = ComponentMetaData.OutputCollection[0];
         Random rand = new Random();

         //Loop rows number of times
         for(int r = 0; r < rows; r++)
         {
            buf.AddRow();
            foreach( IDTSOutputColumn100 col in output.OutputColumnCollection)
            {
               int colIndex = BufferManager.FindColumnByLineageID( output.Buffer, col.LineageID);
               // Note, buffer columns containing binary large objects
               // can not be set using the following syntax. Instead,
               // the AddBlobData and SetBytes methods are used.
               buf[colIndex] = rand.Next();
            }
         }
         buf.SetEndOfRowset();
      }
   }
}

스레드 보안

이 유형의 모든 공용 static(Visual Basic에서는 Shared) 멤버는 스레드로부터 안전합니다. 인스턴스 멤버는 스레드로부터의 안전성이 보장되지 않습니다.

참고 항목

참조

Microsoft.SqlServer.Dts.Pipeline 네임스페이스