refactor(client): HistoryReadPageAsync is abstract; docs for the H3 review fixes
The page API is a required member of IOpcUaClientService / ISessionAdapter (the fakes implement it). DataConnections.md: projected slot sub-limit, per-node fault handling, request-order runs and sub-batches. Client.CLI.md: --aggregate now asks for the server's default aggregate configuration.
This commit is contained in:
+1
-1
@@ -253,7 +253,7 @@ continuation points up to `--max`. `--events` cannot be combined with `--modifie
|
||||
| `--start` | Start time in ISO 8601 UTC format, e.g. `2026-01-15T08:00:00Z` (default: 24 hours ago) |
|
||||
| `--end` | End time in ISO 8601 UTC format, e.g. `2026-01-15T09:00:00Z` (default: now) |
|
||||
| `--max` | Maximum number of values (default: 1000) |
|
||||
| `--aggregate` | Aggregate function: Average, Minimum, Maximum, Count, Start, End, StandardDeviation, TimeAverage, TimeAverage2, Total, Total2, Interpolative |
|
||||
| `--aggregate` | Aggregate function: Average, Minimum, Maximum, Count, Start, End, StandardDeviation, TimeAverage, TimeAverage2, Total, Total2, Interpolative. Since H3 the request asks for the server's default aggregate configuration (`AggregateConfiguration.UseServerCapabilitiesDefaults = true`); it used to send the SDK's all-zero configuration, which OtOpcUa refuses (`BadAggregateConfigurationRejected`, #677) — a behaviour change against a third-party server that honoured the all-zero settings |
|
||||
| `--interval` | Processing interval in milliseconds for aggregates (default: 3600000) |
|
||||
| `--modified` | Read modified-value history (Part 11 `IsReadModified`) instead of raw samples |
|
||||
| `--events` | Read event history (Part 11 HistoryReadEvents) from an event notifier instead of raw samples |
|
||||
|
||||
@@ -222,7 +222,13 @@ origin's `BadHistoryOperationUnsupported`. An origin-side denial, an unhistorize
|
||||
|
||||
**Mixed batches.** One HistoryRead may mix local and projected nodes: local nodes are served by the local historian exactly as
|
||||
before, projected nodes remotely, every result in its own slot. The remote half runs under the same process-wide HistoryRead batch
|
||||
limiter and never holds the node-manager lock.
|
||||
limiter (`ServerHistorian:MaxConcurrentHistoryReadBatches`, N) and never holds the node-manager lock; projected reads hold at most
|
||||
N − max(1, N/4) of the N slots (as remote peers do at an origin), so a slow origin cannot starve local HistoryRead/HistoryUpdate —
|
||||
past that the projected half is `BadTooManyOperations`, unsent. A fault or timeout of the remote call (including the connection's
|
||||
capability probe) fails only the projected half, per node (`BadTimeout` when the deadline fired), and releases its continuation
|
||||
points. Remote calls are runs of consecutive request positions that share a connection, details and (for resumes) the issuing
|
||||
endpoint, read in request order and split into sub-batches of at most min(the connection's batch size, the origin's advertised
|
||||
`MaxBatchItems`) — a large batch is never refused as a whole.
|
||||
|
||||
**Continuation points.** A projected read's continuation point lives in the client's OPC UA session like a local one (a `Remote`
|
||||
cursor; capped by `MaxHistoryContinuationPoints`, oldest evicted). It wraps the origin's token and binds the caller (principal, key,
|
||||
@@ -244,7 +250,7 @@ details on resume gets what it first asked for, as locally). Rules:
|
||||
|
||||
| Limit | Effect |
|
||||
|---|---|
|
||||
| `RemoteNamespaceMapping.MaxHistoryAssemblyBytesPerRequest` (16 MiB) | One budget per request, shared across the batch (the tightest mapping in the batch). Nodes are charged in request order; once a node does not fit, it and every later projected node is `BadTooManyOperations` (never a partial answer; its origin cursor is released). |
|
||||
| `RemoteNamespaceMapping.MaxHistoryAssemblyBytesPerRequest` (16 MiB) | One budget per request, shared across the batch (the tightest mapping in the batch). Nodes are charged in request order (calls run in request order, and at most one node per 256 B of the remaining budget is sent); once a node does not fit, it and every later projected node with data is `BadTooManyOperations` (never a partial answer; its origin cursor is released). |
|
||||
| `ServerHistorian:HistoryReadDeadline` (consumer, 60 s) | The consumer request's remaining deadline, capped per call by `DataConnection.HistoryTimeoutMilliseconds` ⇒ `BadTimeout`. A cancelled request is never counted as an origin fault. |
|
||||
| Aggregates | An aggregate the consumer cannot name is `BadAggregateNotSupported` unsent; one the origin's backend refuses (unknown to it, or not valid for the node's type — #897) comes back `BadAggregateNotSupported` from the origin. The consumer's `HistoryServerCapabilities/AggregateFunctions` does not describe remote backends. |
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ internal interface ISessionAdapter : IDisposable
|
||||
/// <param name="ct">Cancellation.</param>
|
||||
/// <returns>The page.</returns>
|
||||
Task<Models.HistoryPage> HistoryReadPageAsync(HistoryReadDetails details, NodeId nodeId, byte[]? continuationPoint, bool release,
|
||||
CancellationToken ct = default) => throw new NotSupportedException();
|
||||
CancellationToken ct = default);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a subscription adapter for this session.
|
||||
|
||||
@@ -270,7 +270,7 @@ public interface IOpcUaClientService : IDisposable
|
||||
/// <param name="ct">Cancellation.</param>
|
||||
/// <returns>The page.</returns>
|
||||
Task<HistoryPage> HistoryReadPageAsync(HistoryReadDetails details, NodeId nodeId, byte[]? continuationPoint = null, bool release = false,
|
||||
CancellationToken ct = default) => throw new NotSupportedException();
|
||||
CancellationToken ct = default);
|
||||
|
||||
/// <summary>
|
||||
/// Reads redundancy status data such as redundancy mode, service level, and partner endpoint URIs.
|
||||
|
||||
@@ -188,6 +188,17 @@ internal sealed class FakeSessionAdapter : ISessionAdapter
|
||||
return Task.FromResult<IReadOnlyList<DataValue>>(HistoryReadRawResponse);
|
||||
}
|
||||
|
||||
/// <summary>Every HistoryReadPageAsync call (details, continuation point, release flag).</summary>
|
||||
public List<(HistoryReadDetails Details, byte[]? ContinuationPoint, bool Release)> HistoryPageCalls { get; } = [];
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<ZB.MOM.WW.OtOpcUa.Client.Shared.Models.HistoryPage> HistoryReadPageAsync(HistoryReadDetails details, NodeId nodeId,
|
||||
byte[]? continuationPoint, bool release, CancellationToken ct = default)
|
||||
{
|
||||
HistoryPageCalls.Add((details, continuationPoint, release));
|
||||
return Task.FromResult(new ZB.MOM.WW.OtOpcUa.Client.Shared.Models.HistoryPage(StatusCodes.GoodNoData, [], null));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<IReadOnlyList<DataValue>> HistoryReadAggregateAsync(
|
||||
NodeId nodeId, DateTime startTime, DateTime endTime, NodeId aggregateId, double intervalMs,
|
||||
|
||||
@@ -350,6 +350,11 @@ public sealed class FakeOpcUaClientService : IOpcUaClientService
|
||||
return Task.FromResult(HistoryRawResult);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<HistoryPage> HistoryReadPageAsync(HistoryReadDetails details, NodeId nodeId, byte[]? continuationPoint = null,
|
||||
bool release = false, CancellationToken ct = default) =>
|
||||
Task.FromResult(new HistoryPage(StatusCodes.GoodNoData, [], null));
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<IReadOnlyList<DataValue>> HistoryReadAggregateAsync(NodeId nodeId, DateTime startTime, DateTime endTime,
|
||||
AggregateType aggregate, double intervalMs = 3600000, CancellationToken ct = default)
|
||||
|
||||
Reference in New Issue
Block a user