Class OutputPortBaseCollection
Base class for a collection of all (either only output or only error output) ports for a worker. Note that these are the 'untyped' base class ports, which are useful for performing all operations that do not require the type of the row.
Note that workers with ports also add additional members to the worker that allow access to the typed versions of the ports, which do include the row type.
Namespace: actionETL
Assembly: actionETL.dll
Syntax
public abstract class OutputPortBaseCollection : IEnumerable<OutputPortBase>, IEnumerable
Properties
Count
Gets the number of input ports in the collection.
Note: This property is thread-safe.
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Item[Int32]
Returns the OutputPortBase at the specified index. Note that the 'untyped' OutputPortBase base class is returned, which does not specify the type of the rows. If the row type is needed, either cast the returned value to the row type, or use worker specific members that provide the row type.
Note: This indexer is thread-safe.
Declaration
public OutputPortBase this[int index] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | index | The port index. This corresponds to the order in which the ports were added, starting with |
Property Value
| Type | Description |
|---|---|
| OutputPortBase |
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException |
|
Item[String]
Returns the OutputPortBase with the specified port name. Note that the 'untyped' OutputPortBase base class is returned, which does not specify the type of the rows. If the row type is needed, either cast the returned value to the row type, or use worker specific members that provide the row type.
Note: This indexer is thread-safe.
Declaration
public OutputPortBase this[string portName] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| String | portName | Name of the port. |
Property Value
| Type | Description |
|---|---|
| OutputPortBase |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|
TotalRowsSent
Gets the total number of rows sent to a downstream worker across all ports in this collection.
Note that for error output ports, this does not include rows that were received by the error output port but not sent to the downstream worker. Also see TotalRowsReceived and AggregateOutputRows.
Note that this property is only thread-safe after the port has completed.
Declaration
public long TotalRowsSent { get; }
Property Value
| Type | Description |
|---|---|
| Int64 |
Worker
Gets the worker the ports belong to.
Note: Retrieving this property is thread-safe, but only some of the WorkerBase members are thread-safe.
Declaration
public WorkerBase Worker { get; }
Property Value
| Type | Description |
|---|---|
| WorkerBase |
Methods
GetEnumerator()
Returns an enumerator that iterates through the collection.
Note: This method is not thread-safe; use ToArray(), ToArray() or ToArray<TErrorOutput>() to get or iterate over the ports in a thread-safe manner.
Declaration
public IEnumerator<OutputPortBase> GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator<OutputPortBase> |
SendSucceeded()
Calls SendSucceeded() on all ports in the collection. This method will throw an exception if any output port is already in a completed state.
Declaration
public void SendSucceeded()
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Expected |
ToArray()
Returns the ports copied to a new array. The caller can manipulate the array without affecting the worker, e.g. reordering the array items.
Note that the 'untyped' base class port is returned, which does not specify the type of the rows. If the row type is needed, instead use ToArray<TOutput>() or ToArray<TErrorOutput>().
Note: This method is thread-safe.
Declaration
public OutputPortBase[] ToArray()
Returns
| Type | Description |
|---|---|
| OutputPortBase[] |
TrySendError(String)
Calls SendError(String) on all ports in the collection that are not completed.
Also logs the error.
Declaration
public bool TrySendError(string subcategory)
Parameters
| Type | Name | Description |
|---|---|---|
| String | subcategory | The logging sub category, which will be dot separated and appended to the OutputPortBaseStateFailed category string. |
Returns
| Type | Description |
|---|---|
| Boolean |
|
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException |
|
TrySendError(String, Exception)
Calls SendError(String) on all ports in the collection that are not completed.
Also logs the error.
Declaration
public bool TrySendError(string subcategory, Exception exception)
Parameters
| Type | Name | Description |
|---|---|---|
| String | subcategory | The logging sub category, which will be dot separated and appended to the OutputPortBaseStateFailed category string. |
| Exception | exception | The exception that caused the error, or |
Returns
| Type | Description |
|---|---|
| Boolean |
|
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException |
|
TrySendError(String, Exception, String, String[])
Calls SendError(String) on all ports in the collection that are not completed.
Also logs the error.
Declaration
public bool TrySendError(string subcategory, Exception exception, string message, params string[] args)
Parameters
| Type | Name | Description |
|---|---|---|
| String | subcategory | The logging sub category, which will be dot separated and appended to the OutputPortBaseStateFailed category string. |
| Exception | exception | The exception that caused the error, or |
| String | message | The message, or |
| String[] | args | Any arguments used by the message. |
Returns
| Type | Description |
|---|---|
| Boolean |
|
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException |
|
TrySendError(String, String, String[])
Calls SendError(String) on all ports in the collection that are not completed.
Also logs the error.
Declaration
public bool TrySendError(string subcategory, string message, params string[] args)
Parameters
| Type | Name | Description |
|---|---|---|
| String | subcategory | The logging sub category, which will be dot separated and appended to the OutputPortBaseStateFailed category string. |
| String | message | The message, or |
| String[] | args | Any arguments used by the message. |
Returns
| Type | Description |
|---|---|
| Boolean |
|
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException |
|
TrySendSucceeded()
Calls SendSucceeded() on all ports in the collection that are not completed.
Declaration
public bool TrySendSucceeded()
Returns
| Type | Description |
|---|---|
| Boolean |
Explicit Interface Implementations
IEnumerable.GetEnumerator()
Returns an enumerator that iterates through the collection. Use GetEnumerator() instead.
Note: This method is not thread-safe; use ToArray(), ToArray() or ToArray<TErrorOutput>() to get or iterate over the ports in a thread-safe manner.
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator |