Class JsonStore
Provides static methods to access multi-stream JSON stores.
Namespace: Microsoft.Psi.Data.Json
Assembly: Microsoft.Psi.Data.dll
Syntax
public static class JsonStore : object
Methods
View SourceCreate(Pipeline, String, String, Boolean)
Creates a new multi-stream JSON store and returns an JsonExporter instance which can be used to write streams to this store.
Declaration
public static JsonExporter Create(Pipeline pipeline, string name, string rootPath, bool createSubdirectory = true)
Parameters
Type | Name | Description |
---|---|---|
Pipeline | pipeline | The pipeline to add the component to. |
String | name | The name of the store to create. |
String | rootPath | The path to use. If null, an in-memory store is created. |
System.Boolean | createSubdirectory | Indicates whether to create a numbered subdirectory for each execution of the pipeline. |
Returns
Type | Description |
---|---|
JsonExporter | An JsonExporter instance that can be used to write streams. |
Open(Pipeline, String, String)
Opens a JSON store for read and returns an JsonGenerator instance which can be used to inspect the store and open the streams.
Declaration
public static JsonGenerator Open(Pipeline pipeline, string name, string path)
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. |
Returns
Type | Description |
---|---|
JsonGenerator | A JsonGenerator instance that can be used to open streams and read messages. |
Write<TIn>(IProducer<TIn>, String, JsonExporter, DeliveryPolicy<TIn>)
Writes the specified stream to a multi-stream JSON store.
Declaration
public static IProducer<TIn> Write<TIn>(this IProducer<TIn> source, string name, JsonExporter writer, DeliveryPolicy<TIn> deliveryPolicy = null)
Parameters
Type | Name | Description |
---|---|---|
IProducer<TIn> | source | The source stream to write. |
String | name | The name of the persisted stream. |
JsonExporter | writer | The store writer, created by e.g. Create(Pipeline, String, String, Boolean). |
DeliveryPolicy<TIn> | deliveryPolicy | An optional delivery policy. |
Returns
Type | Description |
---|---|
IProducer<TIn> | The input stream. |
Type Parameters
Name | Description |
---|---|
TIn | The type of messages in the stream. |