IStreamDataServicesClient
Namespace: Meshmakers.Octo.Sdk.ServiceClient.AssetRepositoryServices.StreamData
Interface for the StreamData services.
public interface IStreamDataServicesClient : IServiceClient
Implements IServiceClient
Methods
EnableAsync(String)
Enables the StreamData for a tenant
Task EnableAsync(string tenantId)
Parameters
tenantId String
The id of the tenant.
Returns
DisableAsync(String)
Disables StreamData for a tenant: switches the tenant flag off. The System.StreamData model,
the archive definitions and the stored stream data are kept; IStreamDataServicesClient.EnableAsync(String) restores access.
Task DisableAsync(string tenantId)
Parameters
tenantId String
The id of the tenant.
Returns
Remarks:
Verified precondition, not a teardown: the service answers HTTP 409 with an
OperationFailedErrorDto naming every archive that is still Activated - surfaced here as a
ServiceClientResultException - until they are disabled (IStreamDataServicesClient.DisableArchiveAsync(String, String), data
kept) or deleted (IStreamDataServicesClient.DeleteArchiveAsync(String, String), rollups before their source). Disabling StreamData
is required before the tenant can be deleted or detached.
ActivateArchiveAsync(String, String)
Activates a CkArchive: provisions the per-archive CrateDB table and transitions the
archive to Activated. Allowed from Created, Disabled, or
Failed; idempotent on Activated.
Task ActivateArchiveAsync(string tenantId, string archiveRtId)
Parameters
tenantId String
The tenant that owns the archive.
archiveRtId String
Runtime id of the CkArchive entity.
Returns
DisableArchiveAsync(String, String)
Disables a CkArchive: transitions to Disabled (data preserved). Allowed only
from Activated.
Task DisableArchiveAsync(string tenantId, string archiveRtId)
Parameters
tenantId String
archiveRtId String
Returns
EnableArchiveAsync(String, String)
Re-enables a previously disabled archive: transitions Disabled → Activated.
Re-validates column paths against the current CK model; no DDL.
Task EnableArchiveAsync(string tenantId, string archiveRtId)
Parameters
tenantId String
archiveRtId String
Returns
RetryArchiveActivationAsync(String, String)
Retries activation after a previous DDL failure. Allowed only from Failed.
Task RetryArchiveActivationAsync(string tenantId, string archiveRtId)
Parameters
tenantId String
archiveRtId String
Returns
DeleteArchiveAsync(String, String)
Drops the per-archive CrateDB table (idempotent) and soft-deletes the CkArchive
entity. Destructive — historical data is lost. Allowed from any status.
Task DeleteArchiveAsync(string tenantId, string archiveRtId)
Parameters
tenantId String
archiveRtId String
Returns
FreezeRollupArchiveAsync(String, String, DateTime)
Freezes a CkRollupArchive at until. Monotonic — rejected when
the new value is earlier than the current FrozenUntil.
Task FreezeRollupArchiveAsync(string tenantId, string rollupRtId, DateTime until)
Parameters
tenantId String
rollupRtId String
until DateTime
Returns
UnfreezeRollupArchiveAsync(String, String, Boolean)
Clears FrozenUntil on the rollup archive. Idempotent. Set acceptGaps
when source data inside the previously frozen range has been truncated and the operator
knowingly accepts the resulting gaps.
Task UnfreezeRollupArchiveAsync(string tenantId, string rollupRtId, bool acceptGaps)
Parameters
tenantId String
rollupRtId String
acceptGaps Boolean
Returns
RewindRollupWatermarkAsync(String, String, DateTime)
Resets the rollup's watermark (truncated to the bucket boundary) so subsequent orchestrator ticks re-aggregate the rewound range. Destructive: rows in that range are temporarily out of sync until the orchestrator catches up.
Task RewindRollupWatermarkAsync(string tenantId, string rollupRtId, DateTime toBucketEnd)
Parameters
tenantId String
rollupRtId String
toBucketEnd DateTime
Returns
ListRollupsForArchiveAsync(String, String)
Returns every non-soft-deleted rollup archive attached to the given source CkArchive.
Task<IReadOnlyList<RollupArchiveInfoDto>> ListRollupsForArchiveAsync(string tenantId, string archiveRtId)
Parameters
tenantId String
archiveRtId String
Returns
Task<IReadOnlyList<RollupArchiveInfoDto>>
GetArchiveCoverageAsync(String, String)
Returns the measured data coverage of the given archive and of every archive related to it in the tenant's stream-data landscape: what each archive stores, and the timestamp range it actually holds data for.
Task<IReadOnlyList<ArchiveCoverageDto>> GetArchiveCoverageAsync(string tenantId, string archiveRtId)
Parameters
tenantId String
The tenant that owns the archive.
archiveRtId String
Runtime id of the CkArchive entity to report coverage for.
Returns
Task<IReadOnlyList<ArchiveCoverageDto>>
RecomputeArchiveAsync(String, String, DateTime, DateTime, String)
Triggers (or coalesces) an optimistic recompute of a rollup archive over the half-open
range [from, to), optionally scoped to a single rtIdScope.
Returns the resulting job snapshot (state, counts, error reason). When a recompute is
already running for the archive, the range is folded into it and a Coalesced job is
returned.
Task<RollupRecomputeJobInfoDto> RecomputeArchiveAsync(string tenantId, string rollupRtId, DateTime from, DateTime to, string rtIdScope)
Parameters
tenantId String
rollupRtId String
from DateTime
to DateTime
rtIdScope String
Returns
Task<RollupRecomputeJobInfoDto>
BackfillRollupFromSourceAsync(String, String)
Populates / resets a rollup over the ENTIRE history of its source archive without supplying
a timestamp. Resolves the source archive's earliest timestamp and recomputes
[sourceMin, now) over the same reader-safe optimistic recompute path as
IStreamDataServicesClient.RecomputeArchiveAsync(String, String, DateTime, DateTime, String). Returns the resulting job snapshot, or null when
the source archive holds no data (no-op).
Task<RollupRecomputeJobInfoDto> BackfillRollupFromSourceAsync(string tenantId, string rollupRtId)
Parameters
tenantId String
rollupRtId String
Returns
Task<RollupRecomputeJobInfoDto>
ListRecomputeJobsForArchiveAsync(String, String)
Returns the most recent recompute jobs for a rollup archive (newest first, capped at 50), for operational debugging of why a recompute failed.
Task<IReadOnlyList<RollupRecomputeJobInfoDto>> ListRecomputeJobsForArchiveAsync(string tenantId, string archiveRtId)
Parameters
tenantId String
archiveRtId String
Returns
Task<IReadOnlyList<RollupRecomputeJobInfoDto>>
ValidateRollupsAsync(String, IReadOnlyCollection<String>)
Checks rollups for the inconsistencies a restore (or a dump taken during a recompute) can leave: a pointer without rows, rows above the pointer, a watermark ahead of the rows, a missing generation map. Read only; the server runs counts and MAX/MIN statements, nothing is changed. An inconsistent rollup is reported, not thrown.
Task<RollupConsistencyReportDto> ValidateRollupsAsync(string tenantId, IReadOnlyCollection<string> rollupRtIds)
Parameters
tenantId String
The tenant.
rollupRtIds IReadOnlyCollection<String>
The rollups to check; null or empty checks every rollup archive of the tenant.
Returns
Task<RollupConsistencyReportDto>
PlanRollupRepairAsync(String, IReadOnlyCollection<String>)
Lists the steps a rollup repair would run per rollup and changes nothing (dry run). The repair itself is IStreamDataServicesClient.EnqueueRollupRepairAsync(String, IReadOnlyCollection<String>).
Task<RollupRepairReportDto> PlanRollupRepairAsync(string tenantId, IReadOnlyCollection<string> rollupRtIds)
Parameters
tenantId String
The tenant.
rollupRtIds IReadOnlyCollection<String>
The rollups to plan for; null or empty plans every rollup archive of the tenant.
Returns
EnqueueRollupRepairAsync(String, IReadOnlyCollection<String>)
Requests the repair of what IStreamDataServicesClient.ValidateRollupsAsync(String, IReadOnlyCollection<String>) finds. Idempotent. The server runs nothing inside this call: it answers 202 with a request (RollupRepairRequestDto.RequestId) and executes the repair in the background; a second request while one is active returns the active one. Follow it with IStreamDataServicesClient.GetRollupRepairRequestAsync(String, String).
Task<RollupRepairRequestDto> EnqueueRollupRepairAsync(string tenantId, IReadOnlyCollection<string> rollupRtIds)
Parameters
tenantId String
The tenant.
rollupRtIds IReadOnlyCollection<String>
The rollups to repair; null or empty repairs every rollup archive of the tenant.
Returns
GetRollupRepairRequestAsync(String, String)
Reads the state of a repair request: Pending, Running, Done or Failed,
with the final report once it has ended.
Task<RollupRepairRequestDto> GetRollupRepairRequestAsync(string tenantId, string requestId)
Parameters
tenantId String
The tenant.
requestId String
The id returned by IStreamDataServicesClient.EnqueueRollupRepairAsync(String, IReadOnlyCollection<String>).
Returns
AddComputedColumnAsync(String, String, String, String, String, Boolean)
Adds a computed column to an Activated raw or time-range archive. The server queues
the backfill of the existing rows as a background job and returns at once with the column in
Backfilling; the job ends the column Active (visible atomically) or
Failed. Follow it with IStreamDataServicesClient.ListRecomputeJobsForArchiveAsync(String, String)
(RollupRecomputeJobInfoDto.ComputedColumnName); retry a failed one with
IStreamDataServicesClient.RetryComputedColumnBackfillAsync(String, String, String). An asset repository older than this change still
backfills inside the call (the call returns when the column is Active or Failed), lists no
backfill job and has no retry endpoint (HTTP 404).
resultType is the declared cast-back type name
(Boolean / Int / Int64 / Double / DateTime).
Task AddComputedColumnAsync(string tenantId, string archiveRtId, string name, string formula, string resultType, bool indexed)
Parameters
tenantId String
archiveRtId String
name String
formula String
resultType String
indexed Boolean
Returns
AddArchiveColumnAsync(String, String, String, Boolean)
Adds an ingested column for an existing attribute of the archive's target CK type to an Activated raw or
time-range archive without recreating it. The table gains a nullable column first (existing rows keep
their data and read null for it), then the archive definition names it; the next ingested rows fill it.
Idempotent: a path the archive already captures changes nothing. Rejected (HTTP 400) when the archive is not
Activated, is a rollup, or path does not resolve. An asset repository older than this change has
no such endpoint (HTTP 404).
Task AddArchiveColumnAsync(string tenantId, string archiveRtId, string path, bool indexed)
Parameters
tenantId String
archiveRtId String
path String
indexed Boolean
Returns
RemoveComputedColumnAsync(String, String, String)
Removes a computed column from an archive. Rejected when another computed column still references it; the physical CrateDB column is left as a harmless orphan.
Task RemoveComputedColumnAsync(string tenantId, string archiveRtId, string name)
Parameters
tenantId String
archiveRtId String
name String
Returns
UpdateComputedColumnFormulaAsync(String, String, String, String)
Changes the formula of an existing computed column on an active archive with optimistic / atomic semantics: readers keep the previous values while the new formula is backfilled, then switch atomically. Rejected when another computed column references this one. The result type is unchanged.
Task UpdateComputedColumnFormulaAsync(string tenantId, string archiveRtId, string name, string formula)
Parameters
tenantId String
archiveRtId String
name String
formula String
Returns
RetryComputedColumnBackfillAsync(String, String, String)
Queues the backfill of a computed column again — for a column that ended
Failed, or that is stuck in Pending / Backfilling without a running job —
without removing and re-adding it. Returns the queued job, or null when the server
answers without one. Rejected (HTTP 400) when the column is Active or does not exist.
Task<RollupRecomputeJobInfoDto> RetryComputedColumnBackfillAsync(string tenantId, string archiveRtId, string name)
Parameters
tenantId String
archiveRtId String
name String
Returns
Task<RollupRecomputeJobInfoDto>
InsertTimeRangeAsync(String, String, IReadOnlyCollection<TimeRangePointDto>)
Writes externally aggregated time-range values into an Activated TimeRangeArchive
(POST streamdata/archives/{archiveRtId}/insertTimeRange). Each point declares its
TimeRangePointDto.Origin (default automated) and, for a manual write, an optional
reason; the service records the writer of a manual value from the caller's token. Every write needs the tenant's read-write permission. Version note: Asset Repository versions that
contain also require the tenant role StreamDataAdmin for a batch with a manual point and refuse
the whole batch without it (HTTP 403), so this call throws; older service versions do not check that role.
Returns how many rows were stored and which were not, with the reason; a manual value
that could not be stored is a refused call (HTTP 409), never a result.
Task<StreamDataWriteResultDto> InsertTimeRangeAsync(string tenantId, string archiveRtId, IReadOnlyCollection<TimeRangePointDto> points)
Parameters
tenantId String
archiveRtId String
points IReadOnlyCollection<TimeRangePointDto>
Returns
Task<StreamDataWriteResultDto>
InsertAsync(String, String, IReadOnlyCollection<RawPointDto>)
Writes or corrects values of an Activated raw archive (POST streamdata/archives/{archiveRtId}/insert). A raw row is identified by archive + RawPointDto.RtId + RawPointDto.Timestamp
(UTC, millisecond precision); protection is per row. Each point declares its RawPointDto.Origin
(default automated) and, for a manual write, an optional reason; a manual point must name every ingested column
of the archive (null allowed) except the ranking columns (the column keys of the archive's
ConflictPrecedence): a ranking column left out keeps its stored value. A ranking column cannot be
null in any point, automated or manual; a null there is refused (HTTP 400). The service records the writer of a manual value from the caller's token; a batch
with a manual point needs the tenant role StreamDataAdmin, otherwise the whole batch is refused (HTTP 403).
An empty batch returns an empty result without calling the service.
Returns how many rows were stored and which were not, with the reason; a manual value that could not be stored
is a refused call (HTTP 409), and every client error (HTTP 400 naming point and field) throws.
Task<StreamDataWriteResultDto> InsertAsync(string tenantId, string archiveRtId, IReadOnlyCollection<RawPointDto> points)
Parameters
tenantId String
archiveRtId String
points IReadOnlyCollection<RawPointDto>