Class Exporter
Component that writes messages to a multi-stream store.
Inherited Members
Namespace: Microsoft.Psi.Data
Assembly: Microsoft.Psi.dll
Syntax
public abstract class Exporter : Subpipeline, ISourceComponent
Remarks
The store can be backed by a file on disk, can be ephemeral (in-memory) for inter-process communication or can be a network protocol for cross-machine communication.
Constructors
View SourceExporter(Pipeline, String, String, Boolean, KnownSerializers)
Initializes a new instance of the Exporter class.
Declaration
protected Exporter(Pipeline pipeline, string name, string path, bool createSubdirectory = true, KnownSerializers serializers = null)
Parameters
Type | Name | Description |
---|---|---|
Pipeline | pipeline | The pipeline to add the component to. |
String | name | The name of the application that generated the persisted files, or the root name of the files. |
String | path | The directory in which the main persisted file resides or will reside, or null to create a volatile data store. |
System.Boolean | createSubdirectory | If true, a numbered sub-directory is created for this store. |
KnownSerializers | serializers | A collection of known serializers, or null to infer it from the data being written to the store. The known serializer set can be accessed and modified afterwards via the Serializers property. |
Properties
View SourceMetadata
Gets stream metadata.
Declaration
public IEnumerable<IStreamMetadata> Metadata { get; }
Property Value
Type | Description |
---|---|
IEnumerable<IStreamMetadata> |
Name
Gets the name of the store being written to.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
String |
Path
Gets the path to the store being written to if the store is persisted to disk, or null if the store is volatile.
Declaration
public string Path { get; }
Property Value
Type | Description |
---|---|
String |
Serializers
Gets the set of types that this Importer can deserialize. Types can be added or re-mapped using the Register<T>(String, CloningFlags) method.
Declaration
public KnownSerializers Serializers { get; }
Property Value
Type | Description |
---|---|
KnownSerializers |
Methods
View SourceDispose()
Closes the store.
Declaration
public override void Dispose()
Overrides
View SourceSummarizeDistinctKeysInSupplementalMetadata<TKey, TValue>(Emitter<Dictionary<TKey, TValue>>)
Stores supplemental metadata representing distinct dictionary keys seen on the stream.
Declaration
public void SummarizeDistinctKeysInSupplementalMetadata<TKey, TValue>(Emitter<Dictionary<TKey, TValue>> source)
Parameters
Type | Name | Description |
---|---|---|
Emitter<Dictionary<TKey, TValue>> | source | The source stream to write. |
Type Parameters
Name | Description |
---|---|
TKey | The type of dictionary key in the stream. |
TValue | The type of dictionary value in the stream. |
Write<TMessage>(IProducer<TMessage>, String, Boolean, DeliveryPolicy<TMessage>)
Writes the messages from the specified stream to the matching stream in this store.
Declaration
public void Write<TMessage>(IProducer<TMessage> source, string name, bool largeMessages = false, DeliveryPolicy<TMessage> deliveryPolicy = null)
Parameters
Type | Name | Description |
---|---|---|
IProducer<TMessage> | source | The source stream to write. |
String | name | The name of the stream. |
System.Boolean | largeMessages | Indicates whether the stream contains large messages (typically >4k). If true, the messages will be written to the large message file. |
DeliveryPolicy<TMessage> | deliveryPolicy | An optional delivery policy. |
Type Parameters
Name | Description |
---|---|
TMessage | The type of messages in the stream. |
Write<TMessage, TSupplementalMetadata>(IProducer<TMessage>, TSupplementalMetadata, String, Boolean, DeliveryPolicy<TMessage>)
Writes the messages from the specified stream to the matching stream in this store. Additionally stores supplemental metadata value.
Declaration
public void Write<TMessage, TSupplementalMetadata>(IProducer<TMessage> source, TSupplementalMetadata supplementalMetadataValue, string name, bool largeMessages = false, DeliveryPolicy<TMessage> deliveryPolicy = null)
Parameters
Type | Name | Description |
---|---|---|
IProducer<TMessage> | source | The source stream to write. |
TSupplementalMetadata | supplementalMetadataValue | Supplemental metadata value. |
String | name | The name of the stream. |
System.Boolean | largeMessages | Indicates whether the stream contains large messages (typically >4k). If true, the messages will be written to the large message file. |
DeliveryPolicy<TMessage> | deliveryPolicy | An optional delivery policy. |
Type Parameters
Name | Description |
---|---|
TMessage | The type of messages in the stream. |
TSupplementalMetadata | The type of supplemental stream metadata. |
WriteEnvelopes<T>(IProducer<T>, String, DeliveryPolicy<T>)
Writes the envelopes of messages from the specified stream to the store.
Declaration
public void WriteEnvelopes<T>(IProducer<T> source, string name, DeliveryPolicy<T> deliveryPolicy = null)
Parameters
Type | Name | Description |
---|---|---|
IProducer<T> | source | The source stream to write. |
String | name | The name of the stream. |
DeliveryPolicy<T> | deliveryPolicy | An optional delivery policy. |
Type Parameters
Name | Description |
---|---|
T | The type of messages in the stream. |