TransIterator contains helper iterator classes used by HA replica applications to receive transaction-level output from the replication stream. In the current C# API the main built-in implementation is TransIterator.JsonIterator, which writes replication events and object images to a System.IO.Stream in JSON format.
public class TransIterator
{
public abstract class Iterator
{
public Iterator(Connection con);
public void Close();
}
public class JsonIterator : Iterator
{
public JsonIterator(Connection con, System.IO.Stream s, bool compact,
bool ignore_stream_errors);
public JsonIterator(Connection con, System.IO.Stream s);
}
}
ReplicaConnection.Parameters.Iterator.Connection and owns the native iterator handle created by a concrete implementation.Stream; stream lifetime is controlled by the application.System.IO.Stream.compact is true, compact JSON is generated; otherwise the output is formatted for readability. When ignore_stream_errors is false, stream write errors stop replication; when it is true, replication continues and stream errors are ignored.ReplicaConnection.Parameters.Iterator before calling AttachMaster(). The iterator then receives object and schema-change output from the master-side replication stream.ReplicaConnection.Parameters, assign new TransIterator.JsonIterator(con, stream) to Parameters.Iterator, call AttachMaster(), and finally call Close() on the iterator when replication is stopped.